Flow Field implementation based on Eikonal Equation.
- The directions are more accurate than on a regular Flow Field so the paths calculated are smooth instead of being "squarish".
- Calculates three values for each cell:
- Flow direction
- Current direction goal - position of the cell that the flow is directed towards.
- Distance to destination (gradient) - distance to the destination cell.
- Handles obstacles.
- Can handle tiles with different movement speed (not presented in the project).
- Eikonal Equation is not perfect - distance values and directions are not always completely accurate. It can be easily seen for 2x2 pathfinding with destination on 1x1, where gradient value on 2x2 is 1.71 instead of being ~1.41.
Implemented on Unity 2022.3.5f1.
Time complexity: O(width * height)
with a fairly high constant.