Page 1 of 1

Train time use

Posted: Fri Sep 10, 2021 2:49 pm
by burner
Hi,
I try optimize my seablocks base to better performance. I notice that trains take 2ms even almost all trains are at stop. Is there any kind thumb of rules what kind things need cpu time in trains?
Currently most of trains will stand at destination full mode so I start wonder that will it check available destination stations at each tick?

Re: Train time use

Posted: Fri Sep 10, 2021 3:09 pm
by boskid
Trains in the "destination full" state should be performance friendly as there is almost nothing happening in that state except of creating the "destination full" flying text (which is an entity) every 180 ticks. The way they go forward from this state is when the train stop limit logic forces them to recalculate path once a train stop became not full (by increasing limit or decreasing count). When this logic runs (at most once per tick) it will unfortunately touch all the trains in the "destination full" state but most of them should be relatively quickly ignored as they will not have an associated station that became not full.

There is also another part of logic that counts for trains update, and it is the chain signal recursive state propagation but it is mostly a simple stuff and should not show as such large value.

Without any save file there is nothing to run profiler on to tell you what is actually taking the most of the train update time.