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: 3653
Joined: 20 Dec 2007 12:49

AdmiralAI v25

Post by Yexo » 18 Jun 2008 19:45

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 12737 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 » 18 Jun 2008 20:05

€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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo » 19 Jun 2008 11:20

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 » 19 Jun 2008 12:17

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo » 19 Jun 2008 14:54

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 » 20 Jun 2008 14:38

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 » 20 Jun 2008 17:01

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo » 20 Jun 2008 19:27

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo » 27 Jun 2008 22:41

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo » 30 Jun 2008 14:23

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI

Post by Yexo » 14 Jul 2008 22:53

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v6 out)

Post by Yexo » 17 Jul 2008 18:59

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: 9280
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: AdmiralAI (v6 out)

Post by planetmaker » 20 Jul 2008 08:13

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo » 20 Jul 2008 20:41

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 » 21 Jul 2008 14:46

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo » 21 Jul 2008 14:55

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 » 22 Jul 2008 00:42

A problem with depot placing. See screenshot:
Attachments
AdmiralAI_depot.png
AdmiralAI_depot.png (47.45 KiB) Viewed 83877 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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo » 22 Jul 2008 01:22

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: 3653
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v7 out)

Post by Yexo » 22 Jul 2008 17:11

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: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: AdmiralAI (v8 out)

Post by SirkoZ » 22 Jul 2008 22:06

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 3690 times

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

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