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

Supercheese
Tycoon
Tycoon
Posts: 1660
Joined: 16 Dec 2007 22:24
Location: Idaho, USA

Re: ChooChoo, a train network AI

Post by Supercheese » 16 Jan 2013 07:18

Millennium Z1 is actually a default monorail vehicle.
Eyecandy Road Vehicles | Fake Subways | Supercheese's NewObjects

"Fashions and cultures change, but steam trains shall always be majestic."
-Professor Hershel Layton

mabono5
Engineer
Engineer
Posts: 5
Joined: 12 Mar 2010 16:51

Re: ChooChoo, a train network AI

Post by mabono5 » 16 Jan 2013 23:41

Thank you for your responses.

Here are the newgrf's I have been using. The version I am using is 409, however when using the previous version I used to use, 394, appears to be working without a problem.

I advanced it to 2022 to bypass the monorail era, and all that did was continue on with the problem but with lev 1 instead of millenium.

Hover Bus 1.0
PlaneSet 1.5.3(23/Oct/2006)
City Stations
eGRVTSv1.0
World Airliners Set Alpha Release
Bigger Train Depot
DB Double Deck Coaches
Long vehicles v4(13 Jan 2008)
Old Wagons with New Cargos 1.1
Total Town Replacement Set 3.11
Welsh Town Names
Speed upgrade for all default suspension bridges.
Hover Vehicles 1.0
Junkers JU-52
Longer Girder, Steel Bridge
Manual Industries II (nightly-r5)
NewCC Set
Improved Road Vehicles (for DB Set XL) v1.0
Town and Industry - UK Houses
DB Double Deck Coaches v0.3

I have tried with all removed less the plane sets.

Any suggestions are appreciated.

Steve

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

Re: ChooChoo, a train network AI

Post by Michiel » 20 Jan 2013 19:42

Hi Steve, thanks for the bug report! I'm afraid I haven't done any work on ChooChoo recently, but I'll see if I can reproduce and fix it.

Edit: sorry, but I can't seem to reproduce it here :-/ Started a game in 2010, temperate climate, and it successfully runs "Millenium Z1" locomotives with passenger and mail carriages, and diesels for cargo.

mabono5
Engineer
Engineer
Posts: 5
Joined: 12 Mar 2010 16:51

Re: ChooChoo, a train network AI

Post by mabono5 » 20 Jan 2013 21:35

Hey and thank you for your response.

I have uploaded my "unique" scenario and save game for you to have a look at to try and replicate.

http://www.mabono5.com/openttd/choochoo.zip

The map is purpose built due to a competition my brother and I started back in 1990's - who can make the most money, period, any way you can (I have won every time so far ;) )

Thank you

Steve

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

Re: ChooChoo, a train network AI

Post by planetmaker » 02 Jun 2013 16:03

Seven different errors over the day...

Find savegame here

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [CheckError()] choochoo-409/task.nut line [142]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_stations.nut line [400]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_network.nut line [485]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [front] 153316
dbg: [script] [1] [S] [t] 153315
dbg: [script] [1] [S] [area] INSTANCE
dbg: [script] [1] [S] [maxRange] 6
dbg: [script] [1] [S] [curRange] 1
dbg: [script] [1] [S] [spotFound] false
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] ""
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [exit] ARRAY
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE
and before that a few times:

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_network.nut line [434]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [stationRotation] 2
dbg: [script] [1] [S] [towns] INSTANCE
dbg: [script] [1] [S] [exit] ARRAY
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE
and

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [CheckError()] choochoo-409/task.nut line [142]
dbg: [script] [1] [S] *FUNCTION [BuildPlatforms()] choochoo-409/builder_stations.nut line [239]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_stations.nut line [140]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_network.nut line [485]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [cover] 154850
dbg: [script] [1] [S] [platform2] 154851
dbg: [script] [1] [S] [platform1] 154850
dbg: [script] [1] [S] [direction] 2
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] ""
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [exit] ARRAY
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE
and

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_network.nut line [434]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [stationRotation] 2
dbg: [script] [1] [S] [towns] INSTANCE
dbg: [script] [1] [S] [exit] ARRAY
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE
and

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_track.nut line [58]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_network.nut line [245]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_network.nut line [485]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] "   "
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [crossing] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] ""
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [exit] ARRAY
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE
and

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_trains.nut line [188]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_trains.nut line [46]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_cargo.nut line [99]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [wagon] 57
dbg: [script] [1] [S] [wagonType] 315
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] "   "
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] ""
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE
and

Code: Select all

dbg: [script] [1] [S] Your script made an error: unknown error
dbg: [script] [1] [S] 
dbg: [script] [1] [S] *FUNCTION [FindPath()] choochoo-409/builder_track.nut line [115]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_track.nut line [56]
dbg: [script] [1] [S] *FUNCTION [RunSubtasks()] choochoo-409/task.nut line [82]
dbg: [script] [1] [S] *FUNCTION [Run()] choochoo-409/builder_cargo.nut line [99]
dbg: [script] [1] [S] *FUNCTION [Start()] choochoo-409/main.nut line [75]
dbg: [script] [1] [S] 
dbg: [script] [1] [S] [maxBridgeCost] 31526
dbg: [script] [1] [S] [u] 100
dbg: [script] [1] [S] [bridgeLength] 20
dbg: [script] [1] [S] [pathfinder] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [indent] ""
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [this] INSTANCE
dbg: [script] [1] [S] [task] INSTANCE
dbg: [script] [1] [S] [minMoney] 0
dbg: [script] [1] [S] [this] INSTANCE

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

Re: ChooChoo, a train network AI

Post by Michiel » 04 Jun 2013 20:46

Thanks PM! I don't have the right version to open the save game, but as far as I can tell they're regular "couldn't find a route, couldn't build in this spot" exceptions. Anything unusual about the map?

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

Re: ChooChoo, a train network AI

Post by planetmaker » 04 Jun 2013 21:04

Pretty normal map, arctic, with a decent amount of water (30% or so), FISH, NUTS, av8, OpenGFX+Airports, OpenGFX+ Landscape.

A recent trunk version should open it for you; you probably also need the OpenGFX+ Landscape as found next to the savegame; the others are bananas versions.

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

Re: ChooChoo, a train network AI

Post by Michiel » 07 Jun 2013 19:00

OK, thanks!

User avatar
Darthrafael
Engineer
Engineer
Posts: 72
Joined: 03 Aug 2011 14:10
Location: Yes

Re: ChooChoo, a train network AI

Post by Darthrafael » 10 Jul 2013 11:28

If I run this AI with the NUTS, Useless tracks and NuTracks GRFs, the AI builds lifted tracks as rails, which cannot have any locomotives. Because of that reason, ChooChoo only builds roads and railroads, but can't use the railroads, because there aren't any available trains, could you fix this?
Hi~

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

Re: ChooChoo, a train network AI

Post by Michiel » 11 Jul 2013 22:48

Hoi Darth! Probably not, since I'm not really supporting all the crazy newgrfs out there ;) But I'll add it to the lists of things to maybe do :)

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

Re: ChooChoo, a train network AI

Post by planetmaker » 12 Jul 2013 06:29

Michiel wrote:Hoi Darth! Probably not, since I'm not really supporting all the crazy newgrfs out there ;) But I'll add it to the lists of things to maybe do :)
It surely makes sense in a general sense to only build tracks where you can buy in their depots also engines to run on them, no?
EDIT: I have the feeling that particularily in this area many merits are still to be won - and maybe doing so in a small train and track decision library might be a good idea which many can build on and profit from.

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

Re: ChooChoo, a train network AI

Post by Michiel » 14 Jul 2013 21:55

planetmaker wrote:It surely makes sense in a general sense to only build tracks where you can buy in their depots also engines to run on them, no?
EDIT: I have the feeling that particularily in this area many merits are still to be won - and maybe doing so in a small train and track decision library might be a good idea which many can build on and profit from.
Absolutely. I've just been lazy and said "set rail type to AIRailTypeList().Begin()" because in the vanilla game, that gives you the most recent rail type (normal, electric, monorail, maglev) as they become available.

Gladius
Engineer
Engineer
Posts: 3
Joined: 11 Aug 2013 22:44

Re: ChooChoo, a train network AI

Post by Gladius » 11 Aug 2013 22:46

Hi, I have a question. How to stop that goddamn AI ? Im typing stop_ai <company_x> in console and nothing happens. I tried every number from 1 to 15, nothing works. Wtf ?

User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2366
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: ChooChoo, a train network AI

Post by Lord Aro » 11 Aug 2013 23:00

it might be restarting. you'll need to go into AI/GS settings (on the main menu, iirc) and change the number to 0
otherwise, you can't count to 15, and you're missing some numbers out :p The stop_ai command isn't related to the AI, it's a builtin OTTD feature that insta-kills the AI
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

Gladius
Engineer
Engineer
Posts: 3
Joined: 11 Aug 2013 22:44

Re: ChooChoo, a train network AI

Post by Gladius » 12 Aug 2013 09:32

I did what you said but, it's like, every other AI got for example (company 2) next to their name, but ChooChoo got only ChooChoo and nothing else, making it impossible to delete from the game. It is in slot 2 when I open AI/GS debug but stop_ai <company_2> doesn't work.

I'm kinda a begginer at ottd and I started my game, but I got dissatisfied with this AI ( It has 450k value at year 1965 while I have 35kk ) So i wanted to just get rid of it and start another one, but I don't want to start over again.

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 » 12 Aug 2013 09:40

Gladius wrote:I did what you said but, it's like, every other AI got for example (company 2) next to their name, but ChooChoo got only ChooChoo and nothing else, making it impossible to delete from the game. It is in slot 2 when I open AI/GS debug but stop_ai <company_2> doesn't work.
It looks like you have misunderstood the company ID placeholder. If you want to stop company 2 you should use:

Code: Select all

stop_ai 2
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Gladius
Engineer
Engineer
Posts: 3
Joined: 11 Aug 2013 22:44

Re: ChooChoo, a train network AI

Post by Gladius » 12 Aug 2013 09:54

Yes, thank you : ) This will be useful later :P

And sorry for spamming topic with such a trivial question ; )

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

Re: ChooChoo, a train network AI

Post by Michiel » 13 Aug 2013 19:12

Gladius wrote:And sorry for spamming topic with such a trivial question ; )
No worries :P

idioty
Engineer
Engineer
Posts: 58
Joined: 21 Jun 2010 11:54

Re: ChooChoo, a train network AI

Post by idioty » 13 Jan 2014 12:56

I like this AI, but it is unusable with strong preferences:
High build cost, high running costs, minimum loan.
It has built a complex track, but ran out of money. Why build first monorail tracks when rails are available cheaper?
Two different AI is in the screenshot.
Attachments
Screen Shot 2014-01-13 at 9.12.59.png
1
(288.88 KiB) Downloaded 3 times
2
2
Screen Shot 2014-01-13 at 9.19.53.png (116.78 KiB) Viewed 3870 times
Sorry my bad english, I don't speak english!

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

Re: ChooChoo, a train network AI

Post by Michiel » 19 Jan 2014 09:53

If you open the AI settings page and increase "Number of single track cargo lines to start with", it may be able to survive on those game settings. ChooChoo's infrastructure is pretty expensive so it needs some funds to get off the ground. It'll still be really slow, though. It's not designed to make maximum money, just build stuff that looks nice.

The setting is in the main menu under AI/Game Script Settings. You can also change it in-game under Help, AI/Game Script Debug.

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest