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 »

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 »

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 »

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 »

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 »

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 »

Stations like these.
DandRG_station_suggestion.png
DandRG_station_suggestion.png (47.52 KiB) Viewed 6845 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 6846 times
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

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

Post by Brumi »

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
money issue.png (129.65 KiB) Viewed 827 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 »

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 »

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 »

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: 1518
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 »

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 »

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 »

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: 920
Joined: 18 Jul 2009 17:54

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

Post by Brumi »

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 6146 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 »

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: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

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

Post by fanioz »

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 »

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 162 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 »

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 »

Hi Dustin,

I was running a game with Denver & Rio Grande in it and I came across the following construction:
Station not connected
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 48 guests