External Publication
Visit Post

OpenTTD AIs and Game Scripts • Re: Can somebody teach me tile arithmetic?

Transport Tycoon Forums - Index page [Unofficial] February 14, 2026
Source

I got it. First, you misinterpreted the formula. The key is in line 1203: function _dir(from, to) The pathfinder is searching adjacent tiles, so the only possible values are 1, -1, MapSizeX and -MapSizeX, which match directions NW, SE, NE and SW. For some undocumented reason, this specific code only applies to tiles in Y direction, line 1066: if (parDistance > 1) branchs only if parDistance = MapSizeX.

Statistics: Posted by HGus — 14 Feb 2026 10:59


Discussion in the ATmosphere

Loading comments...