By J. Olivo Posted in Rants, Uncategorized on February 10, 2026 0 Comments 6 min read

I’ve spent the last month attempting to develop a simulated ant colony with the help of Antigravity IDE. My goal is to watch a colony mind emerge from the noise of hundreds of individual ants, each hard-coded with simple, stimulus-driven behaviors that would, within the context of hundreds of other similarly coded ants, result in the emergence of a complex, hive intelligence.
You can find the simulation here: https://xenius.org/clickandbuilds/Simulants/index.html
Notes:
1. Upon entering, it will stutter while assets load. Give it a moment.
2. The digging mechanic is still under development! Once completed, I’ll update the code on the site.
3. On start, create a few Foragers by dragging the slider to the right. This will get the food flow going. You’ll also need Attendants if you want the Queen to be fed.
4. The sim is rife with issues… I’m working on them!
5. This app is not optimized for mobile devices, but it will definitely make an attempt to work.
Things that work: Trophollaxis, Necrophoresis, various pheremone channels, nurse behavior (last I checked), attendant behavior, and forager behavior.
SimulAnts is a 3D real-time ant colony simulation that runs in the browser using Three.js and Vite.
Core Concept
Individual ants follow simple behavioral rules (state machines, pheromone sensing, path integration) that produce emergent colony-level organization — foraging, construction, brood
care, and corpse management all arise without top-down coordination.
Key Systems
– Voxel World — A destructible 3D terrain (640x240x640 blocks) that ants can excavate to build tunnels and chambers
– Pheromone Grid — A 4-channel chemical communication layer (home, work, food, death) that decays over time and guides ant behavior
– Ant Colony — Up to 5,000 ants across 8 castes (Queen, Nurses, Attendants, Foragers, Engineers, Workers, Soldiers, Phragmotics), each with distinct roles, colors, and behaviors
– Brood Cycle — Queen lays eggs based on food intake; eggs progress through larvae and pupae stages before becoming adults
– Food System — Clustered food sources that foragers discover, harvest, and share via trophallaxis (mouth-to-mouth feeding)
Ant Behaviors
Ants use state machines, pheromone gradient sensing, climbing physics, energy management, and necrophoresis (corpse burial). An ExcavatorBehavior module implements a behavior tree for complex multi-step tasks.
UI/UX
– Splash screen and logo animation intro
– Orbital 3D camera controls
– dat.GUI panel for tweaking simulation parameters in real time
– Live colony metrics graphs (population by caste, efficiency)
– Click-to-follow individual ants
– Manual dig/fill tools
Tech Stack
Vite + Three.js + dat.GUI + stats.js, with GLB 3D models for each caste and instanced mesh rendering for performance.
1. The Agents: Meet the Colony
The colony simulation is driven by thousands of individual agents, each running a finite state machine and represented by a 3d-ant model. They have their chemoreceptors and an array of simple programs driven by RNG, environmental stimuli, and chemical signal triggers (simulated pheromones). These pheromones have strengths and decay rates, and whether or not an ant responds to stimuli depends on its distance from the pheromones and the angles of its sensory array (antennae), which is configurable by the user in a control panel.
For example, real ants exhibit a behavior called “necrophoresis,” when they sense the presence of oleic acid. Oleic acid is a common monounsaturated fatty acid found in many oils (olive, avocado) and meats, and it functions as both a marker of decay in nature, and ironically, a common preservative in food products.
Caste System
The colony is divided into specialized roles, each with unique behaviors:
2. Pheromones: The Internet of Scents
Communication happens entirely through a Pheromone Grid—a 1024×1024 data texture draped over the world. Ants “paint” this grid with different scents, and others “read” it using three sensors (antennae) positioned Left, Center, and Right of their head. This allows for gradient following (sniffing out the strongest trail).
The Channels:
Pheromones evaporate (decay) over time. If a trail isn’t reinforced by more ants, it vanishes. This ensures old, useless paths are forgotten.
3. The World: Voxel Excavation
The ground is a Voxel World (volumetric pixels). It’s not just a heightmap; it’s a fully 3D block environment.
4. Emergent Behaviors
Complex behaviors emerge from these simple interactions:
Necrophoresis (The Cemetery Effect) Ants hate the smell of death.
Spiral Tunnels Because Engineers use localized noise and structural checks, they rarely dig straight lines. They follow the path of least resistance, curving around obstacles and following existing gradients, resulting in organic, spiraling tunnel networks that look remarkably like real ant casts.
Trophallaxis (Sharing) Hungry ants will stop valid food-carrying ants to ask for a meal. If they touch, they lock into an “Interaction” state, transferring energy values. This distributes food from the surface foragers deep down to the Queen without every ant needing to go outside.