AdmiralAI v25

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

Post Reply
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

AdmiralAI v25

Post by Yexo »

The latest nightly can be found here: http://bundles.openttdcoop.org/ai-admir ... es/LATEST/

Download of latest stable below, last release post: http://www.tt-forums.net/viewtopic.php?p=895929#p895929

Please report any bugs you find in this thread. Please add as much information as possible, and attach screenshots / savegames where appropriate.

Short description: AdmiralAI is an AI that tries to implement as many features from the API as possible. Currently it supports trains, road vehicles (including trams) and planes. One of the main goals is to make an AI that is fun to play against. I've tried to do this by making it play varied (using several types of transport).
Attachments
AdmiralAI-25.tar
(390 KiB) Downloaded 15371 times
Last edited by Yexo on 17 Jun 2009 11:42, edited 45 times in total.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: AdmiralAI

Post by Zutty »

€5.6m?! WOW! Well done Yexo. :)

Can't wait to see it in the tournament.
PathZilla - A networking AI - Now with tram support.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo »

And v2 is out, see first post.
User avatar
Ralph
Engineer
Engineer
Posts: 87
Joined: 21 Jun 2004 15:25

Re: AdmiralAI

Post by Ralph »

At the moment it won't run on the current nightly, I assume the updated road pathfinder will be in this evenings?
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo »

Ralph wrote:At the moment it won't run on the current nightly, I assume the updated road pathfinder will be in this evenings?
Yes, it will be.
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: AdmiralAI

Post by Zutty »

Yexo I'm just curious... why did you call it 'Admiral'? :)
PathZilla - A networking AI - Now with tram support.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AdmiralAI

Post by Roujin »

Congratulations - this gives pretty good results in the tournament :)

I'm going to watch it a little bit myself now, great work!


edit: one minor thing I noticed because I accidentally started the game at 1930 with original vehicles - maybe you should do a check if a vehicle for a specific cargo is available before building the route instead of building the route first and then failing to build vehicles (with ERR_UNKNOWN) if none is available.
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo »

Roujin wrote:Congratulations - this gives pretty good results in the tournament :)

I'm going to watch it a little bit myself now, great work!
Thanks :)
edit: one minor thing I noticed because I accidentally started the game at 1930 with original vehicles - maybe you should do a check if a vehicle for a specific cargo is available before building the route instead of building the route first and then failing to build vehicles (with ERR_UNKNOWN) if none is available.
Good point, I just forgot this and assumed there would always be a vehicle avaiable, I'll implement a check for this.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo »

And here is a new version. The bug roujin posted about (building a route for which no engine is available) is still not fixed.
This version has one major disadvantage / advantage: it does not build any long routes on it's own. This means that it'll perform pretty well on a map with other road AIs, as it can reuse their routes, but as soon as it is alone on a map (or with only air AIs), it'll perform weak.

Doxygen documentation can be found here: http://www.student.tue.nl/V/t.i.marinus ... index.html The documentation is not yet complete, but I'm in the process of fixing that.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo »

And here is version 4. It does build is own routes again, and has numerous bugfixes (thx for reporting those for all who did).
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo »

Version 5. Various bug fixes and other improvements, the most important new features:
  • Autoreplace vehicles when a new engine is available
  • Transport goods to towns (water and food won't be transported yet)
  • Keep ratings from bus stations up, build a new bus if the rating is too low
  • Do some terraforming to build stations.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v6 out)

Post by Yexo »

And now version 6. Tar file in the first post.

New features:
  • Way better stations handling (max amount of trucks per stop)
  • Transport food (and in toyland candies) to towns
  • Sell vehicles if they are jamming in front of a station
  • Don't crash if building a station succeeded in testing mode but fails in exec mode.
  • Build more bus stations in very big towns
  • Add configuration options in the file config.nut (for now just use_busses and use_trucks)
  • Limit the length of routes we build (actual length of route, not manhattan distance)
  • Only build a route when there is a vehicle available to transport the cargo
  • Better error handling when building roads
All suggestions and bug reports are welcome!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AdmiralAI (v6 out)

Post by planetmaker »

Hi Yexo,

compliments on your AI. As we've just seen last night, it performs very well and especially initially got us more than just a small headache - though we managed to beat it eventually using rails :). Keep up your good work!
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo »

I just uploaded version 7 to the first post.

New features:
  • Don't build rail/road crossings, instead build bridges over rail
  • If there are vehicles queuing in front of a station and we try to sell them, turn them around if they can't find a depot
  • Use the improved station handling for busses too
  • Keep a bit more distance between truck stations, so it's easier to upgrade
  • Don't try to build more road vehicles when the AI is already near the limit per player
  • Use two pickup stations for stations that produce two cargo types (farms)
  • Build statues as soon as the AI has enough money to improve station ratings
Bug fixes:
  • Fixed a divide by zero bug.
  • Autoreplace / autorenew didn't keep the old vehicleIDs obviously, so don't keep out own list but use AIVehicleList_Station
dbkblk
Traffic Manager
Traffic Manager
Posts: 154
Joined: 29 Mar 2008 18:38

Re: AdmiralAI (v7 out)

Post by dbkblk »

Hi,
I've tried to launch a new game with two admiralai v7 and a convoy (last version) and the AI Debug said "wrong parameter in this script" for both of yours AI, i dunno what?
Is this an error of your AI or does i need a updated noai build ?

EDIT: Ok, so i've updated the OTTD Build and now it's works perfectly for your AI !!
...but convoy now don't work anymore :x

EDIT2: Ok, you've answered at the same time ! Thanks for the explanations !
Last edited by dbkblk on 21 Jul 2008 14:56, edited 1 time in total.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo »

dbkblk wrote:Hi,
I've tried to launch a new game with two admiralai v7 and a convoy (last version) and the AI Debug said "wrong parameter in this script" for both of yours AI, i dunno what?
Is this an error of your AI or does i need a updated noai build ?
In r13751, the API was changed, so you can use AdmiralAI v7 only with 13751 or newer. If you still get an error, please post again with the file names + line numbers from the error message so I can fix it.
Convoy 1.5 is not yet updated for the new API, so you can use convoy only with 13750 or older. If you get error message with convoy with r13750 or older, please post the error message in the convoy thread.

Edit:
EDIT: Ok, so i've updated the OTTD Build and now it's works perfectly for your AI !!
...but convoy now don't work anymore :x
At this moment, the only working AIs are AdmiralAI, anpai and WrightAI.

Edit: Convoy 1.6 will work.
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: AdmiralAI (v7 out)

Post by athanasios »

A problem with depot placing. See screenshot:
Attachments
AdmiralAI_depot.png
AdmiralAI_depot.png (47.45 KiB) Viewed 116391 times
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo »

athanasios wrote:A problem with depot placing. See screenshot:
Thx for the report, I fixed it locally. I'll release a new version tomorrow with this bug fixed.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo »

I just uploaded version 8 to the first post. First I want to thank everyone that tested and reported bugs. Please keep on playing and reporting any bugs / odd behavior you find.
Version 8 needs r13783-noai or newer to run.

New features:
  • Basic ecs / pbi support. Stockpiles are not yet supported, so if you want to try this, set stockpiling off.
  • Build bridges over rivers, even when there are no slopes in the neighbourhood
  • Use GetSettings in info.nut
  • Change two small bus routes into two longer routes if possible
  • For all newly build routes, check both ways. This way, if one-way roads are build, another road is build next to it so vehicles can go back.
  • Check if a bus is available before building any bus routes, just was done for trucks in v7
Bug fixes:
  • Don't build a depot with the entrance to a drive-through road stop
  • Don't try to transport tourist (and or cargo with cargoclass = CC_PASSENGERS) with truck
  • Only build statues in towns where we have at least one industry.
  • With some town-layouts, it was possible that connecting a roadstop with the route to another town failed.
  • Don't build articulated vehicles, as those are not supported by non-drivethrough stops
  • Don't buld trams as they don't run on normal road.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: AdmiralAI (v8 out)

Post by SirkoZ »

I just ran a 256x256 map with v8 of the AI with the afore-mentioned build and there are 3 things:
1.) it's not building anymore (in only 2009),
2.) it's not autorenewing or replacing its trucks/buses,
3.) look at truck number 123 - a food lorry at rubber plantation... and there was another such example where it built oil lorries near the diamond mine, but sold those off.
Attachments
oTTD_NoAI_Transports_002.sav
savegame
(156.19 KiB) Downloaded 4232 times
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Google Adsense [Bot] and 2 guests