dethrace icon indicating copy to clipboard operation
dethrace copied to clipboard

The internal FPS limiter doesn't work as it should

Open Kappa971 opened this issue 8 months ago • 3 comments

This commit https://github.com/dethrace-labs/dethrace/commit/ca1ef76e7f2beef062394b2b16c2d5149c668c5f caused a drastic performance hit, but previous performances were still very strange and inconsistent: pre-ca1ef76

  • 104-215 fps without --fps=60 (very unstable and with stuttering)
  • 51-58 fps with --fps=60 (Why??? And with stuttering)

after-ca1ef76 48-53 fps with and without --fps=60 (with stuttering)

The fps are indicative, it depends on the map (and the area of ​​the map) but it still shows that something is wrong. All these tests were done with the software renderer because the OpenGL one doesn't work. The target would be 140-143 fps (in my case with a 144 Hz FreeSync monitor), I'm trying to have a stable 60 fps (currently without success) because I don't know if any work has been done to adapt the engine to such high fps.

In any case currently dethrace is unplayable: too low performance and stuttering everywhere, even with --physics-step-time=10 and 60 fps cap (which doesn't seem to work properly even in previous builds).

OS: Windows 11 CPU: AMD R7 5700X GPU: AMD RX 6700 XT

Kappa971 avatar Apr 16 '25 22:04 Kappa971

Sorry to hear that :(

The couple of things I can think of -

That commit set the FPS limiter to 60 by default. Previously it was 0 (off). https://github.com/dethrace-labs/dethrace/commit/ca1ef76e7f2beef062394b2b16c2d5149c668c5f#diff-cd309b2e56691e09cbd6cf74017016abfc95eed68833a3d589e9eca8ee0e5b6bR153

You could try with --fps=0 to see if that has any effect.

Secondly, are you building in debug mode or release mode? That has a big impact on the software renderer.

How are you measuring the FPS? Using the in-game FPS display or something else?

And the stuttering - is that when turning or going straight? The stuttering I'm aware of that for me is resolved with a lower physics-step-time is due to the camera trying to sync up with the cars turning. Traveling straight down a road, or just turning the camera with the arrow keys does not stutter for me.

dethrace-labs avatar Apr 17 '25 18:04 dethrace-labs

The couple of things I can think of -

That commit set the FPS limiter to 60 by default. Previously it was 0 (off). ca1ef76#diff-cd309b2e56691e09cbd6cf74017016abfc95eed68833a3d589e9eca8ee0e5b6bR153

You could try with --fps=0 to see if that has any effect.

With --fps=0 I actually get similar fps to previous builds so yes, the fps cap is enabled by default on newer builds, but --fps=60 not working well because it doesn't limit fps to 60 but to lower fps (??).

Secondly, are you building in debug mode or release mode? That has a big impact on the software renderer.

Unless there is some sort of incompatibility or issue between your project and Visual Studio, I'm building in Release mode (maybe he's ignoring my choice?).

How are you measuring the FPS? Using the in-game FPS display or something else?

I'm using AMD overlay.

And the stuttering - is that when turning or going straight? The stuttering I'm aware of that for me is resolved with a lower physics-step-time is due to the camera trying to sync up with the cars turning. Traveling straight down a road, or just turning the camera with the arrow keys does not stutter for me.

The stuttering is there whether I turn or go straight. As already said the fps cap doesn't limit to 60, but shows variable fps (48-58) with stuttering and it's strange that the FPS limiter worsens performance so much.

Kappa971 avatar Apr 17 '25 23:04 Kappa971

I would like to specify that my PC has no problems, all other games work fine, only dethrace works strangely. Stupid question (or maybe not): have you tested dethrace on Windows? If so, could you share a build that works fine on your PC? Because I don't understand what's happening... OpenGL mode doesn't work (dethrace launches two windows, why??) and in software mode the fps limiter works badly.

As a development environment on Windows I'm using Visual Studio 2022 and vcpkg as a dependency manager (for SDL2 in this case), it works well to compile other open source projects and I think it's the "default" development environment on Windows. If you haven't tested dethrace on Windows, you could try with the same development environment, and I'm almost sure you'll have the same problems as me.

Unfortunately I can't help you in other ways to understand what's wrong with the code because I don't develop software, sorry.

Kappa971 avatar Apr 20 '25 08:04 Kappa971