Sign in to follow this  
teccubus

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

Recommended Posts

teccubus    307
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 :(

Share this post


Link to post
Share on other sites
nife    235
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 ;-).

Share this post


Link to post
Share on other sites
Grain    500
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

Share this post


Link to post
Share on other sites
kburkhart84    3187
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.

Share this post


Link to post
Share on other sites
OrangyTang    1298
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this