Moderator: OpenTTD Developers
I was really happy to find out that there is Pathfinder included in AI script. I mean the `import("pathfinder.rail", "RailPathFinder", 1);`
I tested it already and it is GOD DAMN SLOW! Even for short route (100 manhattan distance) it takes more than in-game year to find a route.
Is there any better easy to use alghoritm for it? I was hoping to not write it from scratch by myself - it does not have to produce perfect routes, just reasonable routes in reasonable time.
So is there something else that is usable for competitive experience? (I would like the AI to perform well or even better than veteran players, especially in later stages - for it I need to build fast).
EDIT: As the complexity increases exponencially, smaller paths dont take that much (i.e. 20 tiles takes just 3 in-game days). I can probably do it in a way by splitting it to several smaller paths of about 20 tiles away and then build them. But was hoping in something better
EDIT2: So POC works - I was able to create 130 diagonal (260 manhattan distance) in just 4 months on simple terrain EDIT3: When map is simple and travelling in mostly non-diagonal direction, its even faster - in 4 months it was able to create the 500 long track (including pathfinding + actual buildling on medium speed)
AAAHogEx was able to accelerate the search speed with the following simple modification.
In the standard RailPathFinder, the A* evaluation function operates on "the cost from the start" + "the estimated cost to the goal", with both values being set to be approximately the same. However, by making the estimated cost to the goal significantly heavier (for instance, doubling it), it generally tends to initiate the search from the side closer to the goal, which is advantageous in most cases.
However, this method can become disadvantageous when the terrain is complex, as it takes a very long time to conduct a search in situations where it is necessary to take a detour to reach the destination. Therefore, AAAHogEx is adopting an approach where it manages to reach the destination through the use of tunnels, bridges, and terrain shaping.
Looking forward to the new AI!
Users browsing this forum: No registered users and 1 guest