Is this Delta Timing?

BlitzPlus Forums/BlitzPlus Programming/Is this Delta Timing?

QuickSilva(Posted 2007) [#1]
After recently looking into Delta Timing I have come up with the following, my question is will this be sufficient to keep my game running at a decent rate on most machines? Since I am new to this timing lark and do not understand most of what has already been discussed in the other timing threads please go easy on me if I have missed something obvious.

I have included the CreateTimer command so that I can test how my code runs at different frame rates for example 30, 60 and so on. Things seem to jerk along at lower framerates but I guess this is supposed to happen to keep the programs speed the same. As I said this is new to me so please correct me if I am wrong.

Finally, I just wanted to ask if it is possible to use render tweening for 2D games and if it is worth implementing if it does work.

Also does Delta Timing have big problems regarding collisions at the slower framerates as I assume that sometimes the objects are going to miss each other completely which wouldn`t happen at full speed.

Basically what I want is the easiest way to implement proper timing in my game in the easiest way that I can so if there are other, easier options, then please let me know.

Another question I have is should I be using Flip False or is there no need to with Delta Timing?

Thanks for any help,

Jason.


Graphics 640,480
SetBuffer BackBuffer()

Global StartTime#=0
Global EndTime#=0
Global TimePassed#=0

Global t=CreateTimer(60)

While Not KeyHit(1)
	Cls
	
	WaitTimer(t)
	
	EndTime#=MilliSecs()
	TimePassed=EndTime#-StartTime#
	StartTime#=EndTime#
	
	x#=x#+0.1*TimePassed#
	If x#>640 Then x#=0
	
	Rect x#,100,50,50
	
	Text 10,10,"Time Passed        : "+TimePassed#
	Text 10,20,"Frames Per Scecond : "+Int(1/TimePassed*1000)
	
	Flip
Wend
End




Réno(Posted 2007) [#2]
I don't use anymore "delta timming" for my games because it's a pain to code this way. "Delta timming" or "Virtual timmers" will always be jerky as the end user monitor's refresh rate won't match your timming metod.

Belive me, I worked hard on that, and this is my conclusion !

:|