Can marking resources as "always loaded in memory" improve rendering performance?

I would like to reduce the rendering consumption in my game. I have noticed that in example games with higher sprite detail (not pixelated) and similar size on screen, the rendering consumption is much much lower (around 0.30 ms) than what I have (around 1.10-1.50 ms). From what I’ve evaluated, objects that have many animations consume more rendering than those that don’t, even if they only have one animation running. For performance reasons I was creating objects that had multiple animations instead of many different objects (mainly enemies). Are there any suggestions to improve the rendering besides small images and not using layer effects? UNCHECKINGTHE “SMOOTH THE IMAGE” SECTION IN RESOURCES IMPROVES PERFORMANCE? The images I use are not large, and some are “sprite panel” type, so I can use one stretched out and not several continuous ones next to each other.
Something I have noticed is that every time objects with multiple animations are created, the rendering section in the profiler gives a high value; It is as if all the images were rendered at the moment the object is created (even if that same object is already on the stage). Which gives the idea that it is better to have the object on the screen previously and make it visible or move it in position at the necessary time instead of creating it. This would change the mechanics of my game and it would be a bit complicated to use, but that’s what I’ve noticed.
There is something I have been wondering about, the “always loaded in memory” of the images in the game resources. The important question is…IF I MARKED THIS ON EVERY IMAGE, WOULDN’T RENDERING BE SO DEMANDING EVERY TIME OBJECTS ARE CREATED OR WHEN THEY APPEAR ON SCREEN AFTER THEY HAVE NOT BEEN? IF NOT, WHAT IS THIS FUNCTION FOR?
Doing the test with each image would cost me a lot of time, which is why I prefer to ask first. The only solid thing I saw on the forum is the last comment on this thread:

1 Like

I also have these doubts. I believe that having a guide page dedicated to resolving doubts about performance would be of great help.

I don’t mean basic optimization tips, but understanding how Gdevelop works to use it to its fullest.

2 Likes

I found this on the Wiki:

Currently the Always loaded in memory option is not yet supported. All the resources (except audio) are always loaded at the startup of the game during the loading.

1 Like

Oh ok, thanks. So it has no function at the moment.
I still don’t understand what makes it consume considerably more resources in rendering than other examples that have a similar screen size and a more detailed background. The only way to achieve values ​​of 0.35-0.45 ms is to point the camera where there is nothing. I have a single effect in camera that, even removing it, gives me values ​​of around 0.90-1.20 ms (with peaks that can reach up to 1.76) in the rendering.

To contribute to the community, let’s start by using this topic to share some useful information, examples, and questions. I’ll also include some doubts you expressed:

  1. How many milliseconds are optimal for a game created in GDevelop? 3D CAR COIN HUNT seems to run at about 10.6 ms.

  2. What does the “Object: Pre-Events” field in Profiler refer to? Is it the functions called by “At Beginning”? it seems to refer to tweens.

  3. What does “Objects (Post Events)” mean? Here too, it seems to indicate tweens.

  4. Is the render field in Profiler just about graphics and assets? Or does it include something else?

  5. Is it better to have many sprites with few animations, or a few sprites with many animations?

  6. Does unchecking the “SMOOTH THE IMAGE” section in resources improve performance?

  7. Is it better to create objects right away and then hide them, or to create and destroy them each time?

  8. Since the introduction of “blazing fast game loading,” what changes have been made? Are there specific commands to select/deselect elements to load?

  9. Is it better to increase functions in the “At the Beginning” field or in the actual game?

3D CARCOIN HUNT - DEBUGGER

The optimal milliseconds consumed by each frame are independent of Gdevelop, but depend on the needs or objectives of the developer. A game that is oriented to mobile phones requires much greater optimization efforts than one for PC. Also, a 3D game usually has a higher rendering consumption than a 2D game.

This depends on the device you are testing on.

Something I have tried was to limit the FPS to 45-50 to be able to polish small frame jumps, but whenever I lower the maximum FPS, the game runs at 15-30 FPS and very slow.

I found some information related to smartphone games (I’m creating a game for Android). I hope they are useful for other users too.

The advice is not to exceed 16ms (10 for browser games, which require 6 ms from the browser).

Insights:

https://medium.com/bobble-engineering/measuring-jank-in-android-apps-521c74a964da