The International Simutrans Forum


Author Topic: Maximum routing depth default too low [112.3]  (Read 1232 times)

0 Members and 1 Guest are viewing this topic.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 19823
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Maximum routing depth default too low [112.3]
« on: August 04, 2013, 07:58:23 PM »
In fixing this issue in Experimental, it occurs to me that the problem is the same in Standard: the maximum routing depth for any given map is the minimum of the world's x dimension multiplied by its y dimension and the maximum routing steps set in This is not always sufficient for a ship going from one end of the map to another otherwise in a straight line (for example, avoiding islands).

This is how I fixed the problem for Experimental - I am not sure whether any of the Standard developers want to use a more sophisticated solution. (Note that this also solves a related problem where using the advanced settings dialogue to change the routing depth had no effect until the game was saved/reloaded as the nodes were not reinitialised on closing the window).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9993
  • Languages: De,EN,JP
Re: Maximum routing depth default too low [112.3]
« Reply #1 on: August 04, 2013, 09:02:32 PM »
If there are less water tunnels and bridges than land tiles (never saw such a map) a routing depth of width*height is mathematically sufficient, since a tile is visited at most once or is discarded when already in the closed list. Insuffient space in the closed list is a strong indication of a broken implementation.

EDIT: I just checked it. It will work unless the value in is too small (this value was for reducing the memory footprint and increase route search speed). DEBUG_ROUTE show that the way search from standard does not touch much more than 1/3 or all tiles even for very hidden ports back on two islands, even on large maps.
« Last Edit: August 04, 2013, 09:22:41 PM by prissi »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5642
  • Languages: EN, NO
Re: Maximum routing depth default too low [112.3]
« Reply #2 on: August 04, 2013, 10:25:20 PM »
If route searching has to traverse the world fully at one level, let alone many, it's a strange map indeed.