A state-driven agent is an agent that performs an action based on its current state.  The logic can be  implemented through the use of a D-FSM that changes state depending on the Agent's perception and stimuli and perform actions on entering, being in, and exiting a state.I'm trying to implement this type of design in a Entity-Component-System (ECS) architecture.My first thought was to implement an FSM component containing a current_state and a rulebook, a System that updates the FSM component current_state depending on its rulebook and a System that implements the actions of an Entity ( and modify its components accordingly ) depending on the state of the FSM component.I'm not sure this is a correct ECS implementation and that it can cleanly represent the enter_state/exit_state -> perform an action behaviour. So, how should SDA be implemented in a ECS architecture?
Implementing state-driven agents within an Entity-Component-System approach
architecture;finite state machine;entity;component