I am building a similar game to Bubble Bobble. This is the scenario:
where E represents enemies, and P represents the player. If a user falls through the lower hole, it reappears through the superior one.
Assume that players can fall and jump.
Also, even though I said I based it on “Bubble Bobble”, the characters can jump “through” platforms to go up. They have to find the proper corners.
My problem here is that I have to program the AI of the enemies, to find and search the player.
What would be the best algorithm to find the shortest path to meet the player?
5
“The best algorithm to achieve this”? Define “best”. A simple A* algorithm will generate the most efficient possible path for an enemy to take to reach the player, but would you really want to play against a perfect computer? That’s a recipe for frustration right there.
The Pac-Man “AI” was actually 4 very simple algorithms that told the 4 ghosts where to move towards, which gave each one a distinct “personality” and hunting style. If they acted intelligently and worked together, they could hunt Pac-Man down, corner him, and kill him consistently, and it would suck to play the game. Instead, the developer came up with a system that is challenging but fun. For something like this, I’d advise a similar tactic: come up with a handful of different simplistic algorithms and test them to see what version(s) are the most fun, individually and together.
3