The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I need your help fixing some weird framedrops / stutter / jitter I have on my Godot 3.2 project.
https://github.com/Skipperro/trainz/tree/testing
It's a simple 3D game I've started to create recently - It's currently just a train running on simple, straight track, through a town and a forest.

The game is so simple it doesn't even use 1% of my CPU (Ryzen 7 3800X) and about 10% of my GPU (Titan Xp). Even though it's nothing that could stress the PC I see weird stuttering or framedrops while the train is in motion. If you look at the environment you will see that the movement is not nice and smooth and sometimes there is a brief freeze, just like few frames would be completely skipped.

Profiler won't help me - it says that frametime is consistent and way below 16 ms. Even if I see framedrops, profiler keeps reporting perfect performance.

If you would have time to help me, please download my project and try it yourself. To move the train you have to slowly rise the throttle by dragging the lever on the right of using arrow keys.

in Engine by (207 points)
edited by

Add details about the OS and drivers you are using, also the monitor refresh rate.

If on windows (which has known problems with OpenGL) you can try enabling the option of vsync via compositor on Display>window settings and see if changes something.

I'm on Linux Mint 19.3 with NVIDIA driver 440.64.
I'm having a 144 Hz display running in Free-Sync. No issues with other games.
I've experimented with vsync settings, fullscreen, forcing FPS, Jitter-Fix settings ect. Nothing works :(

Out of desperation I took this project:
https://github.com/godotengine/godot-demo-projects/tree/3.2-57baf0a/loading/threads

and simply added this function:

func _process(delta):
var rot = $Sprite.rotation_degrees
rot += delta*360
if rot > 360:
    rot -=360
$Sprite.rotation_degrees = rot

It simply rotates the image, so I can see some action.
The movement is broken the same way as in my project - little shaky and once per about 15 seconds it freezes for a moment.
Anyone encountered this behavior before?
Could it be my system?
If yes - how can I fix it?

1 Answer

+3 votes
Best answer

OK, I found the solution.

It was nothing with the Godot or my project.
If you are having similar issue on Linux with NVIDIA - reinstall the NVIDIA driver.

I've purged everything NVIDIA related, restarted PC, installed same driver version, restarted again and now every Godot project is running smooth as butter.

by (207 points)

Thank you for this!

I was going crazy when there was constant stutter and nothing was showing up in the profiler. Reinstalling the driver and rebooting fixed it.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.