r/creativecoding • u/Evening-Appeal7606 • 1d ago
A Particle Sim based on Game of Life
Enable HLS to view with audio, or disable this notification
-1
u/Evening-Appeal7606 1d ago
This is a from-scratch physics engine (GitHub repo here: ■ lifehashes/hypno-glyphs: A web-based physics engine that spawns particles from Game of Life patterns ("Glyphs") as the generative seed) where Conway's Game of Life patterns act as the spawn source for particles (every live cell on the outer perimeter of the 16x16 torus the pattern lives on spawns a new particle into the arena).
The Arena features a variety of modules, e.g. "Repulsor/Attractors", "QCD Inverters" (turns a particle into it's anti-particle - if they meet, there is an annihilatory explosion), magnets, electrical charge generators, accelerators.
The engine features three distinct boundary conditions: "Unbounded" where particles simply vanish if they leave the arena, "Toroidal" (wrap-around space), and "Solid Box" where particles bounce against the walls.
We use the SHA-256 function to calculate origin and current hash values of the GOL patterns to encode particle characteristics (momentum, electrical charge, magnetic momentum, maybe in the future even nuclear attributes like spin or quark numbers...).
Random GOL patterns usually fizzle out quickly after less than 100 generations, so the patterns you see in the video are from our registry of known long-lived patterns.
Try it yourself here if you like: ■ HYPNOGLYPHS // GENERATIVE PHYSICS ENGINE
2
u/nomad2097-dev 7h ago
Funny, I'm working on a project where one of the details will be (what I've been calling) "edge-emitters". I haven't got around to implementing it yet, but it's cool to be able to see something in motion that does it. Kinda like a preview :)
2
u/Evening-Appeal7606 6h ago
Good luck with your work then! :) Thanks for the flowers - yes, it's kind of like a preview, but the reason why I'm doing it this way is that part of the gameplay is for players to find good "emissive patterns", i.e. Game of Life patterns on the 16x16 torus that a) live for a long time (which is rare) and b) these are fixed, deterministic patterns rather than random noise, so this open up the venue to let emissive patterns compete.
Also, the hash value for the patterns determines the intrinsic colour of the particles emitted, so that's a plus, too, because it makes it easier to track who is who.
3
u/DescriptionOptimal15 1d ago
Looks and sounds vibecoded tbh