Transport Tycoon Forums

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

All times are UTC




Post new topic  Reply to topic  [ 68 posts ]  Go to page 1 2 3 4 Next
Author Message
 Post subject: Terron AI
PostPosted: Sat May 21, 2011 1:01 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
Hi guys,

I am glad to present my AI - Terron.

The goal was to make this AI as a strong, stable and earning player as I could.
The AI can use buses, trucks, planes, ships and has more or less flexible settings to adjust it to your needs.
I hope you will enjoy playing with it.

OpenTTD version requirement: 1.3.0 or higher. Actual AI version: 209.
Terron works with NewGRFs. At least with FIRS and those which add new vehicles: Aviators, eGRVTS, FISH, e.t.c.

Save/Load is supported, but because AI uses preprocessing a lot(to make things much faster later) it can require up to several game months for reinitialization and complete recovering. Be aware about it and do not abuse save/load, please.

Please let me know about bugs you find, preferably with AI Debug window screenshots or AI log, or ideally with saved game *before* AI crash, though the last one can be hard to obtain. General suggestions and feedback are welcomed too, of course.

That's pretty much all, but just in case if some people would like to see "features list" I scratched one:
  • Terron can use buses, trucks(mail included), planes and actually working ships.
    You already know that, but this is the very main "feature" by the way!

  • Roads reusing.
    Why to build own road if there is already one nearby?
    AI is regularly seeking and more than able to find and use roads built by other players. Wonderful!

  • Traffic control based on available infrastructure.
    AI will not build more vehicles for a station than it can handle.
    No longer planes in dozens will be flying around an airport desperately waiting for a chance to land, or endless trucks be staying in line near a lone truck stop. Instead increased rate of vehicles arrival achieved by accurate stations expansion. And stylish as well!

  • Cargo transferring.
    By combining airport/dock and bus stations, Terron can build versatile transfer system which provides stream of passengers, maintaining both smooth and profitable planes/ships work. Now with freight too. Splendid!

  • Advanced pathfinding.
    The custom road version of the popular A* comes in bidirectional implementation.
    This improved method allows not only extremely fast roads search and construction, but also requires significantly lesser time for understanding situations when road can't be built. With several work modes for different tasks and improved Fibonacci heap for increased speed, the custom A* is a must for today's AI!

  • Even more advanced pathfinding.
    Hierarchical A* for ships' paths search can connect two docks on the opposite sides of the map literally within seconds. Unbelievable!

  • Fast decision making.
    That's, you know, mighty Artificial Intilligence after all.
    When initial preprocessing - which isn't too long too - is done, Terron may choose what to do next with speed you'll never be able to. Tremendous!

  • Smart decision making.
    Terron weighs own actions as investment projects and chooses what to do next depending on the own company's current income and bank balance, as well as actions' cost and estimated profit. Brilliant!

    "Smart" mode now always on by default.


  • General kindness.
    When AI has no money or it has nothing to do, Terron generously falls sleep in humble attempt to save several precious microseconds of your processor's lifetime, or maybe make a game a bit more smooth. Remarkable!


Last edited by svetovoi on Wed Jun 19, 2013 10:11 am, edited 6 times in total.

Top
   
 Post subject: Re: Terron AI
PostPosted: Sat May 21, 2011 1:01 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
Reserved for who knows what


Top
   
 Post subject: Re: Terron AI
PostPosted: Sun May 22, 2011 2:30 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 888
I am truly impressed. :D
I ran a short test with your AI against some others, and it's working well, no crash, being on par financially with the leading AIs. It's very mature for a first-release AI.
The only "bug" I can report so far is a typo in the settings window: "adanced" project assessment model.

Are you planning to add train support as well? I'm to see another multi-profile AI :)


Top
   
 Post subject: Re: Terron AI
PostPosted: Sun May 22, 2011 5:03 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
Thanks for feedback, I'm glad to hear that Terron has not crashed(yet :) ).

Now "adanced", heh, how could I look at it weeks and did not notice?

And trains... this is something kinda hard to make "right". You see, I don't want to make trains like just bigger trucks.
To connect two points on the map within small radius of 150 - 200 tiles and then select another pair and then one more and so on.
Not bad for trucks, but trains... there are some magic within, something what I wouldn't like to see being ruined by AI which spams endless mess of rail's spaghetti just because it can.
Long and straight main lines, rails reusing, sensible and rational network - that's what interesting. And hard.

Without really good and fast rail pathfinder this is just impossible.
During latest addition of ships to the Terron I made a fast HPA* to build buoys, but constructing two parallel rail lines in hills is not the same as placing a buoy at flat sea every 25 tiles.
Maybe it's already written in other AI? I checked several (Admiral, Otvi) but not very closely.
Path of length around 350 tiles within two - three game weeks would be fine performance.


Top
   
 Post subject: Re: Terron AI
PostPosted: Sun May 22, 2011 5:08 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9067
Location: Sol d
There are already a few AIs which handle trains. Most notably you might want to look at NoCAB, AIAI and then also AdmiralAI and possibly SimpeAI and ChooChoAI as well. Maybe they have already solved some issues of yours already you have with trains. They're - IIRC - all licensed under GPL v2, so re-using stuff should not be a problem, if you chose that license, too.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Terron AI
PostPosted: Mon May 23, 2011 2:13 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
Hmm, after checking several(5 to be accurate) AIs I decided to stick to the plan I had before and to separately test ideas of future trains' system with simpler transport types. Only NoCAB is fast enough, but there are something strange with the path it choose.

So its more likely that either some not trivial freight ships or trucks oriented on delivery of goods instead of coal will be my next step, not trains.


Top
   
 Post subject: Re: Terron AI
PostPosted: Mon May 23, 2011 3:00 pm 
Offline
Transport Coordinator
Transport Coordinator
User avatar

Joined: Sun Jul 13, 2008 12:57 am
Posts: 313
ac84 wrote:
And trains... this is something kinda hard to make "right". You see, I don't want to make trains like just bigger trucks.
To connect two points on the map within small radius of 150 - 200 tiles and then select another pair and then one more and so on.
Not bad for trucks, but trains... there are some magic within, something what I wouldn't like to see being ruined by AI which spams endless mess of rail's spaghetti just because it can.
Long and straight main lines, rails reusing, sensible and rational network - that's what interesting. And hard.


So true...

_________________
Building Powargrid: a turn based strategy game


Top
   
 Post subject: Re: Terron AI
PostPosted: Thu May 26, 2011 6:28 pm 
Offline
Engineer
Engineer

Joined: Thu May 26, 2011 5:56 pm
Posts: 2
First crash:

Attachment:
TerronCrash.png [33.79 KiB]
Downloaded 2 times


Happened shortly after loading this save:

Attachment:
TerronAI-test, 3rd Sep 1998.sav [632.99 KiB]
Downloaded 191 times


So far a very solid AI.


Top
   
 Post subject: Re: Terron AI
PostPosted: Fri May 27, 2011 3:00 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
Fixed.
I have also added couple of options in the settings screen and removed bottleneck in the AI's start period. There are also minor tweaks, not very important stuff.

New version in the first post, saves should be compatible (but who knows all).
If it doesn't contain new bugs I'll add AI to the content library at the weekend.


Top
   
 Post subject: Re: Terron AI
PostPosted: Fri May 27, 2011 4:15 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 888
I've loaded the savegame with the previous version with your AI, still no crash, it's doing well :)
There is a problem with its ships though, that little peninsula makes things hard for your pathfinder. Ships coming from the north are stuck.
Attachment:
ships.png
ships.png [ 81.88 KiB | Viewed 12262 times ]

There is a savegame in this post if you're interested how your AI is doing in my game.


Top
   
 Post subject: Re: Terron AI
PostPosted: Fri May 27, 2011 4:44 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9067
Location: Sol d
Brumi wrote:
I've loaded the savegame with the previous version with your AI, still no crash, it's doing well :)
There is a problem with its ships though, that little peninsula makes things hard for your pathfinder. Ships coming from the north are stuck.
Attachment:
ships.png

There is a savegame in this post if you're interested how your AI is doing in my game.

Not a solution, but a work-around: Set the ship path finder also to YAPF.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Terron AI
PostPosted: Fri May 27, 2011 4:50 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
I'm using NPF and when ships stuck AI receives notification and sells all of them.
With NPF they stuck much lesser too.


Top
   
 Post subject: Re: Terron AI
PostPosted: Sat May 28, 2011 11:35 am 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 888
In my test game, Terron leaves quite a lot of deserted stations on the map. The vehicles were probably sold because of bad performance, but the stations were left behind. Is it intentional?

Anyway, in the detailed performance ratings, how is the number of stations calculated? Are only those stations calculated which have been visited in the past n months?


Top
   
 Post subject: Re: Terron AI
PostPosted: Sat May 28, 2011 2:05 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
Yes, AI should close shorter trade lines, those which usually was built first. Stations may be reused lately or may be not, it depends on particular situation.

Dunno about the second question, maybe http://wiki.openttd.org/OpenTTD will help you.


Top
   
 Post subject: Re: Terron AI
PostPosted: Sat May 28, 2011 4:17 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4538
Location: /home/sweden
Note that your AI will pay a yearly fee for each station it has of about 500 pounds per transport mode it has. (In 1950)

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


Top
   
 Post subject: Re: Terron AI
PostPosted: Sun May 29, 2011 2:19 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
AI update.
Previous version had a horrible typo in the very AI core which is now fixed.


Top
   
 Post subject: Re: Terron AI
PostPosted: Wed Jun 01, 2011 3:05 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 888
I found this while running my test game:
Attachment:
roads!.png [526.51 KiB]
Downloaded 2 times

Becoming old AI-ish? :D
Maybe the AI failed to build a road to Evilwell Woods...


Top
   
 Post subject: Re: Terron AI
PostPosted: Wed Jun 01, 2011 5:34 pm 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
It's not a bug, it's a feature :)

Should resolve jams.
Unfortunately, after the first expansion vehicles not always follow the new road and AI builds additional road second time and then third, and you see the result.

I think it's still better than


Attachments:
jam.png
jam.png [ 101.81 KiB | Viewed 12083 times ]
Top
   
 Post subject: Re: Terron AI
PostPosted: Wed Jun 01, 2011 5:53 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9067
Location: Sol d
ac84 wrote:
It's not a bug, it's a feature :)
I think it's still better than


IMHO not really. The jam in the image you show is caused by the drive-through road stops which cause all other vehicles to wait. You can detect those on the prospective route and build a detour around those, if needed. But these large patches of road... are not nice nor will they help really as the problem is something else (as explained).

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: Terron AI
PostPosted: Thu Jun 02, 2011 11:02 am 
Offline
Engineer
Engineer

Joined: Fri Oct 12, 2007 2:07 pm
Posts: 87
planetmaker wrote:
IMHO not really.

This screenshot shows only about 1/3 of the actual jam. Are you still sure?

Stations placement is not always main cause of the jams, at least from my observations. Jams become really huge problem(as above) because of breakdowns. When many vehicles with relatively low reliability follows one road and several of them breaks it slows all the line. Reliability of all vehicles in the line goes down and this leads to even more breakdowns. It's like chain reaction. When amount of vehicles reaches critical mass(usually because several AIs use one road) then entire route becomes one huge jam. And construction of additional roads resolve this issue.

While, surely, current building algorithm is far from optimal, I'll choose aesthetically unpleasant and even ugly landscape over constant 100 vehicles jam any day.

But I'm looking forward for more intelligent solution.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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.