Creature senses

Creatures use their senses to detect and find enemies (usually players). These senses include seeing and hearing. Creatures cannot smell, so wind doesn't affect sensing.

Creatures select the closest enemy as their target that they can see or hear. However hearing never makes creatures alerted.

## Sight

Creatures have following properties related to sight:

* View range: Distance to see enemies.
* View angle: Field of view. Alerted creatures have full field of view and can see behind their backs.
* Alert range: Distance to get alerted when seeing enemies.
* Eye position: Position of eyes in the character model. Used to check line of sight.

Creatures can see enemies when there is a line of sight from creature eyes to the enemy eyes and the enemy is within the view angle and range.

Stealth reduces creature's alert and view range based on the visibility bar. For crouching players, the line of sight check uses player center position instead of eye position.

### Creature properties:

Most creatures can see 30 meters away with a 90 degree angle. Most creatures get alerted when seeing a target 20 meters away. Exceptions are listed below:

* Lox: 15 sight and 6 alert
* Boar, Neck: 20 sight and 6 alert
* Deer: 25 sight and 25 alert
* Draugr, Draugr elite: 10 alert
* Leech: 360 degree angle
* Blob, Oozer, Yagluth: 30 alert
* Drake, Wraith: 40 sight and 30 alert
* Eikthyr: 40 sight and 40 alert
* Serpent: 50 sight, 360 degree angle and 20 alert
* Bonemass: 50 sight, 80 degree angle and 50 alert
* The Elder: 50 sight and 50 alert
* Moder: 60 sight and 60 alert

## Noise

Noise is measured as how far away it can be heard. For example 40 noise will attract creatures from 40 meters away. Noise doesn't stack, instead the highest value is used. Noise decays 4 per second and usually follows the creature or player that created it.

Players can't detect noise as it's not related to in-game sounds.

### Sources of noise

* Chopping a tree or mining a resource: 100 noise for the closest player within 10 meters (even when caused by a creature).
* Building, repairing or deconstructing: 50 noise
* Jumping or running: 30 noise (creatures run when alerted)
* Moving or swimming: 15 noise
* Dodging: 5 noise
* Sneaking: 0 noise

Attacking also creates noise depending on the weapon, type of attack and whether something was hit. Noise created by arrows and thrown spears will originate from the hit location but set the player as the target. Other attacks will originate from the player.

For example hitting a tree creates 100 noise. After sneaking for 10 seconds, the player is having 60 noise and would still attract creatures from 60 meters of the current location.

For example shooting an arrow will attract creatures within 8 meters of the arrow hit location (4 meters for Huntsman bow). Creatures will start moving towards the player's last known location. However player can easily sneak away because the noise doesn't originate from the player.

### Creature properties

Creatures have a maximum hearing range that determines how far away they can detect sources of noise. Most creature have a hearing range of 9999 meters which is practically infinite. Exceptions are listed below:

* Inside dungeons: 12 meters
* Deer, Lox : 15 meters
* Boar, Neck: 20 meters
* Deathsquito, Ghost, Rancid remains, Root: 30 meters

For example a Lox can't hear a player running or chopping wood from 20 meters away even though the created noise would reach it.

## Sleeping

Sleeping creatures lie on the ground and have reduced senses. They wake up when:

* Receiving damage.
* A players gets within X meters. This is not affected by sneaking, line of sight or noise.
* A player is heard within Y meters.

Noise from arrows and other projects won't wake up sleeping creatures but will make them alerted (which prevents backstabbing).

Following creatures are initially sleeping:

* Abomination: Wakes up when there is a player within 20 meters. Checked every 0 - 8 seconds (randomly determined when the creature is loaded).
* Ulv: Wakes up when there is a player within 4 meters or when hearing a player within 10 meters. Checked every 0.5 seconds.
* Stone Golem: Wakes up when there is a player within 2 meters or when hearing a player within 50 meters. Checked every 0.5 seconds.