Simulation · Published v2

Prismatic Garden

A garden of cyan and rose crystals climbs upward and branches into smaller spires. Energy limits each branch: paint a fresh crystal to grow another cluster. This is a stylized growth model, not a chemistry solver.

No preview

Inside this simulation

Every named building block is public and reusable. These are the exact versions published with this simulation.

Source

// Energy decreases with each new generation, bounding growth without a world edge.
property Mineral { energy: Float<1.0> [0.0 1.0]; age: Float<0.0> [0.0 1.0]; hue: Float<0.0> [0.0 1.0]; }
model AzureCrystal : Mineral;
model RoseCrystal : Mineral { hue<1.0>; };
world { dimensions 3; cell Cube; neighborhood VonNeumann; }
behavior CrystalClock for Mineral { update { set self.age = min(self.age + 0.08, 1.0); } }
behavior CrystalRise for Mineral { expand toward +Z when self.energy > 0.30 && self.age < 0.20 { set target.energy = self.energy * 0.86; set target.age = 0.0; set target.hue = self.hue; } }
behavior CrystalBranch for Mineral { expand toward +X, -X, +Y, -Y when self.energy > 0.62 && self.age > 0.45 { set target.energy = self.energy * 0.76; set target.age = 0.0; set target.hue = self.hue; } }
phase clock { run CrystalClock on AzureCrystal; run CrystalClock on RoseCrystal; }
phase growth { run CrystalRise on AzureCrystal; run CrystalRise on RoseCrystal; run CrystalBranch on AzureCrystal; run CrystalBranch on RoseCrystal; }
visual CrystalLight for Mineral { color { rgba(0.10 + self.hue * 0.78 + self.energy * 0.12, 0.35 + (1.0 - self.hue) * 0.55, 0.65 + self.energy * 0.35, 1.0) } }
visualize AzureCrystal with CrystalLight;
visualize RoseCrystal with CrystalLight;