Page 1 of 1

[0.17.79] Game freezes for 2 minutes when placing BP.

Posted: Sun Dec 15, 2019 2:05 pm
by Stevetrov
NB I believe this is probably related to viewtopic.php?f=7&t=78989
What did you do?
In this savefile
I copied the large T junction in the middle of the map into an open space.
What happened?
The game froze for 2 minutes
and then the blueprint was placed as expected
Image
Looking at VS profile of the exe whilst placing the bp it seems to be calling a callback to repath trains for every piece of track placed.
What did you expect to happen instead? It might be obvious to you, but do it anyway!
I expected the bp to be placed ideally with no noticable slow down although a second or two would be acceptable.
If I place the same bp when there are zero trains on the map, it places in about 1.5s.

Re: [0.17.79] Game freezes for 2 minutes when placing BP.

Posted: Sun Dec 15, 2019 11:37 pm
by Rseding91
Thanks for the report. There's unfortunately nothing I can think of to make this any better. When you have the instant-blueprint option enabled it forces every single rail and rail signal to be built in the same tick and that's just expensive with the setup you've made with so many signals.

One thought I had was to defer the re-pathing until after all of the rails/signals have been built but because of Lua events when reviving entities I can't leave the trains in an inconsistent state while the rest of the rails/signals get revived.

So, that's just how it is. One thing you could do is make a small mod which forces every single train into manual mode before the blueprint is placed and then switches it back after they're all built. It still wouldn't have the desired effect though.