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

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

AI competition III + IV

Post by planetmaker »

I just started one of my testgames with a couple of AIs which I could find on BaNaNas. Map is a mountainous, water-rich arctic map 512^2 with default industries but NewGRF vehicles of all types (see map and NewGRF list below, NewGRFs not on bananas should be found on the DevZone (see signature)). All AI were set to start on consecutive days in January 1950.

The observation so far is that most start off quite well after a few months of thinking. I'll keep things running throughout the day and I'll keep autosaves to have a look at some years throughout the course of the game.
Attachments
Map
Map
Oskarsåker Transport, 1950-01-13.png (46.18 KiB) Viewed 1636 times
Oskar_1952.png
AIs in this competition
(146.78 KiB) Downloaded 2 times
NewGRFs
NewGRFs
Oskarsåker Transport, 1950-10-21.png (11.3 KiB) Viewed 10313 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 »

The nearly initial savegame.

Stay tuned for updates, possibly in a few days though only. I restarted AdmiralAI in late 1952 as it still was stitting with nothing but a single station and no vehicles built but idling otherwise - and now already has two vehicles after 10 days ;-)
Other than all do quite fine except that OTViAI just was offered for sale, struggling due to heavy competition; and the ultra slow vehicles of HEQS were not the best choice for the route it transports grain on; I gave it a new chance in late 1953.

Choochoo's 2nd investment is doubtful to become profitable (see screenshot). But it's one of three AIs which build trains, the other two are TrAIns and SimpleAI - both of which run a fair profit on their lines.

The handling of ships by TransAI is something it should better skip. Nearly all ships run at loss as their routes have no bouys and they get hopelessly lost.

In 1954 NoCab is the clear leader by company profits, making more than twice that of the 2nd most profitable one, using more than 100 road vehicles, 20 planes - and, behold, also 5 trains which were just purchased :-). The trains would be faster if it evaluated the breakdowns setting (there are none) and skipped forced servicing ;-)
Attachments
Oskarsåker Transport, 1950-01-07.sav
starting savegame
(340.79 KiB) Downloaded 260 times
Oskar_1954_choochoo.png
choo choo train track
(363.86 KiB) Downloaded 2 times
TrAIns ships
TrAIns ships
Oskarsåker Transport, 1954-07-09.png (130.79 KiB) Viewed 1636 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 »

Illustration for Trans' problem with ships: red circled are the two docks. The yellow circle indicates where the ships drive around endlessly, never making any profit, never reaching their destination.

In comparison a ship route which NoCab setup a few years later. It uses buoys quite well (yellow circles) between the two docks (red circles) - even though I'd have added at least one buoy further half-way the big gap. The ships run a good profit.
Attachments
Oskarsåker Transport, 1955-11-30.png
Oskarsåker Transport, 1955-11-30.png (291.71 KiB) Viewed 1636 times
vehicle settings
vehicle settings
Oskarsåker Transport, 1956-04-23.png (22.88 KiB) Viewed 10303 times
NoCab ship route.
NoCab ship route.
Oskarsåker Transport, 1960-04-28.png (545.01 KiB) Viewed 1636 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 »

Map after 11 years. Pink is SimpleAI. The yellow all AIAI except two airports which are my player company. A larger screenshot (20MB) is found here
Attachments
Oskarsåker Transport, 1961-07-18.png
map after 11 years
(81.92 KiB) Downloaded 2 times
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: AI competition III

Post by Hyronymus »

Looks good. I'm finding that NoCAB and AdmiralAI have severe trouble when starting an early game. With only RV's available they easily beat you but when trains are available they "forget" to build them. And for some reason they forget to repay their loans, resulting of loans of 4 million euro's.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI competition III

Post by Michiel »

Very cool! I was just thinking I really want to start tinkering again...

Maybe it'd be fun to run a low sea level tournament as well, favouring the train AIs?
Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: AI competition III

Post by Morloth »

Hyronymus wrote:Looks good. I'm finding that NoCAB and AdmiralAI have severe trouble when starting an early game. With only RV's available they easily beat you but when trains are available they "forget" to build them. And for some reason they forget to repay their loans, resulting of loans of 4 million euro's.
A few points on this. NoCAB does not forget about trains, but its heuristic tells it that it's better to invest in other connections first. I never actually played the game myself to be honest so it might be that the metrics I use could be improved, if you have any suggestions why an early rail connection is better I'd love to hear it :).

About repaying loans, NoCAB does this every time after it gathers all the information on what to build (and this can take a few months, depending on how many connections it has / how big the map is, etc). All the money left after building will be paid off. So I don't think forgetting is the right word, it's just that NoCAB doesn't check every X days if it can repay any of its loan; Given that the interest rates are quite low I don't think it ever hurts to wait a few months before paying back the loans.

Thanks for the tournament, good to know NoCAB is still a strong competitor :).
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 »

Let's summarize what I just found after 65 game years: All AIs except ChooChoo survived, many did quite well, SimpleAI and especially NoCAB did exceedingly well.

It proved a good strategy for AIs in this game to start with a profitable air route and then invest into good train routes. None of the AIs built a lot of trains though; but that may well be due to the heavy competition as the map in 2015 features overall a few thousand road vehicles from the various companies.

Kudos to all AI authors - it is a joy to watch them build. Since my last such test game they evolved quite a bit; especially the train and ship support made a big step forward, that's the right way to go IMHO :-) Still some of the path finding and generally the use of trains could still be improved, especially on the networking side, though also there NoCAB does a reasonably good job looking at the monorail network which serves a power plant.

In order to compare the company vehicles against:
Max Trains allowed: 500
Max Road vehicles allowed: 500
Max planes allowed: 20
Max ships allowed: 10

Intermediate savegames are available in yearly intervals upon request.
Attachments
Oskar_company_overview.png
standing after 65 years. From left to right, top to bottom the ranking by company value
(115.61 KiB) Downloaded 2 times
Oskarsåker Transport, 2015-11-08.sav
Final savegame after 65 years
(851.05 KiB) Downloaded 268 times
Oskarsåker Transport, 2015-11-09#1.png
Metropolitan area with dense bus networks
(423.6 KiB) Downloaded 2 times
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 »

5th - a good result for AroAI, and 2nd for road only AIs :)
It shows i need to work on expanding routes, etc
Thanks for the test, it's usually a lot more unbiased than i could do it ;)
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
Hyronymus
Tycoon
Tycoon
Posts: 13235
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: AI competition III

Post by Hyronymus »

Morloth wrote:
Hyronymus wrote:Looks good. I'm finding that NoCAB and AdmiralAI have severe trouble when starting an early game. With only RV's available they easily beat you but when trains are available they "forget" to build them. And for some reason they forget to repay their loans, resulting of loans of 4 million euro's.
A few points on this. NoCAB does not forget about trains, but its heuristic tells it that it's better to invest in other connections first. I never actually played the game myself to be honest so it might be that the metrics I use could be improved, if you have any suggestions why an early rail connection is better I'd love to hear it :).

About repaying loans, NoCAB does this every time after it gathers all the information on what to build (and this can take a few months, depending on how many connections it has / how big the map is, etc). All the money left after building will be paid off. So I don't think forgetting is the right word, it's just that NoCAB doesn't check every X days if it can repay any of its loan; Given that the interest rates are quite low I don't think it ever hurts to wait a few months before paying back the loans.

Thanks for the tournament, good to know NoCAB is still a strong competitor :).
I sometimes wonder if a route setup by NoCAB wouldn't be more profitable if it uses a train. I.e., with some train sets 24 road vehicles on a route are more expensive than one locomotive + wagons. The increased speed of delivery will also result in a bigger profit for the AI. That's why I switch to trains gradually in early games.

Check my attachments for the loans and GRF's used. You said interest rates aren't that high but if you loose NLG 234.000 a year on loan interest...
Attachments
Haagsche Vervoers Mij., 1 Jan 1932.png
(103.55 KiB) Downloaded 2 times
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: AI competition III

Post by Kogut »

I see that I should fix stupid train bugs and enable this type transport as default :)
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI competition III

Post by Michiel »

I figured I'd try your savegame, but it says it requires airportsplus and ogfx-rv, which don't seem to be in Bananas. I couldn't find them online either. They're not in the screenshot you posted - any idea where to get them? I'd like to see if the new version of ChooChoo does a little better.
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4765
Joined: 09 Sep 2007 05:03
Location: home

Re: AI competition III

Post by Alberth »

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: AI competition III

Post by Morloth »

Which versino of airportsplus? I tried almost all releases and nightlies and non of them seem to be working :(.
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 »

from first post ;)

r73 apparently...
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
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AI competition III

Post by planetmaker »

Morloth wrote:
Which versino of airportsplus? I tried almost all releases and nightlies and non of them seem to be working :(.
r73 which is currently the 'latest'. Look in the nightly, not the release section: http://bundles.openttdcoop.org/airports ... es/LATEST/
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 didn't yet change my AI settings back to normal. Thus when testing other stuff (FIRS, OpenGFX+Trains, OpenGFX+RV, OpenGFX Landscape), AIs were all started in rapid succession after firing up OpenTTD. Invariably I noticed that the AI haver very different speeds with which they start building.

Most notably AIAI and AdmiralAI started very quickly building (withing 12 month after start). The other AIs took at least twice as long to start and did not build an as profitable startup route as those two aforementioned ones. AIAI and AdmiralAI in those three, four tests always started at least some air service which proved to be quite profitable, giving them a very good start.

Letting the game run longer, NoCAB catched up and passed by AdmiralAI wrt profits (see screenshot after ~25 years). Except OtviAI all AI did well, though.
Attachments
Unnamed, 2044-12-13.png
Unnamed, 2044-12-13.png (41.49 KiB) Viewed 1636 times
situation 2 years after start up
situation 2 years after start up
Unnamed, 2023-02-25.png (99.76 KiB) Viewed 1636 times
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

It's good to see that most AIs are doing well, no crashes, staying alive (I think it's quite OK to get it right for second try, as I remember the old AI going bankrupt in the easiest mode because of badly placed airports :D )

I'm only curious about those people's opinion who actually play against these AIs...
Brumi
President
President
Posts: 921
Joined: 18 Jul 2009 17:54

Re: AI competition III

Post by Brumi »

I think it's best to post it in this thread.
So I'm doing an AI test now with 14 companies: (version numbers are based on the AI debug window)
  • CluelessPlus v25
  • Convoy v11
  • AdmiralAI v25
  • OtviAI v396
  • NoCAB v498
  • Trans v100307
  • ChooChoo v394
  • TrAIns v2
  • MogulAI v5900
  • SimpleAI v5
  • Denver & Rio Grande v1
  • AroAI v127
  • DictatorAI v101
  • Terron v201
Argh, I left AIAI out! Sorry Kogut, it was not intentional...

The map is 1024x1024, sub-arctic (I didn't look here to see what the last test was). So the map is mountainous, and realistic acceleration is turned off, so it's a bit hard to be good with trains. Vehicle limits are 200 trains, 500 road vehicles, 20 aircraft and 100 ships per player. The maximum initial loan is 300.000 pounds.
NewGRFs used: the Generic Tram Set and the Temperate Oil Wells Only Decrease Neutraliser (sorry I forgot to exclude it for sub-arctic).

Initially, RoadRunner was in the game instead of Denver & Rio Grande, but it took too long to save. (autosave is turned on every 3 months) Then I took PathZilla, which did the same, so Denver & Rio Grande came in.

So, some stats after 10 years:
Graphs after 10 years.png
(42.92 KiB) Downloaded 2 times
Companies after 10 years.png
(86.92 KiB) Downloaded 2 times
It's simple: NoCAB rules the game. DictatorAI and Terron also took a good start, but by now they have been caught up with by AdmiralAI, CluelessPlus and MogulAI.
AroAI went bankrupt when it had 70 buses. Competition is too heavy in large cities I guess...
I also managed to crash OpenTTD around the bankruptcy of AroAI and a plane crash of DictatorAI (it ran out of fuel, had no orders), so the game has been loaded from an autosave. I have no crash log files, OpenTTD simply exited without any notice :( Now AIs without save/lod support are in a bit of trouble.

Here is the savegame after 10 years:
Large AI test after 10 years.sav
(2.07 MiB) Downloaded 261 times
The game is still in progress, I'll keep you informed!
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests