Bibite Attack System

Bibites have health have the capacity to be hurt.

In order to integrate Bibites into that dynamic and increase the potential for interactivity, they have the capacity to attack other entities by biting them through their mouth. The behavior is highly different depending on the bibite attacking another bibite or a matter pellet.

Attacking Pellets
In The Bibites, Attacking is used to bite chunks off pellets in the event where it is too big to be swallowed whole.


 * First, the exerted force must be greater than the pellet's material hardness. The applied force can be calculated as such:

$F = desireToAttack_{(Output Node)} * STR_{(gene)} * 1DSize $


 * Then, if the desire to swallow (output node) is greater than 0
 * The maximum swallowable amount of pellet is calculated from the mouth opening and available stomach space
 * That amount is removed from the pellet and added to the bibite's stomach
 * If the desire to swallow is bellow 0, the pellet is split in two equal parts.

Attacking Bibites
Bibites can attack other individuals by biting them. Doing so deals damages, but also allows the attacking bibites to eat.

When a bibite Attacks, the dealt damages are calculated as such:

$$Dmg = desireToAttack_{(Output Node)} * ({STR}_{(gene)} * 1DSize - {DEF}_{prey} )*BittingDmg_{(setting)}$$

If the prey has higher defence (DEF) stat than the Attacker's mouth strength, no damages are applied, emulating material hardness.

If the attacker wanted to eat, the dealt damages are converted to their energy equivalent, and then to a meat pellet that is transferred to the Bibite's stomach. If the Bibites Didn't want to eat, the pellet is instead spawned near the attack site.

Finally, the attacked bibite is pushed away proportionally to the received damages.