I’m attempting to make a game (hard to figure out by the location of my post). It’s going to be a 2D platformer with some cool unique stuff, but I want moderately smart to advanced AI in it.
I’ve got LOS set up (simple enough; just basic raycasting), so now the enemy can look around and find the player, but when it finds the player, I want the enemy to pursue the player. Like most games with enemies chasing the player, it would go after the player, if the distance got too great or the player got out of sight for a while, stop and return to it’s post. All of this would be moderately easy to implement on a top-down game, but mine’s a platformer. I think it would be sufficient if I could get a non-grid-based pathfinding algorithm set up; I could create nodes, detect which node the player is in, go towards it (checking for absent ground that needs jumping over and such).
I searched for this, and the best example was this, but it’s probably a bit too difficult to implement
All of the AI examples I’ve found have all been implemented in Java, C++, C# or another really powerful but difficult language… I have basic to moderate C++ knowledge, but there are some things (some class method implementation) that are difficult to replicate in Lua, plus… they’re hard to port
Does anyone here have any pointers, Lua (or another scripting language like JavaScript or Python - anything closer than Java or C ) sample codes, or ideas for how to implement this type of thing? Better yet, has anyone created a project with advanced AI and has any experience? Any pointers or code on making an object automatically move to another location in a platformer world would be helpful.
Thanks in advance!
- Caleb