Announcement

Collapse
No announcement yet.

CyMap.calculatePathDistance does not produce accurate results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CyMap.calculatePathDistance does not produce accurate results

    INT calculatePathDistance(CyPlot pSource, CyPlot pDest)

    I've been using this function for my Auto Missionaries mod and I'm realizing the results of this function are not always accurate.

    I had a Pangea map where my capitol was in the middle and several cities were in varying distances around the capitol

    They are all connected by land.

    I counted the tile distances from my capitol to each city, and then I used this function to see what it produced for each city.

    Most of the time it was right on, but for some unknown reason it wasn't right for 2 out of 6 of my cities.

    One city was 5 tiles away, but the function returned 8.

    In another case a city was 4 tiles away but the function returned 5.

    Try it out yourself to see if you get similar results...

  • #2
    It will return the number of tiles te unit would move if sent a goto command to another tile. Sometimes this is higher than the actual number of tiles, since roads may exist in a non sraight line, and following them the long way would be faster than taking the shortcut.
    Creator of the Civ3MultiTool

    Comment


    • #3
      I know what you're saying but I don't think that is the case: the function does not require a CyUnit object parameter, you just give it the from CyPlot and the to CyPlot. And then in my example I had roads connecting these cities and I counted the tiles along the road, because anyway the roads were placed on the shortest possible path.

      I'll see if I can get a screen shot to demonstrate this better later

      Comment

      Working...
      X