In the above scenario, there are 3 paths with
- [1] equal lenghts,
- [2] all follow the change direction rule
- [4] all take oposite from the target direction
the only difference is, how early will you take the uncomfortable back turn.
terminal implementation takes the first option, (green)
my current logic takes the latest (further along the path) option.
I thing there is a missing rule, what to do if you only have uncomfortable turns
- Choose the tile which is the shortest number of steps…
- If multiple tiles are equally close to the units destination, move in the opposite direction…
- In the case where a Unit has just been deployed …
- If there are two tiles with equal distances and are equally prefered based on direction, the unit will choose one that is in the direction of it’s target edge. For example, if a unit wants to reach the top-right edge, and must choose between moving left and right, if both tiles have the same minimum number of steps it will move right.