Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Thu Nov 23, 2017 6:33 pm

All times are UTC




Post new topic  Reply to topic  [ 112 posts ]  Go to page Previous 1 2 3 4 5 6 Next
Author Message
PostPosted: Mon Oct 13, 2014 7:10 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2544
Location: Kent
Hi Minch, I dont know if you are still maintaining this, but it still runs unbelievably slow.

Im running a 4968x4968 map, and have had the AI running for 3 hours now on fast forward, and its managed to build 1 ship and nothing else (ive cheated it 50,000,000 but its not using it for roads).

_________________
Image


Top
   
PostPosted: Mon Oct 13, 2014 8:49 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4532
Location: /home/sweden
4968x4968 is extremely large and I would expect many AIs to have a problem with it unless they have some special strategy to not get into choice overload. Especially as most AIs that you find available were made when 2048x2048 was the maximum map size.

What you can do is to increase the number of oopcodes that the AI can execute per tick. Basically you can allow the AI to "think" more per game time. However, the tick will be over immediately if an AI make an API call that manipulates the game state. So for building operations it only got 74 building actions per second. This limit does not increase when map sizes increase.

Edit: In (advanced) settings you find the oopcodes setting in the group with settings for computer opponents. You will most likely need to choose to view expert settings.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
PostPosted: Mon Oct 13, 2014 8:59 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2544
Location: Kent
Another issue, the AI seemed to freeze and in debug get replaying this message:

"You can't convert a path while there's a running pathfinder."

It comes from this section of code, but i cant identify the issue:

Code:
function _MinchinWeb_RoadPathfinder_::PathToTilePairs()
{
//   Returns a 2D array that has each pair of tiles that path joins
   if (this._running) {
      AILog.Warning("You can't convert a path while there's a running pathfinder.");
      return false;
   }
   if (this._mypath == null) {
      AILog.Warning("You have tried to convert a 'null' path.");
      return false;
   }
   
   local Path = this._mypath;
   local TilePairs = [];

   while (Path != null) {
      local SubPath = Path.GetParent();
      if (SubPath != null) {
         TilePairs.push([Path.GetTile(), SubPath.GetTile()]);   
      }
   Path = SubPath;
   }
   
   //   End build sequence
   return TilePairs;
}


EDIT: I set opcodes to 100,000 and it isnt any faster :/

_________________
Image


Top
   
PostPosted: Mon Oct 13, 2014 10:17 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
@Leanden:The problem you see isn't caused by the map size directly. What I think WmDOT is trying to do is run the ship pathfinder between two points in different waterbodies. WmDOT will keep trying and trying until it is absolutely sure there is no connetions. So basically it is stuck in an infinate loop. And if WmDOT got one ship running, it will probably never run out of money either. I've worked at re-writing the ship pathfinder twice, but struggled with testing.

The solution (recommend for large maps or when you just want the road building): In WmDOT's settings, turn off 'Operation Hibernia'. This will turn off the ship building. As well, run multiple instances of WmDOT (they'll play nice together). On a 512x512 map, I will often run 4 instances. So on a 2k x 2k map you could probably fill all the AI slot with WmDOT's.

Hope this helps and provides some insight.
- MinchinWeb

_________________
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


Top
   
PostPosted: Mon Oct 13, 2014 10:22 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
Leanden wrote:
Another issue, the AI seemed to freeze and in debug get replaying this message:

"You can't convert a path while there's a running pathfinder."

It's throwing this error as the pathfinder has timed out without finding a path...

_________________
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


Top
   
PostPosted: Tue Oct 14, 2014 7:14 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2544
Location: Kent
Thanks, Ill try running it without Hibernia active.

Will WmDOT build level crossings?

_________________
Image


Top
   
PostPosted: Tue Oct 14, 2014 1:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Mar 19, 2009 7:25 pm
Posts: 2544
Location: Kent
Ok new problem, the debug is spamming "cannot convert null path".

_________________
Image


Top
   
PostPosted: Sun Oct 19, 2014 4:31 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
Leanden wrote:
Will WmDOT build level crossings?

I'm pretty sure WmDOT will avoid building level rail crossings wherever possible.

Leanden wrote:
the debug is spamming "cannot convert null path".

If WmDOT keeps building stuff, this isn't a problem. This is what happens when the pathfinding fails, but WmDOT is much better at dealing with impossible road connections than sea connections.

_________________
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


Top
   
PostPosted: Sat Dec 13, 2014 4:51 pm 
Offline
Engineer
Engineer

Joined: Sat Dec 13, 2014 4:48 pm
Posts: 1
Hi, my WmDOT v 13 crashed, and told me to come to this page and report the error.

Code:
dbg: [script] [14] [S] Your script made an error: parameter 1 has an invalid type 'null' ; expected: 'integer'
dbg: [script] [14] [S]
dbg: [script] [14] [S] *FUNCTION [ToStringTiles1D()] minchinwebs_metalibrary-8/Array.nut line [570]
dbg: [script] [14] [S] *FUNCTION [Run()] wmdot-13/OpHibernia.nut line [406]
dbg: [script] [14] [S] *FUNCTION [Start()] wmdot-13/main.nut line [130]
dbg: [script] [14] [S]
dbg: [script] [14] [S] [@ITERATOR@] 1
dbg: [script] [14] [S] [Tile] NULL
dbg: [script] [14] [S] [@INDEX@] 0
dbg: [script] [14] [S] [Temp] ""
dbg: [script] [14] [S] [Length] 2
dbg: [script] [14] [S] [ArrayLength] false
dbg: [script] [14] [S] [InArrayOfTiles] ARRAY
dbg: [script] [14] [S] [this] INSTANCE
dbg: [script] [14] [S] [Depot2] 2877462
dbg: [script] [14] [S] [Depot1] NULL
dbg: [script] [14] [S] [NumberOfBuoys] 0
dbg: [script] [14] [S] [loops] 2
dbg: [script] [14] [S] [SPFResults] ARRAY
dbg: [script] [14] [S] [WBCResults] true
dbg: [script] [14] [S] [WBCTries] 1
dbg: [script] [14] [S] [OldStarts2] INSTANCE
dbg: [script] [14] [S] [Ends2] INSTANCE
dbg: [script] [14] [S] [Starts2] INSTANCE
dbg: [script] [14] [S] [end] 2871319
dbg: [script] [14] [S] [start] 2881544
dbg: [script] [14] [S] [KeepTrying2] false
dbg: [script] [14] [S] [Ends] ARRAY
dbg: [script] [14] [S] [Starts] ARRAY
dbg: [script] [14] [S] [DockLocation] 2871320
dbg: [script] [14] [S] [BuildPair] ARRAY
dbg: [script] [14] [S] [KeepTrying] true
dbg: [script] [14] [S] [tick2] 17953
dbg: [script] [14] [S] [InIndustries] INSTANCE
dbg: [script] [14] [S] [@ITERATOR@] 1
dbg: [script] [14] [S] [CargoNo] 3
dbg: [script] [14] [S] [@INDEX@] 0
dbg: [script] [14] [S] [MyCargos] ARRAY
dbg: [script] [14] [S] [Produced] INSTANCE
dbg: [script] [14] [S] [MyIndustries] INSTANCE
dbg: [script] [14] [S] [tick] 17003
dbg: [script] [14] [S] [this] INSTANCE
dbg: [script] [14] [S] [Time] 16572
dbg: [script] [14] [S] [HQTown] 172
dbg: [script] [14] [S] [Debug_1] "/* v.13, r.121231 // r.27029 // 1961-9-4 start // 2048x2048 map - 1536 towns */"
dbg: [script] [14] [S] [Debug_2] "/* Settings: 0-0 - dl3 // OpDOT: 1 - 100 - 50 - 2 - 1 // OpHibernia: 1 */"
dbg: [script] [14] [S] [this] INSTANCE
dbg: [script] The script died unexpectedly.


That's the error I got.

This is with OpenTTD 1.4.4.

Please let me know if you need any more information.


Top
   
PostPosted: Sat Dec 13, 2014 8:01 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
Thanks wodencafe. I'll look into it. It seems that WmDOT was trying to build a ship route and something failed...

_________________
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


Top
   
PostPosted: Wed Jul 29, 2015 12:49 am 
Offline
Traffic Manager
Traffic Manager

Joined: Sat Nov 29, 2014 11:23 pm
Posts: 147
It's taken me forever to learn how to activate an ai. Wmdot interests me but none of the 4's worth (replicates) I've loaded is working, e.g., no construction cost appears within their balance sheets (the oldest ai's now 2 years old). The ai script debug panel indicates each of their listed libraries and attributes(?) as being loaded and linked up. What might I be doing wrong? Having read the readme when configuring the settings, what is a "DOT State", it makes no sense to me? No Atlas Size setting appeared, have the settings been revised in a subsequent update? Screenshot of one of their (identical) parameters panels shared here.


Attachments:
aiprmtrs.png
aiprmtrs.png [ 47.62 KiB | Viewed 2092 times ]
Top
   
PostPosted: Wed Jul 29, 2015 7:38 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4532
Location: /home/sweden
May not be much of help, but when create a new random game with wmDOT AI (version 13), it will build as you see in its economy window. My wmDOT settings only differ from you in that it has operation Hibernia enabled. (that causes it to build a few money makers to not get bankrupt)

All settings except the first one (days to wait before AI starts) is custom settings provided by the AI. If it is not explained in the AI readme or in this thread, you will have to wait for the AI author to explain or you can dig into the source code of wmDOT.

Our difference can be explained by different OpenTTD settings, NewGRFs in use and even world generation parameters. I would recommend taking out any NewGRF you have active to see if it works better without. If you are still out of luck, post a save of a game you created here, which will then contain used settings except "client settings" (eg. GUI, your nickname, passwords etc.)


Attachments:
Unnamed, 2nd Feb 1950.png [71.47 KiB]
Downloaded 3 times

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Top
   
PostPosted: Wed Jul 29, 2015 8:59 pm 
Offline
Traffic Manager
Traffic Manager

Joined: Sat Nov 29, 2014 11:23 pm
Posts: 147
Plenty of newgrfs indeed plus I loaded the 4 mid-game. I'll see what its author might have to relate, plus I'd feel silly having somebody fuss over some savegame when..errrr..not yet having tried the ai out in a fresh game myself, thank you.


Top
   
PostPosted: Wed Aug 26, 2015 2:14 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
@trainrover : first thanks you for your interest. Based on what you posted, I think WmDOT is still working through the start up phases, which can take a while, especially on bigger maps. When this is finished, it will display a line "The Great Link Up is Compete!" If a couple of game years go by and still nothing more has showed up on the debug screen, then something is probably stuck.

As for 'DOT State', those setting just change the AI's name in-game. WmDOT take inspiration (for naming anyway) from the American States' highway departments. They are usually called [state name] Department of Transportation, and abbreviated to [state abbreviation]DOT. So the Utah Department of Transportation becomes 'UDOT', the Alabama Department of Transportation becomes 'ALDOT', and so on.

The Atlas size setting will only show up if you have the Developer Tools turned on, but you probably would never need to change it, so no worries here.

'The minimal size of towns to connect' is the population threshold at which WmDOT considers towns 'important enough' to be connected. How many towns on your map have a population of over 500? If the answer is less than 2, then WmDOT thinks there is nothing to do at the moment. Try setting this to '0' and see if WmDOT will build some roads.

If you still can't get it to work, please feel free to post a savegame. They can provide a wealth of information to help figure out why something might not be working!

@Zuu : thanks for responding while I was on vacation. Glad to hear WmDOT is working well for you!

_________________
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


Top
   
PostPosted: Fri Jan 01, 2016 12:34 pm 
Offline
Engineer
Engineer

Joined: Tue Dec 29, 2015 8:06 pm
Posts: 59
When I use WmDOT, it only builds a road between two medium sized towns and doesn't do anything else. I don"'t know if it will do this with the setting operating Hibernia off, so will try and see if it works. I think it sidetracks for a few years to make some money.

Also, would cheating to give the AI money mean it doesn't do this, or will that have no effect on the AI at all?

_________________
My screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=74993


Top
   
PostPosted: Sat Jan 02, 2016 1:47 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
@dol422: If you were to upload your savegame here, I could give you a better answer. There could be a number of things at play.
  • How big are your other towns? WmDOT will only connect towns above a certain population (I think that lower limit defaults to a population of 100).
  • Are the big towns on different islands? WmDOT has a limit to how long a bridge it will build, and pathfinding between towns on seperate islands often takes longer. WmDOT will eventually timeout, but it won't do much in the meantime.
  • WmDOT might have run out of money, but this is unlikely. WmDOT won't keep much cash on hand, but you can look up WmDOT's finances and see if it's out of loan room.
  • Operation Hibernia might have hit a snag with the pathfinding between water industries. It's not very small about catching these issues. Eventually, WmDOT should go bankrupt, although that might take a very long time.
Do any of those sound like reasonable explanations to what you're seeing?

_________________
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


Top
   
PostPosted: Sat Jan 02, 2016 7:12 pm 
Offline
Engineer
Engineer

Joined: Tue Dec 29, 2015 8:06 pm
Posts: 59
They sound reasonable enough for my situation.


Attachments:
File comment: As far as I can see, it hasn't built anything yet (apart from it's HQ in Knutton). The map I am playing on is one big island with lots of water. The setting Operation Hibernia is on, though.
WmDOT.sav [11.23 MiB]
Downloaded 26 times

_________________
My screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=74993
Top
   
PostPosted: Sun Jan 03, 2016 7:17 am 
Offline
President
President
User avatar

Joined: Tue Nov 23, 2010 9:25 pm
Posts: 941
Location: ::1
On a huge map with huge number of towns and industries, some AIs will take a long time to initialize. And some scripts need to re-initialize again when you resume the game from the .sav file later.


Top
   
PostPosted: Sun Jan 03, 2016 12:47 pm 
Offline
Engineer
Engineer

Joined: Tue Dec 29, 2015 8:06 pm
Posts: 59
Thanks for the quick reply. I'll try it on a smaller map size and see if its performance increases.

_________________
My screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=74993


Top
   
PostPosted: Thu Jan 07, 2016 10:26 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Feb 01, 2011 12:41 pm
Posts: 226
Sylf, you have basically found the issue. In my test, I downloaded dol422's savegame and started it on my computer. WmDOT eventually started building roads, but it took about 4 (in-game) years. As Sylf also points out, WmDOT 're-initializes' when you reload the savegame.

As well, the map you are playing on (2048x4096, about 10,000 towns) is HUGE. By way of comparison, the original Transport Tycoon had a map size of 256x256 (or 1/128 the size). WmDOT deals with large maps by picking the closest 30-50 towns and largely ignoring the rest of the map. Because of this, you could start about 200 instances of WmDOT and they would each play in their own little 'sandbox', and thus get roads all over the map (that said, OpenTTD only allows 15 AI's active at a time).

So keep playing, and in time, WmDOT will start making roads :)

_________________
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 112 posts ]  Go to page Previous 1 2 3 4 5 6 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2017 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2017.
Hosted by Zernebok Hosting.