Primordial provides three ways to save and share your simulation configurations, plus a built-in session recorder. All controls are in the World tab of the left panel.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/jkh2/Primordial-Sim/llms.txt
Use this file to discover all available pages before exploring further.
Share Link
The Share Link button encodes your entire simulation configuration as base64 JSON and appends it to the current URL as a?s= query parameter.
When you click Share Link:
- All slider and checkbox values are captured via
captureSettings(). - The settings object is serialized to JSON and encoded with
btoa()(base64). - The encoded string is appended to the page URL:
?s=<base64-encoded-settings>. - The full URL is copied to your clipboard via
navigator.clipboard. - If clipboard access is denied (e.g. non-HTTPS context), the full URL is displayed in the UI instead so you can copy it manually.
?s= parameter on load and applies the settings before the world initializes.
Export & Import .primordial Files
Exporting Settings
The Export button downloads a.primordial file containing all current slider and checkbox values.
Filename format: primordial-[preset]-[date].primordial
For example: primordial-armsrace-2024-11-15.primordial
If the preset is set to Custom, the filename uses custom as the preset segment.
File Format
The file is plain JSON with a.primordial extension. Version 3 format:
Slider IDs included in export
| ID | Control |
|---|---|
sOrganisms | Organisms |
sFood | Food Pellets |
sFoodRate | Food Spawn Rate |
sSpeed | Simulation Speed |
sSpecies | Number of Species |
sStartSize | Starting Size |
sMaxSize | Max Size |
sOrgSpeed | Organism Speed |
sLifespan | Lifespan |
sReproSize | Reproduce at Size |
sOffspring | Offspring Count |
sOases | Food Oases |
sEatRatio | Size Advantage to Eat |
sEatGain | Energy from Eating |
sHunt | Hunt Drive |
sFlee | Flee Drive |
sFlock | Flock Cohesion |
sFoodDrive | Food Attraction |
sSeparation | Separation Force |
sMutRate | Mutation Rate |
sMutStr | Mutation Strength |
sFoodGlow | Food Glow |
sTrail | Trail Length |
Checkbox IDs included in export
| ID | Control |
|---|---|
chkSameSpecies | Same Species Protected |
chkFoodChain | Food Chain (Rock-Paper-Scissors) |
chkMutation | Enable Mutation |
chkEvoSpeed | Speed Gene evolves |
chkEvoAggro | Aggression Gene evolves |
chkEvoEfficiency | Efficiency Gene evolves |
chkEvoPerception | Perception Gene evolves |
chkGlow | Additive Glow |
chkDeathFX | Death Particles |
chkShowOases | Show Food Oases |
Importing Settings
The Import button opens a file picker that accepts.primordial and .json files.
When a file is selected:
- The file is read as text and parsed as JSON.
- The importer checks that
_format === 'primordial-settings'. Files that fail this check are rejected with an error message. - If valid, all slider and checkbox values are applied and the world resets automatically.
- A confirmation message shows the version and preset name of the loaded file.
Session Recording
Session recording uses the MediaRecorder API. Chrome and Firefox have full support. Safari has limited MediaRecorder support and may not be able to record — Chrome or Firefox is recommended for reliable recording.
How it works
- The canvas is captured at 30 fps using
canvas.captureStream(30). - If sound is enabled, audio is captured via a
MediaStreamDestinationon the Web Audio graph and merged into the stream. - The video is encoded using the best available codec in priority order: VP9+Opus, VP8+Opus, VP9, VP8, or plain WebM.
- Video bitrate is set to 5 Mbps.
- The output file is a
.webmcontainer.
Output filename
Filenames use an ISO timestamp with colons andT replaced by dashes:
Recording states
| State | Button label | Indicator |
|---|---|---|
| Idle | ⏺ Record | Hidden |
| Recording | ⏹ Stop | Pulsing REC badge (top-right) |