Back to Browse

TyFlow Particle Life

668 views
Feb 4, 2025
1:11

TyFlow implementation of "Particle Life" algorithm. The Particle Life algorithm, developed by Jeffrey Ventrella, simulates emergent behavior in a system of interacting particles, where each particle exerts attraction or repulsion forces on others based on a predefined interaction coefficient matrix. These forces drive dynamic, self-organizing patterns in continuous space, leading to behaviors like swarming, clustering, and oscillations. Each particle search for its neigbors within a "distanceMax" radius. There are 4 particle types (colors) in this setup (setup can be easily scaled for more types). Then a loop is run to summarize the effect of the found particles on the current particle. The influence of each particle is determined by the coefficient from the parameters table(array) multiplied by the v-shaped curve of the distance to the found particle (0 if distance = distanceMin; 1 if distance = (distanceMax-distanceMin)/2; 0 if distance = distanceMax). If distance is less than distanceMin all found particles (regardless of their type and coefficient) repel with force inversely proportional to distance. distanceMin in this setup is defined as distanceMax*distanceMinRato. I would leave that ratio about 0.25-0.3. There are two way of setting parameters table: 1. Setting parameters manually inside the Script (RandParams=0) 2. Use random values for parameters table (RandParams=1). In this case you can roll the dice by changing seedParams. Resulting force from all neighbors is multiplied by the "forceScale" parameter. Different particle types have different simulation group assigned (1 to 4 accordingly) so you can try to mesh them using TyMesher. Video is 8x accelerated but the same effect you can achieve by setting substeps to 1/8 frame. Setup is quite slow because searching neighbors in TyFlow doesn't support multi threading. There a lot of realtime implementations of this algorithm online (this one for is really good https://youtu.be/p4YirERTVF0?si=csztUbBxMNWcbfZB) but I was curious to try this in TyFlow. Entagma also did a very good tutorial about this algorithm (very well explained) https://youtu.be/yjqzDWtzJfQ?si=AUboMtzt3UHn7Wmi File: https://rman197.gumroad.com/l/lvfxca

Download

0 formats

No download links available.

TyFlow Particle Life | NatokHD