Frame rate consistently stutters about every ten seconds?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nichefect
:warning: Old Version Published before Godot 3 was released.

I’ve asked this before but I wanted to get another chance to elaborate more on my problem (I’ve hid the previous question). As I’ve been creating more complex projects, I’ve noticed on all of my projects the frame rate is very inconsistent and it’s really bringing down my excitement and motivation to keep going with Godot. On one project in particular it stutters every ten seconds(I timed it) and on another it’s just erratic all the time. My projects are simple but I thought maybe still I just had too much going on, but even something like having a player controlled Godot icon block still does the same thing. I’m wondering if anyone has experienced the same thing, or knows about any known hardware issues/bugs that may be causing this. Also, maybe there are certain project settings I should pay attention to that address things like this?

Have you tested this and for an exported project in release mode (debug off)?
I am asking cause my projects fall from 60 fps to 59 fps or lower when I run it from the editor but stays solid 60 fps in the exported release mode.

kakoeimon | 2016-05-20 07:15

I don’t know anything about release mode, and I don’t see anything in the documentation about it or anything in the settings to toggle it on or off. I have exported projects as executables and they still have the same problem. Could you tell me how to toggle release mode, and maybe more about what it is? I see something about release in the export dialogue but it wants me to choose a file? I don’t know anything about that.

Nichefect | 2016-05-20 20:47

Just have the “debugging enabled” tickbox unchecked in the export dialogue, this will be the “release” mode and should run more smoothly. Don’t worry about the “custom binary” file options in the exporter. This is only if you want to override the standard export modules with your own.

/chapter: Exporting-Game / Godot Game Engine

Compiling for Windows — Godot Engine (latest) documentation in English

If you are creating a 2d game, there have been many reports of general choppiness in playback, and it really depends on many factors…OS, GPU drivers, etc. There is also no builtin v-sync in Godot, so you could try fiddling with your GPU v-sync options. Of course there is no control over what sort of problems the end gamer/customer will have with your game, but this is one of the joys of gamedev :slight_smile:

In general, openGL drivers can be very inconsistent. I have given up on my laptops with Godot, as they were too inconsistent, but am finding I get excellent results on my old desktop with Win10/gtx560ti. I get a perfect solid 60fps, but on the same machine dual booted to Linux Mint, it has terrible performance with a choppy 20fps or so. Same machine, but different OS/Drivers! Welcome to openGL driver hell. Hopefully at the end of the year we get OpenGLES3 and more solid performance…

zendorf | 2016-05-21 00:22

I just fixed the problem. I have a function that handles scrolling though the map via the viewport canvas transform, and the function was being called in _fixed_process. I moved it to _process and now no stutter every ten seconds. To be honest I guess I don’t understand these two function. I thought that process was called only when there’s enough time, and fixed process was called every frame. I guess I know what my next question is gonna be. But thanks for the help, what you said sounds like something I should still be considering.

Nichefect | 2016-05-21 03:31

Good to hear you got the issue sorted. Fixed process should be used for anything that is using dynamics. I mostly use the move() command with kinematic objects and thus use the fixed process. If I have any object that is moving without any dynamics(ie. directly manipulating the position), I use the normal process.

And just an update to my comment about drivers. After changing my Linux Nvidia in Mint, my game is now running just as smoothly under Mint as it is under Win 10 on the same machine.

Having said that, I am still having issues with my Nvidia OpenGL drivers on my laptops with Godot. Will stick to using a desktop while developing for now. Hopefully the ES3 drivers will be better in general by the time it gets integrated into Godot.

zendorf | 2016-05-25 03:57

Actually the problem isn’t completely solved. Like you, I move my kinematic bodies in fixed process because otherwise collisions get all screwed up. My kinematic body still stutters every ten seconds (and anything else moving from within fixed process). Perhaps your comments on OpenGL are more relevant than my previous solution so I will look into it. I tested the projects on an AlienWare laptop and the problem persists.

Nichefect | 2016-05-25 16:39