In order to investigate the concept of Artificial Intelligence I felt that I could do a better job if I had a solid concept that could serve as a potential future project. An idea that appealed was the constant presence of a monster that would follow the player around. This quickly evolved into the main gameplay element: the player would have to explore a given area at night whilst being followed by an intelligent creature that would pose a danger if the player ignores its presence and actions, or provokes it by approaching it or flashing a light at it.
The aim of creating an artificial intelligence is to provide the player with a sense of exploration whilst at the same time being fully aware of a dangerous creature that could potentially be fatal, but one that, at the same time, can be studied and at avoided. I wanted to encourage the player to avoid direct confrontations. The behavioral patterns that particularly inspired me were those exhibited by predatory animals in the wild, as I wanted the behavior of the creature to feel as intuitive as possible. For example, if the player were to give away their position by using the light for too long, this would provoke the monster to attack. Similarly, if the player were to directly confront the creature, this would result in the creature retaliating and killing the player instantly. Therefore, the game would encourage the player to be constantly on the move, with an alertness of the creature ́s whereabouts.
The navigation mesh is fundamental for this project since it allows the monster to move freely avoiding obstacles and to reach successfully its destination. The AI for the monster consists of a state machine with several behaviours. The first stage consist in a wandering behaviour which makes the monster run along the map, when the player is within 70 units it will trigger the second state which has 2 behaviours; walk to player and hide behind trees. In stage 2 the monster will always walk towards the player taking cover behind trees in front of it, so the monster is constant raycasting for nearest in front trees to take cover during a random period of time, if the monster is in plain sight of the player, it will remain still for a random period of time and then hide, behaviour which can be observed in nature. The monster has several ways of provocation which triggers the state number 3, this provocations consist in the player stare the monster for too long, or keep the flashlight on also for too long or chase the monster, if this happens the monster trigger the dead state number 3, in this state the players is dead, no way to avoid it. The behaviours and triggers are all scripted and developed without using behaviour tree plugins.