Page 3 of 6

Re: WmDOT v8 [2012-01-21]

Posted: 26 Jan 2012 04:16
by MinchinWeb
Thanks to the wonderful people on this forum (with a little help from Google and the GRF Crawler), I have managed to find all the files needed. The behavior is...odd. For some reason, my function to find the station at the Fishing Grounds is failing. Most investigation and coding to follow...

Re: WmDOT v8 [2012-01-21]

Posted: 03 Mar 2012 23:10
by doublehappy
Hi - I am receiving the following error on initialisation of the AI. This is a fresh Windows install, so I downloaded the latest nightly and then downloaded the AI through the in-game online content. I searched the error message and it looks like AIAbstractList is obsolete now?

Image

Usually I'd give up and move on but I love the idea of this AI. Thanks for any help!

Re: WmDOT v8 [2012-01-21]

Posted: 04 Mar 2012 00:37
by MinchinWeb
doublehappy wrote:Hi - I am receiving the following error on initialisation of the AI. This is a fresh Windows install, so I downloaded the latest nightly and then downloaded the AI through the in-game online content. I searched the error message and it looks like AIAbstractList is obsolete now?
(..)
Usually I'd give up and move on but I love the idea of this AI. Thanks for any help!
Thanks for the report. AIAbstractList has indeed been replaced, but I guess I must have missed this one :( I'll try and fix it right away, this should be an easy fix :D

Re: WmDOT v8 [2012-01-21]

Posted: 04 Mar 2012 01:12
by Zuu
I believe that is a bug in SuperLib. I think you could do this at global scope to fix it until version 22 is out:

Code: Select all

AIAbstractList <- AIList

Re: WmDOT v8 [2012-01-21]

Posted: 18 Mar 2012 03:13
by MinchinWeb
Version 9 has been released! Available in the first post on or Bananas. Improvements include:
  • Now supports all of FIRS' water industries
  • Code fixes due to updated AI framework (doublehappy's bug and Zuu's solution, among others)
  • Should be better at building ship routes that actually connect! (JacobD88's bug)
Thanks for all your comments!

I will keep trying to fix bugs as they are reported. As for the next addition to WmDOT, I would like to improve the ship pathfinder, improve ship selection, move to dynamic route management, and move OpDOT (the road building) to a grid based system (hopefully to improve speed on larger maps).

Re: WmDOT v8 [2012-01-21]

Posted: 20 Mar 2012 01:39
by Core Xii
There appears to be something wrong with WmDOT version 9 on Bananas, in that OpenTTD doesn't load it at all.

Re: WmDOT v8 [2012-01-21]

Posted: 22 Mar 2012 00:33
by MinchinWeb
Core Xii wrote:There appears to be something wrong with WmDOT version 9 on Bananas, in that OpenTTD doesn't load it at all.
WmDOT v9 requires version 1.2 of the API and so requires r23879 (or thereabouts) or the latest release candidate version. I've updated Bananas so the download shouldn't show up if your version of OpenTTD can't load it. Sorry for the confusion!

Re: WmDOT v9 [2012-03-17]

Posted: 27 May 2012 17:40
by Paasky
First of all, thanks for this great AI: a perfect fix for the ridiculous gridlock 2x StreetTraffic with 500 cars max each causes in cities I'm not connecting myself :)

I was wondering, would it be possible (with the current pathfinder) to make it be able to build motorways? Something simple like this:
Image

I read earlier in the thread about the problems of long-distance roads & calc time. I wonder if that could be reduced by limiting the max # of turns between two cities to one or two (then either bridge/tunnel any obstacles). I just wonder if the stock pathfinder can be used to do this. Or if it even can handle one-way roads for that matter.


Nevertheless this AI will be a great addition to the coop multiplayer games my friends and I have, making the game world feel a bit more "real" ;)

Re: WmDOT v9 [2012-03-17]

Posted: 28 May 2012 19:47
by MinchinWeb
Hey Paasky! So glad to hear you're loving my AI!
Paasky wrote:First of all, thanks for this great AI: a perfect fix for the ridiculous gridlock 2x StreetTraffic with 500 cars max each causes in cities I'm not connecting myself :)

I was wondering, would it be possible (with the current pathfinder) to make it be able to build motorways? Something simple like this:

I read earlier in the thread about the problems of long-distance roads & calc time. I wonder if that could be reduced by limiting the max # of turns between two cities to one or two (then either bridge/tunnel any obstacles). I just wonder if the stock pathfinder can be used to do this. Or if it even can handle one-way roads for that matter.

Nevertheless this AI will be a great addition to the coop multiplayer games my friends and I have, making the game world feel a bit more "real" ;)
Motorways (or freeways) would indeed be possible. Building one way roads instead of two way roads is a simple change. The pathfinder is directional, so running it both directions would give you both sides of the freeway. This would double your pathfindering time, but that would be fine as long as you don't try to go from one end of the map to the other at once (where pathfinding time is already a problem).

The hard part is actually more in the aesthetics. Running the pathfinder as it is, there is no way to enforce 'drive on the right' or 'drive on the left' rules, or to keep the two highways from crossing each other, or to keep the two highways side by side. How do you find the end of existing freeways to continue them? How long do you make the access road?

To some extent, the fact that the highways might not be side by side is a feature rather than a bug - it's used often in the real world where it's called 'independent gradelines' and used to get gentler hills.

But I love the idea, so I'll see what can be done with it next time I sit down to work on WmDOT.

P.S. I think they'd rather you upload pictures to the forum here, rather than use something like Imgur. That way, they can better make sure that the images don't disappear before the post does.

Re: WmDOT v9 [2012-03-17]

Posted: 29 May 2012 09:42
by JacobD88
Hi Minchinweb,

With regards to motorways i envisage one more problem; junctions...

Once the AI has built the motorways you won't be able to join roads on to them unless you buy the AI out as you can't add junctions to one-way roads and you can't modify the road section to stop it being one-way because you don't own it.

Unless a solution can be found this would make WMDot a pain, as one of the things i love about the AI now is you can just join on to its road network as you please, even if the AI's company isn't purchased...

Re: WmDOT v9 [2012-03-17]

Posted: 29 May 2012 18:56
by Zuu
Regarding junctions:
Convert wmDOT into a GameScript, then players who want a junction can propose that by placing a sign where they want a junction with some pre-defined content (eg. "junction please") Or, keep wmDOT as an AI and create a game script that reads player signs that contain human readable commands to AIs and post that using SCP to the AI.

Or, build highways with one-way signs only every X tiles. Eg. every 3-4 tiles. That then allows players, towns or AIs to add junctions if they wish.

Re: WmDOT v10 [2012-06-27]

Posted: 28 Jun 2012 04:06
by MinchinWeb
Version 10 released! The most notable improvement is that WmDOT is dynamically add ships. It isn't smart enough to delete ships yet, so we'll just cross our fingers that industry production just never goes down... Ship depots also will not longer be built right next to docks.

I hope the next version will add the ability to delete ships if too many are in circulation and replace ships when they get old.

No freeways have been built yet... I'm still considering the best way deal with junctions and access roads.

Available at the first post of this thread or on Bananas.

Re: WmDOT v10 [2012-06-27]

Posted: 28 Jun 2012 20:26
by FLHerne
Junctions/freeways: Could it detect the presence of player-built roads leading up to the freeway, and then build a junction to them?

Re: WmDOT v10 [2012-06-27]

Posted: 29 Jun 2012 05:46
by Zuu
If you accept a delay of 1-2 months, it is possible for the GS to detect your road. If you want quicker action (and saved CPU time), it can be made that the player must tell the GS by placing a sign with a specific message at near the road.

Scanning the list of signs is a few times a month is much quicker than doing advanced scanning of the map several times a month.

Re: WmDOT v10 [2012-06-27]

Posted: 19 Jul 2012 20:13
by FLHerne
More junctions/motorways: Surely not every tile needs to be one-way? If every 4th tile (say) was one-way, this would still ensure that the road was used correctly, while still allowing other roads to be connected to the motorway.

Re: WmDOT v9 [2012-03-17]

Posted: 19 Jul 2012 20:43
by MinchinWeb
Zuu wrote:Convert wmDOT into a GameScript, (...)
I've considered this and even started working on a conversion, and had it running, but ran into issues as at the time because GameScripts couldn't build tunnels or bridges, and couldn't remove road tiles. I think the tunnels and bridges issue has been fixed, but I don't know if road removal works yet. Can anyone confirm that GameScripts can remove roads?
Zuu wrote:Or, build highways with one-way signs only every X tiles. Eg. every 3-4 tiles. That then allows players, towns or AIs to add junctions if they wish.
FLHerne wrote:More junctions/motorways: Surely not every tile needs to be one-way? If every 4th tile (say) was one-way, this would still ensure that the road was used correctly, while still allowing other roads to be connected to the motorway.
I'm thinking out loud trying to figure out what problems I might run into... the biggest one that comes to mind is that if I run the pathfinder in one direction, built the road with one-ways every few titles, and then run the pathfinder the other direction, what's to keep the two directions from continually merging and un-merging? (see picture below) Or worse yet, put a one-way arrow on the common (merged) piece effectively rendering the whole road one-way?
McAlpine & Co., 31st Jan 1950.png
McAlpine & Co., 31st Jan 1950.png (91.83 KiB) Viewed 6464 times
One option is to build a pathfinder that finds both directions at the same time (I know one of the AI's does that for rail pathfinding). This would probably help for pathfinding speed, but would require me to write (or heavy modify) a new pathfinder. One idea I've been playing with is a sort of 'meta-pathfinder' that would break longer pathfinding tasks into finding shorter paths between a series of grid points; maybe that could be easily expanded... Unfortunately, no code for that has been written yet either.

Thanks for taking an interest and helping me problem solve!

Re: WmDOT v10 [2012-06-27]

Posted: 19 Jul 2012 20:57
by FLHerne
Perhaps you could build it with all one-way signs, and then remove many of them?

Totally unrelated: When used with TownCars (and presumably if any other player was using the network), the Cleanup Crew tend to leave cars stranded on single tiles while removing road links. Would it be possible to make it remove roads carefully in order to avoid trapping cars?

Re: WmDOT v10 [2012-06-27]

Posted: 19 Jul 2012 21:03
by FLHerne
Dubious routing decision...
Unnamed, 2nd Sep 2002.png
Unnamed, 2nd Sep 2002.png (92.37 KiB) Viewed 6462 times
Fails to build a bridge...(also random loop)
Unnamed, 5th Apr 2002.png
Unnamed, 5th Apr 2002.png (81 KiB) Viewed 6462 times
What the... :shock:
Unnamed, 16th Nov 2001.png
Unnamed, 16th Nov 2001.png (138.09 KiB) Viewed 6462 times

Re: WmDOT v10 [2012-06-27]

Posted: 19 Jul 2012 21:04
by FLHerne
As previous, but with expensive bridge...
Unnamed, 25th Feb 2004.png
(980.77 KiB) Downloaded 3 times
EDIT: Too many crossroads :P
Black & Co., 17th Oct 2015.png
Black & Co., 17th Oct 2015.png (61.09 KiB) Viewed 6458 times
EDIT2: A random bridge thing.
Black & Co., 1st Apr 2018.png
Black & Co., 1st Apr 2018.png (109.93 KiB) Viewed 6457 times

Re: WmDOT v10 [2012-06-27]

Posted: 19 Jul 2012 21:57
by FLHerne
Two examples of useless bridges...