Page 1 of 1

Reset map revealed

Posted: Sun Feb 12, 2017 2:27 pm
by Malcomn
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?

Image

Re: Reset map revealed

Posted: Sun Feb 12, 2017 3:17 pm
by Klonan
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?

Image

Nope

Re: Reset map revealed

Posted: Sun Feb 12, 2017 8:59 pm
by Mehve
You can use the map seed to get the exact same layout in another game, for what that's worth.

Re: Reset map revealed

Posted: Tue Mar 14, 2017 5:39 pm
by StoneLegion
Sorry to pop this up again. Why is it lagging? If it's all shutdown it should not lag and this seems to be more of a performance issue / bug if that is the case.

Re: Reset map revealed

Posted: Thu Mar 15, 2018 2:46 pm
by mewtwoEX
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.
If 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
Reference https://wiki.factorio.com/Console#World_Manipulation

Re: Reset map revealed

Posted: Thu Mar 15, 2018 9:10 pm
by darkfrei

Re: Reset map revealed

Posted: Fri Mar 16, 2018 12:26 am
by Jap2.0
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.
If 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
Reference https://wiki.factorio.com/Console#World_Manipulation
I assume most, if not all of those biters are inactive, so they should take up very little processing time.