設計生物食物鏈(一)

設計生物食物鏈(一)
--------

本節紀錄食物鏈當中的重要節點:生物單體的有限狀態機

  1. 模擬動機:飢餓
  2. 狩獵
  3. 滿足
  4. 消費
  5. 回到第一步,無限循環

飢餓

讓生物進食的需求,而食物來自狩獵。隨著時間推移,飽食度下降;進食之後飽食度上升,故這個動機會隨著時間一直不斷的產生與消滅。

狩獵

受到飢餓這個動機驅使,使的在這個狀態會搜尋環境中的所有可能物件,並分析其為獵物或是食物;是獵物則進行追蹤與攻擊,是食物則接近並進食。

滿足

飽滿思淫慾,滿足基本生存需求之後則可以進入尋求更高層次的安全感與社交關係等等。在本次作品中為尋找交配對象並進行繁殖。

消費能量

進行娛樂或是繁殖將會消耗大量的能量,使的飽食度驟減,可以使的這個循環更加動態。在食物不足的情況不應該進行成本太高的活動,這會形成一個抉擇。

消長循環

形成一個動態十足的循環,新誕生的個題也可以為這個環境增加更大的變數;如果新個題為獵食者,將會使的狩獵對象的數量再次減少,造成食物減少,提升本族群的死亡率,進而形成生態消長。


Design of animal behaviour 

--------

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 ecosytem, which is a masterpice well-desinged 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 is the behavior states of the suvival loop:
1. Hunger
2. Hunt
3. Satification
4. Social
5. Go back to 1st step and repeat

Hunger

----

Hunger is the very first and distinct motivation for suvival. An animal will starve, and the pain of hunger urge it to do something until its stomach is full. Therfore, 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 following:

Stomach{
float RateOfFullness // zero to one
}

We also want to put some food inside the stomach. On other hand, the stomach can 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 comsumed over time, so the stomach needs a time updater which can be called by 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 stomach, an animal should try hard to find food. If this animal is a predtor, the source of food will be other animals or plants. For realism, we make an animal has behaviors below: wandering, looking around ,serching anything in its sight. If an animal finds anything, it will approach the target, attack, then eat the target.

Social & Breed

----

The social behavior is also the goal we interested in. When an animal loses the motivation of hunger, it feels safe and seeks for any chance for breeding. In practically, when an animal's stomach is full, it starts to find other ones with the same specis as itself. If it finds anyone, approaches the target then stays around. If this animal has any ability of sex, it will send a sexual request to the mate. If both sides feel good and all conidtions are set, there will be an sexual behavior occured.

Sexual behaviors comsume a lot of envergy in general, and we imply this character with clearing their stomach. After that, An egg will be laid ,or a baby will be born ,which depends on what type of these aniamls are. Hence their stomachs are empty once again, they will start the journey of finding foods after a while. Both children and parents continue the suvival circle and begin from hunger. The finite-state machine goes on and on, and keeps a non-static blance during the game time.


留言