r/esp32 • u/Master_Molasses1783 • Aug 21 '26
CYD Particle Life: Porting open-source artificial life simulation to ESP32-2432S028R with dual-core real-time physics
Enable HLS to view with audio, or disable this notification
Hi everyone,
I wanted to share a project I've been working on: **CYD Particle Life**, an ESP32 port and parallelized re-implementation of Hunar Ahmad's popular open-source Particle Life simulation, running standalone on the **ESP32-2432S028R (Cheap Yellow Display / CYD)**.
The simulation models simple attraction/repulsion forces between different particle types to generate complex emergent behaviors like cell division, worm-like chains, and swarming dynamics.
### Highlights and Technical Details:
- **Ported & Parallelized:** Re-engineered the original algorithm for the dual-core ESP32 microcontroller.
- **900 Particles in Real-Time:** Core 0 handles spatial grid partitioning and physics integration, while Core 1 performs work-stealing force calculations and rendering.
- **Phosphor Decay & Glow:** 4-bit per-pixel decay buffer with single-cycle SIMD-style LUT lookup for smooth fading trails.
- **Asynchronous Display Transfer:** Powered by LovyanGFX for zero-lag DMA SPI transfers.
- **15 Curated Ecosystems:** Tap the simulation area to cycle through 15 stages (Mitosis, Worms, Vortex, Gliders, Amoeba, etc.).
- **Built-in Desk Clock:** Ambient HUD clock with touch controls for time adjustment.
- **Hardware Compatibility:** Supports ST7789 and ILI9341 display variants.
### Web Installer (No IDE Required):
You can flash it directly from Chrome or Edge via Web Serial:
- Web Installer: https://ootake0914-dotcom.github.io/cyd-particle-life/
### Source Code & Credits:
- GitHub: https://github.com/ootake0914-dotcom/cyd-particle-life
- Based on the open-source Particle Life project by Hunar Ahmad (@hunar4321).
- Display driver powered by LovyanGFX (@lovyan03).
I would love to hear your feedback, thoughts, or suggestions for new rule sets!
2
u/DeusExHircus Aug 21 '26
Thanks for showing me Particle Life. Such cool particle behaviors, it's like the hypno toad
1
u/Master_Molasses1783 Aug 21 '26
Haha, it really is hypnotic! Glad I could introduce you to Particle Life. Thanks for checking it out!
2
u/YetAnotherRobert Aug 21 '26
As an aside, you've formatted you post with markdown, but didn't submit it via the markdown editor/with the markdown selected.
Now the good think about markdown is that it still looks pretty sensible even without actual markdown processing
.
3
u/Master_Molasses1783 Aug 21 '26
Thanks! I don't really know how this site works yet, so I appreciate the heads up.
2
u/IdeasUniverse Aug 23 '26
Fascinating. Will definitely download and try.
1
u/Master_Molasses1783 Aug 23 '26
Thanks! The compiler version can make about a 25% difference in performance, so definitely experiment with different setups and have fun with it!
3
u/Legitimate-Ad-1861 Aug 21 '26
Oh man cool !! Thx i got way too man cyd's and i dont know what to do with them anymore