Page 1 of 1

[posila] [0.18.12] Crash after loading a save made with 0.18.12 (TransportLineDeserialiser::apply)

Posted: Sat Mar 14, 2020 8:17 am
by Optera
After updating map_gen_settings my save crashes on load.

Mod used to change settings: https://mods.factorio.com/mod/ChangeMapSettings

mods: https://drive.google.com/open?id=1BRVA7 ... -ySdr31JsN
working save: https://drive.google.com/open?id=1o0m4Y ... sjtiKaS2JX
corrupt save: https://drive.google.com/open?id=1SeqDk ... MptKkTsY-3

Update: Seems like it has nothing to do with changing map_gen_settings. I can reproduce the same crash by just saving this map in 0.18.12 and reloading it.

Update 2: the crash also happens with 0.18.10

Re: [0.18.12] Crash after loading a save made with 0.18.12 (TransportLineDeserialiser::apply)

Posted: Sat Mar 14, 2020 3:13 pm
by Optera
I've narrowed the crash down to upgrading to miniloader 1.10.4.
Using 1.10.3 the save loads fine with either 0.18.10 or 0.18.12.

Re: [posila] [0.18.12] Crash after loading a save made with 0.18.12 (TransportLineDeserialiser::apply)

Posted: Wed Mar 18, 2020 8:23 am
by posila
Thanks for the report.

So the underlying problem is the game forbids to place multiple transport belt connectable entities on the same tile ... but to enforce it, it does only collision check. So if a mod makes transport belt connectable entity that doesn't collide, it will be able to build multiple of them on the same spot *facepalm* ... and bad things happen.

I see 2 options how to fix it - either rework collision checking for transport belt connectables to make it really impossible to make overlapping belts, or to rework whatever requires belts not to overlap. Neither of the options are thrilling.

Either way, this save is already in bad state, so some kind of complicated migration would be needed to make the game load it.

It seems miniloaders created two loaders at the same spot by accident and they already updated the mod not to do that, so I'll take more time to think about how to handle this. (I don't want to repeat loader 1x1 fiasco that made modded saves not work correctly for a while)

Re: [posila] [0.18.12] Crash after loading a save made with 0.18.12 (TransportLineDeserialiser::apply)

Posted: Fri Nov 13, 2020 1:04 pm
by posila
I have finally come to terms with fixing this by adding further constraints on transport belt connectable prototype configuration, and restricting belt connectable entities to be build only on grid, to ensure collision check detects overlapping belt connectables.

As of 1.1.0, transport belt connectables must:
- have collision box of an appropriate minimal size
- have expected tile_width and tile_height so they are build on grid in an expected way (tile center vs. edge)
- not have placable-off-grid flag
- collide with itself, collide with entities (not just with tiles), and collide with transport-belt-layer