dandorf it stutters even when the FPS is at 60
then it's probably not fps related, though also worth noting that the rendering fps is separate from physics step/fps.
dandorf it stutters even when the FPS is at 60
then it's probably not fps related, though also worth noting that the rendering fps is separate from physics step/fps.
I tried to duplicate the issue, but haven't succeeded on my cheap laptop or my old phone. Maybe I'm making it too simple.
The mystery deepens. OP have another computer perhaps to test?
duane I just tried it and I am sometimes going down to 58 and making stutters.
In your case, use _process, but the same thing happens to me. I tried to change it to _physics_process and it also goes wrong, even worse I think.
Doesn't it give you problems executing your project?
It is always stable and there are no stutters???
Thanks to all for the help.
It seems that we will never be able to solve it
Erich_L I don't have another one at home.
I'll try to tell a friend to try, to see what the results are.
It is very strange, I have come to think that it may be my PC, but then it would not make sense that if I export it to Android it would have the same behavior and it would continue to stutter, right?
dandorf It is very strange, I have come to think that it may be my PC, but then it would not make sense that if I export it to Android it would have the same behavior and it would continue to stutter, right?
For instance if the stutter is caused by another process running periodically and consuming many resources in an already resource-restrained environment, like a weak computer, or a mobile device. That's my opinion of what's happening.
Can you list your full PC specs? I see your CPU listed, are you using the integrated GPU? What operating system? Everything updated with the OS and all drivers?
PC Specifications:
Graphic card:
How can I tell if Godot is using the dedicated graphics card and not the integrated one? do you use it by default?
I had a very similar problem. This helped
That computer is not the newest, but I used to have a similar machine with a 750 Ti and it could run AAA 3D games at 1080P. It should have no problem with that simple 2D scene in Godot.
Maybe it is using integrated graphics, that is one possibility. Some laptops (or all in one systems) can use switchable graphics, that switches between the dGPU and iGPU, and honestly it never worked.
Or it could be a software issue, such as anti-virus running on the system, or some other background process (cloud backup, etc.). Not sure.
I have had the opportunity to test it on a laptop (with worse features than my computer) and the game is more stable, it does not have those annoying stutters!
Sometimes it lowers the FPS but I think it's normal, because the laptop is not very powerful, but it does eliminate those stutters! That's fine.
So it can be deduced that my PC has some incompatibility with Godot... Since running the game in Godot on my PC with both integrated and dedicated graphics, it stutters.
It still surprises me that if I export the game from my PC to Android and try it on my mobile, it has the same stutters as it does on my PC.
If I export to Android from a PC will the game work fine and not have stutters, on Android then will it work fine? I don't understand this, I thought that would depend on the mobile in question!!
You are helping me a lot, thank you very much
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.
I attach the project to see if you can help me better.
The Space key jumps.
Notice that at times, the game drops to 59FPS and when it has that little drop, it gives a very annoying little jerk that is very noticeable visually.
This happens sporadically
https://www.mediafire.com/file/lrbbuthb8gvytpl/project+example.rar/file