WmDOT v14 [2016-08-29]

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

User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

WmDOT v14 [2016-08-29]

Post by MinchinWeb »

Version 14 Released on August 29, 2016

-- What's New in v14 --
  • bug fixes (ship unloading)
-- What's New in v13 --
  • bug fixes (ship pathfinder timing out and buying non-existent companies)
  • ship pathfinding speed ups
-- What's New in v11 --
  • Delete extra ships; name ships
  • Grid based-pathfinding
  • Freeways!
Image
-- What's New in v10 --
  • Dynamically add ships
  • No longer builds ship depots next to docks
-- What's New in v9 --
  • Added support for FIRS' water-based industries. Requries FIRS v0.7.1 or newer.
  • Bug fixes (to work with SuperLib and updated API)
  • Requires v1.2 of the API, so probably OpenTTD 1.2-RC-1 or newer
-- What's New in v8 --
  • Various improvements and bug fixes (details)
-- What's New in v7 --
  • Operation Hibernia - a revenue source! Transports Oil from Oil Rigs to Oil Refineries
Image
  • Now requires MetaLibrary v2 and SuperLib v19
-- What's New in v6 --
  • Builds less of a road mess in late game (pic)
  • Fixes bug where WmDOT would crash if it couldn't build HQ
  • Now requires MinchinWeb's MetaLibrary v1 (available on Bananas)
-- What's New in v5 --
  • Now starts superfast (within ~15 days) even on the largest maps
  • Now requires SuperLib v7
--What's New in v4 --
  • Changes to pathfinder allowing in to run in 1/20 the time in some cases
  • Double check the road got built
  • Fix problem that was crashing WmDOT on savegame loading (thanks Zuu)
  • Rewrite the innerards to make expansion easier
  • requirements are now SuperLib v6 and Binary Heap v1
-------

I present my AI - WmDOT (short for William's Department of Transportation).

What WmDOT does is build out the highway network rather than compete with you. It select a capital and builds out the highway network from there, with higher weightings on connecting cities that are higher in population and close together. It can work through a 256x256 map inside a couple of years.

It is also designed to allow multiple instances to work together (each instance selects its own capital/starting point).

Full Buildout
Image

Multiple Instances in action
Image

Available here on or Bananas.

Requires SuberLib v37 and MetaLibrary v8.
Attachments
WmDOT-14.tar
WmDOT v14
(160 KiB) Downloaded 416 times
Last edited by MinchinWeb on 29 Aug 2016 22:36, edited 18 times in total.
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: WmDOT v2

Post by Michiel »

Congratulations, always nice to see a new AI! I look forward to trying it out. Looks like your building style makes you a new best friend for Rondje ;-)
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: WmDOT v2

Post by Brumi »

I downloaded it from Bananas, it doesn't work 'out of the box'. I had to copy your road pathfinder to the library directory. Could you come up with a solution so that this won't be needed?
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: WmDOT v2

Post by SirkoZ »

Brumi wrote:I downloaded it from Bananas, it doesn't work 'out of the box'. I had to copy your road pathfinder to the library directory. Could you come up with a solution so that this won't be needed?
And I just downloaded it... Good thing I didn't try it out yet...

By the way - for the revenue stream you can make some airplanes between reasonably sized towns (=accept goods) or if aircraft are disabled, you can make some bus routes between same towns...
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: WmDOT v3

Post by MinchinWeb »

Michiel wrote:I downloaded it from Bananas, it doesn't work 'out of the box'. I had to copy your road pathfinder to the library directory. Could you come up with a solution so that this won't be needed?
Version 3 is up (here and Bananas) that should solve the issue. I've moved the pathfinder to a dedicated file rather than trying to use it as a library. Maybe I can convince them to update the Road Pathfinder in the meantime...
Brumi wrote:By the way - for the revenue stream you can make some airplanes between reasonably sized towns (=accept goods) or if aircraft are disabled, you can make some bus routes between same towns...
I'm in the process of examining the possibilities... I have a few ideas but both of your suggestions are probably the easiest to program... Stay tuned :wink: At this point, I mostly wanted to get it out there - the exposure helps move the project along :)
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: WmDOT v3

Post by Zuu »

I've noticed that your info.nut does not contain this code:

Code: Select all

   function UseAsRandomAI()  { return false; }
If you include it, the AI will not be selected by OpenTTD as a random AI. You might want to consider this for AIs which has the main purpose of providing background services rather than operating transport companies.

However, if your plan is to actually operate bus/truck transport on your highways, then I don't see any reason why your AI can't be included as a random AI.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Felix Atagong
Engineer
Engineer
Posts: 45
Joined: 16 Apr 2007 19:50
Location: Louvain
Contact:

Re: WmDOT v3

Post by Felix Atagong »

I love the idea of a road making AI, now if only we could implement
toll roads
or a
yearly (monthly) tax from every player so that it could go on forever...

But that would need a complete re-organisation of the game I fear...
laserdog
Engineer
Engineer
Posts: 12
Joined: 27 Mar 2011 03:12

Re: WmDOT v3

Post by laserdog »

cant you make an ai hack in its own money?
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: WmDOT v3

Post by Lord Aro »

No, that would be cheating, and AIs can't cheat (apart from the original AI, which is gone)
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
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: WmDOT v3

Post by Zuu »

When loading a game with this AI I get an error:
Unnamed, 2nd Feb 1987.png
Unnamed, 2nd Feb 1987.png (66.35 KiB) Viewed 2666 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: WmDOT v3

Post by MinchinWeb »

Zuu wrote:When loading a game with this AI I get an error:
Unnamed, 2nd Feb 1987.png
Thanks for the report Zuu. It seems fixing one problem (rebuilding HQ on reload) has created another (a missing function). :( The function in question has been written, so I'll try an post an update tomorrow. In the mean time, destroying the company HQ, and then reloading the AI would allow you to continue.

P.S. Thanks for your SuperLib!
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: WmDOT v3

Post by Zuu »

No hurry. Just wanted to make you aware of it.
MinchinWeb wrote:P.S. Thanks for your SuperLib!
I'm glad that you found it useful. I've noticed that in the current version Log.Warning does produce an AILog.Error() call. This will be fixed in the next release, but I don't see it as a very important issue, just though it might be useful to know if you try to use it and don't get the expected behaviour.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: WmDOT v4

Post by MinchinWeb »

Version 4 is now up that fixes the savegame loading bug Zuu mentioned.

Upcoming, I hope to do something so it doesn't bog down near so bad on large maps, and eventually to bring food and water to towns to help them grow...
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: WmDOT v5

Post by Roujin »

Hello MinchinWeb,

I really liked the idea of this AI when I found it by chance on BaNaNaS, and used it in a game, along with TownCars, for some nice eyecandy and obstacles.
It started out fine building a nice road network between the towns, but later on it began messing up the routes, like you can see on the screenshot. I did use the company change cheat to give both AIs a nice amount of cash to work with, and later used it again to clean up some mess WmDOT made in an area that I needed to build in.

Notice that version 4 (revision 52d) of your AI is used, guess that was the newest version around when I started the game. OpenTTD version is 1.1.0.
Attachments
Gunston Transport, 1983-08-07.png
(384.25 KiB) Downloaded 5 times
* @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
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: WmDOT v5

Post by Leanden »

I tried this AI, and it crashed straight out of the box.
Attachments
British Transport Agency, 24th Jul 2014.png
(406.56 KiB) Downloaded 5 times
Image
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: WmDOT v5

Post by MinchinWeb »

Thanks for the reports... My internet is currently down :cry: so it might be a couple of days before I get the fix posted...
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
DeletedUser6
Transport Coordinator
Transport Coordinator
Posts: 294
Joined: 23 Jul 2007 15:13
Location: Somewhere in this page

Re: WmDOT v5

Post by DeletedUser6 »

You lucky few - whenever I get WmDOT - I merely get a failed to compile /WmDOT-3/ and a failed to compile /WmDOT-5/.

EDIT: Downloaded from BaNaNas

Matthew:out
Yay! I'm back! Did you miss me?


...


I thought not.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: WmDOT v5

Post by Zuu »

Which OpenTTD version did you use?
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Leanden
Tycoon
Tycoon
Posts: 2613
Joined: 19 Mar 2009 19:25
Location: Kent

Re: WmDOT v5

Post by Leanden »

Openttd Stable 1.1.0
Image
User avatar
MinchinWeb
Traffic Manager
Traffic Manager
Posts: 225
Joined: 01 Feb 2011 12:41
Contact:

Re: WmDOT v6

Post by MinchinWeb »

Roujin wrote:Hello MinchinWeb,

I really liked the idea of this AI when I found it by chance on BaNaNaS, and used it in a game, along with TownCars, for some nice eyecandy and obstacles.
It started out fine building a nice road network between the towns, but later on it began messing up the routes, like you can see on the screenshot. I did use the company change cheat to give both AIs a nice amount of cash to work with, and later used it again to clean up some mess WmDOT made in an area that I needed to build in.

Notice that version 4 (revision 52d) of your AI is used, guess that was the newest version around when I started the game. OpenTTD version is 1.1.0.
Just for you Roujin, I added a "Cleanup Crew" to WmDOT, new for version 6. It helps, but isn't perfect. You see, WmDOT will (now) only build one road between each town pair, but later on, those town pairs can be across the map. The result is WmDOT will still sometimes build several routes parallel to each other. I'm not sure how to fix the problem more as WmDOT really has no conception of the network as a whole or really the map as a whole. Suggestions on how to improve this are welcome!

Unfortunately, this won't help you with your current game as the Cleanup Crew is run as part of the building procedure.

Below is a sample of the improvement Cleanup Crew makes. It's the same map, run for ~30 year with WmDOT v5 and ~40 years with WmDOT v6.
Image
Attachments
WmDOT v5 vs v6
WmDOT v5 vs v6
With Cleanup Crew v1.png (75.8 KiB) Viewed 2664 times
Last edited by MinchinWeb on 28 Apr 2011 18:07, edited 1 time in total.
Alberta Town Names - 1500+ real names from 'Acme' to 'Zama City'
MinchinWeb's Random Town Name Generator - providing 2 million plus names...
WmDOT v13 - An AI that doubles as your highway department
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests