README.md |
AIrium 2
Creature Structure
Each creature is represented as a matrix of blocks in a 2D grid, but all creatures and structures only occupy one block in the world matrix.
There are three kinds of blocks:
- neuron blocks
- action blocks
- sensor blocks
TODO: energy system
Connection
- Each block is connected to every other adiacent block (diagonals too), so each block has 9 connection weights.
source block output ->>>- * weight ->>>- destination block
- A connection has a weight, which is a floating point number.
- The connection outputs its source block's current stored signal multiplied by the weight.
- If the weight is
0
, then there's no connection - the weight is a floating point number between -1 and 1 included.
Signals
A signal is a floating point value. Each block stores a signal (initialized at 0 which is a null signal).
Neuron (Processing) Blocks
Their output is the sum of all their input connections' current output.
Action (Input) blocks
They take an input signal and act by doing something, for example:
- they move the body in space
- they eject something
- they change color
- they interact with other structures
- they "eat" a block
- nothing (can be useful to stop signals from passing through)
Sensor (Input) blocks
They give adiacent blocks a signal.
Some examples:
- they communicate how far is the first structure in a straight line
- they communicate the amount of structures in relation to blank spaces in an area (popularity in an area)
- they communicate the color/type/activity of the first block in a straight line
- they communicate information about the presence of a particular kind of structure in a direction
- they communicate information about the structure itself, like integrity of adiacent blocks
Generated signals are floating point numbers ranging from -1 to 1 included.
Combined (Input+Output) blocks
They act as Sensor blocks and Action blocks at the same time.
Examples:
- a "mouth" block that can communicate wether food is available to eat and can receive eat commands at the same time
Traversing the brain graph
for each iteration, the stored signal
of each block is calculated using its input connection.
This new stored signal
is stored in a special variable without overwriting the current stored signal
so that the process can be easily accomplished in multithreading execution environments.
After all the new stored signals
have been calculated, their value is applied to the current stored signal
and the calculation process is repeated. This way, signals can propragate around
World Structure
A creature is a matrix of blocks, each adiacent block is connected. The blocks make up both the body and the mind.
The world is a matrix where each cell is either empty or occupied by something. Every structure occupies only one cell.