- Home /
Other - Design/Discussion
AI & pathfinding for 2D platformer - how to approach?
In my 2D platformer (camera from side looking at the xy plane, with some jumping and gravity, shooting, etc) I'd like to add some complex enemies. Ideally, they would be able to patrol around some waypoints, shoot at the player when they see him, chase the player, flee from him, hide in a cover, throw grenades etc. I'd also like them to jump from one platform to another.
I've found RAIN, which offers some impressive behavior trees, unfortunately the pathfinding part is suitable only for 3D games on a xz plane.
I've also found the A* Pathfinding Project, which can be adjusted to 2D games on xy plane, however I haven't really managed to make it work yet, considering gravity, jumps etc.
This made me wonder, before I fully dig into the theory of A* - is there a better way to approach this? How would you go about pathfinding and behaviors in a 2D platformer? As I know very little about pathfinding or AI in general, I'd gladly accept any plugin (paid or free) that would save me some time; or a nudge in the right direction.
Many thanks!
This is probably a forum question (design/discussion). But I'll hit a couple of points anyway.
A* is an algorithm for finding the shortest path between two nodes on a network. Since pathfinding can be represented by nodes on a network then A* is ideal for your application.
$$anonymous$$ost 3D setups can be converted to 2D with the appropriate wrappers.
Follow this Question
Related Questions
Why is my gameObject falling so slow? 1 Answer
A* Pathfinding issues, player node is always off (converting 3d to 2d) 0 Answers
How do I go about making a 2d platform enemy ai 1 Answer
How to create a simple Enemy AI for a 2D game? Mine isn't working. . . 1 Answer
AI Movement Framework Recommendations for 2D Top Down Game 0 Answers