PathZilla (v6) - A networking AI

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

Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: PathZilla (v6) - A networking AI

Post by Yexo »

Zutty wrote:Yexo (or other devs) - Can an AI library expose more than one class via the import() statement, or would I have to use an inner class, such as...
Currently creating subclasses is the only way. Also I can't really think of a nice syntax for import to allow multiple classes, and what should CreateInstance() (in info.nut) return in that case?

Edit: while I'm saying this I realize both CreateInstance() and import could use arrays of strings instead of just a string, but I don't really like that. Are subclasses a problem in your case?
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: PathZilla (v6) - A networking AI

Post by Zutty »

Yexo wrote:
Zutty wrote:Yexo (or other devs) - Can an AI library expose more than one class via the import() statement, or would I have to use an inner class, such as...
Currently creating subclasses is the only way. Also I can't really think of a nice syntax for import to allow multiple classes, and what should CreateInstance() (in info.nut) return in that case?

Edit: while I'm saying this I realize both CreateInstance() and import could use arrays of strings instead of just a string, but I don't really like that. Are subclasses a problem in your case?
It would be nice if the classes in scope within the library could also be in scope within the AI that include()s it. The way include() works, it kind of assumes that each library uses only a single class, which is fine for the pathfinding stuff, but IMHO not as flexible as it could be.

However the design decision has long been made now, I dont think this small gripe justifies changing it. I'm happy enough just to use inner classes. Just thought I'd ask though.

Cheers.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: PathZilla (v6) - A networking AI

Post by Yexo »

Zutty wrote:It would be nice if the classes in scope within the library could also be in scope within the AI that include()s it. The way include() works, it kind of assumes that each library uses only a single class, which is fine for the pathfinding stuff, but IMHO not as flexible as it could be.
The reason it's designed like this it that it allows you to change between different libraries that do the same very easily. Say you use the BinaryHeap library:

Code: Select all

import("queue.binary_heap", "Queue", 1);
After a few months of coding you discover that in your situation the FibonacciHeap library performs better. Then the only thing you have to do is change the import line to:

Code: Select all

import("queue.fibonacci_heap", "Queue", 2);
and you can keep on using the class named Queue just like before. Of course this only works if the classes have similar interfaces, but for the queue libraries this is the case.
Blustuff
Engineer
Engineer
Posts: 112
Joined: 21 Aug 2008 09:37
Location: France

Re: PathZilla (v6) - A networking AI

Post by Blustuff »

Nested classes doesn't exists in squirrel but you can write :

Code: Select all

class Outer
{
  static Inner = class
  {
    ...
  }
  ...
}

Remember that classes are first-class values and thus you can assign them to a variable to achieve the same behavior described by Yexo :

Code: Select all

class SomeImplementationOfAQueue
{
  ...
}

class SomeOtherImplementationOfAQueue
{
  ...
}

Queue <- SomeOtherImplementationOfAQueue; /* Not much harder than Queue <- import(...); */
parcel
Engineer
Engineer
Posts: 19
Joined: 18 Feb 2010 09:55

AI crash on recent nightbuild openttd.

Post by parcel »

AI crash report ( Sorry for my poor English ).
Wenfingford_Transport.png
Wenfingford_Transport.png (65.2 KiB) Viewed 4511 times
And 'Restart AI' button rasie assertion window(I guess It's not AI side problem)
openttd_pathzilla.png
Load and wait a few second, you will see AI crash message.
Attachments
Wenfingford Transport_AI_PathZilla.sav
(149.69 KiB) Downloaded 78 times
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: PathZilla (v6) - A networking AI

Post by Terkhen »

That assertion has been fixed in r19259. It shouldn't appear at the next nightly.
parcel
Engineer
Engineer
Posts: 19
Joined: 18 Feb 2010 09:55

Re: PathZilla (v6) - A networking AI

Post by parcel »

Terkhen wrote:That assertion has been fixed in r19259. It shouldn't appear at the next nightly.
Thank you, Terkhen :)
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: PathZilla (v6) - A networking AI

Post by Morloth »

Hey Zutty,

I was running a couple of benchmarks with the AI and I came across the following error message:
Crash
Crash
I ran the competition overnight, but it seems it crashed quite early as it had no vehicles on the map what so ever.

Hope this helps.
Cheers,
Bram
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: PathZilla (v6) - A networking AI

Post by Kogut »

Rather bad idea (fix: canals construction around :D )
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (104.03 KiB) Viewed 4412 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
City Builder
Engineer
Engineer
Posts: 107
Joined: 12 Apr 2010 11:58

Re: PathZilla (v6) - A networking AI

Post by City Builder »

Hi,

I've been getting these Pathzilla V6 crashes under normal play and was told that this would likely be the thread to report it in.

Hopefully i got the whole thing in one screenshot for ya. Hope it helps
AICRASHPATHZILLA.png
The second part since the first part the window wasn't wide enough to get the full thing.
aicrashpathzilla2.png
Steffl
Engineer
Engineer
Posts: 103
Joined: 23 Feb 2010 15:44

Re: PathZilla (v6) - A networking AI

Post by Steffl »

Hi, PathZilla V6 has problems with newer OpenTTD-Versions. If you want to play with a similar AI, try "RoadRunner".

http://www.tt-forums.net/viewtopic.php?f=65&t=48281
mwyeoh
Engineer
Engineer
Posts: 28
Joined: 21 May 2009 05:36
Location: Perth, Australia

Re: PathZilla (v6) - A networking AI

Post by mwyeoh »

Just reporting a crash

v 1.0.2- RC-1
Attachments
MWYEOH  Locomotive, 3rd Apr 1952.png
Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: PathZilla (v6) - A networking AI

Post by Samu »

hello. PathZilla went bankrupt and it got this error on its second attempt.

ah, and it's 'compatibility', not 'compatability'. lol
Attachments
Unnamed, 25th May 1960.png
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2367
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: PathZilla (v6) - A networking AI

Post by Lord Aro »

i am aware that this ai does not seem to getting updated anymore, but hey, 2 more bugs!:
Attachments
pathzilla v6 crash.png
pathzilla v6 crash 2.png
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
ABCRic
Engineer
Engineer
Posts: 27
Joined: 10 Aug 2010 17:32

Re: PathZilla (v6) - A networking AI

Post by ABCRic »

I'm having the "top() on an empty array" issue as well.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2367
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: PathZilla (v6) - A networking AI

Post by Lord Aro »

Basically, until Zutty fixes it, Pathzilla is broken :(
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Alteris
Engineer
Engineer
Posts: 2
Joined: 11 Aug 2010 11:07

Re: PathZilla (v6) - A networking AI

Post by Alteris »

Bug That showed up today:

Image
LamRis
Engineer
Engineer
Posts: 2
Joined: 27 Sep 2010 11:58

Re: PathZilla (v6) - A networking AI

Post by LamRis »

Bug report:
OpenTTD r20911 (r20994)
PathZilla (v6) r313
Attachments
BugReport2.png
BugReport2.png (10.89 KiB) Viewed 3619 times
RokyTrans, 22-08-2008.sav
(377.79 KiB) Downloaded 80 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9415
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: PathZilla (v6) - A networking AI

Post by planetmaker »

Pathzilla v6 is running here currently.

It considered obviously to build routes from a gold mine to a bank and correctly determined that it had no vehicles which could transport the gold. But that could certainly be optimized as that is not so much a route property (it checked for each route being considered) but rather a cargo property (gold has no vehicles in this game).
Felix Atagong
Engineer
Engineer
Posts: 45
Joined: 16 Apr 2007 19:50
Location: Louvain
Contact:

Re: PathZilla (v6) - A networking AI

Post by Felix Atagong »

Is Pathzilla still under development, anyway here is a bug report...
Attachments
Green Is The Colour, 3 Jul 1885.png
(16.14 KiB) Downloaded 1 time
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests