Weekly Update #6 – Pathfinding
Hello everybody! Happy New Years!
This week was another holiday week with New Year’s celebrations, but we managed to make some headway into enemies. I spent most of the week working with AI Behavior trees and pathfinding, and I’m planning on making videos on both of those topics soon.
Right now I’m using the very simple A* method of pathfinding. In the future I might need to make the pathfinding algorithm more efficient, but it’s serviceable for now. I made a few gifs to visualize how the pathfinding works:
The computer is trying to find a path from the blue square to the green square. It looks outwards in all directions trying to prioritize spaces that are closer to the goal, and when it finds the green square it draws a path back towards the blue square. These are just visualizations, and when the algorithm is run in game it happens almost instantaneously.
After these paths through the map are created, the computer goes through and smooths them out so that enemies will move in more natural, diagonal paths. I’ll hopefully have some gifs of that for next week!
Art for enemies and attacking are still a work in progress, but we’ll be sure to include them in next week’s update.
That’s all from Runner-Up this week. Here’s looking forward to a stellar 2018!