FPS issues with vsync - and what are batches?

For questions about using Classic.

Post » Mon Jan 12, 2009 4:34 pm

When I run my game in unlimited mode, I get about 100-120fps. When I start my game (when it's vsynced), it's running at half the refresh rate of my monitor, unless it's 60 hz, when it runs fine. So if my refresh is 100hz, it's running at 50fps, if my refresh is 60hz, the fps is 60. If I leave the game running but don't do anything, it stays at 50. If I start to do some stuff in the game though, sometimes it goes back up to 100.

I'm guessing vsync drops the framerate to half to keep things smooth if the framerate dips below vsync? Is that correct? What causes it to try to up the framerate again?

Also, what are batches?
Posts: 3,006
Reputation: 27,931

Post » Mon Jan 12, 2009 4:52 pm

Batches are not particularly interesting to the end user, it's more for us developers to test how efficiently the game is being drawn.

V-sync always draws the screen when the monitor is being refreshed to stop tearing. If it misses a V-sync because it's still drawing, it'll wait until the next monitor refresh. So if your game takes just over the time between VSyncs to draw, it'll dip to half the framerate, because frames are never rendered in time for the next VSync, only the one after.

I guess your game is really running at 90-99fps. If your refresh rate is 100Hz, it never has a frame drawn in time for the next VSync, so it only manages to draw every other frame. In windowed mode, the VSync isn't quite so accurate anyway, so it tends to sometimes skip a frame or two a second even if the application isn't doing anything. This probably just exaggerates the problem if your FPS is just below VSync rate.

If you go to 60Hz, it can comfortably get a frame rendered in time for every VSync, so you hit 60fps.

I'd take a look at optimising your game. Whats your video hardware, by the way? If it's powerful, you've got to be doing some pretty heavy rendering to pull down the framerate that low!
Scirra Founder
Posts: 25,295
Reputation: 200,994

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests