Framerate

Hey everybody.

I’m wondering. Is 500 frames per second a very high value or could it be much higher? Because I’ve noticed most 2D Java games run at almost 1200-2000 frames per second, but my Mario remake rans at about 500 maximum. I am using a Thread.sleep(). Maybe it’s because other games don’t use sleep()?

Your not getting 500 frames a second. Your rendering loop is just cycling around at 500 times a second. Anything above the refresh rate of your monitor is just pointless.

I know I’m not actually getting 500. But is it good for it to be able to loop 500 times in one second?

what if vSync is off? i notice games are smoother at 100+ fps than they are at 75fps.

my tilemap engine gets like 1400fps

This is a hoary old subject that’s been battered around countless times over the years. My take on it is:
Vsync should be on if the games FPS is over the refresh rate of the monitor - turning it off is only useful for willy-waving computer comparisons.
Vsync should be an option if the game FPS is under the refresh rate of the monitor - it will eliminate tearing at the expense of a lower framerate. Let the user decide if it’s worth it.

To the OP: 500 FPS is far higher than any monitor can display, so don’t worry about it. Using Thread.sleep will make your game much friendlier to other processes on the computer, which is a good thing.

I have a feeling the OP is worrying about the comparison between his game rendering implementation compared to other - and how it will scale down - i.e. if the games that run at 1000-1200 fps were to only run at 60fps on certain hardware configurations, would his only run at 30fps?

If you’re seeing considerable differences between your project and comparable other one’s it may be worth taking a look at - but I’d be sure that these other games are truly comparable to yours. Have you got examples?

Kev

i dont turn on v-sync, because it just ‘feels’ slower to me, and vsync ends up slowing things down.