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
Paasky
Transport Coordinator
Transport Coordinator
Posts: 269
Joined: 06 Sep 2004 07:38
Location: Vantaa, Finland
Contact:

Re: WmDOT v9 [2012-03-17]

Post by Paasky »

Cool that you're thinking about adding this in :D

I have a feeling one-way bits on every other grid would be best, as then it would be impossible for any vehicle to drive on the wrong side of the road, while keeping the ability to build intersections:
roads.png
(74.35 KiB) Downloaded 13 times
Also one-way bits at both ends of any bridge or tunnel so they can't be used to go the wrong way either.


Ownership of the roads isn't that big of a problem for me, as I start my games from 1885. So the WmDOT builds a few roads, goes bankrupt, and then starts up again ;) But obviously everyone doesn't play like I do.


My thoughts on the pathfinder (without almost any knowledge how difficult they would be to implement :P):
- Only allow a limited amount of turns for motorways, maybe max 2-4. This makes them both faster to travel on & look more... dominating I guess.
- Don't make them go directly from city to city, but rather start & end just outside of a city, with a road into the city:
Brown & Co., 1885-01-16.png
(465.4 KiB) Downloaded 13 times
These could then be expanded further to longer and longer distances.

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

Re: WmDOT v11 [2012-12-31]

Post by MinchinWeb »

Version 11 is released!

In what is likely to be the last release of 2012 :D WmDOT has been updated. There are three major updates:
  • Ship management - WmDOT will delete extra ships on a route. As another bonus, it will also name ships.
  • Grid Based Pathfinding - this is done using Dominion Land System which was added in the latest version of MetaLibrary. The grid is 8x8. While this sometimes results in some random stub roads, many parallel roads should less of an issue.
Multiple WmDOT's (v11) at full build-out.
Multiple WmDOT's (v11) at full build-out.
WmDOT v11 on Grids.png (11.79 KiB) Viewed 3637 times
  • Freeways! (or dual carriageways) - this builds on the grid pathfinding. If the pathfinder builds a straight path between grid points, it will attempt to twin it. If twinning is successful, the couplet is turned into one-way roads. Access is available every 8 squares or so.
WmDOT Twinned Freeways!
WmDOT Twinned Freeways!
WmDOT Twinned Freeways.png (358.8 KiB) Viewed 3637 times
As always, please report bugs and other strange behaviour here.

Update: Version 11.1 has been uploaded to fix a typo.

As a side, it's amazingly gratifying to see the uptake WmDOT has seen. I have no way of knowing exactly how many people play it, but WmDOT (in all it's versions) has been downloaded over 100,000 times!! :shock:
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
thphwh
Director
Director
Posts: 516
Joined: 23 Dec 2011 13:50
Location: Letchworth GC

Re: WmDOT v11 [2012-12-31]

Post by thphwh »

Nice to see highways included! Well done!

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: WmDOT v11 [2012-12-31]

Post by Zuu »

Hello,

I let wmDOT run in fast forward in the background with lots of money to see what it could accomplish. However, at some point the script crashed. (I don't know when that happened, only that the script ran for maybe 10 or 20 years from 1950 to 1960-1970-ish. From that to 2050 it have been running without supervision.)

Aditionally, I've highlighted in the first screenshot a situation where the AI seem to have failed. I beleive there was an industry there before which was the reason it was not able to go straight. However, if you look at the lower left of the circle, the slope of the hill seem to have prevented the script from connecting the two sides of the highway. So the highway was left a bit unconnected. Maybe that is a consequence of the grid system that is hard to do anything about?
Glyttudde Transport, 26th Jan 2052.png
(122.31 KiB) Downloaded 11 times
Earlier part of the error:
Glyttudde Transport, 26th Jan 2052#1.png
(51.91 KiB) Downloaded 12 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: 226
Joined: 01 Feb 2011 12:41
Contact:

Re: WmDOT v11 [2012-12-31]

Post by MinchinWeb »

Thanks for the report Zuu.

Yes, the two unconnected sides of the highway are due to the slope and trying to connect only at grid points. WmDOT is smart enough not to turn the two roads into one way if they can't be connected, but maybe I should move that check up and not built the second road if the two sides can't be connected... I'll give it some thought. If you see any other funny road connections and have a suggestion on how it should look, let me know.

The crash is actually a result of a bug in the ship pathfinder, which will take longer to root out. My guess is that it eventually timed out (it had been running for ~50 years) but it still didn't have a working path and so broke the AI. Fixing the ship pathfinder is high on my list of things to do, but surprisingly complicated.

And thanks again 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

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: WmDOT v11 [2012-12-31]

Post by Samu »

Error. It was trying to do something with Docks, but failed.
Attachments
Unnamed, 1982-04-30.png
(26.06 KiB) Downloaded 12 times
wmdot v12 error.sav
(404 KiB) Downloaded 72 times

Gankenstein
Engineer
Engineer
Posts: 41
Joined: 28 Mar 2013 13:30

Re: WmDOT v11 [2012-12-31]

Post by Gankenstein »

WinDOT v12 crash. Has been running 1925 - 1947 just fine (went bankrupt once). Have no idea what it was trying to do.
Attachments
WinDot v12 crash.PNG
WinDot v12 crash.PNG (17.98 KiB) Viewed 3304 times
Helemaal te gek BV.sav
(1.83 MiB) Downloaded 66 times

R-TEAM
Engineer
Engineer
Posts: 59
Joined: 19 Jan 2005 10:34
Location: Germany

Re: WmDOT v11 [2012-12-31]

Post by R-TEAM »

Hi,

your AI runs first good and make good progress in conecting towns ... but then it crashes again and again with the same error ...
Picture from error and save game added...
I play HardGame version (actual) and many NewGFXs ...

Regards
R-TEAM
Attachments
WmDOT.png
(522.2 KiB) Downloaded 8 times
No-Way Trans&Co AG, 16. Jul 1943.sav
(1.17 MiB) Downloaded 70 times

OmagaIII
Engineer
Engineer
Posts: 4
Joined: 03 Nov 2013 09:29

Re: WmDOT v11 [2012-12-31]

Post by OmagaIII »

Good Day,

I recently started playing OTTD again, and on some suggestions got hold of GRF's and AI etc...

I am currently having a problem with wmDOT though :/

I have attached the crash report to this post. Any help would be great :mrgreen:
Attachments
error.png
(1.11 MiB) Downloaded 7 times

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: WmDOT v11 [2012-12-31]

Post by Zuu »

Did you download WmDOT via in-game content download?

If yes: then the BaNaNaS entry is missing correct dependency declaration. You can obtain version 2 of Queue.FibonacciHeap here: Queue.FibonacciHeap-2.tar.gz and manually put it in [OpenTTD]/ai/library/ (where [OpenTTD] is Documents\OpenTTD on windows or ~/.openttd in Linux)
If no: then download WmDOT with the in-game downloader so that you get all depnedency automatically. (or follow the "if yes" path above to obtain it manually)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

OmagaIII
Engineer
Engineer
Posts: 4
Joined: 03 Nov 2013 09:29

Re: WmDOT v11 [2012-12-31]

Post by OmagaIII »

Ok, got that error out of the way, now I have a new one :(
Attachments
error.png
(439.47 KiB) Downloaded 8 times

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9394
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: WmDOT v11 [2012-12-31]

Post by planetmaker »

OmagaIII wrote:Ok, got that error out of the way, now I have a new one :(
That will be very hard to follow-up for the author. If you look closely at your screenshot, you'll notice that the first line(s) of the error output are all truncated. But they contain the crucial information as to where the error occured. It will be much helpful, if you could produce (next time) more screenshots by scrolling the output so that the complete error output is visible.

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

Re: WmDOT v11 [2012-12-31]

Post by MinchinWeb »

Thank you for your quick response, Zuu and Planetmaker.

OmagaIII: What Planetmaker says is true: without all of the error output, it is hard for me to know exactly what went wrong. I can guess that what's happened is that WmDOT tried to water path, timed out, and crashed, however. I have a few ideas on what to do about this, but have struggled to fix this. Do you have a copy of this game that you could upload to the Forums here so I can see the map and confirm my suspicions?
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
kamnet
Moderator
Moderator
Posts: 7074
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: WmDOT v11 [2012-12-31]

Post by kamnet »

Any idea why WmDOT would build dual carriageways like this?
Attachments
wmdot.png
wmdot.png (38.91 KiB) Viewed 2666 times

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

Re: WmDOT v11 [2012-12-31]

Post by MinchinWeb »

kamnet wrote:Any idea why WmDOT would build dual carriageways like this?
The way WmDOT builds freeways (or dual carriageways, if you prefer) is it connects dots on an 8x8 grid. This reduces the clutter that long running WmDOT's were causing in earlier versions, but occasionally leaves odd stub ends like the one above. Depending on the town locations on the map, WmDOT might later extend the Freeway past this stub end.
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
kamnet
Moderator
Moderator
Posts: 7074
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: WmDOT v11 [2012-12-31]

Post by kamnet »

Sorry if I wasn't more clear, look at how the one-way roads are laid out.

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

Re: WmDOT v11 [2012-12-31]

Post by MinchinWeb »

kamnet wrote:look at how the one-way roads are laid out.
Well, if I guess wrong, tell me what you think is strange about it, and I'll try again.

The fact that there is a non-one way tile at the end of some (but not all) of the freeway links is due to the way that the AI can make one way roads: it must draw the 'one-way-ness' from one tile to an adjacent tile. (Unlike a human player that can draw one-way-ness on only one tile at a time if he wishes.) If both tiles can become one-way, then it works. If one tile can't become one-way, the process fails for both tiles. As well, the process doesn't 'make' a tile one-way, it just flips whether it is or not. WmDOT 'draws' one-way-ness down the full length of the freeway, one tile pair at a time, and you can see the result. This works well enough, in my opinion, to provide one-way-ness without having to explicitly deal with every crossroad and T-ing possibility, while preventing vehicles from going down the 'wrong side' of the freeway.

As for the fact that right/left orientation isn't maintained, it's because of the numbered tile grid: the one way road going 'up' the grid (i.e. the tile reference is getting smaller) is always the 'upper' row of the two freeway links.
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
skippern
Traffic Manager
Traffic Manager
Posts: 199
Joined: 30 Oct 2013 13:57

Re: WmDOT v11 [2012-12-31]

Post by skippern »

What I think Kemnet refers to is the fact that some parts of the dual carriageway are left-hand-side, and other parts are right-hand-side. That falls odd for me too. I have seen it a few times but always dismissed it as different AIs.
Skippern
OpenTTD Mac user

User avatar
kamnet
Moderator
Moderator
Posts: 7074
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: WmDOT v11 [2012-12-31]

Post by kamnet »

skippern wrote:What I think Kemnet refers to is the fact that some parts of the dual carriageway are left-hand-side, and other parts are right-hand-side. That falls odd for me too. I have seen it a few times but always dismissed it as different AIs.
Bingo, this be the one. I would think that maintaining one-way direction would be dependent on whether the player has set driving to the left- or right-side. You don't normally come to an intersection on a highway where the flow of traffic cris-crosses.

(Well, I take that back. You do find it on the diverging diamond interchange, but since OpenTTD cannot implement such designs, this is indeed bizarre to me.)

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

Re: WmDOT v13 [2014-03-10]

Post by MinchinWeb »

Version 13 of WmDOT is released! This fixes two bugs that were reported:
  • the ship pathfinder will no longer crash WmDOT if it times out
  • WmDOT will no longer crash by trying to buy a non-existent company
This release also aims to speed up the Ship Pathfinder.

@kamnet: diverging diamonds are all sorts of fun. Have you ever seen a Continuous Flow Intersection?
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: Timberwolf and 2 guests