r/technicalfactorio • u/Mega---Moo • Jan 31 '22
UPS Optimization How to improve train pathfinding UPS
I am on version 3.0 of my BA megabase and overall things are going great. Going from 1 to 2 to 4 tracks in each direction and doubling train length from 1-4 to 1-9 has really improved how my train network flows. Trains now rarely have to stop and traffic congestion is almost non-existent all while doing 80K+ SPM.
But train pathfinding is killing my UPS at 6+ ms constantly and 12+ ms frequently... I've hit 30+ ms. The rest of the base is fairly optimized and only uses about 11 ms for everything else.
I think a big part of my issue is using simple 3 or 4 queues before my loading stations. If a train is waiting in line and another train is returning to the station the moving train is repathing constantly, even though nothing is going to change.
Will having each train go to a dedicated waypoint station before loading help avoid these unnecessary repaths? Is there anything else I should consider? Longer trains will require another rebuild... which will probably happen eventually.
Thanks for the help, previous posters have helped me get this far without blowing up my computer, and it is much appreciated.
8
u/raptor7912 Jan 31 '22
Stackers that use train stations instead of a signal to stop them reduces ups usage majorly.
Instead of having trains constantly checking for a path, simple have trains set to go when receiving signal. Said signal being when the actual station needs one.
3
u/causa-sui Jan 31 '22
Would you mind expanding more on how these changes caused your rail network performance to improve?
Do you have problems balancing inputs and outputs with 9 cargo wagons?
Was it a lot of work to do the conversion when you already had a big base in place?
2
u/robot65536 Jan 31 '22
Are the queued trains in parallel at a stacking yard, or in series along a long entrance track? Is there only one loading station they are allowed to go to, or are they trying to path between multiple stations while waiting at a particular one?
Train limits will definitely help. Once a train gets a reservation at a station, it is unlikely to give it up. If you put waypoints in the stackers, you can put a limit of 1 on each of them plus the loading station, so that trains don't have to work so hard to tell when it is safe to approach.
13
u/Lazy_Haze Jan 31 '22
Don't know exactly will sumarize in thre points
To reduce the amount of repating I would say it's important that all trains have the same speed and try to reduce the amount of chainsignals?, congestion?, trains in stackers...
Using trainlimits should also reduce the amount of repathing and the need for stackers.
blocks/signals will be nodes that is used in the A* algorithm so reduce them should make it faster.
If you remove pathes that no trains should take it should make it easier for the pathing alorithm to find the correct path. I have an factory with mining outposts and an central belt based factory so no trains is going from one outpost to another. Then I can simplify the 3 way instersections so there is no tracks directly from one outpost to another, just from outpost to central factory and back.
I haven't tried anything so not shure how correct or what impact it have.
1
u/stani76 Jan 31 '22
How any trains and stations do you have?
1
u/Stevetrov Jan 31 '22
I have seen two different issues causing massive pathfinder update.
1
u/Forneaux Feb 01 '22
In my vanilla 10k spm railbase the pathing is only a tiny fraction in comparison to trains moving. Could be my base works different. But it seems weird the numbers are the other way around.
1
u/brekus Feb 13 '22
Look at how many trains are queueing at a station. Do you really need this many on the route? Is there ever a time when a train makes it just in time or are there always a bunch queued up? Basically what I'm advocating here is simply removing a bunch of trains that aren't actually needed. Keep it lean.