Screeps3D
Screeps3D copied to clipboard
High Memory usage after exploration of multiple rooms
KittyTack on slack reported the following When exploring around on MMO the used memory on the system skyrockets, it never seems to unload /unsubscribe the rooms not visible from memory.
KittyTack suggested a button to "unload" all rooms except the ones around your current location.
We need to investigate the memory usage point.
One of the things that may be able to help with this is setting static limits on objects like dots and pooling them. At a certain number, recycle the last one on the pool to the first by changing the values. Also setting the visual objects to setActive('false') can help out with out of range object in the pool.
I believe room objects are already pooled, not sure about dots
Room views seem to add up indefinitely. So terrain data and road network data. Maybe we should limit their amount to some fixed value, with the least recent ones being unloaded?
Limiting it might be a good idea, we also have a maximum viewing distance in the client, not sure how views add up comparted to that? maybe we should unload views that are too far away to be seen? I have no idea if it already does this :)