The Bibites now have an internal storage space analogous to a stomach where they can store and accumulate materials waiting to be digested.
When a Bibite eats something, it is sent to the stomach, where it will be digested by the stomach's acid to transform into energy.
Functioning[]
Capacity[]
The stomach has a maximum capacity of matter it can contain equals to half the bibite's surface (in u2 ). As a result, a "default" bibite (size gene and maturity of 1.0, resulting in a body surface of 42 u2) will be able to hold up to 21 u2 of matter.
Fullness[]
The fullness of the stomach is simply the fill percentage of the stomach, or the total amount of matter it contains divided by it's capacity.
Acid Level and Digestion Potential[]
Bibites have an Output Node in their Brain (called Digestion) that controls the level of activeness (acid level) of their stomach. Being a Sigmoid, it can only range from 0% to 100%. The total digestion potential is proportional to the stomach's acid level divided by it's fullness, as well as the bibite's size (2D) to make physical sense.
However, the total digestion potential is softly capped at 100%, meaning that over 100%, increasing the acid level doesn't increase the digestion potential as much. In fact, going above that threshold will also cause an efficiency malus (detailed lower).
Above the threshold (when the stomach's acid level is higher than the fullness), the total digestion potential will be calculated as such:
As a result, a bibite with it's acid level at 30% but a stomach only 25% full will only have a digestion potential of 105%.
Digestion rate[]
The exact amount of matter digested depends on the stomach's content. First, the digestion potential is split among all the matter it contains proportionally to their respective share of the total contained amount.
In other words, if a bibite's stomach only contains 10u2 of plant and 5u2 of meat, the plants will receive ⅔ of the digestion potential and the meat ⅓.
Then, for each different type of matter, their respective share of the total digestion potential is multiplied to their reactivity (u2/s) to determine their resulting digestion rate (u2/s).
Following our previous example, if that bibite had a total digestion potential of 60%, the digestion rate would be equal 40% ( ⅔ * 60%) of Plant Material's base reactivity. Since the default base reactivity of Plant is 1.0 u2/s (it can be changed in the simulation's parameters), this would result in a final digestion rate of 0.6 u2/s.
Affinity and Efficiency[]
The efficiency at which the stomach will convert matter into energy (or conversion efficiency) can easily be calculated using the particular material's min and max conversion efficiency and the bibite's affinity to that material.
Affinity[]
For now, the bibites can only digest plant and meat.
A bibite's affinity to meat is simply equal to the value of their diet gene (which ranges from 0.0 to 1.0).
A bibite's affinity to plant is then equal to 1 minus the value of their diet gene.
As a result, a bibite with a diet gene of 0.3, would have an affinity toward meat of 30%, and 70% toward plants.
Note: It is however planned to expand this system to make it more complex and allow parallel affinities to exist at a cost.
Conversion Efficiency[]
Then, the conversion efficiency of a particular material can be calculated from the min and max conversion efficiency of the material with the following formula:
Following our previous example, considering the default min/max efficiency of plant is -50% and 50%, and the min/max efficiency of meat is -30% and 85%, this allows us to calculate:
Plant:
Meat:
As such, a bibite with a diet gene of 0.3 would be able to obtain 20% of the energy of the plants it digest, and 4.5% of the energy from meat.
Efficiency Malus[]
If the stomach's acid level is greater than its fullness, an efficiency malus is then applied, proportional to the base efficiency shown above, given by the following formula:
Thus a bibite with a diet gene of 0.0, a stomach fullness of 80% and a stomach acid level of 100% would have an efficiency malus of 10%, meaning it would digest plants at 45% efficiency rather than 50%.
Energy Gain/Loss Rate[]
Now, the actual energy gain/loss rate (E/s) from the digestion of the stomach's content of a bibite is easily computed. It is simply given by the individual digestion rate (u2/s) of each material multiplied by their respective energy density (E/u2) multiplied by the bibite's conversion efficiency (%) with that material.
Maximizing Energy Gain Through Digestion[]
Assuming fixed material and bibite properties, we are left with two variables we can change to influence energy gain: acid level and stomach fullness. In the case of an acid level greater than its fullness, we can provide simplified versions of the above formulas to abstract away those constants:
We can now plug in a value for acid level or for stomach fullness, making it easy to find the optimal counterpart: for example, we might want to compute the optimal stomach fullness for an acid level of 100%:
We then derive:
We now need only find the root to get the optimal stomach fullness for an acid level of 100%, which is 50%.