Patrefans
bagoolworks from patreon
bagoolworks patreon

2/12/18 and Memory

🕑 Added 2018-02-12 14:21:13 +0000 UTC

Comments

Bagool

Thanks, I think I was also blowing it out of proportion with the larger images. After fully replacing everything with the more compact images, I'm now down to 31mb. Much more manageable.

Oh god that's horrible, it sounds like they're essentially forcing you into object pooling which trades RAM for CPU time, that's the sort of stuff you do when you're getting a CPU bottleneck (not something you're ever likely to encounter in a game like this). Good luck!

Bagool

That's another point to the issue that I didn't feel was worth covering. Apparently every layout (or room as you could call it) preloads all of the objects on it. So if I have the mouth object as before, with it's dozen or so animations featuring a dozen or so frames with each frame being the same size as the main picture all being kept in the background while the game runs, then that'll really tax the system. Before, with my mouth animations nearly done I was pushing a gb of RAM usage. Now with nearly the same amount of content but with resized images, I'm only getting 70mb. It'll be more difficult, but I'm going to need to come up with a way to destroy and create the portrait at a certain position when I need it. All of this is pretty new to me, but I think I've gotten the hang of it now.

Take this with a pinch of salt as I've never used construct but alarm bells are ringing here. Just had a look at the full body portrait and it's 152kb, there's no way you should be getting 'huge' memory usage with that, lets say you use it 25 times a second for 10 seconds that's still only getting you up to 31mb. To me this is screaming memory leak and giving me flashbacks to SDL, if you load in an image and only use it once make sure you remove it from memory once it's usage is done. If you're reusing the same image you'll need to cache it at the start and then just call on it each time you want to use it. It sounds to me like what is happening is you're loading in the image every frame while the animation is playing meaning it's being loaded in hundreds of times per second and taking up a huge amount of space.


More Creators