voxeltycoon / issues

17 stars 4 forks source link

bug in train routes #1045

Open mmikeyy opened 10 months ago

mmikeyy commented 10 months ago

TLDR: routes are constantly recalculated to allow trains to take a detour around blocked traffic and sometimes, the new optimal route to the destination forms a loop that brings the train back to the block it's occupying, with only pre-signals along the way. The train is then blocking itself and will no longer move.


It is quite clear that train routes are constantly being recalculated. Sometimes, we see a train take an alternative route to avoid traffic, even if the traffic seems to be a very temporary hindrance and the new path is quite a bit longer. In many cases, it would have been better to leave the route unchanged.

A problem occurs when a new route is calculated repeatedly, and this new optimal route places the train back on its original path when it is possible to loop back to it.

See the attached screen capture. The train comes from the bottom (train origin) and normally takes a turn to the right, which is the shortest path to its destination (red path). But there was probably an obstruction there (train on track) so a new path was calculated taking the train on the green path. The destination can also be reached, albeit much less efficiently, taking a right turn at the very top of the loop that the green path forms. The loop is not round, but logically it's a roundabout. As the train entered the roundabout, a new path was calculated, and it was found that the shortest path to the destination reverted to the original, usual path, that was now clear. To rejoin the original path, the train needs to do a full circle in the roundabout, end exit it through a block that it's now occupying. It stops at the pre-signal labeled "BLOCAGE HERE", waiting for the track to be clear, but since the train itself is occupying the block, it waits forever. And all traffic through the roundabout stops.

I don't know exactly how routes are calculated so I may be wrong in the logic I ascribe to the process. For example, the best (and usual) route is the red one. The next best would be the green one, without the problematic loop (merges with the red one to the right of the image). It is possible - and this would be absolutely bad - that the next best route was the green route, including the loop. It would be nonsensical to plan a route that includes a loop, but perhaps there's a flaw in the logic that allows this to happen.

In any event, a train should never do what this one did. The train that was blocked is the one at the end of the green path on the image. To unblock it, I needed to force it to disregard signals in the roundabout. The saved game has the train in the position shown on the image. If one lets the game run, the train will do its delivery, come back for a new load and then follow the red path this time.

I don't know how to share a saved game: the file exceeds the 25 MB limit. I created a cloud save (s3lii2npufx.cloud). I don't know if doing this makes it accessible.

Note: I've complained elsewhere that it's impossible for me to play this game for over something like 60 hours without it starting to crash. I loaded this saved game and after something like 15 minutes, it froze the computer with the speakers buzzing.

train path problem

andrewpey commented 10 months ago

Thanks for reporting this issue.

You can upload the save file to any online service allowing to upload and share big files, like https://files.fm/ (no registration required).

To find the exact save file from inside the game:

The game will zip the save file for you and then reveal it in Explorer.