I see he updated the file this one works.Lord Aro wrote:works fine for me
Denver & Rio Grande train AI (A freight train AI)
Moderator: OpenTTD Developers
Re: Denver & Rio Grande train AI (A freight train AI)
Re: Denver & Rio Grande train AI (A freight train AI)
{028}
Another occurence of the terraforming problem, this time the AI drove itself into bankruptcy, that 1 train didn't have a consumer station... {030}
This one is quite a common problem when multiple instances of your AI are started. The red company's one train had a similar problem, the consumer station did not exist.
Another occurence of the terraforming problem, this time the AI drove itself into bankruptcy, that 1 train didn't have a consumer station... {030}
This one is quite a common problem when multiple instances of your AI are started. The red company's one train had a similar problem, the consumer station did not exist.
Re: Denver & Rio Grande train AI (A freight train AI)
It only works in 0.7.2 for sure. Care to post a screenshot and some details? What map, setting, newgrfs, etc.wozzar wrote:Does this work in 0.72 because it wasn't building anything. It kept saying path was blocked.
Re: Denver & Rio Grande train AI (A freight train AI)
I've been digging into the Unkinker-code a bit, trying to see how I could recreate the weird ant crawling path that doesn't get unkinked.
It unkinks once for every route, right? And doesn't only do Ant, but the whole path, as far as I understand. It quits when FixPath() has failed more than 10 times (broke infite loop in fixpath) -- FixPath ONLY fails if TilesAreSameLevelAndFlat( tile, path2.Begin() ) returns true. That sounds a little weird to me, shouldn't it fail if they are NOT the same level and flat?
Anyway, to recreate, we should let that function return true 10 times. I'm trying to get it to do that now x__x;;'
EDT *screams* I was right XD gosh, this has puzzled me for some time. OK, I have a scenario where it displays this behaviour three times (:P, sorry) at the first route. Takes some time to PF though, so take a cup-a-coffee meanwhile.
It unkinks once for every route, right? And doesn't only do Ant, but the whole path, as far as I understand. It quits when FixPath() has failed more than 10 times (broke infite loop in fixpath) -- FixPath ONLY fails if TilesAreSameLevelAndFlat( tile, path2.Begin() ) returns true. That sounds a little weird to me, shouldn't it fail if they are NOT the same level and flat?
Anyway, to recreate, we should let that function return true 10 times. I'm trying to get it to do that now x__x;;'
EDT *screams* I was right XD gosh, this has puzzled me for some time. OK, I have a scenario where it displays this behaviour three times (:P, sorry) at the first route. Takes some time to PF though, so take a cup-a-coffee meanwhile.
Re: Denver & Rio Grande train AI (A freight train AI)
You can check path before building.{015} Let AI pathfind when there isn't enough money
- Good idea. Probably work on it later. However, the map changes over time, so the routes would have a higher failure rate.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: Denver & Rio Grande train AI (A freight train AI)
I like this AI, but it has some problems. Even when the minimum route lenght is set to short, it still prefers 200 to 400 tile long routes. Usually it won't have money to completely doubletrack the route, so it ends up with a huge stretch of single track. In that situation, its wasting money on a 3rd train when it will end up just being unprofitable, or very near to unprofitable which it ends up selling anyways. Is it possible for the AI to check the average time that a train waits at a signal? It could always complete the doubletracking after it has more money. This seems to be my experience in tropical climate, with NARS, and Pikka's Basic Industries & a grf that increases all the building costs with a max loan of £500,000. Many times, a DRG ai won't get off the ground cause it decides it wants this 500 tile route, which it cannot afford, and it has no trains. So it keeps waiting for more money that won't appear according to the debug log. Also, the AI does not seem to recognize a situation where 90 degree turns are forbidden which is a major downer.
Good thing I noticed is that it has a very keen eye for profitable routes, and when it does succeed in building one its train profits are usually 2 or 3 times as much as its competitors(AdmiralAI).
Good thing I noticed is that it has a very keen eye for profitable routes, and when it does succeed in building one its train profits are usually 2 or 3 times as much as its competitors(AdmiralAI).
Re: Denver & Rio Grande train AI (A freight train AI)
its not supposed to build it completely double tracked
they're called passing tracks - the old ai did it
they're called passing tracks - the old ai did it
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: Denver & Rio Grande train AI (A freight train AI)
Passing loops actually. And anyways, my point was it usually has at least over 50 to 100 squares of single track at places just cause it couldn't build the passing loops the first time. I just tested by giving the AI tens of millions of pounds, and it preferred not to have that much single track.Lord Aro wrote:its not supposed to build it completely double tracked
they're called passing tracks - the old ai did it
Re: Denver & Rio Grande train AI (A freight train AI)
meh
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: Denver & Rio Grande train AI (A freight train AI)
Dude, you are one hell of a software testerEliandor wrote: EDT *screams* I was right XD gosh, this has puzzled me for some time. OK, I have a scenario where it displays this behaviour three times (:P, sorry) at the first route. Takes some time to PF though, so take a cup-a-coffee meanwhile.
Re: Denver & Rio Grande train AI (A freight train AI)
XD thanks. If you add in an options that a. shows PF with signals and B. enables/disables the first three lines I can also extensively bug test yours. If you want me to .Michiel wrote:Dude, you are one hell of a software tester
Re: Denver & Rio Grande train AI (A freight train AI)
Cool I'm just using the library pathfinder though, but it can use some debugging aids in the form of signs showing what it's doing, that's for sure.
Dustin, sorry for hijacking your thread
Dustin, sorry for hijacking your thread
Re: Denver & Rio Grande train AI (A freight train AI)
I love that obstacle course! I can't wait to get time to try it out. So it sounds like you had a code fix for the unkinker. Did you test it?Eliandor wrote:I've been digging into the Unkinker-code a bit, trying to see how I could recreate the weird ant crawling path that doesn't get unkinked.
It unkinks once for every route, right? And doesn't only do Ant, but the whole path, as far as I understand. It quits when FixPath() has failed more than 10 times (broke infite loop in fixpath) -- FixPath ONLY fails if TilesAreSameLevelAndFlat( tile, path2.Begin() ) returns true. That sounds a little weird to me, shouldn't it fail if they are NOT the same level and flat?
Anyway, to recreate, we should let that function return true 10 times. I'm trying to get it to do that now x__x;;'
EDT *screams* I was right XD gosh, this has puzzled me for some time. OK, I have a scenario where it displays this behaviour three times (:P, sorry) at the first route. Takes some time to PF though, so take a cup-a-coffee meanwhile.
Re: Denver & Rio Grande train AI (A freight train AI)
NARS is supported.Vemarkis wrote:I like this AI, but it has some problems. Even when the minimum route lenght is set to short, it still prefers 200 to 400 tile long routes. Usually it won't have money to completely doubletrack the route, so it ends up with a huge stretch of single track. In that situation, its wasting money on a 3rd train when it will end up just being unprofitable, or very near to unprofitable which it ends up selling anyways. Is it possible for the AI to check the average time that a train waits at a signal? It could always complete the doubletracking after it has more money. This seems to be my experience in tropical climate, with NARS, and Pikka's Basic Industries & a grf that increases all the building costs with a max loan of £500,000. Many times, a DRG ai won't get off the ground cause it decides it wants this 500 tile route, which it cannot afford, and it has no trains. So it keeps waiting for more money that won't appear according to the debug log. Also, the AI does not seem to recognize a situation where 90 degree turns are forbidden which is a major downer.
Good thing I noticed is that it has a very keen eye for profitable routes, and when it does succeed in building one its train profits are usually 2 or 3 times as much as its competitors(AdmiralAI).
Pikka's Basic Industries is not currently supported. Sounds like it works OK though.
a grf that increases all the building costs with a max loan of £500,000 is not supported and not likely to be. Be sure to turn up "fiscal restraint" all the way that might help a little.
"No 90 degree turns" is not supported, and probably never will be.
Yeah, the minimum is just that. Here is how it works in some detail.
Code: Select all
* PRODUCER LOOP
* Pick an unused producer from the top 5.
* Check if a station will fit without terraforming, otherise go back to start.
* CONSUMER LOOP
* Find the (next) closest consumer that is at least min-distance away. (If out of consumers, go to start)
* Check if a station will fit. Otherwise go back to the top of CONSUMER LOOP.
* Try to find a path. If that fails, go back to the top of CONSUMER LOOP.
* Estimate the cost of the path, if to high, go back to the top of CONSUMER LOOP.
* Build the path and the trains.
Is it possible for the AI to check the average time that a train waits at a signal?
Not without having to check a lot.
It could always complete the doubletracking after it has more money.
In theory yes, but once trains are rolling, it's hard. It would have to recall all the trains. Wait for them to depot. Lay the passing lane. Start the trains back up. All the while it would either have to put pathfinding for new routes on hold, or have a more complex state machine to juggle more things at once. If the first route is profitable, then the second route can have passing lanes. The first route is really just to get off the ground.
Many times, a DRG ai won't get off the ground cause it decides it wants this 500 tile route, which it cannot afford, and it has no trains.
That's a bug. It shouldn't try to build a route it doesn't have enough money for. The route estimation function might need to be tweaked upwards. It should be possible for it to not find any worthwile routes, then terraform itself into bankruptcy. But if you don't see a message about lifting restrictions, it shouldn't go bankrupt.
The only thing in here I am likely to fix soon is to make fiscal restraint have more effect on routes being considered.
[edit] Maybe I should add a mission statement to the main post so it's clear what the AI is likely to support in the future.
Last edited by Dustin on 03 Sep 2009 00:57, edited 1 time in total.
Re: Denver & Rio Grande train AI (A freight train AI)
True, but what do you do when they fail? I am just saying caching routes isn't super helpful. And the AI currently doesn't have the ability to pathfind the end of a half done, but errored route. Maybe in a later version.Kogut wrote:You can check path before building.{015} Let AI pathfind when there isn't enough money
- Good idea. Probably work on it later. However, the map changes over time, so the routes would have a higher failure rate.
Re: Denver & Rio Grande train AI (A freight train AI)
Didn't test it yet, will soon. The code /looked/ to me as if it unkinks a maximum of 10 tiles -- I'll try it in an hour.Dustin wrote:I love that obstacle course! I can't wait to get time to try it out. So it sounds like you had a code fix for the unkinker. Did you test it?
Edit: tested, no fix. must be something else.
Re: Denver & Rio Grande train AI (A freight train AI)
fail - nothing wrong, you can start a new one (as so far)Dustin wrote:True, but what do you do when they fail? I am just saying caching routes isn't super helpful. And the AI currently doesn't have the ability to pathfind the end of a half done, but errored route. Maybe in a later version.Kogut wrote:You can check path before building.{015} Let AI pathfind when there isn't enough money
- Good idea. Probably work on it later. However, the map changes over time, so the routes would have a higher failure rate.
OK - very good, you find route (so far: you start pathfinder)
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
AIAI - AI for OpenTTD
Re: Denver & Rio Grande train AI (A freight train AI)
One bug I noticed today while running multiple DRG Ai's, sometimes one DRG AI will try to connect their line to the network of an another DRG AI. Usually this happens when it decides it has found a consumer at the same place as another DRG Ai. It will complete the tracks all the way to the another AI's station, it even finds a proper place at the junction to connect at, and then sell the route when it finds out it cannot buy trains for that route(sadly, stupid me I forgot to take a screenshot of the debug log, but thats what it said at the moment). However, this bug seems to be a rather rare instance, and quite usually they just place their stations next to each other.
[edit]here is a save where it has happened, see Blue player's station "Consumer 17". Included a list of grf's with the screenshot of the place. This time, the ai trying to connect to the other AI's station even built trains..
[edit]here is a save where it has happened, see Blue player's station "Consumer 17". Included a list of grf's with the screenshot of the place. This time, the ai trying to connect to the other AI's station even built trains..
- Attachments
-
- InterDest Transport, 21-12-1925.sav
- (1.04 MiB) Downloaded 180 times
-
- InterDest Transport, 22-12-1925.png
- (289.61 KiB) Downloaded 27 times
Re: Denver & Rio Grande train AI (A freight train AI)
Good bug. DR&G will consider a consumer station to "exist" if it could have built one there at the start of pathfinding. So there is a race condition here. Whichever player gets to the flat spot first wins. The loser needs to figure out that it lost and do something about it.Vemarkis wrote:One bug I noticed today while running multiple DRG Ai's, sometimes one DRG AI will try to connect their line to the network of an another DRG AI. Usually this happens when it decides it has found a consumer at the same place as another DRG Ai. It will complete the tracks all the way to the another AI's station, it even finds a proper place at the junction to connect at, and then sell the route when it finds out it cannot buy trains for that route(sadly, stupid me I forgot to take a screenshot of the debug log, but thats what it said at the moment). However, this bug seems to be a rather rare instance, and quite usually they just place their stations next to each other.
[edit]here is a save where it has happened, see Blue player's station "Consumer 17". Included a list of grf's with the screenshot of the place. This time, the ai trying to connect to the other AI's station even built trains..
Your screenshot also shows 17 consumer didn't hook up it's depot with track. That happens from time to time and I have no idea what causes it.
Re: Denver & Rio Grande train AI (A freight train AI)
It looks like {22}, when removing a producer route, it removes one tile too many near the consumer station.Dustin wrote:Your screenshot also shows 17 consumer didn't hook up it's depot with track. That happens from time to time and I have no idea what causes it.
Who is online
Users browsing this forum: Baidu [Spider] and 34 guests