SRB2 Constant 30 FPS

Larz T

Bool Man Larry
I was already in the middle of a discussion about this problem before Discord took a nose dive but I wanted to post this to see if anyone else has this problem. Basically, SRB2 runs at a constant 30/35 FPS. At first, I thought it was the new version, 2.1.20, but then I tested other exes out like PlusC and TopDown and it's the same thing every time. 30/35 FPS on menus and when the level first loads, it's at 35/35 FPS and then drops to 30 and stays constant. Just wondering what could be the issue unless if it's only just me.

TUqQoMd.png

muwHHNa.png
 
Last edited:
As per discussion on the Discord: It's the Spectre/Meltdown mitigation on hardware over two years old. It turns out SRB2 *hates* this. It affects me too. I don't know what to do. I don't know what can be done. Sorry.
 
I want to expand a little on what toaster said, just for clarity. I'll start with a link:

https://cloudblogs.microsoft.com/mi...-and-meltdown-mitigations-on-windows-systems/

This is the result of an update to Windows. At this time, we are not sure exactly why this is affecting SRB2. Obviously, we are looking into It to see what we can do. It is worth noting that SRB2 is not the only thing affected by this update, so we're not alone in this issue. Unfortunately, until we know more, there's not much we can do about this. If we do find a fix, you can expect a 2.1.21 hotfix for this issue.
 
I'll go out on a limb and say it has to do with the timer that SRB2 uses to time the game loop at 35fps (GetTickCount()? QueryPerformanceCounter()?). Might be worth looking into an alternative timing method.
 
(GetTickCount()? QueryPerformanceCounter()?)

Just checked, and it appears I_GetTime for Windows uses a combo of QueryPerformanceCounter() and pfntimeGetTime() (a pointer to winmm.dll's "timeGetTime") by default, but can use GetTickCount() instead if the game is launched with "-gettickcount" (for the imprecise system timer) in the command line.

...This makes me curious whether -gettickcount improves performance for anyone at all, if SSNTails is on the right trail.
 
Last edited:
Larztard, try running SRB2 with -gettickcount , and let us know if it still runs at 30fps.

Sorry, I thought I had replied to this thread on Sunday night. I can confirm that after using -gettickcount in the parameter for the launcher, it was smooth sailing for custom levels as well as a complete run-through of vanilla. Even removing -gettickcount from the custom parameter box in the launcher it was still 35/35 FPS.
 
Ladeeez and gents, we have a winnar!

But GetTickCount() is pretty imprecise. I'd recommend looking at real replacement options.
 
GetTickCount had a performance impact for me, sadly. At least on my end, it was a set SDL_HINT_ something value to 2 (sorry for having a useless sleepy memory, need to dig it up on Discord) which fixed my issues.

I know Alam is digging into this, though.
 
For context as to what toaster is talking about, Alam was recently experimenting with making I_GetTime use SDL2's own native timer API (where SDL_GetTicks is used), and had people also set SDL_HINT_TIMER_RESOLUTION to 2 to change the resolution of the timer. That is, before he applied it to the code directly later I think.
 
Last edited:

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top