ChooChoo, a train network AI
Moderator: OpenTTD Developers
Re: ChooChoo, a train network AI
I don't know :-/ I tried checking whether each tile of rail built was actually built, as far as the API could tell me. Might be an OpenTTD bug, but I'd sooner expect my own code
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: ChooChoo, a train network AI
I just run a test round. It seems that the AI indeed removes those tiles on his own. They have been built (I've seen it) - and later they were missing. Solving this issue would put your AI seemingly among the top performers of the AIs I have running concurrently. I guess the errors I got are only those which are already reported above (non-critical ones):
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
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: ChooChoo, a train network AI
But... give it some time (13 years) and it can come up with very nice constructions, those which I truely enjoy seeing built by an AI.
- Attachments
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
Cool
Interesting map, too. Glad to hear it's still doing well! Why do they keep releasing new games, preventing me from tinkering with it?
Interesting map, too. Glad to hear it's still doing well! Why do they keep releasing new games, preventing me from tinkering with it?
Re: ChooChoo, a train network AI
Fix for railway running away from front of station:
in file builder.nut
Old version:
New:
in file builder.nut
Old version:
Code: Select all
369 local station = AIStation.GetStationID(location);
370 foreach (index, entry in network.stations) {
Code: Select all
369 local station = AIStation.GetStationID(location);
370 if(AIVehicleList_Station(station).Count()>0)return; //diff
371 foreach (index, entry in network.stations) {
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: ChooChoo, a train network AI
Hello Michiel,
I was toying a bit around with 14 AI's enabled and I noticed something strange.
I have been playing with NuTracks and YARSS ever since they were made but choochoo has a problem with NuTracks.
When it builds its rail tracks it uses the track planning tracks instead of one of the other options.
Trains are not build and choochoo keeps on building track.
It is funny to see what choochoo is planning but I guess this is not the intention.
Other than that I like how choochoo rolls.
I was toying a bit around with 14 AI's enabled and I noticed something strange.
I have been playing with NuTracks and YARSS ever since they were made but choochoo has a problem with NuTracks.
When it builds its rail tracks it uses the track planning tracks instead of one of the other options.
Trains are not build and choochoo keeps on building track.
It is funny to see what choochoo is planning but I guess this is not the intention.
Other than that I like how choochoo rolls.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: ChooChoo, a train network AI
I took a look at http://noai.openttd.org/docs/1.0.0/classAIRail.html to see what chose criterias there is in the API. And just as what I guessed, the last features for eg. track speed are not added. That said, there is API functions to see what engines that can run on what track type. Still, the more track types came very late before 1.0. Perhaps make a suggestion for AIRail.GetSpeed(rail_type) and other functions depending on what the GRFSpec can do with rails.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: ChooChoo, a train network AI
You may want to have a looksie at r19591 before opening a flyspray task.Zuu wrote: I took a look at http://noai.openttd.org/docs/1.0.0/classAIRail.html to see what chose criterias there is in the API. And just as what I guessed, the last features for eg. track speed are not added. That said, there is API functions to see what engines that can run on what track type. Still, the more track types came very late before 1.0. Perhaps make a suggestion for AIRail.GetSpeed(rail_type) and other functions depending on what the GRFSpec can do with rails.
The Force works in mysterious ways ... (and fast )
Thank you Yexo.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.
Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Re: ChooChoo, a train network AI
This is ChooChoos train trying to run to Senington, But it cant because its not connected. I dont know what happened, really...
Re: ChooChoo, a train network AI
Thanks for the bug report - it's a known problem, which I still haven't fixed, unfortunately.
Re: ChooChoo, a train network AI
Another one, this time it removed its terminus station. But except for these bugs its a very good AI.
Re: ChooChoo, a train network AI
New version available! The long awaited bug fix, and some cosmetics:
- junctions now get a name in the form of a waypoint, which makes debug output indicating what it's doing much easier to read (I like how it looks, but this will become optional once I implement... options)
- better cleanup of dead track (try blocking a path being built)
Tarball is in the first post, but BaNaNas is giving me trouble. When I try to update it, I get "Unexpected error while uploading." If I make a new version instead, I get "A file with this name already exists". Hopefully tomorrow!
- junctions now get a name in the form of a waypoint, which makes debug output indicating what it's doing much easier to read (I like how it looks, but this will become optional once I implement... options)
- better cleanup of dead track (try blocking a path being built)
Tarball is in the first post, but BaNaNas is giving me trouble. When I try to update it, I get "Unexpected error while uploading." If I make a new version instead, I get "A file with this name already exists". Hopefully tomorrow!
Re: ChooChoo, a train network AI
And another update. Details in the first post - main improvements are settings (max bridge length, number of single line tracks to start with, whether to place waypoints at junctions) and better station placement at towns.
Re: ChooChoo, a train network AI
It's in BaNaNas! For future me: upload a ZIP file
Re: ChooChoo, a train network AI
Is it possible to do sth with giant CPU usage during searching for crossing? Maybe small Sleep(1) command may help.
It is irritating because after connecting everything possible cc starts to lag game.
It is irritating because after connecting everything possible cc starts to lag game.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: ChooChoo, a train network AI
something i've noticed:
on huge maps (2048x2048) with many thousands of towns, choochoo spends about a year and a half searching for its initial stations - perhaps stop it after 100 connections or something?
on huge maps (2048x2048) with many thousands of towns, choochoo spends about a year and a half searching for its initial stations - perhaps stop it after 100 connections or something?
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
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
Re: ChooChoo, a train network AI
It stops after first good connection, probably it have problems with estimating is it good connection for huge maps.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: ChooChoo, a train network AI
I'll see what I can do. It should already be much better; once it concludes the map is full it'll start sleeping for one day intervals.Kogut wrote:Is it possible to do sth with giant CPU usage during searching for crossing? Maybe small Sleep(1) command may help.
It is irritating because after connecting everything possible cc starts to lag game.
That's the only part of it that is affected by map size. I'm not sure how to handle this - it's important that it picks decent spots for its initial routes, or it may go bankrupt or grow very slowly. However, that currently involves looking at all the cities on the map and checking if they have a potentially interesting neighbour. I'll see if I can redesign this bit!Lord Aro wrote:something i've noticed:
on huge maps (2048x2048) with many thousands of towns, choochoo spends about a year and a half searching for its initial stations - perhaps stop it after 100 connections or something?
Re: ChooChoo, a train network AI
Update!
ChooChoo now starts with cargo trains instead of (single track) passenger lines, which should provide a more stable income when starting off, especially in the deserts with their tiny towns. Note that you can turn these off, but it'll need a larger starting loan to get going. This also fixes the slow startup: even on 2048x2048 maps, it'll start nearly instantly.
It now places a sign where it's currently working and what it's doing. This can be turned off in its settings (all settings can be changed during the game).
I've made the pathfinder multiplier a setting too, so you adjust the tradeoff between speed and optimality. This is tied to difficulty levels: on hard, it's really fast, but potentially really ugly. Give it a go
New tarball in the usual spot; BaNaNas coming up.
ChooChoo now starts with cargo trains instead of (single track) passenger lines, which should provide a more stable income when starting off, especially in the deserts with their tiny towns. Note that you can turn these off, but it'll need a larger starting loan to get going. This also fixes the slow startup: even on 2048x2048 maps, it'll start nearly instantly.
It now places a sign where it's currently working and what it's doing. This can be turned off in its settings (all settings can be changed during the game).
I've made the pathfinder multiplier a setting too, so you adjust the tradeoff between speed and optimality. This is tied to difficulty levels: on hard, it's really fast, but potentially really ugly. Give it a go
New tarball in the usual spot; BaNaNas coming up.
Re: ChooChoo, a train network AI
It should really have a lake detector... the pathfinder is still slow when it tries to find a route across or around a large body of water. Never mind, just thinking out loud It's fun giving it infinite money and watching it spew forth all over the map
Who is online
Users browsing this forum: No registered users and 4 guests