Hi, I'm very new to Godot and am just evaluating it to make some small games for jams. I noticed there is a judder problem in the way the main loop is implemented. I've downloaded the source today but don't know it well enough to change to fix but this is essentially what you can do to fix, a standard 'fix your timestep' loop:

func _process(delta):
	# get MS since the start
	var iMS = OS.get_ticks_msec()

	# make a note of milliseconds at start of game so
	# you can get difference
	iMS -= Globals.m_iMS_Start
	
	# how many ticks should have been complete by this time?
	var ticks_required = iMS / Globals.m_iMS_PerTick
	
	# left over MS not used by tick
	var ms_left = iMS % Globals.m_iMS_PerTick
	
	# calculate interpolation fraction
	Globals.m_fFraction = ms_left / float (Globals.m_iMS_PerTick)
	
	# ticks required THIS update
	ticks_required -= Globals.m_iTick

	for t in range (0, ticks_required):
		TickUpdate()
		# keep count of which tick we are on
		Globals.m_iTick += 1
		 
	pass

This is the gist of the standard loop, use the number of ticks to update the physics, then use the interpolation fraction to interpolate between previous and current tick positions for each object on the frame update.

Tested and works (even with tick rate down to e.g. 2 ticks per second) to cure the judder just in GD script, but should really be implemented in the c++ source to play nice with the physics I should think. I would do this myself but I only spent half hour looking at the source code (relevant function is in main.cpp and timer_sync.cpp) and don't know it.

Hey @lawnjelly!

I would highly suggest opening a issue on the Github repository, as then more of the developers working on Godot who know how to use and edit the source code will be able to see your post :smile:

Ah thank you! :) I will try tomorrow when I am more awake and maybe can make a little demo.

4 years later