Some games benefit more from frame based movement compared to time based.
Take my pong game, I decided to leave it as frame based or maybe even give user the option but I find problems.
Most systems WILL keep up with 100 fps frame rate. The bad thing however is that this is only the case when vysnc is off.
If vsync is on (according to some this is because the timer is on the same thread), the timer only produces ontimer events at the refresh rate
So take for example my timer. Set to 100 fps and yet vsync will make it output at 75 ontimer events a second no matter what I do.
So, logically I assumed the way round this is to find what refresh rate the game is running at and then move the sprite by X:=X+(Y/Refresh rate) (unless it is no vsync in which case I can set RR to 100).
The problem with no vsync is the horrible jerkiness you get, and if I set delphix to fullscreen vsync is automatically activated and cannot be turned off. And further problem is, a monitor with very high refresh rate would have more problems than a lower one. If I set the timer for 100 fps, and vsync comes along to tell me that aint happening buddy, how can I ever hope to achieve frame based motion with vsync on with a set FPS of 100?
The only options I have so far found:
1. Have varying timer speeds depending on refresh rate (not a nice idea)
2. Somehow find a way to have the rendering and motion calculations seperate (no idea how with delphix)
How do you guys work with frame based motion when your timers change ontimer event depending on refresh rate of the monitor?
And a final question. Why is it no vsync with 200 fps is about 15% of my cpu but when I put vsync on it takes a whopping 100% even at 75 fps?
Bookmarks