Pathfinder problem

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Pathfinder problem

Post by Kogut »

Standard pathfinder is terrible slow. Is it possible to reduce time needed to find path?
Last edited by Kogut on 27 Aug 2009 22:14, edited 2 times in total.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Patchfinder problem (too slow)

Post by Zuu »

Yes by accepting to not always find the best path. (best according to some criteria or target function)

If you further accept that the algorithm may not always find a result, then you can get even faster path finding.


If you specify if you are interested in path finding for rail or road you might get more specific answers for that transport mode. Though the general answer above applies to both rail and road.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Patchfinder problem (too slow)

Post by Kogut »

Yes by accepting to not always find the best path.
- Is it possible to do it in original pathfinder?

- I need a rail patchfinder.
Last edited by Kogut on 26 Aug 2009 07:40, edited 1 time in total.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patchfinder problem (too slow)

Post by planetmaker »

Please mind, that any search you carry out will be much more successful, if you search for path finder instead of patch finder - two vastly different words.

There are some AIs out there which use a non-perfect path finder in order to be quicker. Have a look through the existing ones, I don't remember which it was, though.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: Pathfinder problem (too slow)

Post by Michiel »

ChooChoo does - just a one line change. Search for multiplier in pathfinder.nut. A higher multiplier trades "optimality" for speed - higher makes it faster.
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Pathfinder problem (too slow)

Post by Kogut »

Another problem - rail patchfinder "think" that is impossible to build on tracks of his own company. :(
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Pathfinder problem (too slow)

Post by Yexo »

Kogut wrote:Another problem - rail patchfinder "think" that is impossible to build on tracks of his own company. :(
That's not a problem, that's by design. If you want to reuse your own tracks you'll have to create your own pathfinder (one that does keep signals in mind).
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Pathfinder problem

Post by Kogut »

So... It is not a bug. It is a feature...
Interesting
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Pathfinder problem

Post by Yexo »

Kogut wrote:So... It is not a bug. It is a feature...
Interesting
Just joining two tracks doesn't make you able to run 2 trains on it. You have to place correct signals too. Now please explain to me how a generic rail pathfinder should work that supports signals and how it can detect where it's allowed to join tracks, and how to detect a two-way station<>station line (you can't join there, or that train won't be able to run.).
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests