Game timing methods

BlitzMax Forums/BlitzMax Programming/Game timing methods

GfK(Posted 2006) [#1]
Almost posted in General Discussion, but I'm really only interested in a proven concept that'll work in blitzmax.

What game timing methods do you all use?

I want my game to run on as many systems as possible. My target framerate is 30fps. On my 733mhz/8mb graphics test system it runs at ~15fps.

I thought of employing delta timing but I hear many arguments against using it. Aside from the fact it isn't something I've ever used before.

What timing method do you use? Examples?


Grey Alien(Posted 2006) [#2]
If you don't use delta time you could use fixed rate logic but that will perform *worse* on slower machines (although I'm working on some "compensation" code for that). If you only want to run in full-screen mode (i.e. arcade game), then you could lock the display to 60Hz but it's not very professional (most portals won't accept full-screen only games). Finally you could use a blitz timer, I never really fancied that. You seen this before?:

http://www.gaffer.org/game-physics/fix-your-timestep/

That's the method my framework uses with a bit of delta time jiggery pokery thrown in.


H&K(Posted 2006) [#3]
I post timer message every 1000/30 Milli which the game logic catches, then I post a EVENT_GADGETPAINt from the game logic.

I just assume that my game logic isnt that slow, and that it does do the draw when expected.

I suppose if I was doing anything complicated then it wouldnt work. But most of my program time is just sitting in a WaitEvent loop. When I do start to do graphic intensive or even CPU intensive stuff then Ill have to change it.


Gabriel(Posted 2006) [#4]
I generally use delta time. If I was using complex physics then I'd probably use the fix your timestep stuff that Jake linked to. In fact, I'm sure I'd have used it when I wrote Bowling Babes, if I'd known about it then, but that article is recent, I think, and the catchup breaking things problem hadn't occurred to me at the time.


GfK(Posted 2006) [#5]
www.gaffer.org/game-physics/fix-your-timestep/

That's the method my framework uses with a bit of delta time jiggery pokery thrown in.
Holy cow!

I just had a play around with this method. Got my Blitzmax game running perfectly on a 733mhz CPU with 256mb RAM and 8mb shared graphics RAM. I'm very comfortable having this as my minimum system requirements, although I'm confident it'd run well on something of a bit lower spec too.

Thanks for the help! :D


Grey Alien(Posted 2006) [#6]
Thanks great news! well done.


Amon(Posted 2007) [#7]
Can anyone give me the BlitzMax conversion of this?


Grey Alien(Posted 2007) [#8]
you've already got it dude.


Amon(Posted 2007) [#9]
You mean your framework? What I want though is to have it in just one bmx file so that I can include it in my small games.

Can you give us it Jake?


Grey Alien(Posted 2007) [#10]
In V1.02 of my framework in the AOTMG folder there is a file called: ExampleTiming.bmx

It has a slimmed down version of the timing code and no other links to framework code. You can simply rip it out of there or write your game around the structure in that file :-)


Leiden(Posted 2007) [#11]
I've used Deltatiming mainly in the past on a few little demo's here and there. Since you're referring to Blitzmax (2D I assume) I wouldn't have any idea how it would perform as deltatiming relies largly on floating point numbers and pixels are integer based.