[PCG] Tell us more about the reactive AI. On what basis do monsters and humans make their decisions about you? If you're carrying lots of weapons, are they less likely to attack you? If you're wounded? If you're moving slowly? Can you talk us through a monster's decision tree?
In the decision making block we use two models - FSM (finite state machine) used by monsters, and planning of actions by human characters. As FSM is a rather common used model of decision-making in gaming, we'll review rarer planning model, which analogue was used in F.E.A.R.
In order to demonstrate the process of decision-making, we can take the training situation, when two humans have a goal to survive and a have a knife placed between them. Each of the bots reflects nearly like that: I have to survive, but I see the enemies So I have to get rid of them, but I don't have weapons So I can flee, but this is a very hard action So I can try to kill the opponent, but I don't have weapons I see a weapon lying on the ground and I can reach it I have to reach it So there is a certain order of actions built, with the first action "run to the object - knife". After one of the NPCs grabs a knife, another will have no variants to kill him and will run in panic. The first one in his part will follow the one running away.
We can take a situation when three humans with weapons see two enemies - a beast and another human with a weapon. Using the function of evaluating the degree of enemy's danger, threesome will divide in two parts - two of them will deal with the human with the gun, and one with weaker monster (considering the fact, that it can be dangerous only in close combat). The battle starts, humans break up to seek for covers, and a monster, depending on the level of aggression, internal state and available information (whether he knows about all battle participants or not) either flees or strikes.