Alien Fauna ‐ Behaviour Summary - UQcsse3200/2023-studio-1 GitHub Wiki
Passive Fauna Behaviours
To add novelty and mimic natural wild animal behaviours, animals in the game exhibit different types of behaviours and switch states depending on the situation. Behaviours are implemented as tasks that can be added to the AITaskComponent. Details on how to use this to implement your own behaviours can be found here. The behaviours are listed below in order of increasing priority (i.e., Interested is higher than Wandering).
Wandering
Wandering is the most basic type of behaviour animals may exhibit, animals in a wandering state move around a certain position at a regular speed with no clear goal.
Running Away
Running Away is a behaviour in which the animal actively moves away from a player who gets too close. The animal will continue this behaviour until the animal is out of range of the player. This will make tasks such as taming more difficult as the animal will be harder to approach.
Interested
Interested is a behaviour in which the animal is curious about the player or more specifically, the item they are holding. Players may use certain items to cause animals to approach them.
Following player
The behaviour entails the animal following the player if the player is within a specified distance and not obstructed. The animal will stop following and begin wandering about the player once they reach a certain distance as to not crowd the player.
Panic
An animal enters a state of panic when they take damage. Animals run erratically for a certain duration and afterwards, they calm down and return to their default behaviour.
Taming
Taming is a mechanic in which a wild animal may be tamed by the player. Once tamed, a green ring will appear around the animal. When tamed, the animal will then become the player's companion which will drop items that the player can use. Different animals drop different items at different rates.
An animal can be tamed by feeding them their favourite food. The player will need to figure out what food to feed the animal and this will encourage them to explore the various plants found in the plant wiki.
Certain animals are more difficult to tame. The taming mechanic uses a randomiser to determine if an animal gets tamed. However, to prevent unnecessary frustration due to bad luck, a hidden maximum feeding threshold is set. When this threshold is met, the animal is tamed regardless of the probability result. When tamed, the animal will provide additional features in the game. An indicator will also pop up to indicate that the animal has been tamed. More info on the logic can be found at Taming Logic.
Additional behaviours when the animals have been tamed:
- Follow the Player: The animal will follow the player when the player is holding its favourite food and when the player is within a certain radius. The player can now lead tamed animals to a location of their choice e.g the player's farm, the location of player's fences/gates or just around then map. This provides a layer of character to the game, as the player now has a loyal companion/companions as they traverse around the map.
- Special Drops: Animals will drop useful items that will help the player in the game.
Example of tamed indicator:
Some things that can be dropped by tamed animals:
- Eggs
- Poop (fertiliser)
Hostile Fauna Behaviours
Hostiles were included in the game to add opposition and therefore make success within the game more rewarding. To add depth and realism to the hostile fauna, these hostiles exhibit various behaviors and adapt to different situations. Each hostile can hinder the player in a different way, either by directly attacking them, reducing the oxygen level of the planet, or by destroying the player's plants. Hostiles can respond to the player, some run away when you approach and others choose to fight.
Attacking the player
Watch out! Hostiles can damage the player; keep a keen eye on your health. Once damaged, you must eat to replenish your health - beef and chicken are a good source of protein.
Consuming oxygen
Hostiles can reduce the oxygen level of the planet, undoing your plants' hard work. Keep an eye on the oxygen bar to see the change in the planet's oxygen level. An exclamation mark will appear when an oxygen eater is consuming oxygen.
Destroying plants
Hostiles can destroy your plants, hindering your ability to maintain the farm. The dragonfly is an entity that actively seeks out plants to feast on! An exclamation mark will appear when a dragonfly is destroying your plants.