Suggested Formal Description of the Behavior/AI of Friendly Deer

J Young Kim

New Member
Contributor
Design
Formal Description of the Behavior/AI of Friendly Deer

First, and foremost, since we are considering a friendly deer, we will rule out the idea that the deer can be aggressive and start attacking the player.

To bring a sense of realism of the actual behavior of a deer, I will be using the White-tailed Deer's behaviors (https://www.uwsp.edu/wildlife/Ungulates/Pages/White-tailed Deer/White-tailed-Deer-Behavior.aspx) as the base for how the AI of a friendly deer should be.

The following links are some other resources I used for this thread:
Behavior Descriptions (Naturally Occurring):

  • Default/Idle: By default, the deer will intelligently (maybe with the use of the Pathfinding module) wander around (i.e. not run into trees, fall down from great heights, etc.) . In addition, unlike realistic deer, the deer will not be affected by the presence of players, meaning that unless the player has a weapon or was shown to be evil and killed deer, the deer will not change its AI when it encounters a human. In other words, the humans can walk up and touch deer. Either by a situation imposed or by a change in the priority need (http://forum.terasology.org/threads/ai-crowd-simulation.1682/), the deer will break out its idle state and enter the behavior which addresses the cause of the deer changing its behavioral state from idle.
  • Eating: When the deer is feeling hungry, the deer will eat grass, but not a lot. Unlike popular belief, the deer is not a huge fan of grass. However, if Terasology cannot support what the deer actually eats, then grass will have to suffice. Primarily, the deer eats nuts, fruits, and plants. When in the winter and these foods don't exist, they eat leaves and twigs. To make the eating process realistic, the head of the deer will go to the place of the food (head to the floor if grass, head upwards touching the fruit it's eating off of a tree). The deer should making "munching" sounds if the player gets close enough.
  • Swimming: When the deer is in deep water, the deer will swim. Unless the animation can be done for swimming (it's quite hard), the deer will seemingly "walk" in water as the animation. The deer will have a variable of energy, and when the energy depletes, the deer will stop swimming and drown if in deep waters. Of course, the deer should be swimming "fast" when first falling into the water, since deer are not too fond of swimming in water.
  • Running/Leaping: When deer runs, they tend to leap. Thus, when running to do something like go return to its territory when in "foreign land," then they can run as they leap. In other words, this running animation should be used anytime the deer is in a rush.
  • Marking Territory: Deer are concerned with territory, and thus, to make deer AI more realistic, the deer can show the act of marking its territory. Deer mark their territories by rubbing their antlers against trees. When the deer enters a territory that’s foreign to it, then the deer can rub against the trees.
  • Drinking: To drink, the deer will need to go to a source of water, and put its head inside the water. When the player is close enough, the player will hear the deer slurping.
  • Sleeping: The deer can lie down and assume a sleeping position during the night (although, the deer do not always sleep, so it'd be an occurrence rather than a random thing; so setting the decay rate of need for sleep can be very slow). They would sleep somewhere where it's safe, such as in tall grass or under a pine tree in the shadows. The deer will not move, and will start moving in the morning.
*Within the behavior descriptions, I have not included the behavior going to the bathroom because that would not exactly add a noticeable sense of realism, nor would all the players want to see an animal going to the bathroom.

Situational Descriptions:
  • "Freezing": The deer will freeze in its tracks temporarily if either a loud sound was created or a set of lights is shone into the eyes of the deer. In other words, if there is a loud enough sound or a set of lights shining into the deer, then the deer will pause of X seconds.
  • Tail-Raised Runs": When the deer feels that its in danger, the deer will raise its tail and start fleeing the scene. This can occur when in body of deer, when a deer is damaged, then the rest flee. In other words, if there is a reason for the deer to fear for its life, then run away from the source of the fear (player or other animal) with its tail up.
  • Seeking Shelter: When it's snowing or raining (or even high winds), the deer will generally seek shelter. In the wind, rain, or snow, the deer tends to go into isolated and sheltered areas. Thus, when there's high winds, snow, or rain, the deer's Pathfinding can search for an isolated area and stay there until the weather is nice.
  • Oblivious: During the rain or snow, the deer will lose sense of smell and hearing. Thus, when hunting for deer for food, after hurting the deer, the deer will more easily "reset" into the default or any other state aside from panic and running, since in theory, the deer will lose your scent and would not hear you. In other words: if it's raining and snowing, then reduce the time it takes for a reset of the deer's behavior after the player damages the deer.
  • Decreased Activity: When snowing, the deer will reduce its food intake and decrease movement, which lowers the energy expended. When raining, the deer also tends to move less. Thus, in terms of code, if snowing, reduce the amount of eating (lower at rate which need for food increases) and if snowing and raining, increase the time of idle/default behavior (or make it harder to break out of the default behavior).
  • Binge Eating: If a big storm is coming, deer tend to binge a lot before the storm and after the storm. Thus, when a storm is coming, the deer can increase food intake before the storm (players who observe this can figure out what's going to happen) and after the storm. A naive solution would be to increase the rate of need for food.
 
Last edited:

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Great description! Thank you very much.

Lots of interesting hooks here, especially to weather, which we have the basics of in the WeatherManager module, but we haven't had much to put it to use on yet.
 
Top