MogulAI

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

Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

MogulAI

Post by Dezmond_snz »

Today i introducing first public version of my AI named so humble "MogulAI". :)

This AI uses only trucks, trying to grow as fast as it can (sometimes it reaches RV's limit in 5 years).
Using industry-industry truck routes.
Save/load implemented.
Bank balance monitoring and managment implemented.
Routes, stations and vehicles count managment implemented.
Upgrading vehicles implemented.

Tested with FIRS, eGRVTS.
Here is example of network it built in 4.5 years:
Moguls Trans Corp ltd., 1954-05-03.png
Moguls Trans Corp ltd., 1954-05-03.png (63.99 KiB) Viewed 1570 times
Available at BaNaNaS also.
Waiting for your feedback.

edit for b5892:
Little update with fix of road vehicle's "memory effect".

edit for b5898:
- better behavior when coming close to RVs limit;
- use built-in replace functions;
- fixed bug of calculating starting count of vehicles for route;
- some minor tweaks.

edit for b5900:
- fixed load-game bug.
MogulAI-b5900.tar
(120 KiB) Downloaded 1425 times
Last edited by Dezmond_snz on 10 Oct 2010 14:24, edited 13 times in total.
Russia
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Re: MogulAI

Post by Xander »

I look forward to 7.3 :)

Welcome to the AI community. Hope you'll stick around :D
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: MogulAI

Post by Dezmond_snz »

Uploaded new build 5373 of AI that now should work with 0.7.2.
Made check of OTTD version and using NoAI features depending on revision.
Russia
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: MogulAI

Post by Wold »

You should think about the distance your trucks go to produce income, because 30-40 tiles results in 1-2k income. It's fine though, I like it for a first release.
Image
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: MogulAI

Post by Dezmond_snz »

Wold wrote:You should think about the distance your trucks go to produce income, because 30-40 tiles results in 1-2k income. It's fine though, I like it for a first release.
Actualy, AI checks distance when looking for possible service and minimum distance is 70 tiles.

Build 5390 at first post.
Upgrade vehicles implemented. Now it'll check available engines for better ones.
Russia
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Re: MogulAI

Post by Xander »

Just gave Mogul (5373) a run on 0.7.2

Very slick - quick to find and build routes and populates them very well.

A couple of slight hiccups, it connected an unserviced steel mill to a factory and shipped grain to one factory and livestock to another from the same farm.

Can't wait to see how this AI progresses - should prove to be quite a challenge, even for veteran players :)
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Wold
Transport Coordinator
Transport Coordinator
Posts: 318
Joined: 03 Aug 2006 19:32
Skype: woldy_bg
Location: Bulgaria

Re: MogulAI

Post by Wold »

Dezmond_snz wrote:
Wold wrote:You should think about the distance your trucks go to produce income, because 30-40 tiles results in 1-2k income. It's fine though, I like it for a first release.
Actualy, AI checks distance when looking for possible service and minimum distance is 70 tiles.
Well there's something wrong with that check ;)
Attachments
Conham Transport, 2nd Jun 1971.png
Conham Transport, 2nd Jun 1971.png (83.23 KiB) Viewed 1491 times
Image
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: MogulAI

Post by Dezmond_snz »

Wold wrote:Well there's something wrong with that check ;)
Hmm... Interesting. I'll have a look.

Got it. There was another place with check, so 40 tiles was possible. :) Much thanks. In next build posted here it'll be fixed. (Hope post will be soon)
Xander wrote:Just gave Mogul (5373) a run on 0.7.2
Very slick - quick to find and build routes and populates them very well.

A couple of slight hiccups, it connected an unserviced steel mill to a factory and shipped grain to one factory and livestock to another from the same farm.

Can't wait to see how this AI progresses - should prove to be quite a challenge, even for veteran players :)
That's very strange. Provide screenshot next time, please.
Russia
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Re: MogulAI

Post by Xander »

Just gave it another run and I'm going to voice a slight concern I had last time but didn't mention:

Mogul is too good :P

In 3 years it had made not only cleared its loan but was sitting on over £1.5 million 8o. Seriously - that's frighteningly good.

Congrats - you've made a god level AI :D
:bow:
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
KIDS
Engineer
Engineer
Posts: 9
Joined: 05 Aug 2009 11:28

Re: MogulAI

Post by KIDS »

Just to be sure --- it plays the same way as everyone else, no rating boosts or free terraforming like the original AI? If so, that sound beautiful! I'll be sure to test it. Speaking of which, I still expect it to eventually implode into itself as the general AI road congestion puts a brake on its road vehicles.
User avatar
Xander
Route Supervisor
Route Supervisor
Posts: 485
Joined: 18 May 2007 12:47
Location: Oxford
Contact:

Re: MogulAI

Post by Xander »

KIDS wrote:Just to be sure --- it plays the same way as everyone else, no rating boosts or free terraforming like the original AI? If so, that sound beautiful! I'll be sure to test it. Speaking of which, I still expect it to eventually implode into itself as the general AI road congestion puts a brake on its road vehicles.
None of then new AIs can do this. The only thing they can do which humans can't is build adjacent stations as new stations.
Real Tycoons do it on Trains!

JAMI: Just Another Moronic Intelligence
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: MogulAI

Post by Yexo »

Xander wrote:The only thing they can do which humans can't is build adjacent stations as new stations.
Human players can do that too, just press ctrl while building the station.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: MogulAI

Post by Lord Aro »

i must congratulate you - GREAT AI :bow: :bow: :D

i found this bug:

EDIT: it deleted it but only after a year or two
Attachments
Arioa International, 27th Dec 1970.png
Arioa International, 27th Dec 1970.png (207.95 KiB) Viewed 1500 times
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
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: MogulAI

Post by Dezmond_snz »

Thanks for so good opinions. Thanks very much. :oops:
Lord Aro wrote:...
i found this bug:
EDIT: it deleted it but only after a year or two
Well, it's not exactly a bug, i think, 'cuz there was good industry when he began build route. Such delay in removing this route conditioned by that AI was busy with some other work.
I'll add check in middle of building to detect such scenarios in future.
Thanks for report.

Now working on implementing routes from non-raw industries. Coming soon... ;)
Russia
User avatar
dillonb3
Engineer
Engineer
Posts: 4
Joined: 31 Jul 2009 11:30
Location: Dundalk, Ireland

Re: MogulAI

Post by dillonb3 »

Very impressive AI in the space of 9 years it has spawned over 500 road vehicles and currently leads the leaderboard. Don't know if anyone else has this problem but every 2nd time I load the game its AI crashes and stops building
Due to the recession the light at the end of the tunnel has been switched off
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: MogulAI

Post by Dezmond_snz »

Dezmond_snz wrote:Now working on implementing routes from non-raw industries. Coming soon... ;)
Well, that my "soon" become a bit longer than soon. :mrgreen:

Finally i have reason to dig my topic up and present new version of MogulAI.
I made very many changes to strategy and microplaying of AI so now it must be more stable for longer game period.
Some of main changes i can remember:
- new totally custom pathfinder with reserved more traditional one;
- can handle any of industry-to-industry routes (i'm too lazy to implement town as destination or source :) );
- much better vehicles count managment for routes;
- extending stations for more vehicles;
- build statues in towns;
- a bit of terraforming for station and depot placing;
- "damn authority manager" - brings peaсe in intercourses with local authorities ;)
- queue detector and negative profit detector;
- something more... forgot already.

New version and same comments in first post.
Now i should learn how to upload it to bananas...
/me gone to grab some coffee ;)
Russia
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: MogulAI

Post by Kogut »

What a awesome bump! I must check how MagulAI is working!
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
Dezmond_snz
Engineer
Engineer
Posts: 58
Joined: 19 Apr 2009 11:50

Re: MogulAI

Post by Dezmond_snz »

Ok, now MogulAI available at BaNaNaS.
I cannot find bugs in it anymore and that's scared me a bit.
Help me to find them, please. ;)
Russia
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: MogulAI

Post by Kogut »

OK (1.02)
Attachments
Przechwytywanie.PNG
Przechwytywanie.PNG (22.82 KiB) Viewed 15576 times
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: MogulAI

Post by Lord Aro »

also, something of interest...
Attachments
2.0.2.png
2.0.2.png (9.04 KiB) Viewed 15574 times
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
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

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