
Possibility and Probability Maps
In this chapter, we'll be talking about possibility and probability maps, understanding how and where they are used. We'll also be learning the best practices for creating an AI that reacts to the player and that also chooses the best options, as we look to create a character that can make decisions as a human would.
As we saw previously, video games used to rely heavily on predetermining the behavior of what the AI could do in different scenarios that were either created by the game itself or by the player's actions. This method has been present since day one and is still being used today, making it an extremely valuable method for creating quality AI characters. Before explaining, in detail, what each of the maps do, and before demonstrating how to create them in order to develop good AI behavior, it's always good to have a general idea of what possibility and probability maps are and where or when they are applied.
As gamers, we tend to enjoy the product as a whole, experiencing every part of the game with enthusiasm and dedication, forgetting about the technical aspects of the game. For that reason, we sometimes forget that even simple things that happen while we play were already destined to occur that way, and that there is a lot of thought and planning behind that moment. Everything happens for a reason, as we often hear, and this can also be applied to video games. From the moment you clicked the start button to begin the game to the last awesome combo that you performed to defeat the final boss of the game, everything was planned to happen and it was necessary for a programmer to input all of those possibilities within the game. If you clicked the A button and your character jumped, that happened because it was determined to be that way. The same thing is valid for AI enemies or allies on the game; when they do something to defeat or help you, it was necessary for that behavior to be programmed, and to do that we use states.