Skip to content

Brain Format

Vicious Squid edited this page Apr 5, 2026 · 4 revisions

A network of neurons using a dictionary for quick access.
Connections between these neurons are mapped using a simple "Source->Target" text format.

Ten example brains are included in the custom brains folder


Top-Level Structure

Each brain is a single JSON object containing metadata and the neural network definition.

  • type: Categorizes the neuron's role, such as sensor, core, hidden, or custom
  • position: An [x, y] array for visual rendering. (format: always "dosidicus")
  • metadata: Contains descriptive information: name, description, author, version, created, modified

Neurons (Nodes)

Neurons are stored in a dictionary where the key is the unique neuron ID (e.g., "hunger"). Each neuron object includes:

  • type: Categorizes the neuron's role, such as "sensor", "core", "hidden", or "custom".
  • position: An [x, y] array for visual rendering.
  • is_sensor / is_core / is_custom: Boolean flags defining the neuron's nature.
  • is_binary: Boolean. If true, the neuron typically operates in an on/off state (common for sensors like can_see_food).
  • activation: The starting value for that neuron (often 50.0 for core needs or 0.0 for sensors/hidden layers).

Connections (Edges)

Connections are stored in a dictionary where the key uses a specific arrow syntax: "SourceID->TargetID"

  • Value: A float representing the connection weight (e.g., "cleanliness->happiness": 0.141).
  • Self-Correction: Neurons can connect to themselves (e.g., "can_see_food->can_see_food": -0.8).

State

The state object mirrors the neurons' current activation values. It serves as a snapshot of the squid's internal "feelings" or sensor readings at a given moment.

  • It includes the current values for both named neurons and hidden layers.
  • Binary sensors are recorded as booleans in this section (e.g., "can_see_food": false).

Visuals & UI

Specific sections to handle how the brain appears when running in the simulator:

  • neuron_shapes: Maps neuron IDs to geometric shapes: circle, square, diamond, or pentagon.
  • neuron_positions: Position data for the brain tool Network tab

Output Bindings (Implicit Outputs)

The Output Bindings system allows neurons to trigger external actions

(see: brain_neuron_hooks and brain_neuron_outputs)

  • neuron_name: The neuron being monitored.
  • output_hook: The function to trigger (e.g., "neuron_output_change_color").
  • trigger_mode: Defines when the hook fires (e.g., "above", "below", or "falling").
  • threshold: The value the neuron must hit to trigger the hook.
  • hook_params: Configuration for the specific action, such as RGB colour values.

Output bindings can be created and edited using the Brain Designer

Clone this wiki locally