AI competition III + IV

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

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

Re: AI competition III

Post by Brumi »

Here is the situation after 20 years:

Denver & Rio Grande has gone bankrupt, it has been replaced by AIAI (v46, a version with trains, not the one on Bananas).
Graphs after 20 years.png
(42.91 KiB) Downloaded 1 time
Companies after 20 years.png
(82.14 KiB) Downloaded 1 time
TrAIns caught me by surprise: Somewhere around 1964 it had a quick rise in profits, so it's the second most profitable company by now, behind the leading-by-far NoCAB.
AdrmiralAI is doing steadily well, it's also second on the company league table.
Clueless, MogulAI and NoCAB have hit the vehicle limits (yes, NoCAB has hit the train limit as well), so they cannot grow anymore. DictatorAI is nearing the limit as well.
Terron seems to have a problem participating in longer games, its profits are slowly decreasing.
SimpleAI is slowly growing, it has joined the second line of AIs in profits.
Trans crashed (with the same crash as reported at the end of its thread), and was started again in 1966. It managed to build some profitable plane routes, so it had a good start now.
The bus AIs (Convoy, OtviAI and AroAI) are killing each other in the largest cities, they do not manage to turn good profits.
ChooChoo is also there at smaller cities, it's quite slow to expan, but no problems so far :)
AIAI has one oil train, and it's waiting for money to build more. In my previous game, it managed to stand up from such a situation 8)

And the saddest of all, NoCAB crashed while generating the savegame below, it took too long to save. And it looks like that I forgot to turn autosaves on again after the crash of OpenTTD, so I couldn't revert to a previous state, I had to restart NoCAB. Now let's see whether it can take the leading role again...
Attachments
Large AI test after 20 years.sav
(2.24 MiB) Downloaded 164 times
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

Here is the game after 30 years:
Graphs after 30 years.png
(35.39 KiB) Downloaded 1 time
Companies after 30 years.png
(83.13 KiB) Downloaded 1 time
AdmiralAI started a rise just before my previous post, so now it's second in profits anter trAIns. SimpleAI is third in profits. The AIs are doing steadily now. AroAI is out of financial trouble, now it has over 400 buses. Trans has put up some plane and hovercraft routes after its restart, and is turning good profits. NoCAB is making its way for the first place again, it has caught up with the others in 10 years :D
Large AI test after 30 years.sav
(2 MiB) Downloaded 164 times
The game is quite slow now, fast forwarding hardly makes any difference... I will save the game at some time and load it later, hoping that the AIs will be able to continue. Maybe setting the opcode count to 5,000 will help.
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

Some other screenshots from the game:
Attachments
Random screenshot.png
(261 KiB) Downloaded 1 time
Map after 30 years.png
(78.22 KiB) Downloaded 1 time
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: AI competition III

Post by Lord Aro »

thanks for the test! :)

good to see that AroAI eventually gets going...

/me loads savegame to see what was going wrong at the beginning
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
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI competition III

Post by Michiel »

Always nice to see another tournament run :)
Brumi wrote:So the map is mountainous, and realistic acceleration is turned off, so it's a bit hard to be good with trains.
Why is that? Trains are already by far the hardest transport mode for AIs, and most interesting to watch for many players (I assume). Why make it even harder?

Grats to TrAIns btw, that's mighty impressive :)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AI competition III

Post by planetmaker »

Michiel wrote:Trains are already by far the hardest transport mode for AIs, and most interesting to watch for many players (I assume). Why make it even harder?
It's still an often used setting, one way or another. Also it can be argued that it just requires different building: realistic acceleration requires rather smooth tracks, but slopes don't matter so much. But with the original acceleration curves don't matter so much, but slopes are a pain.

For train AIs it is important to handle both settings. Actually the same is true for vehicles ;-)
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

Phew! I loaded the savegame and run it for another 10 years. Now the game lags really hard, becoming slower and slower. Am I approaching infinity or a finite year? :)

Here are the stats after 40 years:
Graphs after 40 years.png
(37.94 KiB) Downloaded 1 time
Companies after 40 years.png
(81.06 KiB) Downloaded 1 time
NoCAB crashed again because it took too long to save. But before that it had already caught up with AdmiralAI and SimpleAI even from 20 years of late start. AIAI has also survived the late start, now it's in the business :)
Anyway, things are going steady now, as most companies have reached their limits. All of them are turning good profits, congratulations to all AI writers!
Apart from the 'took too long to save' crash, there was only one crash and two bankruptcies throughout the game.
Large AI test after 40 years.sav
(1.91 MiB) Downloaded 188 times
I think I won't be able to continue this game further, 3 GHz of computing power seems to be insufficient here. It took half an hour to play through the last two years...
Michiel wrote:Why is that? Trains are already by far the hardest transport mode for AIs, and most interesting to watch for many players (I assume). Why make it even harder?
It's mountainous because sub-arctic only makes sense that way, and the original acceleration is simply because my preference, I play OpenTTD like that :)
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: AI competition III

Post by Lord Aro »

woo! Aro came 3rd in the end :)

It really does well when it has lots of vehicles...
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
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

New week, new game. This time it is in... toyland! :P
Now the construction speed of competitors is set to slow, let's see how the AI's are doing when slowed down. I hope this game will last a bit longer, at least the first 10 years were quite fast...

The AIs included are the same as in the previous game, only NoCAB was replaced to the bleeding edge edition. The terrain is now a bit more friendly, hilly instead of mountainous, and smooth instead of rough.

Let's see the stats!
Graphs after 10 years.png
(47.94 KiB) Downloaded 1 time
Companies after 10 years.png
(93.29 KiB) Downloaded 1 time
The game is quite even, but Terron took the lead, followed by MogulAI. It's too bad that they're already nearing the road vehicle limit.
The others are also doing fairly well.

Here is the savegame:
Toyland test after 10 years.sav
(1.41 MiB) Downloaded 160 times
And there is a graphical glitch in toyland with the default graphic set, the top of the MightyMover Toy Van is black when going towards the northeast. Has this been present since the beginning?
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

I've just passed the 20 year mark, the game is going smoothly as expected :)
Graphs after 20 years.png
(45.1 KiB) Downloaded 1 time
Companies after 20 years.png
(93.94 KiB) Downloaded 1 time
Things are changing. NoCAB took the lead and was soon followed by AdmiralAI just after an economic recession.
I think I spotted why AIAI isn't buying more vehicles, for some reason hundreds of wagons are sitting in a train depot without a locomotive.
TrAIns is also making its way, despite the weak train engines...
Toyland test after 20 years.sav
(1.82 MiB) Downloaded 169 times
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

40 years have passed since the beginning...
Graphs after 40 years.png
(38.65 KiB) Downloaded 1 time
Companies after 40 years.png
(92.74 KiB) Downloaded 1 time
DictatorAI crashed in the 1970s, and later NoCAB crashed in 1980, so it ended the classic AdmiralAI vs NoCAB duel.
AdmiralAI isn't really growing, while Terron has increased its profits lately (I wonder how, its vehicle count isn't growing :) ), so they are the two richest companies. The performance ratings chart is a bit different though: OTVI, SimpleAI and AroAI are high up on the charts besides the two I mentioned.
I replaced AIAI v46 with the version on Bananas before it could go bankrupt. Then it didn't succeed, as it tried to build planes first, and they were unprofitable. So I started AIAI with road vehicles only, it is in business now. I will enable planes later for it.
OpenTTD has also crashed during this period, so the game is reloaded from an autosave. Convoy isn't save/load compatibile, so it has some buses which are really old.
Toyland test after 40 years.sav
(1.29 MiB) Downloaded 160 times
I'm still able to fast forward, so the game continues :)
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

Now it is time for the 75-year report.
Graphs after 75 years.png
(39.54 KiB) Downloaded 1 time
Companies after 75 years.png
(92.58 KiB) Downloaded 1 time
Sadly, NoCAB crashed again in 2009, so it was started again. It's impressive how it can catch up with the others so quickly :)
The second DictatorAI doesn't build anything for some reason, although it has plenty of money.
With monorails and maglevs, trAIns was able to increase its profits further, now it's earning as much as AdmiralAI.
Clueless is only managing its fleet, it doesn't build anything new, although it has only 146 road vehicles.
Convoy doesn't like saving and reloading the game, so this results in quite a few 75-year-old buses, and some others sitting in a depot for ages, but at least it doesn't crash.
The other RV-only AIs have reached or are nearing the limit. Is it intentional that Terron is always around 400 instead of 500?
ChooChoo has a nice network, and it has the widest range of train locomotives, from nostalgia steamers to monorails :D
SimpleAI is quite slow to build new connections, but is constantly expanding. I also found a bug in it, I should report it in its thread :wink:
AIAI finally got going, now it's turning decent profits.

So 11 out of 14 AIs have been running for 75 years, this is quite an achievement.
Attachments
Toyland test after 75 years.sav
(1.85 MiB) Downloaded 166 times
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

And finally 100 game years have been completed.
Graphs after 100 years.png
(36.09 KiB) Downloaded 1 time
Companies after 100 years.png
(92.31 KiB) Downloaded 1 time
In the last few years, the profits of trAIns have dropped for some reason. SimpeAI and ChooChoo were slowly growing, now they're 3rd and 4th in profits.
There are some sharp drops in OTVI's profits on the graphs, in some months the property maintenance goes really high... (around 700k for the last year) Do you have any idea what it is? Anyway, OTVI was doing really well, although it's a bit reluctant to build trains.
I noticed that Terron was selling about half of its road vehicles in the last year. I waited for one more year, and by the time the high score screen appeared, all of its road vehicles were sold! :?

Here is the final savegame:
Attachments
Toyland test after 100 years.sav
(1.8 MiB) Downloaded 145 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: AI competition III

Post by Zuu »

Thank you very much for the AI competitions.

I think one important reason why CluelessPlus is not doing so well this time is that it is not so light on CPU use.

Brumi wrote:Clueless is only managing its fleet, it doesn't build anything new, although it has only 146 road vehicles.
Actually, when I tried to load the 75 years save game, it built a new connection just that it took it 1 year to find a pair to connect and build the connection. But after that it ended up in several years of vehicle management.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

It looks like it made some sense to play the game with slow AI speed, at least I found a bug in SimpleAI that wasn't there in the previous game :wink:
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AI competition III

Post by Kogut »

Brumi wrote:AIAI has one oil train, and it's waiting for money to build more. In my previous game, it managed to stand up from such a situation 8)
And it menaged also here!
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: AI competition III

Post by planetmaker »

I ran a new run with 9 AIs as found from bananas:

Let me take the result in advance, in order of operating profit:
Doing very well:
  • NoCAB
  • AIAI
  • TerronAI
Doing a good job:
  • CluelessPlus
  • AdmiralAI
  • SimpleAI
  • Trans
Companies which did not make a profit:
  • TrAIns
  • AroAI
The setting was a tropical map 256x512 tiles with a medium amount of water, started in 1945. NewGRFs in use:
OpenGFX+Industries 0.3.4
OpenGFX+Trains 0.2.5
OpenGFX+RoadVehicles 0.2.0
OpenGFX+Airports 0.2.1
NuTracks 1.1.1
Aviators Aircraft av8 1.81
FISH 0.9.1
HEQS 1.1.0
Starting conditions
Starting conditions
Unnamed, 1945-08-30.png (45.64 KiB) Viewed 1491 times
Notable is that TerronAI is a very quick starter, but also AdmiralAI and NoCAB got off the ground quite well. Final savegame after 15 years attached as well.
Attachments
5 year graph
5 year graph
aibattleIV_5years.png (35.14 KiB) Viewed 5422 times
aibattleIV_15years.sav
savegame after 15 years
(364.92 KiB) Downloaded 141 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AI competition III

Post by planetmaker »

I terminated the game after 15 years as the map is nearly completely built and also the relative ranks don't quite change.

All in all it was again a nice game to look in and see how the different AIs solve the tasks at hand. Roads were still the main means of transport - and the most profitable, it seems. Though those AI which got an initial air route established made good money with that, too.
Attachments
aibattleIV_15years_overview.png
overview
(118.28 KiB) Downloaded 1 time
overall operating profit
overall operating profit
aibattleIV_15years.png (80.58 KiB) Viewed 1491 times
zoom-in with the biggest three players not shown
zoom-in with the biggest three players not shown
aibattleIV_15years_detail.png (81.14 KiB) Viewed 1491 times
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AI competition III + IV

Post by planetmaker »

Something noteworth is IMHO the amount of roads build - something which all AI probably could still optimize and save a bit road building. None of the roads is really jammed or full, but AIAI, NoCAB, CluelessPlus, SimpleAI and AroAI all own pieces of road there - and IMHO there's a lot of quite pointless duplication around. I have somewhat the feeling that TerronAI re-uses existing roads better as there was less often long roads owned by it in parallel to other existing routes.
Attachments
Phillips & Co., 1959-10-07#3.png
Phillips & Co., 1959-10-07#3.png (64.7 KiB) Viewed 5417 times
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III + IV

Post by Brumi »

Thanks for the test! :)

Conclusion for me: The choice of railtypes in SimpleAI is not too clever, it is not compatibile with NuTracks. But... was that track in the upper right corner of your last screenshot built by SimpleAI or you? By the way, I've already started some work to be compatibile with NewGRF trainsets (namely the UKRS and NARS), but ran into problems, like not finding which wagon can be attached to a multiple unit engine.

As for the roads, something can be done by modifying the penalties for the road pathfinder, maybe it will follow others' roads more. Testing the behaviour is not so easy though...
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 20 guests