From my understanding from Dynamic factories | Defold it will load only the bullet shown in screen(fire)? So it saves performance on the other game objects not currently seen(rock, lighting).
Trying to optimize from one collection with many sprites that might affect performance.
Collection with items:
10 swords
23 polearm
8 bows
Maybe a moving character with different looks/phases.
100% health human hunter
80% health monster transformation
Or just different resolutions with high dpi enabled?
Is it affecting performance? Have you measured? What are you worried about? Memory? CPU? You can use the Profiler to check if you are spending an acceptable amount of time.
Dynamic factories are what I would call a power user feature. It is not necessary to use in most scenarios. If it’s only a matter of changing the visuals of a sprite like in the example it can also be achieved using a single factory, a bullet game object with a sprite and then one line of code to change which image to show on the sprite (sprite.play_flipbook()).
(should have mention ram optimizing not performance optimization) Just wary since its not going to be a pixels art style and Im just maximizing ram usage(AI Bubble/I think that’s a lot of low ram gamers).
There is going to be a maximum number of 80 slots for characters to be in a level.
And a Player Character that will change in with different armors equipped(messages), maybe even animation on the sprites.
I think what you should care about is GPU memory. What is the size of your textures and how many do you have loaded at once? Using dynamic factories can help in this regard since you can have multiple smaller textures and only use the ones you need at the moment. BUT, many small textures may increase the number of draw calls. So it really depends on the size of your textures and how many you have and what kind of graphics you need to show at the same time.
Still deciding on the maximum number of background elements, background effects and props in a level.
Particles(leaf falling, debris from buildings)
25x25(can be even lower)
Normal size characters, props, background effects(like water animation)
309x373 > player size(changing armor with dynamic factories/a lot of armor variation(helmet,body))
Maybe after a level, equipment can be modified so not on the heavy game-play areas.
Characters(ally or enemy), background elements(boulder)
531x633
Characters(ally or enemy), background elements(ruin statue)
706x765
Characters(ally or enemy), background elements(bunch of trees)
926x1019
Boss(not entirely the whole screen), background
1920x1080
Thinking of a script that relates to settings where low sprites no animations and high setting is sprites with it, tying it with dynamic factories.
Once you have everything figured out and laid out into a number of different atlases you can get an idea of how much GPU memory you will use. Atlas width x height x 4 will give you the uncompressed size of the atlas. Depending on if you are targeting phones, desktop PCs or browsers you will have different memory budgets. You need to figure out how to lay out and arrange your atlases so that you can have all of the necessary graphics that you plan to show at the same time loaded into GPU memory.
Note that this is good to keep in mind, but I would not focus too much on it early on during development as the scope of your game will change over time.