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
- Create — Define world in cruxLang or JSON
- Compile — Convert to cruxIR
- Load — Initialize in cruxVM
- Run — Execute ticks
- Observe — Monitor state and events
Example Structure
{
"metadata": {
"name": "my-world",
"version": "1.0.0",
"seed": 12345,
"tickRate": 1
},
"initialState": {
"agents": [...],
"zones": [...],
"globals": {}
},
"rules": [...]
}