ChooChoo, a train network AI
Moderator: OpenTTD Developers
Re: ChooChoo, a train network AI
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
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;
}
You better climb in your time machine then, as 1.2.0-RC1 was released two days agoMichiel wrote: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
LOL, well bugger Sorry folks, it's gonna be late!Alberth wrote:You better climb in your time machine then, as 1.2.0-RC1 was released two days agoMichiel wrote: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
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.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; }
Re: ChooChoo, a train network AI
Good point, that may indeed cause trouble.
-
- Engineer
- Posts: 47
- Joined: 15 Mar 2012 23:48
Re: ChooChoo, a train network AI
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
Re: ChooChoo, a train network AI
Thank youbillybobjoepants 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
Re: ChooChoo, a train network AI
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
- 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
- Attachments
-
- big-network.png (66.79 KiB) Viewed 9459 times
Re: ChooChoo, a train network AI
are you working on fixing the limited features?
sorry my bad english
Limited load/save support (it'll "forget" the current work in progress).
No train replacement except autorenew, but it will switch to new rail types when it starts a new network.
Ideas
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!
sorry my bad english
Limited load/save support (it'll "forget" the current work in progress).
No train replacement except autorenew, but it will switch to new rail types when it starts a new network.
Ideas
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
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!1. Full Save and Load that Choo Choo will conuting train line that saved than forgot the work in Progress
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...Switching new englines First Steam Train to Asiastar than Autorenewing the trains.
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.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!
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
Update uploaded to Bananas!
Re: ChooChoo, a train network AI
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.
Edit: new version is up.
Re: ChooChoo, a train network AI
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
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
Thanks,
KaosKidd
I hope this helps. I can always tell the time but I can't always make a clock.
KaosKidd
I hope this helps. I can always tell the time but I can't always make a clock.
Re: ChooChoo, a train network AI
Thanks I'll keep an eye out for what you saw, see if I can fix it.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: ChooChoo, a train network AI
Mis-placed bug-report for choochoo: http://bugs.openttd.org/task/5265
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Re: ChooChoo, a train network AI
Thanks - looks like that's the old version, that bug should be fixed already.
-
- Engineer
- Posts: 7
- Joined: 20 Mar 2012 22:33
Re: ChooChoo, a train network AI
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!
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
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
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
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
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.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
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Who is online
Users browsing this forum: No registered users and 37 guests