Smooth moving in 2d, synchronisation, vsync and FPS limiting

Started by
6 comments, last by OrangyTang 18 years, 10 months ago
Hi, i've got problems with smooth moving animation in 2d sidescroller. I've tried 2 ideas: + frame depedent movement + limiting FPS, but if I limit FPS to 60 and monitor runs on 75Hz moving isn't smooth :/ when i limit FPS to 75Hz it is, but I want my game running in the same speed regardless of refresh frequency. + time depedent movement - animation is never smooth, except when I limit FPS to 75 and vertical refresh is 75Hz, but even if I do so I see somethin is wrong with it. I didn't try to take average of last X frames. there is no difference if VSYNC is enabled or not, only tearing is visible or not. i want this game to be frame depedent, but I don't have any other ideas :(
Advertisement
Why not just have your game set the refresh rate to what ever you want.
because 60Hz refresh rate kills me :/ I can't stand refresh rate lower than 75Hz
You could interpolate between frames (interpolating 60 fps to 75/85 fps) - that way you're still frame dependant, but it will look much better than without interpolation. Of course it will look quite funny in some situations if not done properly, but that's another problem ;-).
Killers don't end up in jailThey end up on a high-score!
Quote:Original post by teccubus
because 60Hz refresh rate kills me :/ I can't stand refresh rate lower than 75Hz


So have it set the refresh rate at 75
yeah, but i don't know if player's monitor can do 75 Hz
If done right, time-based movement should work perfectly. You don't have to worry about the refresh rate, v-sync, or whatever. I don't try to get the average of frames before, rather I just use the current frame's timespan to move my objects. You run the risk that if another process takes up time, it jerks, but it is much less of a problem and pain to do it this way. Plus, the same jerk will happen frame based as well, just that it will freeze instead of jerk, so either way, the jerk hurts your program. So I go with the easieast method IMO.


Quote:Original post by kburkhart84
If done right, time-based movement should work perfectly.

No. constant tick based (frame based) will look better for 2d stuff. For 3d your brain is much more tolerant of time glitches and irregularities. For 2d these become much more noticable as you're seeing much more predictable, flat motion.

60hz is usually smooth and non-flickery. If it is then you've usually got the brightness turned up way too high (or your monitor is crap). While most people (me included) can't stand 60 or even 75 for a desktop this usually involves looking at a high resolution with small, static text. At 60 for a game you'll be fine.

This topic is closed to new replies.

Advertisement