Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Nov 18, 2017 5:50 pm

All times are UTC




Post new topic  Reply to topic  [ 272 posts ]  Go to page 1 2 3 4 514 Next
Author Message
 Post subject: AIAI
PostPosted: Fri Feb 19, 2010 7:35 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Here is my attempt to write an AI. It is intended to be both challenging and produce nice looking infrastructure. I also plan to make it working with all possible settings and add support for all "normal" newgrfs - for now it should work with all newgrfs from bananas.

Done:
full save load support
support for eGRVTS, HEQS, NARS, 2cc etc
support for FIRS, ECS etc
full RV support
freight train support
plane support
uses all cargoes (except mail, tourists)
newtrack support

code and bug tracker resides at https://github.com/matkoniecz/AIAI


Attachments:
support for FIRS and eGRVTS.PNG
support for FIRS and eGRVTS.PNG [ 38.88 KiB | Viewed 30321 times ]
Now with trains!.png
Now with trains!.png [ 140.29 KiB | Viewed 24439 times ]

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Last edited by Kogut on Wed Sep 21, 2016 7:08 pm, edited 72 times in total.
Top
   
PostPosted: Fri Feb 19, 2010 7:36 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
...


Attachments:
support for HEQS.PNG
support for HEQS.PNG [ 21.81 KiB | Viewed 30319 times ]
av8 support.PNG
av8 support.PNG [ 56.3 KiB | Viewed 29907 times ]
basic ECS vectors support.PNG
basic ECS vectors support.PNG [ 71.87 KiB | Viewed 29907 times ]

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Last edited by Kogut on Tue Mar 16, 2010 2:04 pm, edited 1 time in total.
Top
   
PostPosted: Fri Feb 19, 2010 7:47 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9022
Location: Sol d
Nice view. I tried to give it a shot (no newgrfs, temperate climate):


Attachments:
File comment: AIAI crash
Neu Hahnmünster Transport, 13-02-1975.png
Neu Hahnmünster Transport, 13-02-1975.png [ 33.49 KiB | Viewed 30317 times ]

_________________
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
   
PostPosted: Fri Feb 19, 2010 7:49 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
I uploaded incorrect version. :cry:
Now it should works.
Thanks for bug report!

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
PostPosted: Sun Feb 21, 2010 7:04 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 873
Good work! :)
In my first test, your AI is working fine, it is incredibly fast :))
Keep it up, it's nice to see a new AI!


Top
   
 Post subject: Re: AIAI alpha version
PostPosted: Mon Feb 22, 2010 7:23 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Version alpha uploaded

New
limit of RV in one route
useless vehicles are sold
better error handling
improvement of road pathfinder (from SimpleAI)
fixed crash when no suitable RV are available
fixed bugs
better secondary cargo handlig (conditional orders)
money menagement

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: AIAI alpha version
PostPosted: Sat Feb 27, 2010 8:41 am 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
I'm really liking your AI. It plays really very fast and good, even it is only a alpha version.
It remembers me a little to the Pathzilla AI, which is one of my favourite AI's.
But unfortunenally I have to report a little bug, which I don't know why it happened.
Keep on working. Nice greetings.

Edit:
I have an idea to fix the problem. You just have to change line 352 of main.nut to:

local name=AIVehicle.GetName(car)+" ";


Attachments:
Baker & Co., 22. Sep 1947.png [10.75 KiB]
Downloaded 5 times
Top
   
 Post subject: Re: AIAI alpha version
PostPosted: Sat Feb 27, 2010 10:09 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Thanks for bug report and good opinion about ai.

The main problem was that vehicleID was valid in RenevRV function (when AI created vehicle list in 413 line) but RV was destroyed before executing of CzyNaSprzedaz function. In result vehicle become invalid and program crashed. I must check what happen when Noai API get it: AIVehicle.Sth(invalid_vehicle).

Edit:

local name=AIVehicle.GetName(car)+" "+" "+" "+" "+" "+" "; //it may work, but i must check what getname return when performed on illegal vehicle

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: AIAI alpha version
PostPosted: Tue Mar 16, 2010 2:02 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
New version of AIAI!

- Planes (support for air newgrfs)
- Kind of support for ECS
- Bugfixes (thx Steffl)
- Better menagement
- Now ai (should) replace vehicles


Attachments:
aiai_beta.tar [94 KiB]
Downloaded 371 times
What AIAI constructed on flat map.PNG
What AIAI constructed on flat map.PNG [ 33.82 KiB | Viewed 29909 times ]

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: AIAI alpha version
PostPosted: Tue Mar 16, 2010 3:09 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 873
Nice work! :)
It's still one of the fastest AIs of all time, it was working fine in my test, it reached the vehicle limits in a matter of years...
I have one little problem: airports are sometimes overworked, there were 14 planes using one small airport, for example. Apart from that, it was doing very well.


Top
   
 Post subject: Re: AIAI alpha version
PostPosted: Tue Mar 16, 2010 3:24 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Airport capacity still have flaws to find (sometimes capacity control is ignored). I am working on it.

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: AIAI beta version
PostPosted: Tue Mar 16, 2010 6:12 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Fixed:
EDIT Another bug fixed, new version uploaded
EDIT
known problems
- stupid plane behaviour on very large maps (too big distances between airports)
- sometimes ai try to build aircrafts when limit is reached


Attachments:
aiai_beta3.tar [96.5 KiB]
Downloaded 382 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: AIAI beta4 version
PostPosted: Sat Mar 27, 2010 2:25 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
New feature: shameless copy - paste from cluelessplus (replacing level crossing with bridge)

Fixed known probles, new problems are known:
n^2 is bad idea when n may be 5k (n = AIIndustryList().Count() ) In other words - searching for best industry on large maps is very, very slow.
solution: change to amortized contant time (200)

long bridges sometimes are unavailable!

very high rotation of vehicles


Attachments:
aiai_beta4.tar [113.5 KiB]
Downloaded 326 times
Przechwytywanie.PNG
Przechwytywanie.PNG [ 28.07 KiB | Viewed 29646 times ]

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: AIAI beta4 version
PostPosted: Sat Apr 03, 2010 12:53 pm 
Offline
Engineer
Engineer

Joined: Tue Feb 23, 2010 3:44 pm
Posts: 103
I found some little bug again in your AI again. But I'm sure you can handle it easily :-)

PS.: I try to make a AI too (ok, it's not really mine), but it can hardly compete with your AI. Only sometimes it is a little bit better. But in most cases your AI wins.


Attachments:
Baker & Co., 10. Sep 1945.png
Baker & Co., 10. Sep 1945.png [ 39.19 KiB | Viewed 29548 times ]
Top
   
 Post subject: Re: AIAI beta4 version
PostPosted: Sat Apr 03, 2010 1:07 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Thanks! It happens when industry is closed during looping over industry list.

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
PostPosted: Sat Apr 03, 2010 3:39 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
All known problems fixed (including bug reported by Steffl)!
This is gamma version/first bananas candidate.
So I wait for next bug reports.

The biggest new feature: industry to city routes.

And one small question. I keep aiai in content_download folder. Where it should be to avoid overwrittion by Bananas?


Attachments:
Przechwytywanie.PNG
Przechwytywanie.PNG [ 82.16 KiB | Viewed 29526 times ]
aiai_gamma.tar [123.5 KiB]
Downloaded 266 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: AIAI beta4 version
PostPosted: Sat Apr 03, 2010 3:46 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4532
Location: /home/sweden
<openttd dir>/ai/AIAI/info.nut

Where the openttd dir can be either the installation dir or OpenTTD in your documents etc.

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


Top
   
 Post subject: Re: AIAI gamma version
PostPosted: Sat Apr 03, 2010 5:32 pm 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
Aaargh
Know problem - factory servised both by truck and plane

Bugfix - plane connection to industry without production.


Attachments:
aiai_gamma1.tar [123.5 KiB]
Downloaded 410 times

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Top
   
 Post subject: Re: AIAI gamma1 version
PostPosted: Thu Apr 08, 2010 5:45 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Feb 07, 2008 2:06 pm
Posts: 378
Location: Glasgow
Hey Kogut,

Congratulations with your AI, I just took it for a test run and it performs really well! I did 2 quick runs I did with it it beated NoCAB fair and square :). It was quite a nice match to see, NoCAB took the initiative while your AI was able to catch up after 10-15 years and took the lead after that. Seems that your strategy to look for the best industries and connect those pays off, from what I gleaned from the games played NoCAB spends way too much time planning and thinking while AIAI builds and takes the lead as it is really fast.

Later in the game NoCAB did manage to crawl closer to your AI as better trains became available and it replaced all its small airfields with larger ones, but never close enough to surpass yours (at least not before 1985 after which time I had to quit).

Well done and I'm looking forward to your final AI! In the meantime I'll use this one to benchmark my own ;).
- Bram


Top
   
 Post subject: Re: AIAI gamma1 version
PostPosted: Thu Apr 08, 2010 5:55 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2364
Location: Location, Location
Whoa!
An AI that beats NoCAB? (i've never tried Rondje OK?)
This is going to be some fearsome AI...
Good Luck! :mrgreen:

_________________
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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-2017 phpBB Limited

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