Suggested Formal Description of the Behavior/AI Of Aggressive Badgers or Boars

J Young Kim

New Member
Contributor
Design
Formal Description of the Behavior/AI of Aggressive Badgers or Boars


A key word that needs to be noted is 'Aggressive', meaning that the following will describe behavioral patterns which will be exaggerated to be aggressive.


The Aggressive Behaviors of Boars:
Behaviors of Badgers:
Forum Suggestion Regarding Algorithm on Needs-Based AI: http://forum.terasology.org/threads/ai-crowd-simulation.1682/


Naturally Occurring Behaviors

  • Default/Idle:

    • Boars: Boars are nocturnal animals, especially during when hunting begins. Thus, although boars roam in the night, it is not uncommon for the boars to travel in the day. Boars will use a pathfinding algorithm which will allow them to intelligently traverse the land (meaning that the boars will not go into situations or places of death). The boar will attack players regardless of its state, no matter what (unless two boars are fighting each other). The boar will break out its default state (wandering) if the need-based system imposes a need on the boar, and the boar will take action to get rid of the need (when hungry, hunt for food).

    • Badgers: An important thing to note is that badgers are nocturnal animals, meaning that they sleep in the day and wander in the night. Thus, the player should not be seeing many badgers in the day, but may see a larger number in the night. Badgers tend to live in wide flat areas, and in setts, which are artificial holes/tunnels created by the badgers. The badger will most likely wander around underground using intelligent pathfinding (Pathfinding module) since we don't want badgers digging into lava, death drops, etc. The badgers' AI will run on a need-based system, meaning that unless there's a variable which breaks the badger out of its default state, then the badger will remain in its default state.
  • Reaction to Humans:

    • Boars: As the title of the thread implies, we are discussing an aggressive boar by nature. Thus, when a player is nearby a boar, the player will either try to outrun it or fight it. Unlike badgers, the player cannot simply jump in the water, for the boar will continue chasing the player until the boar reaches a point where it gives up chase (when too tired, too far away from territory, etc.).

    • Badgers: As the title of this thread implies, we are not actually simulating the real behavior of a badger, we are simulating an aggressive badger. Thus, if a human is nearby, whether it be underground or during the night, the badger will attack the player. The player will either have to run away or kill the badger to escape it. The badger will stop chasing the player if: 1) the player runs far enough away from its territory, or 2) the player jumps in the water to swim (badgers dislike swimming). The badger will disregard its health, and fight the player to the death if the player decides to fight the badger.
  • Eating:

    • Boars: Boars are omnivores, and will anything. However, opposite from badgers, the boar will mainly eat plants. Simply put, the boar’s AI will search for plants to eat, and when there are no feasible plants to eat, then it will eat meats or invertebrates such as worms (if implemented into Terasology). Boars will be aggressive in the sense that if a player walks up to a boar when it’s eating, the boar will not chase, but attempt to intimidate the player away from its food. In vary dire situations, cannibalism can ensue (although not recommended for a game played by children).

    • Badgers: Badgers are omnivores, meaning that they eat anything. Although omnivores, the badgers prefer eating worms, insects, and small animals such as rabbits. To make the AI more enjoyable to the players, when given choices of what the badger can eat if hungry, the badger should prioritize eating meats, and only if there’s no meats then the badger should eat fruits. If the badger happens to be feasting and the player goes near it, then the badger will ignore the player. However, going too close may warrant an attack from the badger to warn the player to back away from its food.
  • Swimming:

    • Boars: Boars do not mind swimming, and regarding the pathfinding of the boars, boars will take the path of the shortest time or distance. In other words, unlike badgers, water is not a limiting factor when deciding which path to take to a particular destination.

    • Badgers: Badgers really dislike swimming, or getting wet in general. Thus, the badger will use pathfinding to find a path that does not require swimming to get to its destination (whatever it may be), and it will only swim if it’s the absolute only method of getting to the destination. If the destination is not important (i.e. badger going there for fun), then the destination will be abandoned if water obstructs the pathway.
  • Drinking:

    • Boars: Boars will drink normally from a water source (i.e. river, lake, etc.). Boars will be aggressive towards players when the player approaches a drinking boar. In other words, the boar will attempt to scare off the player, and if it succeeds, then it will resume drinking. If it fails, then it’ll be wary of the player and may not drink.

    • Badgers: Badgers will drink normally from a water source (i.e. river, lake, etc.). When the player approaches a drinking badger, the badger will be aggressive and start attempting to scare off the player by damaging the player if the player refuses to leave.
  • Sleeping:

    • Boars: Boars tend to sleep in their nest, but in Terasology, showing this nest may not be utmost priority, so we can make the boars sleep in areas with a lot of vegetation (i.e. places where there are a lot of under bushes). In hot weather, the boars can sleep in mud or in the shade. They generally sleep on their side, so a model of a boar on its can be used to represent a boar sleeping.
    • Badgers: Badgers will mainly be found sleeping in the day, primarily with their body curled. Badgers will be sleeping in their setts (underground habitat). If the player sprints across one, then the badger may wake up and start hunting the player. But if the player calmly walks past the sett, then the badger will remain asleep. The badger will start roaming in the evening, and go back to bed when it hits morning. However, the badger may still be wandering in the day, although it will be very rare.
  • Fighting:

    • Boars: Boars generally fight when a boar challenges another boar. The boars will make large squealing sounds during the match due to injuries. In game, the boars will be bashing into each other. Although the boars may fight to the death (rare case), a boar generally gives up, and both boars after fighting leave to rest and heal from injuries. Thus, before, during, or after a fight, the boar will ignore the player. The boar will start being aggressive once the boar has healed up (a timer).

    • Badgers: Badgers generally do not fight each other, but if one challenges another (i.e. for dominance), then they will fight. For simplistic purposes, to show the fighting, the badgers will keep ramming into each other In the game until one concedes (the badgers won’t die from a fight like this. When the badger has a certain amount of health left, then it can give up the fight). If a player approaches two badgers fighting, the badger will continue fighting, and even after finishing the fight, will not pursue the player.
*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.


Special Behavior (Situation Induced):

  • Boars:
    • Mud (Wallowing): When the boar is hot, the boar will lie down in some mud to help it cool off. Thus, for this to be implemented, the boar can be placed in an environment where there is mud present. For the code, we can state that when there is very hot weather, or the boar is ‘hot’ (a variable which can be affected after the boar has done some exercise or when the weather is hot in general), the boar will look for mud and lie in it (a new texture for the boar would be nice to help it look different in the mud).

    • Turning More Nocturnal: Boars are naturally nocturnal, but can turn more nocturnal. In other words, the boars will start travelling more in the night than day. This occurs, when the boars are hunted or bothered by humans, and become less nocturnal when the boars are not hunted or bothered for quite some time. For the code, we can have a variable of ‘bothersome’ or ‘fear’ for the boar, and the boars will become more nocturnal as this variable increases in value. When the variable reaches 100, then the boars will completely be nocturnal, and will remain this way until the variable reaches zero. Before reaching 100, the variable can decrease in value exponentially based on the last time since hunted or bothered by humans. In essence, if human bothers or hunts boars, then boars become more nocturnal by increasing the ‘fear’ variable. If the ‘fear’ variable reaches 100, then the boars remain nocturnal until the ‘fear’ variable reaches zero.

    • Rubbing Against Sturdy Objects: The boars will exhibit the behavior of rubbing against sturdy objects to remove unwanted material from the body. These materials can consist of excess mud, hair, or parasites such as ticks. The player won’t notice much if there are ticks or hair, so we can ignore these variables. The most noticeable material on the boars would be mud. Thus, if the boar has mud on it, then it’ll start rubbing itself against a sturdy object (i.e. tree, fences, etc.) once out of the mud.

    • Rain Behavior: During the rain, the boar will act differently based on its situation. First, if the raining is very hard, the boar will go under some cover, like under a tree for instance. However, if the the rain is slight, there will be no change in behavior. If the boar was hot (from the weather or from exercising), then the boar will go in the rain and enjoy it (because it helps them cool down). Thus, for the code, if raining hard and the boar is hot or if the rain is just a light drizzle, act normal. If raining hard and every circumstance for the boar is normal, stay under cover.
    • Readying to Charge: Boars are known to charge at their enemies for combat. This method of charging will most likely be a method of how the boars will attack the player. These behaviors will be shown by the boar if the boar threatens to charge at the player: when the boar is walking perpendicular and almost in a circle with the player being the center of the circle, when the tail is straight, or when the head is down but the eyes are looking up. When these traits are shown, it is advised that the player runs from the boar. These traits should first be shown as a warning against the player, and when the player goes closer towards the boar, then the boar should charge. As for code, if the player enters a boar’s warning zone, exhibit the warning traits, and if the player enters the danger zone the boar charges.

    • Hiding Objects in Nest: Boars have the habit of taking stuff and hiding it in their nest. To interact with the player, the boars can ‘raid’ the player’s homes, and look through chests of the player and if it finds something interesting, it will take it back to its base (based on realism, we can either have the boar be able to break into homes via charging or only allow such raidings to occur if the chest is accessible without breaking anything (i.e. door is open). For checking if there is an open path, the boar can use a pathfinding algorithm). In terms of code, if the boar is near a chest, the boar will check the chest, and take one item back to its nest.
  • Badgers:

    • Hunting: Badgers have a superb sense of smell. They are able to detect their preys through the grass and snow even if the badger is on the surface. When the badger is hungry, and there happens to be an animal underground (i.e. nest of bugs), the badger will engage in pathfinding (Pathfinding module) its way so that it's on top of its prey, and once ready, will conduct a sneak attack on the prey from above. Thus, when the badger is hungry and detects prey X blocks away from it underground, the badger will dig a path so that it's one block up from the prey, and once ready to attack, the badger will dig down and attack the prey. As an added fear for the players, the players should be able to hear a badger digging if they are a tunnel in the dirt, which signifies that a badger may be on the hunt for the player. To be realistic, we can state that the badger, although can detect, will not be able to dig through stone, and will eventually give up the chase (important to add this 'break-statement' if the badger has no possible method of reaching its prey).

    • Hunting (Part 2): Another behavior which the badger exhibits is that it creates large holes in the ground, and when an animal (its prey) unburrows, the badger will attack and eat it. Thus, if the badger is hungry and senses that there is an animal which will unburrow in the future (machine-learning?), then dig a large hole in the area which its prey will most likely unburrow and wait.

    • Breaking through Barriers: Badgers have poor eyesight, great physical prowess, and a great determination to get to its destination. Thus, when on the surface, if the badger is going on a path and there happens to be a destroyable object in the way (i.e. fences, dirt, etc.), then the badger will destroy the object and continue on its path.

    • Protection of Young: Badgers are very protective of their young. So when a player is near them and there are badger babies, the badger would not give chase, but rather stand in front of the babies and be ready to attack if the player gets too close. In other words, the badger will not chase the player in exchange for compromising the safety of its younglings. Thus, if there is a player and badger younglings, then the badger enters protective mode, where all the younglings gather and the badger stands in front of them.

    • Deep Sleep: During the winter, badgers do not hibernate, but rather, sleep for an extended period of time, especially if the winter is pretty bad. Thus, if there is a pattern of cold, bad weather during the winter for an extended period of time, then, the badger will sleep for X days until the bad weather days pass (of course, this requires a weather module to give a notification that the weather will be bad for an extended period of time).

    • Staying in Setts: When there is bad weather, namely storms or just snowing/raining a lot, then the badger will remain in its sett and not move out. If it needs something, it will try by digging tunnels to accomplish its goals or fulfill its needs.
 
Top