Have any code to revert this map reveal?

Malcomn wrote:I've messed up code to reveal the map, and now it's too big and I'm having perfomance issues.
Have any code to revert this map reveal?
Reference https://wiki.factorio.com/Console#World_ManipulationIf much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.Code: Select all
/c local surface = game.player.surface; game.player.force.cancel_charting(surface); local chunk_radius = 32; for chunk in surface.get_chunks() do if (chunk.x < -chunk_radius or chunk.x > chunk_radius or chunk.y < -chunk_radius or chunk.y > chunk_radius) then surface.delete_chunk(chunk) end end
I assume most, if not all of those biters are inactive, so they should take up very little processing time.mewtwoEX wrote:This thread popped up when I was doing a search for this main topic. I eventually found the solution in the WIKI. Reproduced below for other people who stumble here.
In answer to the "why is it slow" question, with all those biters to calculate every tick, it certainly would run slow even with no user buildings made.
Reference https://wiki.factorio.com/Console#World_ManipulationIf much of the map is revealed, it increases the size of the save file. The following command cancels the generation of all chunks that are currently queued for generation and removes chunks outside a 32 chunks radius around 0,0. Note that this will remove player entities if there are any on these chunks.Code: Select all
/c local surface = game.player.surface; game.player.force.cancel_charting(surface); local chunk_radius = 32; for chunk in surface.get_chunks() do if (chunk.x < -chunk_radius or chunk.x > chunk_radius or chunk.y < -chunk_radius or chunk.y > chunk_radius) then surface.delete_chunk(chunk) end end