Posts

Showing posts from March, 2021

Game AI - Flow Fields and how to implement them? (Path Finding method for game AI)

Image
Flow Fields!      Flow fields are a method/data structure for pathfinding with AI that takes what would usually be the job of many independent actors and turns it into a one-time gig that everyone can take advantage of (depending on how you implement it). I am going to talk about this subject under the assumption that you have a basic understanding of pathfinding (so if you have no clue then I suggest you google things like Dijkstra's algorithm and A* to get an idea of the methods/terms used).     I want to start off by talking about what a flow field is, its advantages and its shortcomings. This won't be an in-depth dive into flow fields, just a surface-level analysis based on what I can see/understand. I do want to mention though that all of this can change based on how you implement your flow field. This is the flow field example that I made for this blog post. It shows the "units" pathing to a target in a basic 2D environment that I generated using Unity's bui