Hi,
I want to ask a question about using FSM for AI decision making system.
I make a basic AI FSM system for my game. For melee enemies can be in 2 state; ‘Seek For Player’ and ‘Attack’. The transition between this states depends on distance. This works very well.
But what if I create a ranged enemy type? In this case the transition between ‘Seek For Player’ and ‘Attack’ not only depends on distance but also depends on obstacles in the world. Like when the ranged enemy reaches the attack distance, I want also look for is there any obstacles between the player and ranged enemy. If there is no obstacle then the state changed to ‘Attack’ state but if there is obstacle then state changes the ‘Change Position’ state.
This example can be extended for other enemy types like enemies that uses general Melee Enemy states(Seek and Attack) but also have one extra state that depends on different parameter.
I only think to solve this create FSM for all enemy types. Is this the solution or this can be achieved only one FSM for covers all enemy types?
General Melee Enemy Type FSM => Seek For Player, Attack
General Ranged Enemy Type FSM => Seek For Player, Change Position, Attack
Melee Enemy Type with Extra State => Seek For Player, Charge, Attack
Boss Type 1 => Seek For Player, Do Ranged Attack, Do Melee Attack, Change Position etc.
Thanks in advance.