Sometimes my automated carts will just follow each other forever. I added "Swap" points to promote alternating routes, but It would be useful if I could randomize things completely.
Trigger Probability?Solved
I will consider adding a "random" track selection option, and a "probability" that determines whether a trigger even applies.
However, I'm not sure these are the right solution to your problem without knowing more. Can you showcase what your setup looks like? Maybe a map overview or drawing depicting the routes.
Here is my current tunnel map.
I have ALL of your tunnel triggers active in the config.
I have also placed SWAP triggers on the straight tracks shortly after each Train Station "spawn" exit;
The dots on the map roughly represent these SWAP triggers.
(map size 3000 seed 1653078275)
Any features or advice will be appreciated!
Using the default triggers, you should see 7 distinct loops.
- 5 trains in the top left
- 2 in bottom left
- 7 in middle
- 2 in middle right
- 2 in top right
- 4 in upper middle
- 8 that loop the outer edges
However, using conductor limits, you don't get to pick which routes are traveled. I'm not sure why you would need randomization for this map. If it's because some routes are skipped, may we can think about a way for the plugin to be smarter about which trains it automates, or a way to disable specific instances of tunnel triggers per map. You could actually just disable the spawn triggers and place map-specific spawn triggers to determine which trains will be automated.
The spacing between trains should be pretty consistent, but there will be a few that are close to each other since they spawn close. Using the map marker feature, it should be easy to see where they are at all times for debugging.
What do you mean they just follow each other? That shouldn't happen with the default triggers, but swapping may make them eventually go the same route.
Over time I have noticed some carts following each other back-to-back "forever", nearly colliding before slow triggers but never actually colliding. This is what inspired me to try SWAP triggers. There are still occasionally some followers, so I resort to adding temporary Invert triggers to force a collision 😄
Merged post
Also, a little off topic, but trigger probability could also enable us to create a very small chance that barricades destroy the train for example.
My guess is that it has something to do with the barricades since they will spawn and then slow down the workcart, causing it to get closer to the next one. I can do a few things to mitigate this, such as instantly destroying barricades on collision, and disabling spawning of barricades.
Currently, the only thing that spreads out trains is premature departures, where a train getting rear-ended will cause it to leave immediately if it's waiting, or it will cancel the stop completely if it's currently braking to a stop (i.e., a Brake Zero <Time> trigger). This is why the trains probably don't collide most of the time, because a previous collision calibrated the timings slightly. I could expand on this logic a bit, by making the train in the back increase its wait time a bit. A long line of trains would then eventually apply backpressure, where the one at the back end (Train A) waits longer, then the one before it (Train B) waits longer, pushing Train A back some more, eventually allowing Train C to start pushing them back.
I previously experimented with deterministically predicting where the trains would go, according to current instructions and triggers along the track. I could revisit this in order to build a higher level system that can predict schedules and help spread out the trains. Issue with random triggers is that it breaks the prediction.
Merged post
I see, you found a bug. When a workcart rear-ends another while braking to a stop, after chilling for a few seconds, the rear-workcart doesn't brake to a stop and wait like it's supposed to, it just keeps going, causing them to follow each other like you said.
Merged post
I pushed some changes to the GitHub repo.
https://github.com/WheteThunger/AutomatedWorkcarts
- Fixed an issue where an automated train rear-ending another could cause the rear train to skip it's in-progress braking/stopping process, effectively making trains just follow each other around
- Improved back-pressure handing so trains should space out a bit more aggressively in response to collisions
- Added config option (
DestroyBarricadesInstantly) to instantly destroy barricades on collision with an automated train, to reduce the amount that barricades will push trains closer together, though the train will still initially slow down when hitting the barricade - Added config option (
SpawnTriggersRespectConductorLimit) to make spawn/conductor triggers respect conductor limits - Added trigger chance option (e.g.,
awt.update 50%) which applies to the entire trigger, except for whether the trigger adds a conductor
This is great.
I was able to awt.train workcart wagonb to both TrainStation spawn profiles
and enable SpawnTriggersRespectconductorLimit to get some nice passenger trains going with all of the other tunnel triggers enabled.
I am wondering if the extra wagon will create any collision issues but I have not seen anything concerning yet. They are staying pretty spread out so far.
I haven't re-added any SWAP points or tried probabilities yet as I'm trying to observe your default profiles as suggested. (with the extra wagons)
I did enable DestroyBarricadesInstantly and watched it go down in the tunnel. The first barricade in the series is just deleted without effects and the second barricade after the stop trigger goes through a default destroy animation which still slows the train.
Locked automatically