Experiment workflow
1
AI proposes a hypothesis
Ask the AI to design an experiment (use the Design Experiment quick action or ask in freeform). The AI responds with a hypothesis, proposed parameter changes, and a duration.
2
Protocol is parsed
The system scans the AI’s response for an
experiment code block. If found, it parses the JSON protocol inside.3
Countdown begins
A system message appears in the chat: “Experiment protocol detected. Starting in 3 seconds…” Three seconds later,
startExperiment() fires automatically.4
Parameters are applied
The experiment engine applies all specified slider and checkbox changes to the simulation immediately. The before-snapshot is captured at this moment.
5
Experiment runs
The simulation runs under the new parameters. A pulsing green dot and countdown appear in the experiment status bar at the bottom of the AI panel, showing seconds remaining.
6
After-snapshot captured
When the timer expires,
checkExperiment() detects completion and calls getSimSnapshot() to capture the post-experiment state.7
AI writes the lab report
Both snapshots are sent to the AI via
analyzeExperiment(). The AI produces a structured report covering hypothesis, observations, analysis, conclusion, and a suggested follow-up experiment.Experiment protocol format
The AI outputs experiments as a fenced code block with the language tagexperiment. The system matches this block with a regex and parses the contents as JSON.
Valid slider IDs
These are the slider element IDs the experiment engine recognizes. Any of these can appear in thechanges object.
Valid checkbox IDs
These are the checkbox element IDs the experiment engine recognizes. Any of these can appear in thecheckboxes object.
What the snapshots contain
Both the before and after snapshots are produced bygetSimSnapshot(). Each snapshot includes:
simTime— elapsed simulation time in secondsgeneration— total reproduction eventstotalAlive— current organism counttotalFood— current food pellet countspecies— array of per-species objects, each with:name— color name (Red, Orange, Gold, Green, Teal, Cyan, Blue, Indigo, Purple, Magenta, Lime, Emerald)population— live organism countavgSize— mean organism sizeavgEnergy— mean energy levelgenes—{ speed, aggro, efficiency, perception }as percentages (0–100)
extinctions— array of species names with zero populationtopPredator—{ species, kills, size }for the single organism with the most kills, ornullsettings— current values for key parameters (hunt, flee, mutation rate, food chain, etc.)
Lab report format
The AI structures its post-experiment analysis report with these five sections:- HYPOTHESIS — restates the hypothesis from the protocol
- OBSERVATIONS — what changed between snapshots: population shifts, extinctions, gene drift
- ANALYSIS — mechanistic explanation of why the changes occurred, referencing simulation rules
- CONCLUSION — whether the data supported or refuted the hypothesis
- NEXT EXPERIMENT — a concrete follow-up suggestion with specific slider values