Decision-makingAnd where does the newborn go from here?
The decision-making is the part of the code that select what an agent should do next.
The agent is always in one of the AI state that is available to him. Each state have rules that say under what conditions the agent change to another state.
All the possible actions is put in a tree and each frame the tree is updated. The first action that fit will run until it is done or another one takes over.
For every possible action a mob can perform a desirability (utility) value is calculated. The action with the highest value is then performed.
Give the agent a screenplay to follow.