Creative coding / Simulation
Emergent Sandbox
A particle sandbox where simple attraction and repulsion rules create clusters, chasing loops and moving swarms.
I built Emergent Sandbox with Codex as an open-ended simulation for emergent behavior. Simple attraction and repulsion rules produce clusters, chasing loops, orbiting pairs and moving swarms. The program runs locally in the browser.
Changing the rules
An interaction matrix controls how two to eight particle colors respond to each other. The rules can be asymmetric: one color can chase another without being chased back. Live controls adjust force strength, interaction range, damping, gravity and optional Fibonacci distance bands, making it easy to explore how small changes affect the larger pattern.
Interacting with the scene
Grab, spawn or erase particles, paint solid obstacles, and explore the world with pan and zoom. Selecting a particle reveals the forces acting on it, while live measurements track clustering, color segregation, heading diversity and organized activity. These tools connect the visible patterns to the local interactions that produce them.
Repeatable experiments and automated exploration
Pause the simulation, advance one step or replay a seeded scene to examine how it develops. Background searches explore rule combinations for interesting patterns, and configurations can be saved, loaded or shared through JSON. This makes it possible to return to a setup and compare the effects of different choices.
