[1.1.80] Trains repath to path that requires braking over their braking force

Bugs that are actually features.
Post Reply
Tertius
Filter Inserter
Filter Inserter
Posts: 683
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

[1.1.80] Trains repath to path that requires braking over their braking force

Post by Tertius »

It happens that with a regular repath (signal became green), a train running at maximum speed is assigned a different path. On that new path, it may be required to brake, because it approaches a train that is slowly accelerating. It can happen that the approaching train was so fast that its regular braking distance is located within the train that's accelerating, so it's breaking harder than allowed with the braking force to not crash into the accelerating train.

I had a setup where the repath happened when the fast train was directly in front of a chain signal where it had to stop, so it stopped almost instantly from 298 km/h to zero. This violates the physics expected for a valid simulation.

In the screenshot, you see the breaking distance marker of train 1 within train 2. I assume this must not be. For correct physics, the marker has be in front of the blue chain signal, because that's where it will come to halt.
Unbenannt.jpg
Unbenannt.jpg (1.11 MiB) Viewed 659 times

What happens:
  1. Train 2 is currently halting on the red signal next to the orange digit "2".
  2. Train 1 is fast approaching and its path leads to one of the empty stacker lanes, because these have the lowest path finding penalty. The occupied lanes have both trains waiting on red signals, so they have a higher penalty.
  3. The signal next to the "2" becomes green.
  4. Train 1 is repathed to the rightmost track where Train 2 is about to leave and slowly accelerating.
  5. Screenshot is taken with the mouse over train 1 to show its current path.
  6. Train 1 brakes and comes to a halt in front of the blue chain signal, grossly violating its braking force.
The issue is with 4. The new path is valid according to the penalty rules mentioned in the wiki, because a train on a track doesn't count for a penalty, and the other paths still includes a train waiting in front of a red signal. However, it causes overbraking.
To avoid this overbraking, I guess it's necessary to include the current braking distance into the validity of a path - a path where a train needs to brake harder than its braking force allows is probably forbidden.

Blueprint of the whole test setup, including trains:


You have to wait for the situation - it's required to have a train in the stacker and on the fast lane, and an approaching train with the correct timing. To randomize the timing slightly, the loopback on top has these 3 different lanes.

Remark: there is some circuit wire connected to the signals in the stacker - they are currently inactive, because the conditions are never met. I experimented with the path penalty for "signal set to red with circuit network" to work around the issue.

The motivation of all this is to make a "fast lane" next to a stacker to enable an incoming train overtake the halted trains in the stacker to keep its speed, so throughput behind the stacker is maximized and congestion avoided.

I''m sorry for the verbosity, but I cannot explain it shorter.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.80] Trains repath to path that requires braking over their braking force

Post by Rseding91 »

Thanks for the report however that is working correctly. The train accounts for the new path needing a much larger braking force and stops correctly.
If you want to get ahold of me I'm almost always on Discord.

Tertius
Filter Inserter
Filter Inserter
Posts: 683
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: [1.1.80] Trains repath to path that requires braking over their braking force

Post by Tertius »

Ok, however this is somewhat against the simulated laws of physics.

If this is working correctly, make it an achievement: "We brake for everybody: Bring an automated train from 298 km/h to a regular halt within a distance of 10 tiles".

Rseding91
Factorio Staff
Factorio Staff
Posts: 13219
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.80] Trains repath to path that requires braking over their braking force

Post by Rseding91 »

The laws of physics are not an important aspect in our video game :) You'll find many many places where gameplay and fun are priority over realism.
If you want to get ahold of me I'm almost always on Discord.

Post Reply

Return to “Not a bug”