Hey guys,
For my recent project, a RPG, I need to import sprites externally, because adding them by hand would just be... overwhelming.
I currently have a problem with the sprite_add function.
Im trying to load a few sprites (a lot more in the future with more items).
Currently about 640 strip sprites (8 directions, 8 different sprites, 10 animations)
The basic single sprite dimensions are 128x128px, so the strips are relatively with a max of about 25frames.
All sprites together are 15.3Mb on disk, but if I import them with sprite_add, I land at 1.9Gb RAM, which is huge...
After learning that sprite_add does create a texture map (so 640 maps total), I had a simple fix in mind.
I created the texture maps on my own (via external python code) and it packs every direction in a single map. So now I have 80 sprite maps (8 different sprites, 10 animations) and thus I should only have 80 texture maps. But as it turns out, even with cutting 87,5% of texture maps, I still reach 1.9Gb RAM and I simply can't understand the problem.
btw: Without sprite_add I land at about 20Mb RAM
Does anyone have an Idea what might happen, or how I can fix this issue?
Working with sprite_flush and sprite_prefetch wont suffice, because we are currently talking about just 8 different sprites (equippable items) and in a standard RPG there are way more then 8 combination on the screen at any time, like in a city with just a few NPC.
Thanks in advance and happy coding!
TL;DR
External sprites are 15.3Mb on Disk
640 sprites with sprite_add result in 1.9Gb RAM and 640 texture maps
80 packed sprite maps with sprite_add also result in 1.9Gb RAM but 80 texture maps
Without sprite_add I run on just 20Mb RAM
Send help!
For my recent project, a RPG, I need to import sprites externally, because adding them by hand would just be... overwhelming.
I currently have a problem with the sprite_add function.
Im trying to load a few sprites (a lot more in the future with more items).
Currently about 640 strip sprites (8 directions, 8 different sprites, 10 animations)
The basic single sprite dimensions are 128x128px, so the strips are relatively with a max of about 25frames.
All sprites together are 15.3Mb on disk, but if I import them with sprite_add, I land at 1.9Gb RAM, which is huge...
After learning that sprite_add does create a texture map (so 640 maps total), I had a simple fix in mind.
I created the texture maps on my own (via external python code) and it packs every direction in a single map. So now I have 80 sprite maps (8 different sprites, 10 animations) and thus I should only have 80 texture maps. But as it turns out, even with cutting 87,5% of texture maps, I still reach 1.9Gb RAM and I simply can't understand the problem.
btw: Without sprite_add I land at about 20Mb RAM
Does anyone have an Idea what might happen, or how I can fix this issue?
Working with sprite_flush and sprite_prefetch wont suffice, because we are currently talking about just 8 different sprites (equippable items) and in a standard RPG there are way more then 8 combination on the screen at any time, like in a city with just a few NPC.
Thanks in advance and happy coding!
TL;DR
External sprites are 15.3Mb on Disk
640 sprites with sprite_add result in 1.9Gb RAM and 640 texture maps
80 packed sprite maps with sprite_add also result in 1.9Gb RAM but 80 texture maps
Without sprite_add I run on just 20Mb RAM
Send help!