What do you think?

Started by
11 comments, last by Floppy 22 years, 5 months ago
I like to use a delta with a limit. For example:
frameTime = thisTick - lastTick;
delta = (frameTime > 50 ? 50 : frameTime) / 1000.0f; //minimum 20 fps
That way, there''s no frame rate limit, but it will slow down rather than move large amounts every frame when the frame rate gets low.


-Deku-chan

DK Art (my site, which has little programming-related stuff on it, but you should go anyway^_^)
Advertisement
Here''s a link discussing this topic. It was a "tip of the day" a while back on FlipCode. It''s pretty long, with lots of code, and the people talk about lots of different aspects:

Main Loop with Fixed Time Steps.

Alistair Keys

"There are two kinds of people, those who finish what they start and so on."
-- Robert Byrne
I was developing a game on a Pentium 90. I locked everything - physics, game loop - to the framerate.

I then gave a copy to a friend who had a P3 800. He played it, and hit me.

Superpig
- saving pigs from untimely fates
- sleeps in a ham-mock at www.thebinaryrefinery.cjb.net

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

This topic is closed to new replies.

Advertisement