By the start of the project, the main goal for monster behavior was to patrol the mansion, search the hiding spots inside of the rooms (which got removed from the game later on), be aware of the sounds player makes and search the location where those sounds were made. I have added a noise level to each player and some of the items that are supposed to make noise. Noise value rapidly changes when being increased and gradually decreases over time when no new noise is made. The monster is always aware of every noise, but only enters alert state when the noise level is high enough for the distance between the monster and a noise source.
In case the monster ever sees a player (player is inside of adjustable field of view of the monster), the monster is entering a chase state. While chasing, the monster is moving faster. If the player manages to break the line of sight, the monster still follows to the last known location and takes a look around before going back to patrolling state. During the development, some new behaviors were added, and only two of them got to the final version.
Since multiple conditions could have been fulfilled at the same time, a priority level for each behavior was added to prevent monster from jumping in and out of state when she should not.
Scream behavior: while patrolling, the monster has a chance to start screaming, which locks her movement while screaming, but heavily increases her speed for a few seconds after the scream.
Eye spawning: every time the monster gets attracted to a sound source, she saves the location of that source in order to later determine what rooms were the most commonly used by the players. After that, she can spawn up to 4 eyes in those locations that add to her field of view and get destroyed and respawned in a new location 10 seconds after detecting a player.
Some of the removed behaviors:
Camouflage: while searching a room and not finding anyone there, monster can hide inside of the hiding spot.
Sprint: after either scream or camouflage, when the monster sees a player, she will sprint in the direction towards the player (but she cannot stop until she hits a wall or another object). In case monster did not manage to catch a player, she gets stunned for a few seconds, to let the player relocate.