RoadPathfinder

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
urdh
Engineer
Engineer
Posts: 9
Joined: 16 Jun 2009 14:33

RoadPathfinder

Post by urdh »

I'm having problems with RoadPathfinder... it doesn't find paths that obviously exist:
Image

Am I doing something wrong here?
Here's the pathfinding part of my AI: http://pastebin.ca/1462214
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: RoadPathfinder

Post by Yexo »

Did you call AIRoad.SetCurrentRoadType before?
urdh
Engineer
Engineer
Posts: 9
Joined: 16 Jun 2009 14:33

Re: RoadPathfinder

Post by urdh »

Yexo wrote:Did you call AIRoad.SetCurrentRoadType before?
No. Doing so doesn't seem to make any difference though :(
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: RoadPathfinder

Post by Yexo »

Can you upload your complete AI? Or in case you don't want to make it public yet, send it to me via pm?
urdh
Engineer
Engineer
Posts: 9
Joined: 16 Jun 2009 14:33

Re: RoadPathfinder

Post by urdh »

Yexo wrote:Can you upload your complete AI? Or in case you don't want to make it public yet, send it to me via pm?
Here: http://solidfiles.com/d/T1uy
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: RoadPathfinder

Post by Yexo »

In all games I've tried running it, it build one route succesfully, then crashed. Do you still have that savegame were it failed to find a route?
urdh
Engineer
Engineer
Posts: 9
Joined: 16 Jun 2009 14:33

Re: RoadPathfinder

Post by urdh »

http://solidfiles.com/d/TAyM

Seems to be working now... I think I was sending invalid tiles to the pathfinder.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: RoadPathfinder

Post by Yexo »

Nice to hear it works now. And I'm glad we can look forward to having another AI for OpenTTD :) Good luck with further coding

Ps. You can upload files to this forum, that prevents other from going to 3rdparty download sites to your savegame/ai/screenshot.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 20 guests