PDA

View Full Version : Demo Timing


jinx
04-24-2004, 10:56 AM
I've gotten around to pondering over demo timing (demos ala scene.org, not game demos) and I was wondering if anyone had any good links on where to find information about how people do the timing in their demos.

Obviously I can think of a few simple ways, but I was wondering if there was any better way of doing it than just keeping track of the number of seconds or music ticks elapsed and passing it through to the effects.

Anyway..

Jx

anubis
04-24-2004, 05:38 PM
cut your framerate...

baldurk
04-25-2004, 03:38 AM
The best way to do it is to use time-based movement. At least that's what I did in my two demos. Basically for each frame, you find out how many milliseconds have passed since last time and multiply any constants by that. Say object A moves 10 units per second. You'd figure out how many units it moves per milliseconds (0.01 in this case) and do TimePassed * 0.01f. That way if the demo slows down, and it takes 2 milliseconds instead of 1 to render each frame, then you move twice as far per frame, so it all cancels out.

anubis
04-25-2004, 03:46 AM
which at times can still produce jittery results. the best thing is to fix the framerate to 30 or 60 fps and do what baldurk suggested