ChooChoo, a train network AI

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
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

idioty wrote:Why build first monorail tracks when rails are available cheaper?
Two different AI is in the screenshot.
Oh, that's because in the normal game with default settings, monorail is not that much more expensive, and the newer trains are usually strictly better than the old ones, so that's the only logic that's built in. Basically, rail is just assumed to be cheap, and only trains/tunnels/bridges are expensive.
User avatar
skippern
Traffic Manager
Traffic Manager
Posts: 195
Joined: 30 Oct 2013 13:57

Re: ChooChoo, a train network AI

Post by skippern »

Another thing, when using the PIPE NewGRF, ChooChoo tends to try to make pipelines to transport Iron Ore from the mines to a steel mill, and similar. Since PIPE is restricted to liquid cargoes this doesn't go well (even though there are real life examples of pipelines pumping marble (slurry) and iron ore as well)

In other words ChooChoo should probably check to avoid using the pipe railtype (4, I have checked)
Skippern
OpenTTD Mac user
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: ChooChoo, a train network AI

Post by Kogut »

Hardcoding is evil. It can be done properly (I forgot how but AIAI is handling this kind of thing).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Baldy's Boss
Tycoon
Tycoon
Posts: 1396
Joined: 23 Feb 2014 22:02

Re: ChooChoo, a train network AI

Post by Baldy's Boss »

I'm pretty sure that the AI I bought out in my "Rartown Brown Railroad Co." game was a ChooChoo...I connected a station the AI had built(which had signs in the air saying ChooChoo was pathfinding) near my world's largest city to a nearby set of double tracks between those four-way junctions that had also been built by the AI,
and built a station in the nearby second-largest city and plugged it into the other end of the junction.Then I started sending trains on this route.
The first train to reach the second junction,going down a one-way track,reversed course and headed for the train behind it...I'm told the junction allows no exits.

The game save and an image of the impasse and junction are up on page 4 of the "General Hello and a Help Request" topic in the OpenTTD General forum.

What's the fix?
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: ChooChoo, a train network AI

Post by Alberth »

An a link to that page/image: http://www.tt-forums.net/viewtopic.php? ... 4#p1113274

@Baldy's Boss
The little document icon near the "posted" date at the right in the header above each message gives you a link to that post.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

It was, Baldy's Boss, and thanks for the link Alberth, I'll reply over there!
Baldy's Boss
Tycoon
Tycoon
Posts: 1396
Joined: 23 Feb 2014 22:02

Re: ChooChoo, a train network AI

Post by Baldy's Boss »

It's one thing that ChooChoo posts notes in the air about its plans.But apparently they linger even after a ChooChoo has gone bankrupt?
Take a look at this game.
Attachments
LittleOldWorldRedRailroad,1stJan1914.sav
(241.44 KiB) Downloaded 230 times
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

Baldy's Boss wrote:It's one thing that ChooChoo posts notes in the air about its plans.But apparently they linger even after a ChooChoo has gone bankrupt?
Take a look at this game.
That's quite possible. If an AI goes bankrupt, it stops running and can no longer clean up its signs, I believe. If this bothers you, you can turn the signs off through ChooChoo's settings.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: ChooChoo, a train network AI

Post by Zuu »

And in a game where this has already occurred, there is the option to turn off competitor signs. It will hide dead AI signs. (my main motivation for implementing that feature was actually when testing AIs and having my screen littered by dead AI signs from restarting my AI over and over)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Keplergamer
Engineer
Engineer
Posts: 7
Joined: 04 Aug 2015 03:05

Re: ChooChoo, a train network AI

Post by Keplergamer »

Choo-choo made this some time ago:

Image
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

Cool, that's a lot of track it managed to squeeze in there. Then again, that game has been running for quite a while :) Interesting looking map, by the way!
Baldy's Boss
Tycoon
Tycoon
Posts: 1396
Joined: 23 Feb 2014 22:02

Re: ChooChoo, a train network AI

Post by Baldy's Boss »

In the save,a ChooChoo (which went bankrupt one month later) apparently "reinvented the wheel" in trying to build service between Quarberg Market and Funthwaite Springs...two parallel dual lines that don't connect.
So it was left with heavy infrastructure bills and no revenue potential on the route.Does it not keep track of where it has tracks?
Attachments
LittleOldWorldRedRailroad,1stSep1959.sav
(294.18 KiB) Downloaded 218 times
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

Baldy's Boss wrote:Does it not keep track of where it has tracks?
No, it doesn't; it just plops down a crossing into a random spot that looks promising, then tries to extend the crossing in each direction. It's entirely possible it'll pick two spots, close together, neither of which results in a buildable route.

However, the savegame does look odd: it has two sets of unfinished track, which shouldn't normally happen (one containing Frohead Junction and the other with Wreeley Junction). It won't start a new network unless every exit of every crossing has been tried. Although... did you happen to save and reload the game? That would explain it, since it doesn't keep track of what it was building across a save/load cycle (in fact, it doesn't save anything, it just looks at the map).

Sorry, in this case it's just too stupid to live :P
Baldy's Boss
Tycoon
Tycoon
Posts: 1396
Joined: 23 Feb 2014 22:02

Re: ChooChoo, a train network AI

Post by Baldy's Boss »

Yes,I am given to frequent save/reloads.
I can probably check older saves for how this set developed.


So there's no "check the existing network" function?
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

Nope, once a network is built (or you load a savegame) it is forgotten. It just sells vehicles operating at a loss. Other than that, it just goes and builds stuff. I added (but never released) a feature where it sells the bottom 10% of vehicles (by yearly profit) and clones the top 10% every year, but that's it.
xarick
Transport Coordinator
Transport Coordinator
Posts: 335
Joined: 26 Feb 2015 00:52

Re: ChooChoo, a train network AI

Post by xarick »

Train 4 needs to take a hell of a path to go from a station so close to the other.
Attachments
screenshot#7.png
(655.23 KiB) Not downloaded yet
autosave4.sav
(2.27 MiB) Downloaded 213 times
Formerly known as Samu
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

Ha, yes it'll do that. It'll probably discover it's not a profitable route and sell the vehicles. I never got around to implementing a comparison between "as the crow flies" distance vs. the distance the train will have to take.
matta2006
Engineer
Engineer
Posts: 1
Joined: 26 May 2016 11:24

Re: ChooChoo, a train network AI

Post by matta2006 »

Dear developers,

first of all, I really like the way this AI is playing and building its long rails.

I am running some contest games. And, I have found that this AI does not returns its loans, even when it has plenty of money. I think it is a bug, and this costs 50 winning point for nothing.

Best regards,
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: ChooChoo, a train network AI

Post by Michiel »

Hi matta2006, you're right. While it's waiting for more money to come in, it'll always max out its loan, so it can see when it has how much it needs. Between checks, it should really have paid back what it could. However, it has to keep enough in cash to pay for station maintenance and avoid bankruptcy, and I was too lazy to make it any smarter :)
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: ChooChoo, a train network AI

Post by Kogut »

From "newgrf hates ChooChoo" saga: 2cc trainset has passenger-only monorail. This AI attempts to use it to move coal.
Attachments
2cc.sav
(56.77 KiB) Downloaded 198 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google Adsense [Bot] and 5 guests