Special "neurons": muscles and receptors 

Basic muscles (actuators) and receptors (sensors) are illustrated below.

A muscle neuron ('|' or '@' in genotype) can change the relative orientation of the controlled stick (relative to the previous stick).
This simple 2-stick creature with a bending muscle in the middle is described by the genotype "XX[|...]". The joint stays straight when the signal is equal to 0. Positive and negative values bend the construction in the opposite directions. [animation]
The "G" receptor (gyroscope, equilibrium sense) gives information about the stick's orientation relative to the gravity force. A gyroscope mounted on a horizontally aligned stick sends 0 to its outputs. Vertical position is perceived as -1 or +1 depending on which end is higher. [animation]
The "T" receptor (touch) can be imagined as a whisker attached to the stick. Its relaxed state is -1 (nothing detected in the whiskers' range). The signal value grows as the stick gets closer to any material object. Reaches 0 when the stick touches the ground. Higher values mean that the stick is pushed into the ground. [animation]
The "S" receptor (smell) excitation depends on the sum of the neighbor energy sources (energy balls and other creatures). Output range is from 0 (nothing detected) to 1 (maximum). Rich or closer energy sources smell 'stronger' than small or distant ones. [animation]

Formulas for basic effectors and receptors

Neuron type How simulated
| (muscle)

[animation]
Changes the relative orientation of the joint's parts by rotating the second part around the first part's Z axis. Parameters:
  • p (power) – muscle strength. Affects the movement velocity and the maximum force the muscle can exert.
  • r (range) – Affects movement range, maximal value 1.0 means full range (-180°..+180°). The following rule applies:
    Angle = Range * Signal * 180°
    
Sample creature (f1 genotype XX[|])
//0
p:
p:1, m=2
p:2
j:0, 1, dx=1
j:1, 2, dx=1
n:j=1, d=|

Neutral position
Singal = 0
Angle = 0°

Muscle active
Signal = 0.2
Angle = 36°

Explanation: The joint is attached to parts #1 and #2. Part #2 was rotated around the Z axis of Part #1, so its position and orientation was changed.

The above pictures were created using the "standard-xyz" OpenGL visualization style, which can be used to investigate part orientations in creatures.

@ (muscle) Changes the relative orientation of the joint's parts by rotating the second part around the first part's X axis. Parameters:
  • p (power) – muscle strength. Affects the movement velocity and the maximum force the muscle can exert.
This musle always uses the full movement range (-180°..+180°).
Angle = Signal * 180°

Sample creature (f1 genotype XX[@])
//0
p:
p:1, m=2
p:2
j:0, 1, dx=1
j:1, 2, dx=1
n:j=1, d=@

Neutral position
Singal = 0
Angle = 0°

Muscle active
Signal = 0.25
Angle = 45°

Explanation: The joint is attached to parts #1 and #2. Part #2 was rotated around the X axis of Part #1. Part #2 was not moved, because it lies on the X axis (in creatures built from f1 genotypes, all parts lie on the X axis).

The above pictures were created using the "standard-xyz" OpenGL visualization style, which can be used to investigate part orientations in creatures.

G
(gyroscope)

[animation]
state = (part1.z – part2.z) / stick_length
T
(touch)

[animation]
  • if touches: state = distance of part and ground (which is equivalent to positive depth)
  • if does not touch: check along x orientation of the part
    • state = –1.0 if there are no objects closer than 1.0 distance
    • state = ... (intermediate negative values)
    • state = 0.0 if a touched object is just at the T part
S
(smell)

[animation]
state = (sum_all_energy_sources[ energy / distance2 ])/100
(if distance<1, then use 1)
Water
(water detector / water pressure indicator)

[animation]
  • above surface: state = 0.0
  • below surface: state = depth
Energy
(energy level)

[animation]
  • state = 1.0 for initial energy level (a newborn organism)
  • state = ... (intermediate values)
  • state = 0.0 for no energy (creature dies)
 
 
 
On the forum: