Page 1 of 32

AdmiralAI v25

Posted: 18 Jun 2008 19:45
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).

Re: AdmiralAI

Posted: 18 Jun 2008 20:05
by Zutty
€5.6m?! WOW! Well done Yexo. :)

Can't wait to see it in the tournament.

Re: AdmiralAI

Posted: 19 Jun 2008 11:20
by Yexo
And v2 is out, see first post.

Re: AdmiralAI

Posted: 19 Jun 2008 12:17
by Ralph
At the moment it won't run on the current nightly, I assume the updated road pathfinder will be in this evenings?

Re: AdmiralAI

Posted: 19 Jun 2008 14:54
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.

Re: AdmiralAI

Posted: 20 Jun 2008 14:38
by Zutty
Yexo I'm just curious... why did you call it 'Admiral'? :)

Re: AdmiralAI

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

Re: AdmiralAI

Posted: 20 Jun 2008 19:27
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.

Re: AdmiralAI

Posted: 27 Jun 2008 22:41
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.

Re: AdmiralAI

Posted: 30 Jun 2008 14:23
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).

Re: AdmiralAI

Posted: 14 Jul 2008 22:53
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.

Re: AdmiralAI (v6 out)

Posted: 17 Jul 2008 18:59
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!

Re: AdmiralAI (v6 out)

Posted: 20 Jul 2008 08:13
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!

Re: AdmiralAI (v7 out)

Posted: 20 Jul 2008 20:41
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

Re: AdmiralAI (v7 out)

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

Re: AdmiralAI (v7 out)

Posted: 21 Jul 2008 14:55
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.

Re: AdmiralAI (v7 out)

Posted: 22 Jul 2008 00:42
by athanasios
A problem with depot placing. See screenshot:

Re: AdmiralAI (v7 out)

Posted: 22 Jul 2008 01:22
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.

Re: AdmiralAI (v7 out)

Posted: 22 Jul 2008 17:11
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.

Re: AdmiralAI (v8 out)

Posted: 22 Jul 2008 22:06
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.