Replies: 3 comments 11 replies
-
I have experienced this problem too. In the current pathfinder code the only 'dynamic' route differentiator is the destination station occupied level. Everything else is a 'static' differentiator - like the road slope, if the road has a train crossing, etc. That means that the pathfinder will basically always take the optimal route and only vary when it gets close to the destination station. I think there is a lot of room for improvement. One of the things I have noticed is that many players play for different reasons - some people like to make profit, some like realism (as in, road vehicles always follow the same road routes like in real life), etc. Looking at the github commit history, this road pathfinder code hasn't changed for years. Making a change to the core gameplay behaviour that has been the same for years, might be hard to effect. On the other hand, road vehicles are less popular than trains so maybe we can. Another addition that will be useful for road vehicles are waypoints but an AI model might find them hard to use. I can share with you a version of OpenTTD with the change for busy roads that I mentioned above and you can trial it with your AI model. |
Beta Was this translation helpful? Give feedback.
-
In fact only 8 "segments" are cached, not the whole route. But a segment is one "junction tile" to the next "junction tile", so a long straight roads is only 1 segment. Maybe a length limit would help too. |
Beta Was this translation helpful? Give feedback.
-
This is a solution close to what I originally thought of. I don't know how pathfinder works and I'm generally a visual learner, so something like this appeals to me. :) Updates of such a map do not have to be frequent, because it is mainly about outline, general information about which roads to avoid to avoid absurd accumulations of traffic jams. It doesn't have to be super effective, but it's important that it doesn't increase the load on the game. In any case, it seems to me that a vehicle that is standing should be more noticeable on such a "map" than one that is moving. @zacc This is probably a different solution than the target one (?), but I'd still like to see how it works. :) If you have the Windows version, I'd be happy to test it. :) |
Beta Was this translation helpful? Give feedback.
-
Version of OpenTTD
14.0-RC2 - old problem
Expected result
Pathfinder sees busy roads and takes them into account when calculating the route. The status update doesn't have to be very frequent (traffic jams are "realistic"), but it would be nice if the game took into account what is happening on the roads and did not direct all vehicles to one road.
Actual result
Pathfinder doesn't see traffic jams and even if an alternative route is 1% longer, it never takes it into account. This often leads to quite bizarre situations when, with a large network of available roads, pathfinder directs all vehicles to where there is the biggest traffic jam. This is especially visible in the case of connections created by AAAHogAI (screenshot below), which creates far too many roads, but even this doesn't help to avoid congestion.
And another example where pathfinder could choose one of the slightly longer roads (it has 9 to choose from), but it doesn't do this and directs all vehicles to one of them.
Steps to reproduce
Below are two saves for both of the above screenshots.
Road transport - pathfinder problem.zip
Beta Was this translation helpful? Give feedback.
All reactions