Presenting the Denver and Rio Grande train AI. It's named for the railroad my grandfather worked on. That's him as the president.

Mission The goal of D&RG is to be a train focused AI that's a reasonable replacement for the "old AI" and a showcase and testbed for completely custom pathfinding. It should be profitable, robust and interesting in the default game and with popular NewGrfs.

Completely custom pathfinder that is much faster than the default rail pathfinder.

Minimal terraforming.

Mostly Non-network style connections (sort of like the Old AI).

Pathfinder uses 3 sub-pathfinders.

Main pathfinder is "as the crow flies" CrowPathFinder that heads directly for the goal (watching slopes to ensure tracks can be built). This is the key to speed since most of the time this is all you need.

Bridge and Ant pathfinders are secondary. Bridge just tries to bridge gaps the crow detects. If bridge fails the ant (slow and similar to A*) wanders around trying to find a path.

Poor to decent code. I was more interested in making it work than making the code very good.

There are settings for a "verbose" mode so you can see the pathfinder in real time.

2cc compatible, but don't expect it to turn a profit on rough or hilly maps with default costs. The engines in that set are really expensive. Turn up fininacial restraint to high for best results.

Got an error pretty fast: Index Depot doesn't exist (main.nut, line 150). Changing line 331 to return null instead of false fixed it. Other than that I haven't really done much testing. It doesn't seem to work without NARS, as it build an engine without any wagons.

Got an error pretty fast: Index Depot doesn't exist (main.nut, line 150). Changing line 331 to return null instead of false fixed it. Other than that I haven't really done much testing. It doesn't seem to work without NARS, as it build an engine without any wagons.

Thanks for the report. I will look into it. I don't see how you could test it much more in the 30 minutes since I uploaded it.

By the way: Super awesome good job on the API! It's really nice. I have worked with a lot of "real" api's and I wish they were all as nice as this one.

Got an error pretty fast: Index Depot doesn't exist (main.nut, line 150). Changing line 331 to return null instead of false fixed it. Other than that I haven't really done much testing. It doesn't seem to work without NARS, as it build an engine without any wagons.

Fixed and Fixed in A3. You were right about needing Null there. Good eye. Also, I wasn't filtering the wagons enough, I think I was trying to build maglev wagons on regular tracks. I also had a problem with the engine since the default wagons don't list a top speed.

I don't know if there is a recommended way. But I have 7Zip installed with the hooks for the right-click menu enabled. So I just right click on my AI's folder and go into the 7Zip menu and select "add to archive ..." and then in the dialog I select tar-archive if it is not what I last used.

There are certainly many other ways out there. Good to know is that 7Zip is an open source software and that it is hosted at sf.net. A quick google should get you to their homepage.

I don't know if there is a recommended way. But I have 7Zip installed with the hooks for the right-click menu enabled. So I just right click on my AI's folder and go into the 7Zip menu and select "add to archive ..." and then in the dialog I select tar-archive if it is not what I last used.

There are certainly many other ways out there. Good to know is that 7Zip is an open source software and that it is hosted at sf.net. A quick google should get you to their homepage.

Ironically, I had used 7Zip to make the zip file. I saw another post that said some tars don't work correctly, so I wasn't sure if 7zip would work. Thanks! Upload a .tar file.

I think the most common error with tars would be that people make a tar of the contents of their AI directory without including the folder itself. OpenTTD requires that the folder is included in the tar, and not just having all the files directly in the tar.

I think the most common error with tars would be that people make a tar of the contents of their AI directory without including the folder itself. OpenTTD requires that the folder is included in the tar, and not just having all the files directly in the tar.

Whoops. I think I fixed mine. But I am having a lot of problems uploading files to the board.

I think it should have min_value = 0, or you could change it to a boolean so it has a toggle button.

Zuu wrote:

I would also suggest that debug signs are off by default, as most users would probably want to have them turned off.

You are both correct. I did that to get the settings to take effect so I could see the debug signs. For some reason I can see and set the settings, but the ones I pick aren't used. Whatever is defined in the Info.nut is what is used. Any hints on how to fix my settings would be appreciated. I'll look into how to make it a bool.

A6 has these changes. It's also got two days worth of improvements. It doesn't spew quite so many signs and keeps them cleaned up now anyway.

)@)&$)(@$*@n. I am having terrible troubles uploading new versions to the board. One verion of A6 is bad, but I thought I had uploaded the fix. I will try to edit the main post again. In the mean time, here is A7.

Why kind of troubles exactly are you experiencing when uploading these little files to the Forum? Why do you think it comes to this? I'm really curious now that you've metioned it at least two times.

Mostly I have problems when I edit the first post.

Well, when I try to upload any file to it, I often get a message from IE that the connection to the server was broken. When I do manage to upload, I don't always see the list of previous files I uploaded. At least once I thought the upload worked and older version of the file was there.

It takes me 4 or 5 tries to upload anything. If I don't turn on compatibility mode, the edit window scrolls back to the top after each character I type. Each character takes half a second to show up and the whole edit window seems to jitter as I type.

The board probably works in IE7 and Firefox. But it's not too happy with IE8 I guess. I don't want to get another browser just to post. So I am sad.

WOW! This is a huge improvement. It just barely turns a profit, but it can stay alive for 20+ years, unike the last version. It builds really fast, and I like the simple RoRo stations.

I noted though that the pathfinder is perhaps a bit to eager to build bridges, as you can see in the attached screenshot.

Still, keep up the good work

Thanks, glad you like it. Until A7 most of the work was in the pathfinder. It had plenty of bugs to squash there I can tell you. A7 introduced an actual station manager and the ro-ro stations. They are designed to allow hookups to any front or back tile and still work.

Barely turns a profit? What settings are you running under? In my tests it's steadily profitable. It's nothing compared to an Airport loving AI, but not bad for trains.

I personally really like those bridges. Why go around a town (hard and slow for my pathfinder) when you can just hop over? It will sometimes build a useless bridge near a station if the last 20 or so tiles are along an axis.

I have improved the town aviodance in this version a lot. I use a square around each city center that the pathfinder won't enter. Keeps it from getting hung up in an inside corner of a town. The ant can't cope well with concave obstacles, so I just tell it the towns are are squareish.

I still have a route-killing bug in the ant somewhere that's devilishly hard to reproduce. It submits disjointed routes that invoke the bridge logic incorrectly and things go downhill from there.

Once I squash a few more bugs I want to improve the routes to two way track so I can build more trains for good producers. Or at least add passing lanes like from the original games AI.

Later, if I can get user option settings working, I may add bus service. However the bus service would be designed to lose money while making sure all the small towns are being grown.

I would also suggest that debug signs are off by default, as most users would probably want to have them turned off.

I did that to get the settings to take effect so I could see the debug signs. For some reason I can see and set the settings, but the ones I pick aren't used. Whatever is defined in the Info.nut is what is used. Any hints on how to fix my settings would be appreciated.

Your settings are working well, where used. When turning off 'display_thinking' no more path signs '{.}' appears, but for the main signs (while searching good locations for stations) you aren't using these settings.Maybe if you use some internal list to copy these signs (while placing it) and check this list instead of the real signs you could make the same job without showing signs.

I was playing a bit more with DustinAI (v7) and I have some questions for you.

While removing signals, problematic points aren't removed. I don't know if it's a bug or a feature. If it's a bug, you can changechange line 535 in main.nut from

When a new route fails, the cost of building the producing station could be done later, and so some more money could be available for another route (lines 414 and 464 in main.nut), if you are checking the internal list mentioned before (instead of the real signs).

A bug building a new station (in the point of view, ignore the new route pathfinding):

And finally, a curious joke: I tried 2 DustinAI, and they are both trying the same routes at the same time, resulting in mixed lines (some tiles with tracks from Dustin1 and another with tracks from Dustin2).

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum