Welcome to the Creatures Wiki! Log in and join the community.

Biochemistry

From Creatures Wiki
Revision as of 21:48, 23 September 2021 by Ligfx (talk | contribs)
Jump to navigation Jump to search
Pippinchemist.png

A creature's biochemistry is the collection (sum total) of its chemical reactions. A realistic biochemistry with analagous chemicals, emitters, neuroemitter, and receptors to the real world is a big part of making creatures act realistically, because when their brains are linked up to monitor chemicals they can decide things like "maybe it would be a good idea to eat some food when my glycogen level is low".

This is also a good place to look when creatures are behaving oddly, as a mutation may have caused a positive reinforcement loop in their brain regarding ideas like walking into walls.

In Creatures 2 and Creatures 3, some of the genes involved in biochemistry depend on the organ that contains those genes being alive: so heavy metal poisoning or other diseases can cause a creature to lose some important biochemical reactions.

Chemicals

Chemicals are the components of a Creature's biochemistry. They can react with each other in chemical reactions defined by the creature's genetics. The chemicals are arbitrary - they possess no innate qualities of their own, and what they do to a creature is solely determined by its genetics, including ratios.

There are complete lists of Creatures 1 chemicals, Creatures 2 chemicals, and Creatures 3 chemicals. Some chemicals also have separate pages; these are in the Chemicals category.

Half-lives

The half-life of any chemical, either in the Creatures series or our own universe, is the time it takes for a given amount of any chemical to decay to half the original value. In Creatures, altering this can have profound effects on biochemistry.

In creatures, the half-life of any chemical is determined by a big gene called, oddly enough, the half-life gene. The half-life gene is the longest gene in a creature, as it contains the decay rates of all the chemicals in a creature's biochemistry. A common mutation of the half-life gene produces a longer half-life for ageing or life, leading to longer-lived creatures.

As of Creatures 2, if you hex edit a gene file, and change the decay rate to values that are not in the included table, you will just get the same behaviour as the nearest lower value in the table. For example, any value from 0 to 7 will behave as 0 does, and any value from 64-71 will behave the same as 64. source

See biological half-life on Wikipedia for more on the real-life topic.

Emitters

An emitter (or chemoemitter) releases chemicals into the "bloodstream" of a creature, affecting its biochemistry. An emitter gene controls what chemical, how much, and under what circumstances.

One common mutation in this gene in C1 was instead of an emitter emitting DecASH all the time, it emitted alcohol instead, leading to a creature that was permanently drunk. Slave suffered from this mutation.

Receptors

Receptors monitor chemical levels and change the brain's behaviour - for example, shivering to relieve coldness. They are fed by emitters. One of the things that receptors do is monitor the ageing or life chemical and tell the norn when to change life stages. In some instances, receptors may control the reaction rate of a chemical reaction.

In C3, receptors were updated to bind to the reaction rate locus as well as the organ clockrate locus.

Reactions

Chemical reactions are genes which control the changing of one group of chemicals to another. These reactions can be found in the creature's Digital DNA as part of their biochemistry. The main limitation on these is that it is not possible to create a reaction of the form [Nothing] --> Chemical (the reverse is possible). Some of these reactions can be mutated to devastating effect, e.g. converting energy into glycotoxin.

The basic form of a chemical reaction in the genes can be written as iA + jB → kC + lD at a given rate, where ijkl are ratios and ABCD are chemicals. In addition to this basic form, A + B → C ('fusion'), A → NONE (exponential decay), A + B → A + C (catalysis) and A + B → A (catalytic breakdown of B) are possible.

The rate at which reactions occur is concentration-dependent.[1]

As chemicals have no innate properties of their own, stoichiometry is entirely controlled by genetics - which can lead to energy being created from reducing sex drive, as in the Bacchus mutation, or large amounts of long-term energy being created from disproportionally small amounts of short-term energy, as in the Highlander mutation.

As an example, consider the reaction 2H + O -> W, and current chemical levels of 10H and 10O Each biotick, the current levels of chemical H and chemical O are examined to determine if and how much of the reaction can occur. In this case, there are five units available for the reaction (10H + 5O). The number of units available is reduced by the reaction rate, in the same manner as a chemical half life, and the resulting number of units are then consumed by the reaction, and an equivalent number of units of output chemicals are created.

Organs

Creatures 2 diagram showing the different functions of the organs.

Organs were introduced in Creatures 2.

They, like in real creatures, work together to ensure the creatures survival. Certain organs, like the heart, lungs, brain, and various support organs, are essential for life in the default genome. If any of these organs stop functioning it can cause death!

Organs all have certain chemical reactions that occur within them, for example, 1 water + 1 nothing = 1 hotness decrease + 1 nothing. This is the reaction for sweating and takes place in the skin organ. If the skin organ were to stop functioning the temperature of the creature would rise.

Organs have life forces and clock rates. The clock rate is how fast the reactions are taking place in that organ while the lifeforce is the health of the organ. Organ lifeforce naturally decays over time as the creature ages, but certain chemicals (Antigens, Lactate, heavy metals) can cause the lifeforce of certain organs to deteriorate faster. Another major lifeforce killer is ATP deficiency, causing all organs to deteriorate very quickly. As of C2, each organ comes with a certain ATP cost, and if an organ does not have enough ATP it loses lifeforce until its needs are met.source

The brain decreases to low lifeforce in seconds.

Organs naturally become less functional over the lifespan of the creature - this is controlled by a setting called 'organ vulnerability'.source

There are lists of C2 Organs and C3 Organs.

Neuroemitters

Starting in the Creatures Evolution Engine, creatures can have defined neuroemitters. Like an emitter, it gives a small amount of four chemicals. The neuroemitter is triggered by neurons, rather than locus levels. The sole neuroemitter in the standard C3 norn gives adrenalin, fear and crowded when the norn sees a grendel.

Implementation details

Initial chemical concentrations

In all games, initial chemical concentrations are set by genetics.

In Creatures 1, late-switching chemical concentrations genes will reset the chemical to the new value when the creature hits that life stage.

In Creatures 2, these late-switching genes are ignored.

In the Creatures Evolution Engine, this late-switching gene behavior is restored, similar to Creatures 1.

C1 emitters

Every processing period (sample rate * bioticks) the specified locus of a given tissue of a given organ is examined to determine if and how much of a chemical should be released.

There are two types of calculations that can be done:

  • Analog emitters (!(flags & 2)) release a chemical proportional to the signal level received, according to the calculation (signal - threshold) * (gain / 255) if signal > threshold else 0
  • Digital emitters (flags & 2) release a chemical entirely when they see a certain signal level, according to the calculation gain if signal > threshold else 0

Additionally, emitters may reset a locus to zero when a signal level above threshold is seen (flags & 1); and may treat a locus signal as its inverted value, e.g. 255 would become 0 (flags & 4).

Chris Double notes that "when a norn is born the emitter is processed at least twice. So even if the sample rate is set to almost never the emitter will be processed." and also "Sometimes the emitter is processed when importing a norn. A norn with an emitter set to almost never had the emitter processed when imported. Could this be related to import deaths in some way?"

C1 emitter loci

organ tissue locus description
Brain (0) lobe id (n) Activity (0) Lobe activity - # of neurons firing
Numloose0 (1) # Loose dendrites/neurons of type 0
Numloose1 (2) # Loose dendrites/neurons of type 1
Output (n) Output of neuron n-3
Creature (1) Somatic (0) Muscles (0) Muscle energy used this tick
Circulatory (1) Floating (0..7) A floating recip-emit is a place that a receptor can use for storing a data value from 0-255 which an emitter can then use for any purpose. It's a means of linking a receptor directly to an emitter without going through a brain lobe. There are up to eight of these numbered from 0-7. The life kit norns use this for the hunger/glycogen equation.
Reproductive (1) Fertile (0) This will be a value of 0 until the norn becomes fertile in which case it will be 255.
Pregnant (1) This will be a value of 0 until the norn becomes pregnant in which case it will be 255.
Immune (3) Dead (0) 255 if dead, else 0
Sensorimotor (4) Const (0) Always produces a value of 255
Asleep (1) 255 if asleep, else 0
Coldness (2) Not connected in Creatures 1
Hotness (3) Not connected in Creatures 1
Light level (4) A value from 0-255 indicating the light level
Crowdedness (5) How many and how close others of your kind are
Drives (5) Drive (0..15) The current value of a given drive

C1 receptors

Every biotick, the amount of the specified chemical is examined to determine the resulting value of the given locus.

If the chemical is above the threshold value, then the new value of the locus is calculated according to one of two rules:

  • Analog receptors (!(flags & 2)) stimulate a locus proportional to the signal level received: nominal + (chemical - threshold) * gain / 255 * R
  • Digital receptors (flags & 2) stimulate a locus when they see a certain chemical level: nominal + gain * R

In these calculations, R is 1 normally, or -1 if "Output REDUCES with increased stimulation" is set (flags & 1).

If the chemical is not above the threshold value, then the locus is just set to nominal.

C1 receptor loci

organ tissue locus description
Brain (0) lobe id Threshold (0) Sets the threshold value of the given lobe
Leakage (1) Sets the leakage value of the given lobe
Rest state (2) Sets the rest state value of the given lobe
Type 0 relax susceptibility (3) Sets the relax susceptibility value of type 0 dendrites for the given lobe
Type 0 relax STW (4) Sets the relax short-term weight of type 0 dendrites for the given lobe
Type 0 relax LTW (5) Sets the relax long-term weight of type 0 dendrites for the given lobe
Type 0 strength gain rate (6) Sets the strength gain rate of type 0 dendrites for the given lobe
Type 0 strength loss rate (7) Sets the strength loss rate of type 0 dendrites for the given lobe
Type 1 relax susceptibility (8) See above.
Type 1 relax STW (9) See above.
Type 1 relax LTW (10) See above.
Type 1 strength gain rate (11) See above.
Type 1 strength loss rate (12) See above.
Brain chemical 0 (13) Sets the value of lobe's chemical 0.
Brain chemical 1 (14) Sets the value of lobe's chemical 1.
Brain chemical 2 (15) Sets the value of lobe's chemical 2.
Brain chemical 3 (16) Sets the value of lobe's chemical 3.
Neuron state (n) State of neuron n-17
Creature (0) Somatic (1) Become child (0) If a baby, become a child.
Become adolescent (1) If a child, become an adolescent.
Become youth (2) If an adolescent, become a youth.
Become adult (3) If a youth, become an adult.
Become old (4) If an adult, become old.
Become senile (5) If old, become senile.
Die of old age (6) If senile, die of old age.
Circulatory (2) Floating (0..7) A floating recip-emit is a place that a receptor can use for storing a data value from 0-255 which an emitter can then use for any purpose. It's a means of linking a receptor directly to an emitter without going through a brain lobe. There are up to eight of these numbered from 0-7. The life kit norns use this for the hunger/glycogen equation.
Reproductive (2) Become fertile (0) If low, remove any egg/sperm from the gamete; if high, add one. In the C1 genome this tracks the Oestrogen or Testosterone (Females and Males respectively) chemical exactly.
Receptive (1) If greater than zero then the norn is receptive to sperm. In the C1 genome it is linked to sex drive for females.
Immune (3) Die (0) If the value of this is ever non-zero the norn will die. In the various life kit genomes it is linked to the aging chemical. When the chemical is lower than a certain value the norn will die.
Sensorimotor (4) Involuntary action (0..7) Activates an involuntary action
Gain (8..15) Activates gait n-8 (where gait 0 is the normal walk gait)
Drive (5) Drive (0..15) Set the current value of a given drive

See also

External links