Page 12 of 15

Re: AIAI

Posted: 02 Jun 2013 15:04
by planetmaker
AIAI v87 (from GUI, though it calls itself iota14 in its output) seems to not know about aircraft range:

Code: Select all

dbg: [script] [2] [S] Your script made an error: division by zero
dbg: [script] [2] [S] 
dbg: [script] [2] [S] *FUNCTION [abort()] aiai-iota14/UTIL/debug.nut line [40]
dbg: [script] [2] [S] *FUNCTION [HandleEvents()] aiai-iota14/main.nut line [366]
dbg: [script] [2] [S] *FUNCTION [Maintenance()] aiai-iota14/main.nut line [314]
dbg: [script] [2] [S] *FUNCTION [Start()] aiai-iota14/main.nut line [51]
dbg: [script] [2] [S] 
dbg: [script] [2] [S] [tesmode] false
dbg: [script] [2] [S] [message] "AIRCRAFT_DEST_TOO_FAR 322 322 Aircraft 17"
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [airplane_id] 322
dbg: [script] [2] [S] [order_event] INSTANCE
dbg: [script] [2] [S] [ev_type] 23
dbg: [script] [2] [S] [event] INSTANCE
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [this] INSTANCE
dbg: [script] [2] [S] [need] 130000
dbg: [script] [2] [S] [builders] ARRAY
dbg: [script] [2] [S] [this] INSTANCE

Re: AIAI

Posted: 06 Jul 2013 05:32
by Kogut
Coding restarted!
planetmaker wrote:Likely this has been reported before... AIAI was doing quite well and then sadly died:
Thanks for the save! Also - thanks to all bug reporters.

"Count does not exist" is now fixed, it was caused by industry closed during processing list of possible candidates.

Re: AIAI

Posted: 06 Jul 2013 17:25
by Kogut
Samu wrote:another crash found

division by zero

Using AIAI v87. Not sure what it was trying to do.
Sorry - this one was caused by AIAI not refusing to be loaded in game with incompatible version.

Re: AIAI

Posted: 08 Jul 2013 07:06
by Kogut
BaNaNaS contains new version (iota89) - with bugfixes, tweaks and better NewGrf support (NUTS trainset is now handled properly).

Thanks to everybody who helped by reporting bugs!

known problems: https://github.com/Bulwersator/AIAI/issues?state=open

Re: AIAI

Posted: 14 Jul 2013 19:19
by Wormnest
AIAI v 89 crashes with Count does not exist.

Re: AIAI

Posted: 14 Jul 2013 20:06
by Kogut
Wormnest wrote:AIAI v 89 crashes with Count does not exist.
Thanks for report - I thought that it is fixed. Can you post savegame? I have no idea what happens here, it seems to be case of weird NewGrf or my misinterpretation of API documentation. And with savegame I may check what is happening with industry number 2065.

Re: AIAI

Posted: 15 Jul 2013 12:22
by Wormnest
Kogut wrote:Can you post savegame?
I'm sorry the savegame is too big for the forum.

Re: AIAI

Posted: 16 Jul 2013 07:45
by Kogut
New version (iota90) is available. It includes bugfixes, tweaks and refactoring (hopefully unnoticeable for players).

Anyone that encounter this .Count() - crash: please report it (report with savegame would be even more helpful).

Re: AIAI

Posted: 16 Jul 2013 10:31
by Wormnest
In a new AI test game AIAI Assertion failed with v90.

Re: AIAI

Posted: 16 Jul 2013 11:02
by Kogut
Can you provide also dtnames.grf? File is unavailable on BaNaNaS, http://grfcrawler.tt-forums.net/index.p ... q=36347476 is a dead link and version on http://www.tt-forums.net/viewtopic.php?f=67&t=51962 have different ID.

Thanks for the report!

Re: AIAI

Posted: 16 Jul 2013 11:15
by Kogut
I published new version (it may collect more information about this crash).

Re: AIAI

Posted: 16 Jul 2013 12:02
by Wormnest
Kogut wrote:Can you provide also dtnames.grf?
I hope I am allowed to post it here but since it's gpl it shouldn't be a problem I think so here it is.

Re: AIAI

Posted: 16 Jul 2013 13:00
by Kogut
It is newgrf with id 44544E32. This save wants one with 36347476 (information from load menu). Can you try to find the one used in this game?

Why some authors prefer to not upload their work to BaNaNaS? This situation would be so easier, search would require around 3 second (by one person), not around 30 minutes (by two people).

Re: AIAI

Posted: 16 Jul 2013 15:08
by Steffl
Hi Kogut,
I found a bug in AIAI iota 89.
The savegame is before the bug occurs and it was made a nightly (version r25522).
I didn't watch what your AI did, but the profit of it was good until it crashed.


And as I waited to upload the savegame above I found another bug.
This time in version iota 91.
Look at screenshot Nr. 2.
OpenTTD version was 1.3.1. You use a API-function which is too new for 1.3.x versions.

Someone posted a very clever piece of code how you can check if a function is available.

I think it was if(HasCargoRating in AIStation){....

In older versions AIStation.GetCargoRating returns the value 69 when there this station has no rating for this cargo type.
You can try if this works:

Code: Select all

if((HasCargoRating in AIStation&&!AIStation.HasCargoRating(station,cargo))||
(!HasCargoRating in AIStation&&AIStation.GetCargoRating(station,cargo)==69&&AIStation.GetCargoWaiting(station,cargo)<1)){

Re: AIAI

Posted: 16 Jul 2013 15:28
by Kogut
I published version iota92 without too new NoAI API calls. Thanks for reports!

EDIT: It seems that first one happened because AIAI unexpectedly was in test mode.

EDIT2: And iota93, finally something crashed in my test.

Re: AIAI

Posted: 16 Jul 2013 18:23
by Wormnest
Found it in the data folder.

Re: AIAI

Posted: 17 Jul 2013 09:14
by Kogut
Wormnest wrote:Found it in the data folder.
Thanks! This crash and one reported by Steffl (in v89) are fixed in iota94. Thanks again for reports!

Re: AIAI

Posted: 17 Jul 2013 15:20
by mart3p
Using AIAI iota94 with the latest development version or ISR (r221), I noticed that AIAI always builds the same type of station (the type intended for the source) for both source and destination. ISR r221 should be available for download from the usual place in the next few hours.

Your debugging AI does build the correct source and destination types.

From a quick look at the code in AIAI Railbuilder.nut it seems that the source_station parameter of BuildNewGRFRailStation is always set to true:

Code: Select all

if(!AIRail.BuildNewGRFRailStation(location, direction, platform_count, trasa.station_size, AIStation.STATION_NEW,
      trasa.cargo, source_industry, goal_industry, distance, true)) {

Re: AIAI

Posted: 17 Jul 2013 15:42
by Kogut
Thanks for bug report (and even debugging!).

It is now fixed in development version: https://github.com/Bulwersator/AIAI/com ... a7ef6def3b

Re: AIAI

Posted: 17 Jul 2013 16:15
by Steffl
Hi Kogut,
here's a new bug I found.
I played with AIAI version iota93 and Openttd 1.3.1.

I add the savegame, too. AIAI played good in the beginning of the game, but later it had to pay much for its infrastructure maintainance and it seems it tried to sell vehicles when it crashed.
screenshot.png
screenshot.png (41.8 KiB) Viewed 4068 times