Concepts

Worlds

Self-contained simulation environments.

What is a World?

A World is a complete simulation environment containing all the state, rules, and configuration needed to evolve over time.

World Components

metadata
Name, version, seed, tick rate, and configuration
initialState
Starting snapshot: agents, zones, fields, globals
rules
Logic that transforms state each tick

World Lifecycle

  1. Create — Define world in cruxLang or JSON
  2. Compile — Convert to cruxIR
  3. Load — Initialize in cruxVM
  4. Run — Execute ticks
  5. Observe — Monitor state and events

Example Structure

{
  "metadata": {
    "name": "my-world",
    "version": "1.0.0",
    "seed": 12345,
    "tickRate": 1
  },
  "initialState": {
    "agents": [...],
    "zones": [...],
    "globals": {}
  },
  "rules": [...]
}