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

ilt
Engineer
Engineer
Posts: 18
Joined: 03 Oct 2008 17:49

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by ilt »

:?

Has tried to test at "hard" difficulty

All 7 AdmiralAIs started with same route
Unnamed, 14th Sep 1952.jpg
Unnamed, 14th Sep 1952.jpg (84.96 KiB) Viewed 5972 times
User avatar
ZeroMD
Engineer
Engineer
Posts: 32
Joined: 28 Sep 2008 11:18
Location: The Netherlands

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by ZeroMD »

Great AI, however there are some pathfinding problems ( see picture)
Attachments
ai.jpg
ai.jpg (69.6 KiB) Viewed 1381 times
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by SirkoZ »

Nicely done Yexo, however there are still some problems with attaching the rail with rail stations but apart from that one of AI's crashed even before it started building the rails (I restarted the other 3 for messing around with my busses - reason: AI's drive through bus stops and great many busses stopping one by one in the middle of my route).
Here's the save (r14418, v13 of AI).
Attachments
Avonton Transport, 4th Mar 2051.sav
savegame
(585.59 KiB) Downloaded 152 times
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by Gremnon »

Been experimenting with this too, it seems that the rail part of the AI either can't handle NARS2, 2CC set or the extended engine pool. I'm not sure which yet, I'm still investigating.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by Yexo »

Thanks for all the reports everyone, I'm very happy that is has been tested by many different people!
ilt wrote::?

Has tried to test at "hard" difficulty

All 7 AdmiralAIs started with same route
I'll try to fix this by randomizing the order in which the industries are searched.
ZeroMD wrote:Great AI, however there are some pathfinding problems ( see picture)
I'm out of ideas of how to fix that issue, as the station is build before the pathfinding is started. If pathfinding doesn't return a route, the station remains.
SirkoZ wrote:Nicely done Yexo, however there are still some problems with attaching the rail with rail stations but apart from that one of AI's crashed even before it started building the rails (I restarted the other 3 for messing around with my busses - reason: AI's drive through bus stops and great many busses stopping one by one in the middle of my route).
Here's the save (r14418, v13 of AI).
As for attaching rail stations to rail, I've found and fixed another bug. The number of busses may need some tweaking to be better. Alternatively you can try to disable allowing bus stops on town-owned road.
Gremnon wrote:Been experimenting with this too, it seems that the rail part of the AI either can't handle NARS2, 2CC set or the extended engine pool. I'm not sure which yet, I'm still investigating.
The engine pool can't be the problem. I haven't tested NARS2 nor 2CC set, so both of them could give problems. I'm sure the DBSet gives problems, because the AI tries to attach a wagon to an engine but that is disallowed by that grf. Maybe NARS2 and 2CC set have a similar system (disallowing the attaching of cargo coaches to fast pax-only engines)?
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by Gremnon »

I've not tried it since, I'll have another experiment with them separately.
Although when I was, it seemed to have greater sucess using 2CC than NARS2... when it actually got to the point of building a train.
User avatar
YukonRob
Transport Coordinator
Transport Coordinator
Posts: 290
Joined: 31 Jul 2007 00:58
Location: North of 63

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by YukonRob »

Haven't had a chance to try your recent versions but regarding NARS2, (early) trains must have cabooses so this could be the issue.
User avatar
This is my name
Director
Director
Posts: 515
Joined: 17 Sep 2008 01:36
Location: SOMEWHERE IN LINGGI
Contact:

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by This is my name »

I like your new version AI. But Aviators Aircraft doesn't quite work and it gives me errors every time I load a savegame :?

BTW, everything else is fine to me :) . I must say, good luck! :wink:
Attachments
error.PNG
error.PNG (12.69 KiB) Viewed 5114 times
Fradean Freighter, 20th Jan 1933.sav
(1.74 MiB) Downloaded 150 times
usecubes.com 3-D Pixel Design Software
ilt
Engineer
Engineer
Posts: 18
Joined: 03 Oct 2008 17:49

Re: AdmiralAI (v13 out): busses, trucks, trams, trains, planes

Post by ilt »

Yexo wrote: I'm out of ideas of how to fix that issue, as the station is build before the pathfinding is started. If pathfinding doesn't return a route, the station remains.
I will try to solve a similar problem by using simple function isRouteAvailable with valid tiles from coverage radiuses as parametres.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

AdmiralAI v14

Post by Yexo »

New release: AdmiralAI v14. Thanks too all who tested, I hope you continue to report all bugs you find. Tar file can be found in the first post.

Version 14 needs NoAI r14512 or newer.

New features:
  • At the moment a new bus route will be build, try subsidized routes first.
  • Build NewGRF rail station (this needs a station grf that supports callback 18, like Industrial Stations Renewal
  • Greatly improved airport building. Better reuse of exisint airports before new ones are build.
  • Choose the best type of rail for a route (instead of always normal rail)
  • Convert normal rail to electric rail if better electric engines are available
  • Enable the usage of helicopters, but only as plane replacement (no heliports are build)
  • If there are too many trains on a route, sell one.
Bug fixes:
  • Fix plane loading code (reported by This is my name)
  • Enable wagon removal,so train don't become too long when replacing an engine with a longer one
  • Build the rail connection to the station correct (reported by SirkoZ)
  • Autoreplace for planes was broken
  • Don't build passenger-only engines. (dbset now works correctly)
  • Don't start a new route if one of the existing routes needs more vehicles
I am not aware of any vehicle-grf related bugs at the moment so if you notice any, please report them. The only possible problem can be the 2cc-set, because it increases the building costs for electrified rail a lot.

Attached are three screenshots by games where AdmiralAI run alone on the map started with

Code: Select all

start_ai admiralai use_planes=0,use_trains=1,use_trucks=0,use_busses=0
Edit: I forgot to mentions a known problem:
Saving/Loading code was not updated, but the rest of the code was. it may still work, it might also do strange things after loading a game.
Attachments
Unnamed, 5th Jun 1944.png
A simple, clean junction with ecs loaded.
(164.5 KiB) Downloaded 181 times
Unnamed, 6th Sep 1945.png
Some more junctions and IRS
(141.98 KiB) Downloaded 192 times
Unnamed, 10th Aug 1964.png
Jams!
(178.93 KiB) Downloaded 183 times
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by athanasios »

Here we get a clever AI. Congratulations! :bow:
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.
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by Roujin »

Wow - the lines look a bit messy, but nice job! :D Even proper usage of the one way pbs signal there...

Also nice touch that it chooses e.g. the ISR Coal station next to a coal mine :D
* @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
Dimension
Engineer
Engineer
Posts: 8
Joined: 25 Oct 2008 06:20

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by Dimension »

Nice AI, Yexo !

(...i hope you understand my english)
Screenshot:
Build 14520. AI don't finished construction of the road to the station. And since this moment (1953-1977) it left off work , don't continue any construction, don't pay off a debt.
Attachments
Untitled-1.jpg
Untitled-1.jpg (82.7 KiB) Viewed 4471 times
Last edited by Dimension on 25 Oct 2008 12:40, edited 1 time in total.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by SirkoZ »

Thank you for the new release, Yexo.
Just one quick thing - I went through your 3 screenshots - look real nice.
However for those players that have 90° turns disabled (not me) your AI should try not to build a depot with 90° turn right on depot's exit.
I'm talking about the "Some more junctions and IRS" - second screenshot/depot near a coal mine.
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by Yexo »

Thanks for all the kind words!
Roujin wrote:Wow - the lines look a bit messy, but nice job! :D Even proper usage of the one way pbs signal there...

Also nice touch that it chooses e.g. the ISR Coal station next to a coal mine :D
That is actually the work of the grf, not of the AI. The AI supplies some parameters (industry types, pickup or drop station, distance, cargo) and the grf picka a station layout to build.
Dimension wrote:Nice AI, Yexo !

(...i hope you understand my english)
Screenshot:
Build 14520. AI don't finished construction of the road to the station. And since this moment (1953-1977) it left off work , don't continue any construction, don't pay off a debt.
Since it doesn't do anything, I guess it crashed. If this happens again, can you post the error message shown in the ai debug panel (found under the question mark in the menu bar)? (a screenshot of the complete red message would be best).
SirkoZ wrote:Thank you for the new release, Yexo.
Just one quick thing - I went through your 3 screenshots - look real nice.
However for those players that have 90° turns disabled (not me) your AI should try not to build a depot with 90° turn right on depot's exit.
I'm talking about the "Some more junctions and IRS" - second screenshot/depot near a coal mine.
You're right but actually that depot is only used for the line going towards the iron ore miine (so no 90* turn). For the line towards the south, there is another depot (not visible in the screenshot).
XxInNOutxX
Engineer
Engineer
Posts: 61
Joined: 20 Oct 2008 12:50

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by XxInNOutxX »

Where to i put the TAR file? Tried looking for bin folder but to no avail. :(
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by Yexo »

XxInNOutxX wrote:Where to i put the TAR file? Tried looking for bin folder but to no avail. :(
If you download a binary release, you put it in the ai/ folder.
XxInNOutxX
Engineer
Engineer
Posts: 61
Joined: 20 Oct 2008 12:50

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by XxInNOutxX »

Thanks a million Yexo! But now this AI seems to make itself bankrupt instead of building better except for 1 or 2. Is this a feature or has my AI gone haywire?
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by Yexo »

XxInNOutxX wrote:Thanks a million Yexo! But now this AI seems to make itself bankrupt instead of building better except for 1 or 2. Is this a feature or has my AI gone haywire?
What AI have you started? (Check the company name).

In case of AdmiralAI: this AI doesn't work nice when started more than two times, as all AIs will try to build the same route. In case you only started 1/2 and it went bankrupt, you may have very difficult map settings / other settings. In that case I'd like to see a savegame.
XxInNOutxX
Engineer
Engineer
Posts: 61
Joined: 20 Oct 2008 12:50

Re: AdmiralAI (v14 out): busses, trucks, trams, trains, planes

Post by XxInNOutxX »

Well i tried to load the save file to play and guess what, it crashed on me for some reason. Can u enlighten me pls Yexo? :P I don't think you get what i mean. I meant starting 7 of them and only 1 or 2 manage to start off, the rest just had their values reduced to 1 pound
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 10 guests