Major lag, how to optimize?


I am desperate for advice or tips on how to solve this, I am currently making a Super Mario Bros 1 remake, and the FPS would drop from 60-30 FPS, and goes ludicrously low to 20-10. I’ve tried my own ways of optimization and googling some tips, but they didn’t work.

The text on the up left of the screen is the FPS. I am a bit new to GDevelop and have no idea how to optimize this.

Thanks, any advice helps, if you have any questions about the tiles or how anything else works, I’ll be glad to answer.

Thank you!

People need to see the events to give advice.

Ohhhh that explains a lot, thank you

Part 1:
Make every static object a tiled sprite, even the pipes and question blocks, its way performant than a sprite.

Part 2:
I can see from the image that the game resolution is too big and you probably zoomed in with the camera, thats unnecessary, make the game resolution tiny and change the window size.

Not sure where came to this understanding. Tiled sprite can be MUCH be less performant than the equal amount of sprites, especially because it can’t be culled in the same way. Some of this has to do with whether or not the PC supports the shaders used to render the tiled sprite in WebGL.

Additionally, it will always be slower if the source texture isn’t a power of 2 resolution because of the math the shader has to do. This was still true as of the last time testing was done around this as recently as tests done last June. (And this is PixiJS specific, not GDevelop specific)

For the OP: Are you setting a minimum or maximum of 60fps?
If so, what is the refresh rate of your monitor? All browsers (and therefore GDevelop games) are locked to Vsync On, so if you have a maximum (or minimum) of 60 fps, but a refresh rate of 75 or 144 hz, you’ll always bump down to 48 or lower FPS.

Beyond that, I agree with Davy, we’d need to see the events to know more.

1 Like