Page 1 of 2

[Rseding91] Chunk deletion failure

Posted: Thu Oct 05, 2017 2:19 pm
by POPISowyNumer
After trying to delete some of the chunks generated via self-written command, game crashed.
Then I tried the command posted as a tip numerous time on the forum, and game crashed as well.

Attached below documents that seem to be the crash logs.

Re: Chunk deletion failure

Posted: Thu Oct 05, 2017 2:22 pm
by Loewchen
Post the commands you used, the save file and the .ziped mod folder please.

Re: Chunk deletion failure

Posted: Thu Oct 05, 2017 5:36 pm
by POPISowyNumer
Here's the save dropbox link https://www.dropbox.com/s/6wppkc0hcp7sm ... 3.zip?dl=0
mod list is attached
also while i tried to redo the upper command factorio crashed again, and simultaneously mozilla crashed too, though i do not know how much of a coincidence was that.
commands were:
/c for x=4096,8196 do for y=-8196,8196 do game.player.surface.delete_chunk{x, y} end end
/c game.player.surface.delete_chunk{0, 4}

Re: Chunk deletion failure

Posted: Thu Oct 05, 2017 5:41 pm
by Loewchen
Does it crash always when running the command or just once/sometimes?

Re: Chunk deletion failure

Posted: Thu Oct 05, 2017 5:51 pm
by POPISowyNumer
All three times I ran any of those commands it crashed.
Few other variations of this command do nothing.
Among them this one:
/c for chunk in game.player.surface.get_chunks() do
if chunk.x > 2048 or chunk.x < -2048 or chunk.y > 2048 or chunk.y < -2048 then
game.player.surface.delete_chunk(chunk)
end
end
This command was processed by game, and failed to produce any result, be it deletion of chunks or crash.

Re: Chunk deletion failure

Posted: Fri Oct 06, 2017 12:10 am
by Rseding91
Both of the crashes in the log files you provided are fixed in 0.16.

Re: Chunk deletion failure

Posted: Fri Oct 06, 2017 8:28 am
by POPISowyNumer
Rseding91 wrote:Both of the crashes in the log files you provided are fixed in 0.16.
Rseding91 wrote:fixed in 0.16.
Oh dammit.
So...
Is there any crashless way to get rid of excess chunks in 0.15 or am I stuck with 200MB map until whenever my modpack will be 0.16 compatible?

Re: Chunk deletion failure

Posted: Fri Oct 06, 2017 3:47 pm
by Rseding91
POPISowyNumer wrote:
Rseding91 wrote:Both of the crashes in the log files you provided are fixed in 0.16.
Rseding91 wrote:fixed in 0.16.
Oh dammit.
So...
Is there any crashless way to get rid of excess chunks in 0.15
Nope.

Re: Chunk deletion failure

Posted: Fri Oct 06, 2017 4:20 pm
by Bilka
Rseding91 wrote:
POPISowyNumer wrote: Is there any crashless way to get rid of excess chunks in 0.15
Nope.
? I don't quite understand; there's mods that delete chunks that work perfectly fine.

Re: Chunk deletion failure

Posted: Wed Oct 11, 2017 4:32 pm
by POPISowyNumer
I have retested one of the commands, and apparently this time my PC had run out of memory.
Attaching the new crash log

Re: Chunk deletion failure

Posted: Wed Oct 11, 2017 5:38 pm
by Rseding91
The crash should be fixed in 0.15.36 (labeled experimental right now).

Re: Chunk deletion failure

Posted: Fri Oct 13, 2017 8:28 am
by POPISowyNumer
I have retested the '/c for x=4096,8196 do for y=-8196,8196 do game.player.surface.delete_chunk{x, y} end end' command with much smaller range for x, first for 8000-8196 and then 7800-8000.
Both commands didn't crash the game, suggesting that origin of crash is memory related, but again, both commands failed to delete the chunks, which seems to be quite inconsistent with what command suggests to be for.

Re: Chunk deletion failure

Posted: Fri Oct 13, 2017 9:18 pm
by Rseding91
POPISowyNumer wrote:I have retested the '/c for x=4096,8196 do for y=-8196,8196 do game.player.surface.delete_chunk{x, y} end end' command with much smaller range for x, first for 8000-8196 and then 7800-8000.
Both commands didn't crash the game, suggesting that origin of crash is memory related, but again, both commands failed to delete the chunks, which seems to be quite inconsistent with what command suggests to be for.
The positions are chunk based not world position based. You asked it to delete all chunks between world positions x=131072 through x=262272.

See: http://lua-api.factorio.com/latest/LuaS ... lete_chunk

Re: Chunk deletion failure

Posted: Sat Oct 14, 2017 6:53 pm
by POPISowyNumer
Rseding91 wrote:The positions are chunk based not world position based. You asked it to delete all chunks between world positions x=131072 through x=262272.

See: http://lua-api.factorio.com/latest/LuaS ... lete_chunk
Well...
Due to some slight underestimation of how much map would this command reveal /c game.forces.player.chart(game.player.surface, {lefttop = {x = -8192, y = -8192}, rightbottom = {x = 8192, y = 8192}}), I decided to delete some of the excess chunks, to reduce map size and stop factorio from chugging down my entire RAM, which led me to encounter the whole crashing issue.
I assumed values used by this command are the same magnitude as those that are supposed to go in the deleting command.
If that's not right, I ask for some clarification.

Re: Chunk deletion failure

Posted: Sat Oct 14, 2017 7:06 pm
by Rseding91
POPISowyNumer wrote:
Rseding91 wrote:The positions are chunk based not world position based. You asked it to delete all chunks between world positions x=131072 through x=262272.

See: http://lua-api.factorio.com/latest/LuaS ... lete_chunk
Well...
Due to some slight underestimation of how much map would this command reveal /c game.forces.player.chart(game.player.surface, {lefttop = {x = -8192, y = -8192}, rightbottom = {x = 8192, y = 8192}}), I decided to delete some of the excess chunks, to reduce map size and stop factorio from chugging down my entire RAM, which led me to encounter the whole crashing issue.
I assumed values used by this command are the same magnitude as those that are supposed to go in the deleting command.
If that's not right, I ask for some clarification.
Charting uses world positions and chunk deletion uses chunk positions. Chunk positions are world positions / 32.

Re: Chunk deletion failure

Posted: Sat Oct 14, 2017 8:16 pm
by Rseding91
I've updated the Lua docs for 0.16 to better describe the difference between a map position and a chunk position.

Re: Chunk deletion failure

Posted: Sat Oct 14, 2017 9:05 pm
by POPISowyNumer
Rseding91 wrote:I've updated the Lua docs for 0.16 to better describe the difference between a map position and a chunk position.
So two birds with one stone.
Good to be useful tester

Re: Chunk deletion failure

Posted: Sat Oct 14, 2017 10:42 pm
by POPISowyNumer
Welp.
So I have .36 installed, just checked that to be sure.
I tried to delete some chunks on overly big map... and crash.
Okay, maybe I went too hard on my poor pc, let's size down
Crash again.
So I loaded smallest version of that map i have now, crash again.
AND
on freshly new map it worked as intended.
I am deeply confused.

Re: Chunk deletion failure

Posted: Sat Oct 14, 2017 11:27 pm
by Rseding91
POPISowyNumer wrote:Welp.
So I have .36 installed, just checked that to be sure.
I tried to delete some chunks on overly big map... and crash.
Okay, maybe I went too hard on my poor pc, let's size down
Crash again.
So I loaded smallest version of that map i have now, crash again.
AND
on freshly new map it worked as intended.
I am deeply confused.
Your new crash looks completely different. Can you upload the save you're using and the command you're running that crashes it?

Re: Chunk deletion failure

Posted: Sun Oct 15, 2017 7:48 am
by POPISowyNumer
Save's attached, with new crash log
Commands that crashed this save were
/c for x=7,8 do for y=7,8 do game.player.surface.delete_chunk{x, y} end end
and
/c for x=3,4 do for y=3,4 do game.player.surface.delete_chunk{x, y} end end
in the bigger map the values were just a tad bigger.

There's no running radars that cover that space, although I think I was using Bob's MK5 radars on that map before.