Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Thanks for playing :)

Hm.  The jumping is part of an attempted optimization that's less noticeable at 60fps (batching world-driven changes to the sim and only uploading them to the GPU every few frames), but when limiting my own FPS to 30 it becomes obvious and ugly.  It looks like I'll have to replace that with something better, thanks for pointing it out!

do you know why my fps was limited to 30? I have a pretty beefy PC, is 30 the default?

No, the default is 60!  If your PC is beefy then it running at 30 is  probably a bug...  Are you on Windows?

If you run and press 'g', that'll show the profiler.  This is what it looks like for me (running generally at a comfortable 60fps)...  It could be a problem in the vsync implementatio of the graphics libraries I'm using.

(+1)

ya I'm on Windows, it sits around 32 fps

(1 edit)

Thanks for mentioning this, I'm seeing it on my windows machine as well. 

I think I see the problem.  To maintain 60FPS, the game sleeps for the remainder.  At least on my windows machine, when it does this, it sometimes sleeps for way too long (even though the requested sleep time is correct).  This is what's behind it being at 30FPS on your machine.  Very strange, I'll have to put in a better system.

Out of curiousity I looked at the raylib source to see what they do. This looks like a pretty sensible implementation that fixes what you're hitting. Seems like Sleep() is pretty off: https://github.com/raysan5/raylib/blob/master/src/rcore.c#L4954

Yep, just sticking a while(time not right){} loop at the end fixed it!  I've uploaded a new version with the improved performance (it feels a lot better at a solid 60FPS than 30!), plus one or two other little things I added over the weekend.  Thanks for the help, friendly lain-anon :)