Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sun Dec 16, 2018 12:20 am

All times are UTC




Post new topic  Reply to topic  [ 260 posts ]  Go to page 1 2 3 4 513 Next
Author Message
PostPosted: Sat Jul 11, 2009 10:35 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Update Release V1 on Bananas

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.

Bugs Post


Features
  • North America themed. Prefers the NARS train set. (But supports default and 2cc).
  • Two way tracks.
  • Train management.
  • Remove stations for closed industries.
  • BSD License
  • 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.
  • Reuse of consumer stations for mini networks.
  • Untested with non-default industry grfs.
  • Lots of user tweakable settings.


Non-features (I.E. Don't ask please, they aren't planned anytime soon.)
  • "no 90 degree turns".
  • industry newgrfs.
  • dealing with newgrfs that are financially challenging. Low loans, increased building costs, ect.
  • non-trains. (Though some limited bus capability might be forthcoming).
  • Support for versions other than the current stable release. (0.7.2 at this time)

Please check it out. If it crashes, please let me know.

Save games or custom scenarios where bugs show up early (and after issueing a "restart" command) are VERY helpful.

Thanks to the AI API developers! It's really good.
Thanks to the other AI authors for help, examples, inspiration and encouragement.
Thanks to Brumi, Eliandor and Sirkoz for lots of bug reports.


Attachments:
DustinAI_PBS_Station.png
DustinAI_PBS_Station.png [ 20.44 KiB | Viewed 15736 times ]

_________________
Denver & Rio Grande Railroad AI


Last edited by Dustin on Fri Oct 02, 2009 7:18 pm, edited 38 times in total.
Top
   
PostPosted: Sat Jul 11, 2009 10:52 pm 
Offline
Tycoon
Tycoon

Joined: Thu Dec 20, 2007 12:49 pm
Posts: 3653
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.


Top
   
PostPosted: Sat Jul 11, 2009 11:27 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Yexo wrote:
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.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Sun Jul 12, 2009 5:07 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Fri Dec 19, 2008 5:03 am
Posts: 313
Location: Indonesia
Dustin wrote:
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. :)

Thats why his name is Yexo. (he even hack my hundreds line of code into just below ten :D )
your pathfinder concept seems interesting. I'll try it at home.

_________________
Correct me If I am wrong - PM me if my English was bad :D

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


Top
   
PostPosted: Sun Jul 12, 2009 5:26 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Yexo wrote:
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.

The AI should work with no grfs now.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Tue Jul 14, 2009 12:32 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Is there a recomended way to create a .TAR (on windows) instead of the .Zip to make it easier to use?

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Tue Jul 14, 2009 2:32 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
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.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Tue Jul 14, 2009 3:15 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Zuu wrote:
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.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Tue Jul 14, 2009 3:42 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
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.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Tue Jul 14, 2009 4:09 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Zuu wrote:
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.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Wed Jul 15, 2009 4:51 pm 
Offline
Director
Director
User avatar

Joined: Tue Jan 22, 2008 4:33 pm
Posts: 565
Hey interesting AI Dustin. Its quite fun to watch it do its thing.

I noticed a couple of small issues. First the TAR doesn't have a directory in it so it makes it harder to install. Second the "display signs" setting cant be turned off. In info.nut it says....

Code:
AddSetting({name = "display_thinking", description = "Display signs showing what the pathfinder is thinking", easy_value = 1, medium_value = 1, hard_value = 1, custom_value = 1, flags = 0, min_value = 1, max_value = 1});


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

_________________
PathZilla - A networking AI - Now with tram support.


Top
   
PostPosted: Thu Jul 16, 2009 12:14 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
I would also suggest that debug signs are off by default, as most users would probably want to have them turned off.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Thu Jul 16, 2009 1:23 am 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Zutty wrote:
Hey interesting AI Dustin. Its quite fun to watch it do its thing.

Thanks! Glad to see someone is trying it. I tried it with PathZilla. My bridge building needs more work before they get along as well as I would like.

Zutty wrote:

I noticed a couple of small issues. First the TAR doesn't have a directory in it so it makes it harder to install. Second the "display signs" setting cant be turned off. In info.nut it says....

Code:
AddSetting({name = "display_thinking", 
description = "Display signs showing what the pathfinder is thinking",
easy_value = 1, medium_value = 1, hard_value = 1, custom_value = 1, flags = 0, min_value = 1, max_value = 1});


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.

I will upload A6 now.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Thu Jul 16, 2009 10:20 am 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 08, 2009 8:06 pm
Posts: 33
Location: Spain
Dustin wrote:
I will upload A6 now.

DustinAI v6 don't build any route :(
BuildRoute() (main.nut line 200) returns false while trying only one route.


Top
   
PostPosted: Thu Jul 16, 2009 3:50 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Abenhor wrote:
Dustin wrote:
I will upload A6 now.

DustinAI v6 don't build any route :(
BuildRoute() (main.nut line 200) returns false while trying only one route.



)@)&$)(@$*@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.


Attachments:
DustinAI.A7.tar [69.5 KiB]
Downloaded 423 times

_________________
Denver & Rio Grande Railroad AI
Top
   
PostPosted: Thu Jul 16, 2009 4:21 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1494
Location: The sunny side of Alps
Dustin wrote:
I am having terrible troubles uploading new versions to the board....

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. :-)

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
PostPosted: Thu Jul 16, 2009 4:56 pm 
Offline
Director
Director
User avatar

Joined: Tue Jan 22, 2008 4:33 pm
Posts: 565
WOW! :shock: 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 :)


Attachments:
Unnamed, 24th Jan 1950.png [199.75 KiB]
Downloaded 136 times

_________________
PathZilla - A networking AI - Now with tram support.
Top
   
PostPosted: Thu Jul 16, 2009 6:03 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
SirkoZ wrote:
Dustin wrote:
I am having terrible troubles uploading new versions to the board....

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.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Thu Jul 16, 2009 7:23 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Wed Dec 07, 2005 7:22 pm
Posts: 272
Zutty wrote:
WOW! :shock: 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? :P 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.

_________________
Denver & Rio Grande Railroad AI


Top
   
PostPosted: Thu Jul 16, 2009 11:00 pm 
Offline
Engineer
Engineer
User avatar

Joined: Wed Jul 08, 2009 8:06 pm
Posts: 33
Location: Spain
Dustin wrote:
Zuu wrote:
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 change
change line 535 in main.nut from
Code:
 if(name == "{.}" || name == "{-}" ||name == "{A}" || name == "{B}" || name == "{+}" || name == "{=}")

to
Code:
 if(name == "{.}" || name == "{-}" ||name == "{A}" || name == "{B}" || name == "{+}" || name == "{=}" || name == "{*}")


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):
Attachment:
File comment: Bug building a station
DustinAI_0.png [232.6 KiB]
Downloaded 87 times


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). :lol:

Attachment:
File comment: 2 DustinAI Minimap
DustinAI_1.png [93.96 KiB]
Downloaded 104 times

Attachment:
File comment: 2 DustinAI Station list
DustinAI_2.png [265.79 KiB]
Downloaded 106 times


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 260 posts ]  Go to page 1 2 3 4 513 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.