Design of animal behavior : v1.2

Design of animal behavior
--------
英文寫作修正版:3

Our goal is to make a game about animal behavior. Animal behavior is a professional scientific subject with a long history. Through observation, we can understand how complicated and fascinating nature is. It is a challenge to reproduce the ecosystem, a masterpiece well designed by God and tested over thousands of years. This article is an introduction to our food chain mechanism: The finite-state machine of ONE creature.

The following are the behavior states of the survival loop:
1. Hunger
2. Hunt
3. Satisfaction
4. Social
5. Go back to 1st step and repeat

Hunger
----

Hunger is the very first and distinct motivation for survival. An animal will starve, and the pain of hunger urge it to do something until its stomach is full. Therefore, each animal should be designed with a stomach in it. The stomach should be full, empty, or somewhere in between. We can define it with the following:

Stomach{
float RateOfFullness // zero to one
}

We also want to put some food inside the stomach. The stomach can also be described as a food container:

Stomach{
float RateOfFullness // zero to one
void Add(Food food);
int Count{get;}
bool Contains(Food food);
}

Food is consumed by stomach over time, so the stomach needs a time updater which can be called by the system :

Stomach{
float RateOfFullness // zero to one
void Add(Food food);
int Count{get;}
bool Contains(Food food);
void Update(float deltaSeconds);
}

An animal can send a request message to its stomach and get a response that tells the animal how hungry it is. If the stomach is not full, an animal can eat something to put food inside the stomach. But, where's the food?

Hunt
----

For the sake of its stomach, an animal should try hard to find food. If this animal is a predator, the source of food will be other animals or plants. For realism, we make an animal have behaviors below: wandering, looking around, searching anything in its sight. If an animal finds anything, it will approach the target, attack, then eat the target.

Social & Breed
----

Social behavior is also a goal we are interested in. When an animal loses the motivation of hunger, it feels safe and searches for any chance to breed. In our model, when an animal's stomach is full, it starts to find other members of the same species. If it finds anyone, it approaches the target then stays around. If this animal has any mating potential, it will send a sexual request to the mate. If both sides feel good and all conditions are met, a sexual behavior will occur.

In general, sexual behaviors consume significant energy, and we show this fact by clearing their stomach. After that, either an egg will be laid, or a baby will be born. It depends on what type of animals they are. Hence, their stomachs are empty once again and they will start the journey of finding food after a while. Both children and parents will continue the survival circle and begin from hunger. The finite-state machine goes on and on and keeps a non-static balance during the game time.



留言