A very long belt for storing some rocks:
Delete any section of the belt and the game halts (probably infinite loop)
No crash log / nothing abnormal in game log / no output after halt
100% reproducible on my side (tried at least 5 times)
Blueprint of entire ship is attached (belt.txt), don't think the save file has any use.
Issue is not seen when I'm not reading full belt content and cutting the belt
Top left I'm reading belt content[boskid][2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
-
- Burner Inserter
- Posts: 5
- Joined: Sat Nov 09, 2024 4:26 am
- Contact:
[boskid][2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
- Attachments
-
- belt.txt
- (451.32 KiB) Downloaded 11 times
Re: [2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
Its not infinite loop, it looks like it is O(N^2) where N is amount of belt belt pieces: when removing 1 belt piece there is code that tries to span transport line nicely, but before doing so it cuts the entire sequence into 1 tile long pieces (this is the first N) and when every piece is created, belt reader is propagated backward and forward (this is the second N). I may have some ideas how to improve this slightly, but this really feels like one of the "stop shooting yourself into your foot from the artillery cannot" case.
-
- Burner Inserter
- Posts: 5
- Joined: Sat Nov 09, 2024 4:26 am
- Contact:
Re: [boskid][2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
hmm, can the belt reader be propagated after the new lines are formed? It would still be O(N).
By any means, this is a really niche situation that I can work around.
By any means, this is a really niche situation that I can work around.
Re: [boskid][2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
Ok, it looks like by adding a strategic one line of code in one specifc place fixes this issue completly without even need to rewrite the remerge logic. So this issue should be now fixed for 2.0.22.
-
- Burner Inserter
- Posts: 5
- Joined: Sat Nov 09, 2024 4:26 am
- Contact:
Re: [boskid][2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
Thanks for the quick fix!
Re: [boskid][2.0.20] Read full belt content on very long belt loop halts the game when the belt is cut
Ok, i did also another optimization on top of the previous one, a rewirite of the remerge logic and now my setup that consists of 250k of transport belts connected in sequence with belt reader active, when removing a belt takes about 8ms for the remerge operation which is hardly noticable. In 2.0.21 that same setup was taking way more than 5 minutes (i never saw it finish) so i am going to call it a success.
-
- Inserter
- Posts: 23
- Joined: Tue Jan 29, 2019 7:15 pm
- Contact: