Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
A simulation where life unfolds in real time (soupof.life)
89 points by maybe-tomorrow 7 hours ago | hide | past | favorite | 50 comments




If you’re interested in what’s happening under the hood (and what isn’t), I’ve documented the concepts and abstractions here:

https://soupof.life/concepts

It’s a living doc, but should answer quite some questions.


Very interesting to watch, though I don't really have a great idea of what's going on most of the time. Performance seems to be fairly poor despite my system being pretty beefy (Ryzen 9 7950x3d). I see the performance monitor and notice that the render loop seems to fairly regularly exceed the latency for 60fps, despite this being a 'simple' task by modern standards. I'd give more helpful feedback as to why, but the minified code makes it hard to say.

Do you plan on monetizing this somehow? If not, open sourcing some, if not all, would be pretty cool, even if it weren't necessarily licensed in a way that others could 'take' it, if that's your concern. Nonetheless, a very cool project.


it runs slow for me too but also doesn't peak the CPU core

FPS dips usually line up with big ecological events (population blooms, mass reproduction, lots of giant organisms, pathogen waves). The sim and rendering are decoupled, so you get (hopefully) brief spikes when a lot happens at once, then it settles again as populations crash/thin out. It’s normal behavior, not a runaway bug.

I’ve spent a lot of time optimizing hot paths and getting calculations down, but when the ecology goes a bit wild, you’ll still see temporary spikes. If you want to focus on stats only, you can switch to Simmer mode (no graphs) or turn off the arena, which reduces rendering work quite a bit.


I guess some O(n^2) algorithm.

Yes, some parts are inherently O(n²) (mate finding, crowd density, predator/prey proximity, pathogen spread). Ecology needs pairwise relationships.

To keep it sane, I don’t do naive all-vs-all. I use:

Zone-based spatial indexing so most checks only run against local neighbors (roughly n/16 instead of n). Temporal caching of indices so they’re not rebuilt every tick. Statistical sampling for crowd density at high population (estimate from a fixed-size sample instead of full scans).

So in practice it’s closer to O(n² / k), with k ≈ 16–50 depending on zone layout and population. You still see spikes during blooms, but it’s usually 10–30× faster than naive pairwise checks.


> Yes, some parts are inherently O(n²) (mate finding, crowd density, predator/prey proximity, pathogen spread). Ecology needs pairwise relationships.

You might be able to do a bit better for some of these, check this out https://en.wikipedia.org/wiki/N-body_simulation

Essentially the idea in some optimizations is to divide the space into cells, and so you can discard relations with elements in far away cells.



I actually got a lot of thoughtful feedback from Reddit after sharing this last week, and I’ve been iterating on it since. Figured it was worth sharing the updated version again.

It’s still very much an experiment. Best way to experience it is just to open it and watch a world unfold for a while.


Could you link the Reddit post? I’ve been interested in this kind of idea and how these systems work but never knew how to begin


This is just SO DAMN COOL! Looking forward to digging into the concepts writeup. Thank you!

Neat simulation, but something seems up with the traits. I have ended up with two lineages with ridiculously high "Predate" scores - one with over 10^22 "percent".

Also, it's currently running at 1 tick per second...


Good catch, you actually found a bug. The predation (and dormancy) weights were being multiplied by scarcity/emotion modifiers, but in some early-return paths the original values were never restored. That meant the weights compounded every tick and could blow up exponentially into these absurd numbers.

That also explains the slowdown: once those values get extreme, a lot of the probability and normalization math gets very expensive.

It’s fixed now by restoring the original weights before every early return. Thanks for flagging it. That was a legit bug.


What does the "real" mean in "real time"?

Fair question. By real time I mean the simulation is continuously running and evolving while you’re watching it, not that it’s synced to real-world biological or physical time.

This is awesome. How do you integrate morphology into the simulation? Does morphology effect movement (via area friction or mass impact on momentum) or metabolism (via area/volume ratio)?

Thanks! Morphology does affect both movement and metabolism, but by design it’s modeled as biological abstraction rather than full physics.

Traits like spikes, tentacles, lobes, adhesion, and size add drag/weight, so complex or armored bodies are slower and less agile. Bigger bodies and complex structures also have higher metabolic upkeep. It’s not true fluid dynamics or area/volume math, but it’s tuned to produce the same evolutionary tradeoffs.

So you get: big and complex = strong but slow and hungry. Small and simple = fast and cheap but fragile.


I'm not sure if it's a local issue or intended, but the dots change color when crossing different niches(?), like their color is filtered through the background pane. I would imagine the color of the dots represent specific species and shouldn't change color across environments.

Lineage colors themselves should be stable. What you’re probably seeing is the transparent colored zone backgrounds, which visually tint organisms as they move through different niches. That’s intentional, to give quick visual feedback about which environment they’re in.

Lineages can change color if they diverge enough to be treated as a new distinct lineage, but that’s a separate case.


Spent a few minutes just watching worlds unfold. There's something meditative about it.

Curious about the performance issues Meegul mentioned. These simulations can be surprisingly compute-intensive once you add physics interactions between many entities. Would love to see the code if you ever open-source it.

Nice work.


Thanks, glad you enjoyed it. Performance-wise, big blooms and ecological events can be surprisingly expensive even with optimizations, so you’ll see occasional spikes that usually settle again.

Not sure yet on open-sourcing. Appreciate the interest!


@maybe-tomorrow out of curiosity, is my guess that this is made with help from codex correct? (I'm trying to keep up my sense for the different default aesthetics of the different models, but this one I'm not sure about)

love the UI. i made something along a similar concept recently: https://blinkys.entropicsystems.net/

That’s really cool, nice work! I just tried it and was petting for a bit. What does observe do? It asked for camera permission and now I’m curious.

Thanks! "Observe" (if used from the toolbar at the top), just means you're watching Blinkys (the player is observing). They might follow your cursor around and just get curious. If you observe too long, it results in neglect, which can reduce their overall health. Generally, it's better to be interacting with them. It's just a default player state when you're not Feeding, Petting, Teaching or Punishing.

When you enable the "Enable Observation", they observe your motion (through your webcam) and will react accordingly. There's a little more detail about the Webcam Observation in the manual :)

---

Webcam Observation

Enabling webcam allows the Blinkys to "see" you through motion detection. They respond to your real-world movement:

Motion is detected by comparing video frames every 100ms

Significant motion (> 30%) triggers awareness in random Blinkys

If collective trust is low (< 0.4), your movement increases their fear

If trust is high, your presence may comfort them

The "THEY ARE WATCHING YOU" indicator appears when Blinkys are aware of your cursor.

The "CAMERA ACCESS GRANTED" warning appears when webcam is active

Privacy Note: Webcam data is processed entirely locally in your browser. No video is transmitted, stored, or sent anywhere. The Blinkys only receive a single motion intensity value (0-1), not actual images. You can disable the camera at any time.


That’s wild, thanks for the detailed explanation. Super cool mechanic

Maybe off topic but this site feels very vibe coded to me. Doesn't mean it's necessarily slop, it seems interesting. But I guess it's just too much effort on the UI and other things like that which someone with a limited budget wouldn't spend time on (but an AI can) vs the core thing. Just an observation (and apologies if I'm wrong).

Yeah, I definitely vibe coded parts of it, especially some of the graphs, but a lot of time went into the actual mechanics and how the systems interact. I also got a lot of pushback from my girlfriend (PhD in virology, teaches evolution), so she kept asking hard questions and forcing me to rethink things. And my kids do a check their worlds every morning, collect organisms and use the narrate feature to see what happened overnight, and their honest feedback helped a lot :D

Its not working for me, there is an SSL error. `SSL_ERROR_RX_RECORD_TOO_LONG`

Thanks for flagging. That error usually isn’t caused by the site itself, but by something intercepting HTTPS on the network side I think. Maybe something with VPN, netork or antivirus?

Looks very cool, so congrats, but I'm not that interested without a description of the genomes, etc.

Thanks! I get that and short version: it’s not a realistic genetic model, it’s a trait-inheritance system with evolutionary flavor.

Each organism just has a set of numeric traits (size, armor, spikes, tentacles, aggression, reproduction rate, etc). There are no genes, codons, chromosomes, or genetic sequences. When organisms reproduce, offspring traits are basically noisy, heritable copies of the parents, with per-trait heritability and mutation.

Structural traits (like size) are strongly inherited, behavioral traits are more plastic. Big size, armor, high reproduction, etc all come with metabolic and mobility tradeoffs and mutation rates can go up under stress.

So it’s a phenotype-level evolutionary model, not a molecular genetics simulator. The goal is to get interesting evolutionary dynamics and tradeoffs, not to simulate real DNA or genetic architectures.

You can zoom into (and capture a snapshot of) each organism by clicking it and see a lot of details on traits.


It's cool. Curious what libraries you're building on, from a web front-end perspective, to make the UI and charts etc?

Mostly pretty standard React stuff: React + Vite + TypeScript, Tailwind for styling, and shadcn/ui (on top of Radix) for most UI components. Charts are done with Recharts.

The actual simulation and arena rendering is all custom using the Canvas 2D API, no rendering libraries there.


The website does not make it clear what is it about, is this a Conway's game of life implementation?

Creator here. It is not Conway’s Game of Life.

Soup of Life is an artificial life simulation with moving agents that have genomes, energy, and heritable traits like size, morphology, and behavior. Organisms are born, feed, reproduce with mutation, and die in a continuous 2D world with different ecological zones that bias evolution in different directions.

Unlike Conway’s Game of Life, which is a deterministic cellular automaton on a fixed grid, this is an evolving ecosystem. You see predator–prey dynamics, trait trade-offs, niche specialization, boom–bust cycles, and extinction events. There is no explicit notion of species. Lineages and niches emerge naturally from reproduction and environmental pressure.

For most people it works best if you go in unprepared and just watch what happens.


As someone who, indeed, went in unprepared to just to see what happens, I was also left wanting in knowing what exactly I was looking at. It all just looked arbitrarily random to me.

As I've heard it said regarding art, part of the appreciation comes from knowing _how_ it was made (and why), not merely from what was made. We don't appreciate Warhol's soup cans because they're soup cans -- it's everything else about them that makes it art.

So, my recommendation is, make the narrator a default panel on the opening screen. Give folks a narrative description of the events occurring up front, and then invite them to explore the work from there.


Hello bot.

Downvote me, but gp is obviously an AI bot attempting to train on human responders.

No human could possible conflate this game with Conway’s game of life — especially when they explicitly name Conway’s game of life. It is conceptually impossible to make this error.


Really like what you are going for.

I'd like more hover help to explain features, so i can read them while it runs. Next to 'Cognition' there is some help. I'd like that on all parameters.

And, would like to see results from multiple long term runs. Does it settle out in particular configurations over time?

And, need little more short description of what is going on, since it seems to cycle around different stability points and not really one life form take off.


Thanks, really appreciate that feedback.

Totally agree on hover help. Only a few parameters have it now, but adding tooltips across the board is on my list so it’s easier to explore while it runs.

You can also use the narrate function to make a bit more sense of it.

On long-term behavior: I’ve run hundreds of long sims, many over a million ticks, and there isn’t one stable end state, sometimes I end up with one lineage of giants but even they got taken over or go extinct. I usually see eras in size, traits, and cognition, with different dominant lineages over time. Sometimes big organisms appear quickly, sometimes it takes hours, and some worlds crash early.

I also agree a short narrative layer would help explain what’s going on. Some of the underlying assumptions are described here if you’re curious: https://soupof.life/concepts


Hey, I remember this Black Mirror episode!

If mine ever start chirping, I will pull the plug.

Amazing! Thank you for sharing.

Thanks, glad you liked it!

I notice it mentions microbrains, in case people are interested, a similar fruitflies evolving brains is this one: (Desktop only).

https://claude.ai/public/artifacts/8f39482c-b2c7-4bd6-8d47-4...

click the maze and you can watch flies genetically evolve brains to beat the level. Genetic algorithms beat every version of backprop and transformer architecture that I tried. Pause it and click one of the flies for a stunning visualization of its whole brain.


I love it and really impressive, thanks for sharing! Soup of Life organisms have a bit more simple brain visualisation :D soupof.life/card/1wt8olc1

If you are interested you can read more on how I implemented brains here: https://soupof.life/concepts/life-organisms/cognition


A couple sprites might help better understand what is going on, and feel better emotional connection to these lives.

Yeah, that’s probably because the panel with organisms didn’t load. A refresh usually fixes it. If you’re still not seeing it, let me know which device/browser you’re on, that helps a lot for debugging.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: