AI rail pathfinder and 45 degree turns
Moderator: OpenTTD Developers
AI rail pathfinder and 45 degree turns
Is there an easy way to tweak the rail pathfinder to penalize two 45 degree turns after eachother? I'd like to discourage it from choosing corner type A, and prefer type B:

Re: AI rail pathfinder and 45 degree turns
I don't know about tweaking the pathfinder but you could add a penalty station, way-point or level crossing after 2 45 degree turns so the route is less favourable.
Re: AI rail pathfinder and 45 degree turns
Thanks, but I don't mean the train's pathfinder, but the NoAI library that's used to build the rails.
Re: AI rail pathfinder and 45 degree turns
If the rail pf has the same structure as the road pf, you want to make your own MyPF : RailPF that overrides the default _Cost function. You may first call the RailPF::_Cost function to get the default cost and then add your own penalties.
Check eg. Admiral AI and see if it uses this technique to penalize level crossings with road. CluelessPlus implements its own _Cost and _Neighbour functions, but for the road pathfinder so it might be more useful for you if you can find a rail-AI that has a custom _Cost function.
Check eg. Admiral AI and see if it uses this technique to penalize level crossings with road. CluelessPlus implements its own _Cost and _Neighbour functions, but for the road pathfinder so it might be more useful for you if you can find a rail-AI that has a custom _Cost function.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: AI rail pathfinder and 45 degree turns
I think it does, I'll have a look.
Who is online
Users browsing this forum: Google [Bot] and 8 guests