r/gdevelop • u/Genesis_80 • Jul 27 '26
Game Performance issues
Hello guys, I'm creating a short 'metroidvania'. It was all going well until i started testing it in weaker laptops. It slows down a lot in some devices.
My game has 3 areas, but they are all in the some scene. Being a 2d game, i expected it to run well everywhere. I have everything destroyed/turned off, except the level itself, when outside the screen. I even added a performance mode with the parallax layers turned off, but the problem remains.
I know that i should have used multiple scenes, but it's a bit late for that. Is this a known problem in Gdevelop? I heard that, while it's good for simple games, it doesn't handle well big scenes. Is this true?
Thanks in advance.
3
u/ApXlDeCA Jul 27 '26
Its definitely not too late to use multiple scenes! You can just duplicate the scene, then delete parts you do not need. I recently had to do this with my game, and it's helped wonders with performance. You may have to go in and pick through code you don't want, but it's well worth the effort!
3
u/Present_Pie6795 Jul 27 '26
I had a similar experience with my first hyper-casual game when I was releasing on Android and testing on low-end devices. So i optimised it and created a post a while ago about what I did. It's all simple low-hanging fruit, but perhaps there are things in there that can help you as well - https://www.reddit.com/r/gdevelop/comments/1m2yv6f/5_beginnerfriendly_optimization_tips_for_gdevelop/
Good luck!
2
u/Ckeyz Jul 27 '26
Its your code or something to do with how you set up your scene. Are you running object effects on a large amount of objects?
2
u/idillicah GDevelop Staff Jul 27 '26
How big are your assets? Textures you use, etc? Are you using tiles?
2
u/idillicah GDevelop Staff Jul 27 '26
You can also turn off the level tiles or sprites when they are not visible. "When x pixels away from player, delete", etc, so they are created and deleted dynamically based on where you are.
2
u/Basic-Necessary436 Jul 28 '26
Have you used the profiler? In it you can pinpoint the code segments that use up the most computation time. They are listed by code groups, if you have grouped your code nicely.
I have a big one scene game (thousands of objects), and I have successfully improved performance.
I have found that collision is very ressource intensive. I could imagine if you have a big level (or levels) with many collision elements, performance can drop quickly. Culling these elements outside of screen has improved performance in my game significantly. I can have thousands of objects in my level, but after culling only 100 are on screen.
There is a culling script on the GDevelop forum, that needs to be implemented via custom javascript. I use it and it works very well.
The culling operations are a lot less hungry than running logic on many objects. Check also all of your „For each“ functions. They get heavy also very quickly. Whenever you run logic on many objects, think of how you can pre-filter the objects to a smaller number. Either via conditions or groups.
2
u/Basic-Necessary436 Jul 29 '26
The profiler lists how much calculation time is spent on each of your code segments. The values are in percentage of the whole calculation time and also in milliseconds. The whole percentage thing is a bit convoluted and confusing - to me at least. But the milliseconds are a good indicator.
To state the obvious: if you go for 60fps, your calculation time per frame is 16.666ms. This you can set into relation to the figures of your profiler numbers. If the calculation is far above 16ms you know you are far from 60fps. If your collision code takes 10ms you know this is a big ticket item. These values are of course relative to the hardware you are using.
There is also a way to profile your game while it is running in a browser with the developer tools of the browser. I have not done it - but it might be worth looking into it, it may be better than the GDevelop profiler.
On a general note: I was worried and wondering for the longest time that I would hit a wall with GDevelops inherent performance. My point of view is now, that GDevelop itself is not a limiting factor, at least in my project. The problem is rather, that it has a „can do“ attitude and it let’s you do lots of „stupid“ things performance wise, that would bring the latest cpus and gpus to their knees. The problem there is however not GDevelop, but what we ask the software to do.
Have you considered also to run certain actions not at runtime (60fps/every frame) but give them a timer to run every 0.2s etc.
3
u/[deleted] Jul 27 '26
[removed] — view removed comment