0

So, I want to implement AI to my LibGDX 2d platformer game. I have read stuff about A* pathfinding, but I think that if I make an A* pathfinding the performance would be very bad(on android), it is not great already. Then I stumbled upon an article which talks about manualy placed nodes on a map for pathfinding(link http://joostdevblog.blogspot.com/2014/06/solving-path-finding-and-movement-in-2d.html). I am using tiled map editor for map editing and the phisycs are done with box2d. I have an idea that I could move the mob to the nearest node that I will have placed with the editor and to some put some kind of property to know when to jump, but I am not sure how to do some things:

1.How to find the shortest path?

2.What to do if the path is blocked at that moment(like a deployable wall)?

3.Should I consider another method for pathfinding?

EDIT: I also have read this article(link http://www.gamasutra.com/blogs/YoannPignole/20150427/241995/The_Hobbyist_Coder_3__2D_platformers_pathfinding__part_12.php), but it seems very complicated.

  • 1
    As muc has i remeber A* is the most efficient way to find the shortest path. A platformer game makes it a bit more difficult (cause of gravity + jumping). A way to handle that could be those `Node`s you are talking about. Usualy you have 4 neighbour `Node`s/`Node` (up, down, left, right), but if you are on a "Jump"-`Node`, you could have 5 `Node`s, where the 5th is the "Landing"-`Node`. – Robert P Jun 01 '15 at 14:38
  • I had dozens of 'characters' regularly using a Java A* pathfinding autonomously on a 250x250 grid in an Android game i released in 2013, and didn't had major performance issues doing so. Now, we are in 2015 and devices are even more powerful => A* is efficient enough for Android. – Khopa Jun 01 '15 at 15:06

0 Answers0