Disabling components and buffers/limits

Hi,

I am currently making a game with an infinite generation, where the player may need to return to previous areas (meaning I would rather not use go.delete as in other questions on these forums). I am trying to use msg.post("#sprite", “disable”) to be able to spawn in more sprites than the sprite buffer allows however I am finding the sprite buffer still gets filled. I have attempted to force the sprites to disable before new objects can be spawned (one chunk at a time) but am still finding this issue occuring.

My question is, does a sprite being disabled mean it still counts for the sprite buffer (and I’m doing something wrong), or do I need to have a complete rethink of my methods? I just want to know that trying to fix my issue will not be a waste of time.

Yes, disabled sprites still count towards the sprite buffer limit.

If you want a large world, you will need to load and unload it in chunks. Obviously, if your goal is “infinite”, then at some point you will not be able to keep it all loaded at once, even without buffer limits. Even if none of it was being drawn or running scripts, you would still run out of memory eventually.

1 Like

Thanks for the help. What I’m probably going to have to do is have a basic memory of each object within the chunk (object type, position and health, which can be stored in lists that are no bigger than 135 spaces per list) that can be used to re-create the objects when entering the chunk.

When I say infinite, I meant more in the terms of having a level system where each level gets slightly bigger, and the level itself is “uncapped”. Looking back on it now, I realise this is impossible, but I feel I would like to be able to get to a larger floor than 5 without hitting any buffers (which already have been doubled).