I recently restarted on my long time game development project and had a few questions about how to improve my games AI.
I am a little stuck on the best way to implement my Enemy path finding when there are multiple enemies that can collide with each other. Here is an example of the way my AI works at the moment.
The melee enemy has the following states:
Aggressive Attacking - Is in range of attacking player
Aggressive Stuck - Is trying to reach the player but blocked by a collision object
Aggressive Clear - Is trying to reach the player but is not blocked by a collision object
Passive - not currently looking for the player but if it moves in it's line of sight it will move to the aggressive state
Currently I am using a uniform tile system. Here is the basics on how the pathing works.
FIND PATH FROM ENEMY TO PLAYER IF [BLOCKED BY A COLLISION TILE] CALL A STAR ALGORITHM ELSE IF [NO COLLISION ON PATH] MOVE TO PLAYER
I do this every frame. This seems to work ok, but things have got more complicated when I bring in multiple enemies. What would be the best way to achieve the following.
Find a path for the enemy to the player when there are multiple enemies that can all collide with each other? If I just call A STAR it won't work correctly as the other enemies who are collision objects are also moving.
Sorry I hope this made sense, any help would be great.