[Rseding91] [0.17.9] Modded:Cannot save map: Detected corruption of the game state

This subforum contains all the issues which we already resolved.
Post Reply
CaveGrinder
Inserter
Inserter
Posts: 31
Joined: Fri Aug 24, 2018 7:42 pm
Contact:

[Rseding91] [0.17.9] Modded:Cannot save map: Detected corruption of the game state

Post by CaveGrinder »

Hi,

i am currently working on a mod and am encountering a reproduce-able game state corruption. I am seeing this in 0.17.9 and 0.17.0, i did not try intermediate versions. Also the mod needs 0.17.x so i cannot try it in 0.16.x

steps to reproduce:
add only one attached mod RepeatingIslands_0.1.1
RepeatingIslands_0.1.1.zip
(4.32 KiB) Downloaded 95 times
start a new game
choose "island" from map type (mandatory, otherwise the mod doesn't work correctly)
change Island size to lowest 17% (not so relevant but should show the issue faster)
run the command
/c game.forces.player.chart(game.player.surface, {lefttop = {x = -2048, y = -2048}, rightbottom = {x = 2048, y = 2048}})
Wait, the corruption typically occurs within ~1-2 minutes. It is 100% reproduceable on my machine, i tried it at least 30 times while trying to narrow it down.

The mod creates a new surface with the island type in the background. once the island is completely generated it is copied over to nauvis, and another one is started.
The mod makes heavy use of the APIs is_chunk_generated/request_to_generate_chunks/force_generate_chunk_requests/count_tiles_filtered/clone_area/delete_surface.
I was not able to pin it down to one responsible call, but the combination in the current mod shows it the fastest for me.
I know the delete_surface call is not the cause since it happens also when i don't delete the surfaces and just use new ones.


User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5030
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: [0.17.9] Modded:Cannot save map: Detected corruption of the game state

Post by Klonan »

Also if you want multiple islands you can just set multiple starting points to the nauvis surface

CaveGrinder
Inserter
Inserter
Posts: 31
Joined: Fri Aug 24, 2018 7:42 pm
Contact:

Re: [0.17.9] Modded:Cannot save map: Detected corruption of the game state

Post by CaveGrinder »

i have attached the log:
factorio-current.log
(5.08 KiB) Downloaded 104 times
the starting_points is almost what i wanted but it didn't quite fit.
- i have to know the number of islands in advance, but i want to use ships and don't know if i spend 10h,100h or 1000h on the map so i tried a generic approach
- maybe i got it wrong, i thought changing the map_gen_settings of nauvis does nothing as it would not be re-applied... i could create another surface with those settings but then mods that assume i am playing on nauvis would not work

CaveGrinder
Inserter
Inserter
Posts: 31
Joined: Fri Aug 24, 2018 7:42 pm
Contact:

Re: [0.17.9] Modded:Cannot save map: Detected corruption of the game state

Post by CaveGrinder »

i have found a workaround; if i ensure that the chunk exists before calling clone_area
(using calling is_chunk_generated+request_to_generate_chunks and waiting till that is done)
this corruption doesn't seem to happen

Rseding91
Factorio Staff
Factorio Staff
Posts: 12205
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [Rseding91] [0.17.9] Modded:Cannot save map: Detected corruption of the game state

Post by Rseding91 »

Thanks for the report. It's now fixed for the next version of 0.17.
If you want to get ahold of me I'm almost always on Discord.


Post Reply

Return to “Resolved Problems and Bugs”