The whole premise of EvoSim is that nothing is told how to behave. Each organism carries a small neural network, the environment applies selection pressure, and whatever survives gets to pass on its weights. The behavior you end up watching — seeking food, avoiding crowding, moving in a straight line instead of spinning in place — is never written down anywhere. It just falls out of the loop.
The temptation to cheat
The hardest part wasn't the simulation, it was resisting myself. Every time something looked broken, the instinct was to add a rule: "nudge them toward food," "penalize standing still." But every rule you add is behavior you designed, not behavior that emerged — and it quietly defeats the point. The discipline is to only ever touch the fitness function and the environment, never the organisms' decisions.
Fitness is the only lever
So all the tuning lives in selection. If organisms aren't doing something useful, the answer is almost always that the fitness signal is too weak, too noisy, or rewards the wrong proxy. Fix the pressure and the population finds its own way there, usually in a way I wouldn't have coded by hand.
Why Rust
Emergence needs scale and generations — lots of organisms, lots of ticks. Running it in Rust compiled to WASM keeps the whole thing real-time in the browser, which matters more than it sounds: being able to watch evolution happen live is what makes the project worth showing at all.
Just a short note for now — a fuller writeup will come when I revisit the project.