• Godot Help
  • Simple scene drops FPS to 58/59 and it shows a lot [3.5.1 stable / GLESS 3]

I come back to the subject...

I bought a new computer, with a RTX 3070 Ti graphics card and I tried to replicate the same game in Godot and surprise...

It keeps doing the stutters every "x" seconds.... The stuttering happens just when it drops from 60 to 59 FPS, at that moment.

I still don't understand why this happens. I think it's the movement of the Camara2D but I have no idea how to fix this. 🙁

If I leave static, even if the game drops to 59 no stuttering is noticed.... But if the Camara2D is constantly moving, chasing the player, there if you notice a stuttering when it goes down to 59 FPS, especially in the environment (the map tiles).

It's probably worth considering that not all stuttering or jittering is caused by lag. Potential causes are myriad. Yes it could be to do with physics but perhaps the source is just collision, some micro-collision happening every n-frames or so.

I bet it's CPU related. On thing can be a garbage collector or memory management. For example, if you had a particle system and every 10 seconds it runs out of memory, the reallocation could cause a frame rate hitch.

    and what tests could I do to try to detect the error? 🙁

    Best thing to do is to provide a ZIP of a project so that others can test it.

    It would probably show up as a thin vertical line when profiling the app. That said, I only have a rudimentary understanding of the profiler. But that is where to look.

    cybereality
    do you mean this?

    I used the profilaldor and I get that vertical line...

    That chart is a frame-time plot. That is a graph of time each frame took to be displayed on screen. I phrased it that way for a reason. You might think it's how long it took to render, but no. It's how long everything took to get ready and then on top of that to be rendered.

    Where that 1 spike is is whats causing the average FPS value to momentarily show slightly under 60 fps, but for that specific spike, for that 1 frame or rather because of it the average effectively might have actually been '15 fps'.

    So the next question is to figure out what is actually happening during that 1 frame, during the spike.

      Megalomaniak
      What surprises me is that the game is super simple.

      I don't quite know how to debug it to find out where it might be causing the problem.

      EDIT: Also, I just checked that the vertical line does not appear whenever I launch the game....
      Sometimes it doesn't appear, and the game has the same jitters as always every "x" seconds.

      I am very confused!

      Is it possible that it could be V-Sync with your monitor causing the issue? Maybe the V-Sync code from the monitor/graphics driver is causing a few frames to be dropped/skipped?

      a year later

      i solve the same problem by check the option "debug/settings/stdout/verbose_stdout"

      4 months later

      Hello, were you in the end able to solve this issue? I am experiencing the same thing on Godot 4.1.3 making a 2d game, and the occasional stutter happens on the device as well (iPhone ). When I set the fps to be 60 it is a bit better but image is blurrier naturally, looks much more 'stuttery' on the phone if the refresh rate is allowed to be 120.