{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreia3ejupdyf3iqppapu6xz6ddpqhojkkwnodntzlfwiwwkjpsx6ray",
    "uri": "at://did:plc:i7budt2wflrcfy6jtvfocbix/app.bsky.feed.post/3mewqqrcepa42"
  },
  "path": "/viewtopic.php?p=1278085#p1278085",
  "publishedAt": "2026-02-15T15:45:54.000Z",
  "site": "https://www.tt-forums.net",
  "tags": [
    "GoldMine"
  ],
  "textContent": "> If the tiles are in the X direction, then dir equals to 1 * sign(cur_node - par_tile), if they are in the Y direction, multiply that by MapSizeX\n\nI definitely understand now, when current tile index is substracted from parent tile index we get either +1 or -1 for X axis or mapsizeX for Y axis, divided by distance it gives tile index next to current tile.\nSo the result can be called either direction or index.\n\nThis formula seems to be enough for tile arithmetic since diagonal neighbors are not used for path finding, although it's possible to derive one.\n\nI just tried with calculator and this is impressive, thanks for help.\n\nStatistics: Posted by GoldMine — 15 Feb 2026 15:45\n\n* * *",
  "title": "OpenTTD AIs and Game Scripts • Re: Can somebody teach me tile arithmetic?",
  "updatedAt": "2026-02-15T15:45:54.000Z"
}