AI vs me: trains and networks

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

Post Reply
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

AI vs me: trains and networks

Post by 1009 »

Hi all.

I'm a long time TTD / OpenTTD-player, a fan of trains, coffee, programming and AI. I'm not too good at C or whatever yet, but I enjoy testing the AIs. I'll try making my own train AI some day, but for now, I'll just run comparision games.
I thought it'd be cool to compare their network building skills to mine. I can say, it's much more challanging than playing on your own, as I do most of the time. It makes quick building more important than complex crossings and stuff like that.

Anyway, today I've been playing against ChooChoo, trAIns and Denver & Rio Grande AI. I decided to leave out TransAI and Admiral, to see how these younger guys would do. The game is on a 256x256 desert map, with everything flat (just like Holland. Not the desert, but the flatness.). The game starts in 1960, but the first screens will be from 1964.
Just like with AI Battle Royale, I'll be featuring a Spot On for every AI. The first will be Choochoo, after the initial comparision.
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: AI vs me: trains and networks

Post by 1009 »

1964

Every company started quickly, connections I'd like to have build were blocked by others quickly. That's a good thing, such speed. AIs and me really had to work around eachother.
Companies trying to work around eachother.
Companies trying to work around eachother.
1964_AICrossing.png (48.2 KiB) Viewed 2892 times
What caught my attention was Choochoo deleting one of the crossings in front of one of their "start up"-stations. Two trains wasted.
Also, Denver & Rio Grande could've found a better path there I think. Does it try both of the stations entrances or only the one that's closest to the destination?
Choochoo and Denver & Rio Grande having some problems.
Choochoo and Denver & Rio Grande having some problems.
1964_poor_track.png (112.65 KiB) Viewed 742 times
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: AI vs me: trains and networks

Post by 1009 »

TrAIns is the biggest competitor. Even though it fails at big lakes (just like Admiral, only that AI gives up after a few years I believe), as you can see in the map, it's profit overtakes mine now and then.
1964 Graph
1964 Graph
1964_graphs.png (60.16 KiB) Viewed 737 times
1964 Map
1964 Map
1964_map_colours.png (13.73 KiB) Viewed 723 times
Next: the Spot On for Choochoo.
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: AI vs me: trains and networks

Post by Dustin »

Eliandor wrote:1964

Every company started quickly, connections I'd like to have build were blocked by others quickly. That's a good thing, such speed. AIs and me really had to work around eachother.
1964_AICrossing.png
What caught my attention was Choochoo deleting one of the crossings in front of one of their "start up"-stations. Two trains wasted.
Also, Denver & Rio Grande could've found a better path there I think. Does it try both of the stations entrances or only the one that's closest to the destination?
1964_poor_track.png

I don't think this is a problem per se. (For D&RG). It always connects the closest corners. Due to that slope it had a hard time "turning the corner" up the slope. The cost in thinking time to fix situations like that is pretty high. D&RG relies on getting many decent routes up and running rather than optimizing routes. In that picture, clearly, it should have gone for another corner, but it couldn't know that until it was nearly done. And checking for that sort of thing means a really big search space.

Edit: A better questions is "why didn't it put the station in the other orientation and to the left of the refinery?". That's the real problem here. D&RG favors stations down and to the right due to the way the AI station placement routines work. The AI is passing up good places to put stations, or putting them "behind" the acceptor.
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: AI vs me: trains and networks

Post by 1009 »

Dustin wrote:I don't think this is a problem per se. (For D&RG). It always connects the closest corners. Due to that slope it had a hard time "turning the corner" up the slope. The cost in thinking time to fix situations like that is pretty high. D&RG relies on getting many decent routes up and running rather than optimizing routes. In that picture, clearly, it should have gone for another corner, but it couldn't know that until it was nearly done. And checking for that sort of thing means a really big search space.

Edit: A better questions is "why didn't it put the station in the other orientation and to the left of the refinery?". That's the real problem here. D&RG favors stations down and to the right due to the way the AI station placement routines work. The AI is passing up good places to put stations, or putting them "behind" the acceptor.
Alright, I see. I don't think having a favourite placement for the station should really be a problem, it could've build just a fine route from there (if not blocked by slopes, of course)
Anyway, since D&RG isn't aggressive (I read somewhere that it only targets industries where no other companies are building) -- why not do route optimalisation? Especially in small maps it'll only be limited to a few routes. The routes it builds, though, are easily improvable: it's always node - route - node - route, so if you only change the routes between the nodes everything should work just fine.
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: AI vs me: trains and networks

Post by 1009 »

Spot On: Choochoo

I actually wanted to wait with this for another day or something, but felt bored, so I decided to make a new post right now.

Choochoo has a big disadvantage in the desert. I'm planning on running a normal game soon, where it'll do a lot better I assume.
As all users of this AI are probably aware of, Choochoo builds cute (subjective) networks with cute (again subjective) crossings. It's very efficient in making it's networks, because it can easily attach a new city to the existing rail.

I'm sorry to say that Choochoo could not survive on this map. In 1968, the company was declared bankrupt. Thus, I can only show 2 screenshots, both made in 1964, of Choochoo at it's best. Maybe it should check on Desert, and then check what cities are supplies with water or food or don't need any of that to grow / supply enough passengers.
Choochoo's typical crossing.
Choochoo's typical crossing.
H_Choochoo_1964_1.png (15.77 KiB) Viewed 2818 times
The straight tracks are really prefered by Choochoo, but a secondary track may get into trouble because of it.
Straight lines first: other lines later.
Straight lines first: other lines later.
H_Choochoo_1964_2.png (56.53 KiB) Viewed 714 times
I hope to be able to show some more exciting screenshots of Choochoo in Temperate. :)
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: AI vs me: trains and networks

Post by Wold »

The reason why ChooChoo and TConvoy will fail on desert/snow terrain is the fact that there are no actual towns that can produce a nice number of people so they can't make enough income. The idea though is good and everyone should admire the work of the developers.

About the AIs - trAIns is very good because the idea pays well. It chooses nice industries ( and as we know cargo pays well ) and the pathfinder is great. DustinAI is pretty good too for the same reasons as trAIns. TransAI is damn good at the start of the game and sucky later because it doesn't compete for the industries. AdmiralAI, which you left out, on the other hand is very competitive - it builds near your stations, builds statues to boost the rating, uses aircrafts for money making - the most successful strategy.
Image
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: AI vs me: trains and networks

Post by 1009 »

Wold wrote:The reason why ChooChoo and TConvoy will fail on desert/snow terrain is the fact that there are no actual towns that can produce a nice number of people so they can't make enough income. The idea though is good and everyone should admire the work of the developers.
I know that. That's why I was planning on running another AI vs. Me, but then on Temperate. Maybe even with 2CC, just to see how they'd do with that set.

Anyway, 1968!
There hasn't been much growth, alas. D&RG hasn't found too many new industries It has connect a new gold mine, but it's been in a loop checking Local Authorities / Good Station Spots for a few years now. TrAIns, which will be the next Spot On, has been busy pathfinding it's way through a lake for the previous five years. That's why my company has overtaken it in company value.

Not too much interesting stuff to display here. I'll include the graphs and the map, then write the two remaining spot ons. I'm curious as to how the AIs will do in Temperate!
1968 Map
1968 Map
1968_map_colours.png (14.1 KiB) Viewed 687 times
1968 Graphs
1968 Graphs
1968_graphs.png (38.39 KiB) Viewed 684 times
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: AI vs me: trains and networks

Post by 1009 »

Spot On: TrAIns

I think everyone was charmed by the way it builds it's double rails, neat and fast. I've played a few other games with TrAIns, but in all it got stuck in the end. Lakes are always the cause of this.
TrAIns pathfinding through the lake.
TrAIns pathfinding through the lake.
H_Trains_1968_2.png (44.05 KiB) Viewed 2721 times
The pathfinder is a little confused with the spacey double rails I build. Are two bridges build this way cheaper? It won't do any good without Realistic Acceleration, though.
TrAIns building double bridges.
TrAIns building double bridges.
H_TrAIns_1968_1.png (14.82 KiB) Viewed 2722 times
Enough negative stuff. I want to include a screenshots if why I'm really fond of this AI.
TrAIns doing what it does best.
TrAIns doing what it does best.
H_TrAIns_1968_3.png (27.19 KiB) Viewed 731 times
Next: some screenshots of D&RG.
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: AI vs me: trains and networks

Post by Dustin »

Eliandor wrote:Anyway, since D&RG isn't aggressive (I read somewhere that it only targets industries where no other companies are building) -- why not do route optimalisation? Especially in small maps it'll only be limited to a few routes. The routes it builds, though, are easily improvable: it's always node - route - node - route, so if you only change the routes between the nodes everything should work just fine.
First, that behavior is changed. Now it makes a list of unshipped cargo and tries to ship the most valuable one. So if there is a competitor doing a poor job, or all the other places are taken, it will jump in.

I might consider this as something for the future. Taking the kinks out of a line looks nice, but barely contributes to the yearly income if the route was reasonable to start. It's almost always way more profitable to start a new route, or upgrade the engines on an old one. The resource that most constrains an AI is computing ticks. Pathfinding and optimization are very expensive. So DR&G chooses sub-optimal but easier to calculate routes.

It would probably be (way) more profitable to add in Air transport and RVs.
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: AI vs me: trains and networks

Post by Dustin »

Eliandor wrote:D&RG hasn't found too many new industries It has connect a new gold mine, but it's been in a loop checking Local Authorities / Good Station Spots for a few years now.
I am actually working on that right problem now. The way it locates stations needs some work. On a nice flat map like that one, it should be able to plop them down like crazy. Like so much of the AI, I focused on getting things working at all so the whole AI could hang together and run. Now I am going back and optimizing things where I "cheated" a lot. Station placement is ripe for improvements.

I look forward to your screen shots.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 13 Jul 2008 00:57
Contact:

Re: AI vs me: trains and networks

Post by Michiel »

Always cool to see AIs go head to head. And glorious failure is always an option :P Desert maps are tough for a passenger only AI.

"Cute" is pretty much what I'm aiming for; decent performance in these matchups has actually been an unexpected side effect.
By the way, I really like the RoRo stations trAIns is building! I've been thinking of using a RoRo design for ChooChoo, but I'm tinkering with the rail network first (or will be, when I've got some time to spare).

Anyway, thanks to Eliandor for the nice writeup, and good luck to my fellow AI hackers :D
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Semrush [Bot] and 1 guest