Denver & Rio Grande train AI (A freight train 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

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 03 Sep 2009 19:17

Eliandor wrote:
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.
It looks like {22}, when removing a producer route, it removes one tile too many near the consumer station.
Yes, but I was pretty sure my fix was good. I haven't caught it in the act of not making those tiles or removing them, so I can't say where the bug is.

User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: Denver & Rio Grande train AI (A freight train AI)

Post by 1009 » 03 Sep 2009 19:25

Dustin wrote:
Eliandor wrote:
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.
It looks like {22}, when removing a producer route, it removes one tile too many near the consumer station.
Yes, but I was pretty sure my fix was good. I haven't caught it in the act of not making those tiles or removing them, so I can't say where the bug is.
Does the route include a tile on the station area too? That way it'll destroy it.

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 03 Sep 2009 19:47

Eliandor wrote: Does the route include a tile on the station area too? That way it'll destroy it.
It has too or the route would fall one short. When the route is done being built and stored in memory route.RemoveList(stationTiles) is run. I tested that and it worked in all my tests.

Passing lanes may be at fault. But I don't think that is what happened here. Bottom line, I have a lot of hypothesis, but nothing definite.

User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: Denver & Rio Grande train AI (A freight train AI)

Post by 1009 » 03 Sep 2009 19:52

Dustin wrote:
Eliandor wrote: Does the route include a tile on the station area too? That way it'll destroy it.
It has too or the route would fall one short. When the route is done being built and stored in memory route.RemoveList(stationTiles) is run. I tested that and it worked in all my tests.

Passing lanes may be at fault. But I don't think that is what happened here. Bottom line, I have a lot of hypothesis, but nothing definite.
Solution: equip the station with four crossings on every side. That's all it'll ever need, right? Want me to show you a sample or?

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 03 Sep 2009 23:04

Eliandor wrote:
Dustin wrote:
Eliandor wrote: Does the route include a tile on the station area too? That way it'll destroy it.
It has too or the route would fall one short. When the route is done being built and stored in memory route.RemoveList(stationTiles) is run. I tested that and it worked in all my tests.

Passing lanes may be at fault. But I don't think that is what happened here. Bottom line, I have a lot of hypothesis, but nothing definite.
Solution: equip the station with four crossings on every side. That's all it'll ever need, right? Want me to show you a sample or?
Yeah, and example would be nice. I am considering moving the depots away from the stations and making the stations back into RORO.

User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: Denver & Rio Grande train AI (A freight train AI)

Post by 1009 » 04 Sep 2009 05:42

Stations like these.
DandRG_station_suggestion.png
DandRG_station_suggestion.png (47.52 KiB) Viewed 4053 times
Roro would be cool, but I think you should consider placing depots at producer stations and leaving the consumers as they are now instead -- disadvantage of Roro is that it only has one entrance. Unless you'd make something like...
DandRG_roro_suggestion.png
DandRG_roro_suggestion.png (57.53 KiB) Viewed 4054 times

Brumi
President
President
Posts: 904
Joined: 18 Jul 2009 17:54

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Brumi » 04 Sep 2009 09:45

In another thread you mentioned that with super fiscal restraint D&RG tries to build a new route if it has 100% of the maximal loan available. Today I checked what happens if set set the maximal loan to 100k and start your AI with the maximal fiscal restraint. Building the HQ takes away a little amount of money, so that 100% is not available from the start. I was glad to see that even under these circumstances your AI tried to build something. Then I ran into another bug:

{031}
Here the AI thought that the consumer station already exists, but it had not been built because it didn't have enough money.
money issue.png
(129.65 KiB) Downloaded 72 times
There is another issue in the picture, the AI spends quite a lot on terraforming during pathfinding. With such a tight budget it will eventually go bankrupt.

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 05 Sep 2009 00:06

Brumi wrote:In another thread you mentioned that with super fiscal restraint D&RG tries to build a new route if it has 100% of the maximal loan available. Today I checked what happens if set set the maximal loan to 100k and start your AI with the maximal fiscal restraint. Building the HQ takes away a little amount of money, so that 100% is not available from the start. I was glad to see that even under these circumstances your AI tried to build something. Then I ran into another bug:

{031}
Here the AI thought that the consumer station already exists, but it had not been built because it didn't have enough money.
money issue.png
There is another issue in the picture, the AI spends quite a lot on terraforming during pathfinding. With such a tight budget it will eventually go bankrupt.
Interesting. It should probably stop thinking of unbuilt stations as existing.

Would you believe the "terraform and go bankrupt" is actually a feature/AI cheat? :lol: In a way it is because it will flatten some spots around some stations, go bankrupt and start over with the initial loan and some primo places to put stations. So subsequent AI's are less likely to go bankrupt.

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 17 Sep 2009 21:18

D4 seems pretty stable and I haven't gotten any new crash reports for a while. I was going to upload to Bananas today, but i get a very generic error when I try to upload from IE8.
BaNaNaS wrote:Unhandled Exception
An unhandled exception was thrown by the application.


User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 21 Sep 2009 21:17

SirkoZ wrote:Did you try with fireferret?
Nope, I didn't have time that day. I have 18 weeks of work assigned to me at work and 11 weeks to deliver. So I am a little busy these days.

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1501
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Denver & Rio Grande train AI (A freight train AI)

Post by SirkoZ » 23 Sep 2009 13:32

Oh my. Well - I was just saying because The Exploder is still totally incompatible with widely accepted standards (according to acid3 tests) hence my suggestion.

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 23 Sep 2009 20:27

SirkoZ wrote:Oh my. Well - I was just saying because The Exploder is still totally incompatible with widely accepted standards (according to acid3 tests) hence my suggestion.
The server should still probably tell me something other than "unhandled exeption". The form on that page is pretty basic, I doubt anything in IE is causing it to barf. Probably something wrong with my .Tar file (made with 7zip).

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Zuu » 23 Sep 2009 20:29

All tar-files I have made are made with 7zip.

As long as you include the directory and not just all the files it should be okay.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Brumi
President
President
Posts: 904
Joined: 18 Jul 2009 17:54

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Brumi » 26 Sep 2009 09:51

Hi Dustin,
Let me give you another bug report, the kink remover is in trouble on rough terrain:
kink remover failed.png
kink remover failed.png (104.62 KiB) Viewed 3354 times
Anyway, I'm looking forward to seeing your AI on Bananas. :)

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 29 Sep 2009 19:54

Brumi wrote:Hi Dustin,
Let me give you another bug report, the kink remover is in trouble on rough terrain:
kink remover failed.png
Anyway, I'm looking forward to seeing your AI on Bananas. :)
Nice.
Known issue. The dekinker only works on level tiles. I don't think I am going to get any work done on this AI until at least the new year. I will try again to get it on Bananas soon though.

Bananas worked today. I downloaded and started the AI. So V1 is shipped! Yay!

User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: Denver & Rio Grande train AI (A freight train AI)

Post by fanioz » 30 Sep 2009 02:51

Bananas worked today. I downloaded and started the AI. So V1 is shipped! Yay!
Well done dustin:D
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image

User avatar
Menno
Tycoon
Tycoon
Posts: 1190
Joined: 05 Feb 2005 14:35
Location: Netherlands, Utrecht

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Menno » 09 Oct 2009 20:36

I tried a game with Denver & Rio Grande v1 among other AI's.
It performed quite reasonable. However, many times the single-lane pieces clog up lines, causing trains turning around. It apparently tries to use the fastest engine available, however its crazy tracklaying makes it impossible for any train to achieve a speed higher than 120-150 km/h on any track. If you enhance the tracklaying its useful to buy the fasted engine, otherwise it might be smarter to buy the strongest or cheapest which can reach 150 km/h.
Difficulty settings were slightly easier than medium, startdate 1977, max initial loan 200,000 GBP.
See attached save game.
OpenTTD 0.7.3
NewGRFs: OpenGFX, better vehicles names, Av8 1.501 (I read it works well, probably better, with the North American set but as I had other AI's running I didn't want to risk problems because of strange newgrfs)

(I will post comparable posts in the other AI's topics)
Attachments
AI game.sav
(658.84 KiB) Downloaded 79 times
*hmz*

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Dustin » 09 Oct 2009 21:05

Menno wrote:I tried a game with Denver & Rio Grande v1 among other AI's.
It performed quite reasonable. However, many times the single-lane pieces clog up lines, causing trains turning around. It apparently tries to use the fastest engine available, however its crazy tracklaying makes it impossible for any train to achieve a speed higher than 120-150 km/h on any track. If you enhance the tracklaying its useful to buy the fasted engine, otherwise it might be smarter to buy the strongest or cheapest which can reach 150 km/h.
Difficulty settings were slightly easier than medium, startdate 1977, max initial loan 200,000 GBP.
See attached save game.
OpenTTD 0.7.3
NewGRFs: OpenGFX, better vehicles names, Av8 1.501 (I read it works well, probably better, with the North American set but as I had other AI's running I didn't want to risk problems because of strange newgrfs)

(I will post comparable posts in the other AI's topics)
This is a very good report. Thank you very much for the feedback.

Morloth
Transport Coordinator
Transport Coordinator
Posts: 378
Joined: 07 Feb 2008 14:06
Location: Glasgow

Re: Denver & Rio Grande train AI (A freight train AI)

Post by Morloth » 16 Mar 2010 02:54

Hi Dustin,

I was running a game with Denver & Rio Grande in it and I came across the following construction:
Unnamed, 13th Mar 1951.png
Station not connected
Hope you'll be able to fix it! :)

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 5 guests