Memory doesn't persist between ticks



  • https://pastebin.com/FTyPrQXi this is my main loop code.

    As you can see I have 4 console.log's

    First 2 -> before anything else being executed in my script

    Last 2 -> At the very bottom of my script's execution 0_1527780457706_e61e6041-9cea-40ac-a64d-e2dcb1497f59-image.png

    This screenshot is the result of these console.log's after 2 ticks.

    As you can see at the beginning Memory.remoteRooms['E16S37'] is undefined as expected.

    Then at the very end it is set and it has information in itself.

    Since the screenshot covers 2 ticks, one after another, there should be no code of mine being executed between the first last 2 console.log's and the last first (the blue line). So with no code of my own...Memory has been emptied.

    Here is the information stored {"name":"E16S37","sources":{"59f1a42382100e1594f3c88e":{"id":"59f1a42382100e1594f3c88e","energy":3000,"creeps":[],"maxCreepsCount":1,"creepsMiningPotential":0,"container":"","link":""},"59f1a42382100e1594f3c88f":{"id":"59f1a42382100e1594f3c88f","energy":3000,"creeps":[],"maxCreepsCount":4,"creepsMiningPotential":0,"container":"","link":""}},"minerals":{"59f1c0de7d0b3d79de5f17ce":{"id":"59f1c0de7d0b3d79de5f17ce","type":"O","container":""}},"controller":{"id":"59f1a42382100e1594f3c88d","pos":{"x":41,"y":11},"reserved":false,"reservationEndTick":0},"underAttack":false,"threatLevel":0,"owner":"E16S38","containers":{},"constructionSites":{}}

    As you can see there are no functions or anything else that is non JSON.


  • Dev Team

    Most likely the problem is related to your code, since we don't observe any issues with memory at the moment. If you are absolutely sure it is not related to your code, please try to create a minimal isolated reproducible test case. It's very hard to tell anything based on the output of a real script.