Testing several AIs that use trains
Moderator: OpenTTD Developers
Testing several AIs that use trains
I conducted 3 games with several AIs using only trains by disabling road vehicles, ships and aircraft.
The AIs used were:
- NoCAB v495
- Denver & Rio Grande v1
- ChooChoo v361
- trAIns v2
- AdmiralAI v25
- SimpleAI v5
OpenTTD version is 1.0.4
I came to a clear conclusion who the worst was, and it's NoCAB. In these 3 games, it was only able to build trains in 1 of them. In that game I saw it attempting a second station, it even started building the rails but ended up with no money to finish it so it removed the lines. It did this several times in vain, as it was wasting all its little money for nothing. Only 15 years later it was finally able to build a second train route, having a total of 6 trains, while the company with most trains already had 140, and the company with the most value already had 45.
I'd say for second worst it's ChooChoo, mainly because it cheats with bus stations, but also because it waits an eternity for money. It's very random, if ChooChoo gets a good start then it will develop fast enough, the waiting for money will be minimal, but if it doesn't, it becomes a pretty slow going AI. I think the main problem are bridges, it takes most of it's money, sometimes it builds bridges a height higher than usual for nothing.
Denver & Rio Grande is quite complicated, it needs fine tunning in its settings to be able to build something and prosper in an environment with other AIs. It finally developed in the 3rd game beyond 10 trains and it's one of the best.
The others 3 are winners, but they're all different so I can't really conclude who's the definite winner. If we're talking about most trains, then it's SimpleAI, however SimpleAI has the weirdest pathfinding, it constructs randomly, as long as it's able to connect 2 stations, it's fine. But if we're talking about the look, then trAIns is the best. It is also the one that has the most company value and best looking networks. on the contraire, AdmiralAI has the most complicated network for the human eye, but despite that, it is an efficient AI with lots of profit.
The AIs used were:
- NoCAB v495
- Denver & Rio Grande v1
- ChooChoo v361
- trAIns v2
- AdmiralAI v25
- SimpleAI v5
OpenTTD version is 1.0.4
I came to a clear conclusion who the worst was, and it's NoCAB. In these 3 games, it was only able to build trains in 1 of them. In that game I saw it attempting a second station, it even started building the rails but ended up with no money to finish it so it removed the lines. It did this several times in vain, as it was wasting all its little money for nothing. Only 15 years later it was finally able to build a second train route, having a total of 6 trains, while the company with most trains already had 140, and the company with the most value already had 45.
I'd say for second worst it's ChooChoo, mainly because it cheats with bus stations, but also because it waits an eternity for money. It's very random, if ChooChoo gets a good start then it will develop fast enough, the waiting for money will be minimal, but if it doesn't, it becomes a pretty slow going AI. I think the main problem are bridges, it takes most of it's money, sometimes it builds bridges a height higher than usual for nothing.
Denver & Rio Grande is quite complicated, it needs fine tunning in its settings to be able to build something and prosper in an environment with other AIs. It finally developed in the 3rd game beyond 10 trains and it's one of the best.
The others 3 are winners, but they're all different so I can't really conclude who's the definite winner. If we're talking about most trains, then it's SimpleAI, however SimpleAI has the weirdest pathfinding, it constructs randomly, as long as it's able to connect 2 stations, it's fine. But if we're talking about the look, then trAIns is the best. It is also the one that has the most company value and best looking networks. on the contraire, AdmiralAI has the most complicated network for the human eye, but despite that, it is an efficient AI with lots of profit.
Re: Testing several AIs that use trains
AIs with bridge upgrading:
- SimpleAI (replaces existing bridges as soon as a faster bridge is available)
- AdmiralAI (doesn't replace existing bridges, only when building new routes)
- trAIns (doesn't replace existing bridges, only when building new routes)
- ChooChoo (doesn't replace existing bridges, only when building new routes)
- Denver & Rio Grande (doesn't replace existing bridges, unknown as of yet when building new routes)
AIs with engine model upgrading:
- trAIns (replaces running models as well as rail type as soon as a newer profitable model is available)
- SimpleAI (when replacing old aged vehicles and when building new routes)
- Denver & Rio Grande (when replacing old aged vehicles and when building new routes)
- AdmiralAI (only when previous used model is no longer available and when building new routes)
- ChooChoo (does't replace non-existing model, keeps old aged model, but builds new models on new routes)
- Attachments
-
- Sem nome, 2016-06-11.sav
- (582.83 KiB) Downloaded 156 times
Re: Testing several AIs that use trains
That one is interesting. In my games (starting in 1950 with the default train set) AdmiralAI gradually replaces its older engines to the Manley-Morel DMU when it becomes available. Not the optimal choice thoughSamu wrote:- AdmiralAI (only when previous used model is no longer available and when building new routes)

Re: Testing several AIs that use trains
That is also how I coded itBrumi wrote:That one is interesting. In my games (starting in 1950 with the default train set) AdmiralAI gradually replaces its older engines to the Manley-Morel DMU when it becomes available. Not the optimal choice thoughSamu wrote:- AdmiralAI (only when previous used model is no longer available and when building new routes)

Re: Testing several AIs that use trains
I started the game in 1985, it picked SH '125'. 20 years later, it replaces these engines with the same SH '125' though it could have picked 'AsiaStar'. The reliability isn't that good anymore, you know.
Re: Testing several AIs that use trains
Ah, but that is a different issue. For some reason AdmiralAI thinks the SH '125' is better than the AsiaStar. IIRC it doesn't take the reliability into account at all. Another reason might be that it had trouble updating the line to electric rail.
Re: Testing several AIs that use trains
Train Jam and old trains not being replaced at all.
AdmiralAI.
AdmiralAI.
- Attachments
-
- Sem nome, 2049-10-28.sav
- (469.06 KiB) Downloaded 170 times
Re: Testing several AIs that use trains
Hi Samu,
Thanks for testing, I've been inactive on these forums and with NoCAB for quite some time now so I did not notice that a change in the rail code broke the train building part of my AI. The new version 2.1.2 should work as it did before, so please try it one more time before writing it off. Thanks
.
Bram
Thanks for testing, I've been inactive on these forums and with NoCAB for quite some time now so I did not notice that a change in the rail code broke the train building part of my AI. The new version 2.1.2 should work as it did before, so please try it one more time before writing it off. Thanks

Bram
Re: Testing several AIs that use trains
Hi Samu, thanks for the test!Samu wrote:I'd say for second worst it's ChooChoo, mainly because it cheats with bus stations, but also because it waits an eternity for money. It's very random, if ChooChoo gets a good start then it will develop fast enough, the waiting for money will be minimal, but if it doesn't, it becomes a pretty slow going AI. I think the main problem are bridges, it takes most of it's money, sometimes it builds bridges a height higher than usual for nothing.
I wish I was better at understanding how the pathfinder works. I have no idea why it sometimes decides to build bridges where they're not needed. I can increase the A* cost for them, of course, but then it'd fail to find a path more often. Alternatively, I can reduce the pathfinder speed for a more optimal route, and have it sit there for months calculating, which is boring as heck to watch, so I'm afraid the bridges will stay. Are you sure that's it, though? Unless you're playing with increased building costs, bridges are only a couple thousand pounds (IIRC) and the main cost is in buying locomotives.
I'm not sure what to do with ChooChoo - I could make it generate lots of profit by just spamming the map with point-to-point cargo lines, but that's cheap and ugly. I could make it choose optimal industries, but then it'd look silly if you start several ChooChoos and they all sit in the same spot. If it doesn't "cheat" with bus stations, it's almost impossible to play on mountainous maps, because you can rarely build close enough to the city center to get decent coverage without risking bankruptcy by massive terraforming, especially if you try to hook up small towns as well.
It's the same with the waiting for money thing; either you risk bankruptcy on the hard maps, or go too slow on easy maps. Maybe I should give it a "recklessness" parameter, making it more willing to spend money it's keeping back for when the game checks for bankruptcy.
If you want it to be more aggressive, you can increase the "number of point to point lines to build at the start". If you raise that to, say, 20 (or whatever maximum I set), it'll make a mess of the map but it should go a lot quicker. A larger starting loan also helps a lot, of course. What game settings did you use, btw?
All in all, I'm not sure where to sit on the spectrum of profit vs. aesthetics, and since most AIs go for profit, I'm sticking closer to the other end, capitalism be damned

Re: Testing several AIs that use trains
No, that's not what I mean, the bridge is really needed. It happens on slopes that take 2 squares, the AI starts the bridge on the first square instead of starting it on the second square. This raises the height for the bridge by 1 where it's not needed should it had started on the second square.I wish I was better at understanding how the pathfinder works. I have no idea why it sometimes decides to build bridges where they're not needed.
EDIT: Actually, the pathfinder is right, just tested myself building a bridge on the first square, it's 2 times as cheap than building it on the second square. Makes no sense. Aesthetically speaking, it looks ugly but it's cheaper.
- Attachments
-
- Sem nome, 25 Jul 2016.png
- (110.62 KiB) Downloaded 4 times
Re: Testing several AIs that use trains
OMG, look at this from SimpleAI.
- Attachments
-
- Sem nome, 1982-07-17.png
- (255.85 KiB) Downloaded 2 times
Re: Testing several AIs that use trains
I think it may be because building on coastal tiles is more expensive than bridging over them (though the pathfinder doesn't look at "dollar costs" - but the pathfinder costs for slope + coast + bridge may be more than just the longer bridge). Thanks for checking and grabbing a screenshot btwSamu wrote:No, that's not what I mean, the bridge is really needed. It happens on slopes that take 2 squares, the AI starts the bridge on the first square instead of starting it on the second square. This raises the height for the bridge by 1 where it's not needed should it had started on the second square.I wish I was better at understanding how the pathfinder works. I have no idea why it sometimes decides to build bridges where they're not needed.
EDIT: Actually, the pathfinder is right, just tested myself building a bridge on the first square, it's 2 times as cheap than building it on the second square. Makes no sense. Aesthetically speaking, it looks ugly but it's cheaper.

Who is online
Users browsing this forum: No registered users and 7 guests