This repository is a demonstration of a flowfield. Each grid tile points to the direction of the target. Flowfields are a great optimisation when you have many agents that wish to navigate towards a singular target. This is a common technique used in RTS games.
This demonstration is not made with optimisation in mind but there are many ways to optimise it such as the use of threading or even GPU processing.
This repository requires my A* Pathfinding Algorithm Repository to work since it uses the A* pathfinding algorithm to calculate the flowfields. So make sure you import that repository aswell.
Helpful sources to learn the algorithm:
PDF :: Crowd Pathfinding and Steering Using Flow Field Tiles