Memory not cleared when starting new Survival game
-
Whenever (or, almost every time) I start a new Survival game, the Memory contains all the same information that it did at the end of my last game. This includes incorrect state information that I've stored, and IDs for game objects that don't exist. I can't even write a script to clear the memory at the beginning, because any flag that I set to indicate this has already been done would be carried over to a new game as well.
-
This is not a bug.
Memory object is saved because it can store not only your current Survival game state, but also another modes' data, including World mode. Memory is linked to your account, not to a single game.
In order to track Survival game data better to use
Room.memory
object rather than globalMemory
. Or you can reset your globalMemory
on the first tick in survival mode room usingRoom.survivalInfo.score
:var room = Game.spawns.Spawn1.room; if(room.survivalInfo.score == 0) { // reset Memory here }
-
This single memory state per account thingy would be interesting to see when a bot runs in multiple rooms at the same time... it would currently break the behavior of my bot