AI Battle Royale

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: AI Battle Royale

Post by Yexo »

Roujin wrote:Bugs & Mishaps

1) AdmiralAI
Here's what I *think* is the output after AdmiralAI did not do anything productive for a quite long time.
If this is correct, and if I interpret it correctly, AdmiralAI doesn't have anything to connect anymore in his list, and thus scans again the map to see if any new industries have appeared in the meantime. This takes quite some time and Admiral does not build anything in the meantime. Which is bad for its performance.
This is only a guess. Maybe I'm completely off. The AI author (Yexo) will know best.
Thanks a lot for posting the AI debug log Roujin. Your original guess (expensive computation) is correct, but it's not the scanning for new industries that's expensive. The lines above are the problem (Path found in large_number). I guess it did tried to do some pathfinding before that that failed, then it tries again. Some pathfinding took a lot of time. After the pathfinding it processes all events it got (lots of new industries), and then prints the date (1972-3-4, that's when it started to build again)
---
Hope this helps.
Yes, it helps a lot.
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI Battle Royale

Post by Brumi »

Nice work Roujin! :)
Quite interesting results...
Did you use realistic acceleration for trains? It can make a lot of difference.
And is there some way to print the AI debug output into some log file?
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: AI Battle Royale

Post by Morloth »

Congrats everyone with the results and thanks Roujin for the running and analysis of the tournament. Good to see that the newcommers (Choochoo and Denver & Rio) are doing really really well! Although it might be a little discouraging that WrightAI is still doing so well (TrueBrain's ghost still hunts us ;)). But like you said yourself, especially on larger maps, aircraft do dominate.

I'm not sure what causes the slowdown in NoCAB's momentum, although I do know that in the tested version there is a 'bug' which causus NoCAB to build vehicle very very slowly. But I assume traffic jams might be another reason as there are loads of competitors on a relatively small map. Trains are a very nice thing to have as you do not need to worry about other competitors jamming your rails :).

Hope to get some free time after October so I can work on an implementation of trains as well, but the strides made by newcomers and veterans like AdmiralAI are pretty impressive, kudos to all of you! :)

- Bram
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 345
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

Roujin wrote:Bugs & Mishaps
2) ChooChoo
As stated above, at the very end of my test game ChooChoo started to put a bunch of useless pieces of rail on the map in several places.
Here's a screenshot.
AI Tournament, 1975-01-03#6.png
Thanks, both for a very fun to read thread, and some great feedback. I'm amazed ChooChoo did so well!

I'm aware of this issue - it should probably just stop building stuff once it runs out of space. My current plan is to stop building new networks and upgrade the old ones to monorail/maglev, but I've got some bug fixing to do first. I'll see if I can at least prevent the rail spam at the end.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

Dustin wrote:Thanks again! Thanks for the "spot on" too. Was D&RG still updating the date in the AI Log at the end? If it didn't stall, bankrupt or crash it might be about ready for bananas.
I didn't specifically look for the date, but I'm pretty sure it didn't crash. :) Bankrupt neither.
As I wrote somewhere above, I'd recommend another sub-pathfinder or an improvement of "bridge", capable of going over existing track. Your AI really did not live up to its standards in this game - because very soon the tracks of others would be in the way, which currently pose a near impossible obstacle to D&RG.
Brumi wrote:Nice work Roujin! :)
Quite interesting results...
Did you use realistic acceleration for trains? It can make a lot of difference.
And is there some way to print the AI debug output into some log file?
Yes, realistic acceleration was enabled. Here's the config I used, if you're interested in other settings:
openttd.cfg
(11.27 KiB) Downloaded 128 times
I'm not aware of a way to print it to a log file...

Morloth wrote:[...] But I assume traffic jams might be another reason as there are loads of competitors on a relatively small map.[...]
Hmm, I think NoCAB didn't have all that much trouble with traffic jams. Most of the game it was operating in places with little competition - while most RV focused AIs concentrated on towns and hindered each other there, yours built a lot of industry routes (with trucks) and was not bothered with competition until late game. But maybe that was the problem - late in the game more and more got connected with rails by other AIs, posing a serious threat to your truck connections, and thus the profit didn't raise anymore? Just an idea..
I'll be posting some saves so you (and the others) can have a look at the game for themselves. Unfortunately many AIs haven't got their loading straight yet so it probably won't play well from then on (for some AIs), but it's nice to look at, at least.
AI Tournament, 1960-01-01.sav
(744.69 KiB) Downloaded 130 times
AI Tournament, 1965-01-01.sav
(870.52 KiB) Downloaded 110 times
(cont. in next post)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

(continued)
AI Tournament, 1970-01-01.sav
(976.28 KiB) Downloaded 110 times
AI Tournament, 1975-01-03.sav
(1.04 MiB) Downloaded 155 times
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: AI Battle Royale

Post by fanioz »

Big Thanks to Roujin for running the tournament, give the Spot On, and reporting Time on time running. :D
Although TransAI is not doing very well with his train. :oops:
One thing for note, that FanAI (former of Trans) is no longer updated, so you will have one slot free for an other AI instead of FanAI, wich is probably does'nt build anything. :)

Thanks. :D
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

fanioz wrote:Big Thanks to Roujin for running the tournament, give the Spot On, and reporting Time on time running. :D
Although TransAI is not doing very well with his train. :oops:
One thing for note, that FanAI (former of Trans) is no longer updated, so you will have one slot free for an other AI instead of FanAI, wich is probably does'nt build anything. :)

Thanks. :D
Yup, thanks for the tip, I noticed somewhere during the game.. next time I should really spend more time on planning beforehand, so such things don't happen. ;) Indeed FanAI crashed due to being not up to date with the API. Its successor TransAI managed fine though. True, it did not score as much as some other AIs (it started a bit slow, and built not as much in total as other AIs), but it did manage to build its lines and survived the whole game without crashing or going bankrupt, so I wouldn't say it did a bad job :)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

Hey everyone, I thought about doing this again with 0.7.2 now that it's out. However I note that there's constant changes in the API, so I don't know if it's a good idea to run the next battle royale on 0.7.2. Can someone who knows tell me? Are the AIs that were designed with current trunk compatible with 0.7.2?

I have seen the recently added AI API changelog http://hg.openttd.org/openttd/trunk.hg/rev/d09d73ef4da9
I figure that things noted under 0.8.0 are in trunk but not in 0.7.2...
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Re: AI Battle Royale

Post by Xander »

Perhaps set up a deadline for people to submit their AI's to the tournament? Give them, say, 2 weeks to bring the AI up to 0.7.2 compatability and run the Battle Royale then?
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AI Battle Royale

Post by Yexo »

Roujin wrote:I have seen the recently added AI API changelog http://hg.openttd.org/openttd/trunk.hg/rev/d09d73ef4da9
I figure that things noted under 0.8.0 are in trunk but not in 0.7.2...
Tonight (with the new nightly) that changelog will be linked from http://noai.openttd.org/docs/

The things noted under 0.8 are mostly just added yesterday, so I doubt any AI is already using them. Most will be backported to 0.7.3. The changelog only lists stable versions, so anything added in trunk will be listed under 0.8.0 (unless backported to 0.7)
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

Yexo wrote:
Roujin wrote:I have seen the recently added AI API changelog http://hg.openttd.org/openttd/trunk.hg/rev/d09d73ef4da9
I figure that things noted under 0.8.0 are in trunk but not in 0.7.2...
Tonight (with the new nightly) that changelog will be linked from http://noai.openttd.org/docs/

The things noted under 0.8 are mostly just added yesterday, so I doubt any AI is already using them. Most will be backported to 0.7.3. The changelog only lists stable versions, so anything added in trunk will be listed under 0.8.0 (unless backported to 0.7)
Hmm, does this mean all AIs compatible with trunk until yesterday (before your latest additions) should be 100% compatible with 0.7.2?
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

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

Re: AI Battle Royale

Post by Yexo »

Roujin wrote:Hmm, does this mean all AIs compatible with trunk until yesterday (before your latest additions) should be 100% compatible with 0.7.2?
There can be other reasons other then the API they are not compatible, but I think they should be.
LoWang
Engineer
Engineer
Posts: 93
Joined: 25 Jun 2005 21:17
Contact:

Re: AI Battle Royale

Post by LoWang »

this was so good and exciting! I want more of it. Thank you Roujin! :D I am very interested in any kind of AI, because it is the materializing of ideas! And to see different ideas competing is so fun! :)
Those that are last, can yet be first...
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

Thanks for your warm words :)

Meanwhile, I've written a little patch that makes life a bit easier for me.

I've also got a little goodie here for you, I'll call it an "AI Battle Royale Special" ;)
Here are the results of an AI game featuring 12 of the 14 AIs above (minus FanAI because it's an old version of TransAI; and minus MedievalAI because it's outdated and doesn't work with the current API). What makes this game special is that it's a 2048x2048 map, and it has run (overnight ;)) for 65 game years.

Not very surprisingly, Aircraft is overpowered here, so WrightAI and AdmiralAI are clearly in the lead. Also of course most AIs have met the vehicle limits long ago, so their growth was stopped at that point. So the graphs basically only tell us which AI is using aircraft and which isn't. :(
Anyway, you might find it interesting for some other reason (e.g. look at the map), so I'll share it with you:

1) Company Graphs
AI Battle Royale Special, 2045-01-01.png
(28.07 KiB) Downloaded 85 times
2) Company Graphs without the two leading companies
AI Battle Royale Special, 2045-01-01#1.png
(27.51 KiB) Downloaded 62 times
3) Company Graphs without the three leading companies
AI Battle Royale Special, 2045-01-01#2.png
(29.07 KiB) Downloaded 58 times
(continued in next post)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

(continued)

4) Individual Company Stats
AI Battle Royale Special, 2045-01-01#3.png
(69.02 KiB) Downloaded 57 times
5) (not_so_small) Smallmap
AI Battle Royale Special, 2045-01-01#4.png
(516.45 KiB) Downloaded 80 times
6) Savegame
edit: can't upload it because it's too large.. looking for a solution :/
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI Battle Royale

Post by Brumi »

Nice! :)
I wonder what happened to NoCAB... :? Maybe it started building too late and all cities were 'occupied' by other players' airports then? And NoCAB didn't have at least one ship either....
Did you use RC13 of Denver & Rio Grande? It did quite well :)
Which AI is the unnamed blue player?
It seems that PAXLink did something similar to the previous game - going bankrupt and then doing well :)
It is strange that PathZilla had only 4 road vehicles by the end... and it also seems to have gone bankrupt :(
I assume Trans got into some kind of infinite loop - trying at one place, failing, trying another, failing, trying the first...
I think it would be interesting to run a Battle Royale without aircraft, things would go different.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AI Battle Royale

Post by Roujin »

Brumi wrote:Nice! :)
I wonder what happened to NoCAB... :? Maybe it started building too late and all cities were 'occupied' by other players' airports then? And NoCAB didn't have at least one ship either....
I think there's nothing wrong with it except it hit the limit of 500 RVs.
Did you use RC13 of Denver & Rio Grande? It did quite well :)
yes
Which AI is the unnamed blue player?
It's Rondje om de kerk, which unfortunately still won't start due to taking too long to initialize.
It seems that PAXLink did something similar to the previous game - going bankrupt and then doing well :)
It is strange that PathZilla had only 4 road vehicles by the end... and it also seems to have gone bankrupt :(
I assume Trans got into some kind of infinite loop - trying at one place, failing, trying another, failing, trying the first...
Unfortunately I have no information about what happened during these 65 years, only the ending results. This is because I've just let it run overnight.
I think it would be interesting to run a Battle Royale without aircraft, things would go different.
Certainly. Having a running Rondje would also change things quite a bit, I reckon.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 345
Joined: 13 Jul 2008 00:57
Contact:

Re: AI Battle Royale

Post by Michiel »

Cool :D I really should update ChooChoo... I've got some useful fixes planned, but I've been spending all my time playing Dwarf Fortress recently :oops: I'll poke Maninthebox about Rondje.
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: AI Battle Royale

Post by Dustin »

Brumi wrote: Did you use RC13 of Denver & Rio Grande? It did quite well :)
D&RG just loves big maps, so I am not surprised. It's relatively fast pathfinder does quite well with a lot of choices. 512x512 is a little cramped for it. I made changes in RC13 specifically to help if do better in these games with lots of AIs. Glad to see that it seemed to help. Specifically, I not longer skip all industries with stations. Instead I pick stations based on shipped cargo last month.

Hopefully the bridge pathfinder enhancements I am working on now will allow it to do better in the more crowded games.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest