Page 14 of 20

Re: ChooChoo, a train network AI

Posted: 22 Feb 2012 01:02
by Michiel
Noted, and thanks! I'll try and get a new version out before 1.2 is out of beta (but no promises).

Re: ChooChoo, a train network AI

Posted: 22 Feb 2012 11:35
by Alberth
The fix by soravux is correct, but there is a simpler way to get the result:

Code: Select all

function CompareRouteValue(a, b) {
   return a.payback - b.payback;
}
Michiel wrote:Noted, and thanks! I'll try and get a new version out before 1.2 is out of beta (but no promises).
You better climb in your time machine then, as 1.2.0-RC1 was released two days ago :)

Re: ChooChoo, a train network AI

Posted: 22 Feb 2012 23:54
by Michiel
Alberth wrote:
Michiel wrote:Noted, and thanks! I'll try and get a new version out before 1.2 is out of beta (but no promises).
You better climb in your time machine then, as 1.2.0-RC1 was released two days ago :)
LOL, well bugger :) Sorry folks, it's gonna be late!

Re: ChooChoo, a train network AI

Posted: 22 Feb 2012 23:58
by Michiel
Alberth wrote:The fix by soravux is correct, but there is a simpler way to get the result:

Code: Select all

function CompareRouteValue(a, b) {
   return a.payback - b.payback;
}
Lemme think... Is that also correct when a.payback - b.payback overflows? Not likely to happen here, I know, but in the general case. I think it is, but I have a nagging feeling I remember reading about having to do the less/greater than check to catch some edge case.

Re: ChooChoo, a train network AI

Posted: 23 Feb 2012 11:23
by Alberth
Good point, that may indeed cause trouble.

Re: ChooChoo, a train network AI

Posted: 24 Mar 2012 00:04
by DeletedUser17
Regardless of problems, looks very, very nice! And besides, what AI isn't riddled with hidden problems? This is really one of the best I've ever seen :D

Re: ChooChoo, a train network AI

Posted: 24 Mar 2012 11:26
by Michiel
billybobjoepants wrote:Regardless of problems, looks very, very nice! And besides, what AI isn't riddled with hidden problems? This is really one of the best I've ever seen :D
Thank you :D

Re: ChooChoo, a train network AI

Posted: 25 Mar 2012 22:27
by Michiel
Fixing bugs and taking names... Currently testing a new release, with several fixes:
- handle maps with no/few industries, and large maps with lots of industries
- fixed "Inconsistent compare function"
- "desync" multiple ChooChoo AIs by having them sleep for a short random time so they don't all try to build the same cargo routes
- fixed crash when there are no wagons available for a cargo type

At the moment I'm watching a test run where it seems to be quite happily wiring up the northern quadrant of a 1024x1024 map into a single sprawling rail network, so it's looking good, so far :)

Re: ChooChoo, a train network AI

Posted: 26 Mar 2012 21:15
by MAG101
are you working on fixing the limited features?

sorry my bad english :oops:

Limited load/save support (it'll "forget" the current work in progress). :cry:
No train replacement except autorenew, but it will switch to new rail types when it starts a new network. :cry:

Ideas :idea:

1. Full Save and Load that Choo Choo will conuting train line that saved than forgot the work in Progress

2. Switching new englines First Steam Train to Asiastar than Autorenewing the trains.

3. Remove unused Cargo lines and any parts of unused tracks and station and even remove full network if no trains running them, Infrastructure maintenance and Inflation + no train running = network money losing!

Re: ChooChoo, a train network AI

Posted: 28 Mar 2012 19:21
by Michiel
1. Full Save and Load that Choo Choo will conuting train line that saved than forgot the work in Progress
Probably not for a while. You'd have to save a LOT of state to remember "where you left off". However, it may be possible to either store, or detect, open ended crossings and resume expansion from those... Hmm, I'll keep it in mind!
Switching new englines First Steam Train to Asiastar than Autorenewing the trains.
Probably not, I tend to put off those boring "management" tasks and focus on the network building. It could perform much, much better if I did some more train management... but I just don't care enough :) The goal for ChooChoo isn't to be the most efficient competitor, but to build stuff that looks interesting, after all. But more efficiency does let you build more stuff...
Remove unused Cargo lines and any parts of unused tracks and station and even remove full network if no trains running them, Infrastructure maintenance and Inflation + no train running = network money losing!
I'll go with "maybe". Station maintenance is really cheap and unused rail is free, so it's easier to just let it rust... but I admit that there's an aesthetic reason for cleaning up unused stuff, so I might, at some point.

After the bug fixes, I've got some plans to let it try harder to find sites to build stations, so it can grow even bigger networks. Then, I want to look at running freight trains, as well.

Re: ChooChoo, a train network AI

Posted: 28 Mar 2012 19:59
by Michiel
Update uploaded to Bananas!

Re: ChooChoo, a train network AI

Posted: 28 Mar 2012 20:39
by Michiel
Woops, and already found the first new bug... messed up the cargo route selection. Currently (finally!) migrating to the new API version, so I'll upload a fixed one once things are working again.

Edit: new version is up.

Re: ChooChoo, a train network AI

Posted: 24 Apr 2012 16:16
by KaosKidd
Hello everyone.
Michiel, I wanted to say that your AI is awesome! I started and played a full game last night and found it fascinating to watch. With only one or twice did I find an depot with a train not attached to anything. I wasn't paying close enough attention to give you any details.

Anyway, my first post and it's about your AI. Great Job, please keep on working on it!

KaosKidd

Re: ChooChoo, a train network AI

Posted: 24 Apr 2012 19:59
by Michiel
Thanks :D I'll keep an eye out for what you saw, see if I can fix it.

Re: ChooChoo, a train network AI

Posted: 06 Aug 2012 13:56
by planetmaker
Mis-placed bug-report for choochoo: http://bugs.openttd.org/task/5265

Re: ChooChoo, a train network AI

Posted: 06 Aug 2012 23:23
by Michiel
Thanks - looks like that's the old version, that bug should be fixed already.

Re: ChooChoo, a train network AI

Posted: 21 Aug 2012 14:17
by gobbybobby
starting in 1900 using a couple of train packs that include some monorail with "underground/ metro" style trains

The AI is building monorail tracks, and losing money as these slow, and expensive to run trains are no good for the longer routes its building, (I am on largest map size, with just 50 citys as I like city's to be spread out) and just going out of business each time it starts up. I have another AI using trains, which is coping fine building normal steam trains, connecting industry. Maybe this AI should not jump to monorail just because it can!


Its now connected 2 city' and is just breaking even in terms of train income. (making about £2,000 per train per year, so going negative on property maintenance and lone interest.) Took it till 1922 to finally get a train to make profit, but its still gonna fail in 10 years if it keeps going how it is!

Re: ChooChoo, a train network AI

Posted: 21 Aug 2012 19:57
by Michiel
I understand the problem, but I'm not really able to support all kinds of newgrfs. ChooChoo just assumes that the most recent rail type is the best available, as it is in the normal game. It has no way to tell that in your game, monorail is actually metro track. It would need quite an elaborate mathematical model to be able to work out what the best train/track combination would be. It's definitely possible, but I'm pretty sure I'm not going to ;) Thanks for reporting it though, I do appreciate the feedback!

Re: ChooChoo, a train network AI

Posted: 16 Jan 2013 01:52
by mabono5
Hey! Great AI, one of my faves.

I do use several types of grf's to make that game more interesting, but ChooChoo does not seem to want to play any more. It starts to build a network, connects the station's, but immediately removes what it has built, leaving a train in a depot to rust.

It builds a Millenium Z1 Electric train then an error saying "no suitable wagon" is in the debug.

Any ideas?

Thanks
Steve

Re: ChooChoo, a train network AI

Posted: 16 Jan 2013 07:10
by Zuu
mabono5 wrote:Hey! Great AI, one of my faves.

I do use several types of grf's to make that game more interesting, but ChooChoo does not seem to want to play any more. It starts to build a network, connects the station's, but immediately removes what it has built, leaving a train in a depot to rust.

It builds a Millenium Z1 Electric train then an error saying "no suitable wagon" is in the debug.

Any ideas?

Thanks
Steve
You might want to provide a list of NewGRFs to make it easier to figure out what have gone wrong in your case. The engine name sounds like you play with the NUTS train set, but I don't know for sure.