You don't give orders. You design signals.
A strategic ant colony management game where you control a collective mind through pheromone signals. Build tunnels, manage castes, defend against predators, and evolve your colony β all through emergent AI driven by chemical communication.
- Pheromone Signal System β Paint chemical trails to guide your colony. No direct orders β design the signals, and the ants respond.
- 7 Ant Castes β Queen, Worker, Scout, Soldier, Nurse, Builder, and Cultivator β each with unique AI, stats, and behaviors.
- Colony Mind Abilities β Charge consciousness and unleash powerful abilities like Work Surge, Total Alarm, and Chemical Fury.
- 10 Chamber Types β Build Queen Chambers, Barracks, Fungus Gardens, Pheromone Labs, and more, each with unique effects.
- 8 Enemy Types β Defend against Spiders, Wasps, Centipedes, Antlions, Rival Ants, and more with distinct AI behaviors.
- Dynamic Events β Rain, droughts, earthquakes, pesticide sprays, and flash floods challenge your colony.
- Day/Night Cycle & Fog of War β Stars, moon, sun, and dynamic lighting affect surface visibility and ant behavior.
- Evolution System β Choose from 5 branches: Military, Agricultural, Explorer, Subterranean, and Chemical.
- Procedural Maps β Every game generates a unique underground world with clay, sand, stone veins, roots, and water.
- Sound Effects β Web Audio API synthesized sounds for digging, combat, hatching, events, and ambient atmosphere.
- Performance Optimized β Mutation-based simulation, viewport culling, noise caching, and throttled updates.
- A* Pathfinding β Intelligent pathfinding with tunnel quality modifiers and 8-directional movement.
| Input | Action |
|---|---|
| Left Click / Drag | Use selected tool (excavate, build, mark pheromone) |
| Right Click / Drag | Pan camera |
| Scroll Wheel | Zoom in/out (toward cursor) |
| WASD / Arrow Keys | Pan camera smoothly |
| Space | Pause / Resume |
| 1 / 2 / 3 | Set game speed |
| P | Toggle pheromone overlay |
| M | Toggle minimap |
| F | Toggle follow mode (queen / selected ant) |
| Esc | Open settings panel |
- Start with a Queen, 6 Workers, and 1 Scout in an underground chamber
- Excavate tunnels to expand your nest and reach the surface
- Mark pheromones to direct ants toward food, excavation, or defense
- Build chambers for specialized functions (brood, storage, barracks, etc.)
- Defend against predators and survive environmental events
- Evolve through 4 game phases: Survival > Expansion > Dominance > Empire
Pheromones are the core mechanic. Instead of selecting and commanding individual ants, you paint pheromone signals on the map. Ants detect and follow these signals based on their caste AI:
| Pheromone | Color | Effect |
|---|---|---|
| Collect | Green | Workers gather nearby resources |
| Excavate | Orange | Workers dig in marked area |
| Defend | Red | Soldiers rush to position |
| Evacuate | Yellow | All ants flee from area |
| Explore | Blue | Scouts investigate area |
| Attack | Purple | Soldiers go on offensive |
| Priority | Red-Orange | Marks high-priority zone |
| Home | Brown | Points toward queen chamber |
| Food | Gold | Marks food trail |
| Danger | Bright Red | Signals danger area |
Pheromones decay over time, diffuse to adjacent cells, and consume pheromone resources. Pheromone Labs boost signal strength by 30%.
| Caste | HP | Speed | Attack | Role |
|---|---|---|---|---|
| Queen | 250 | 0.25 | 8 | Lays eggs, emits home pheromone |
| Worker | 35 | 0.70 | 3 | Gathers, excavates, delivers resources |
| Scout | 22 | 1.40 | 2 | Explores, finds food, fast movement |
| Soldier | 100 | 0.45 | 18 | Fights enemies, patrols |
| Nurse | 28 | 0.55 | 1 | Cares for brood, feeds larvae |
| Builder | 45 | 0.55 | 5 | Builds chambers, carries heavy loads |
| Cultivator | 28 | 0.45 | 2 | Tends fungus gardens |
Each ant has a personality (Diligent, Brave, Curious, Cautious, Aggressive, Social) that modifies their behavior, and individual memory tracking food sources, danger locations, and visited chambers.
The Colony Mind charges over time based on ant loyalty. Spend consciousness to activate powerful abilities:
| Ability | Cost | Effect |
|---|---|---|
| Work Surge | 20 | Workers move 50% faster |
| Total Alarm | 30 | All soldiers rush to defend |
| Perfect Route | 25 | Optimal pathfinding for all ants |
| Last Stand | 40 | Workers block tunnels to protect queen |
| Evacuation | 50 | Emergency migration of queen and eggs |
| Chemical Fury | 60 | All ants attack with doubled ferocity |
Passive bonuses at consciousness thresholds:
- 25%: +5% work speed
- 50%: +10% work speed, better pathfinding
- 75%: +15% work speed, +10% soldier attack
- 100%: All bonuses + 20% egg laying rate
| Chamber | Cost | Effect |
|---|---|---|
| Queen Chamber | 5 Earth | Queen lays eggs here |
| Brood Chamber | 3 Earth, 1 Biomass | Eggs develop 20% faster |
| Food Storage | 2 Earth | Food spoilage -50% |
| Fungus Garden | 3 Earth, 3 Biomass | Produces fungus over time |
| Barracks | 4 Earth, 2 Biomass | Soldiers +20% attack nearby |
| Pheromone Lab | 3 Earth, 3 Biomass | Pheromone strength +30% |
| Waste Chamber | 2 Earth | Contamination -60% nearby |
| Humidity Chamber | 3 Earth, 1 Biomass | Stabilizes humidity +40% |
| Nursery | 2 Earth, 2 Biomass | Brood survival +25% |
| Granary | 2 Earth, 1 Biomass | Sugar/nectar storage +50% |
- Day/Night Cycle β 8-phase sky transitions (dawn, noon, dusk, night) with underground light seepage and dawn fog
- Fog of War β Only areas near ants are visible; unexplored regions are hidden
- Temperature β Varies by depth; extreme temps damage brood
- Humidity β Affects fungus growth and chamber conditions
- Contamination β Builds up without waste chambers; damages brood
- Water Levels β Rain and floods can flood tunnels; animated water with reflections
- Tunnel Quality β Affects ant movement speed and fatigue
| Enemy | HP | Attack | Behavior |
|---|---|---|---|
| Wolf Spider | 70 | 14 | Hunts ants, creates web zones |
| Ground Beetle | 120 | 8 | Territorial, patrols set routes |
| Centipede | 90 | 12 | Hunts in tunnels |
| Paper Wasp | 45 | 22 | Fast hit-and-run hunter |
| Rival Ant | 35 | 7 | Raids food stores in groups |
| Termite | 50 | 6 | Territorial, patrols in formation |
| Antlion | 80 | 20 | Ambush with pull-trap pits |
| Parasitic Mite | 10 | 2 | Wanders, weak but numerous |
Rain, Drought, Tunnel Collapse, Cold Snap, Heat Wave, Toxic Fungus, Pesticide Spray, Enemy Raid, Earthquake, and Flash Flood β each with varying severity, warning announcements, and event combos.
The game features a synthesized audio system using the Web Audio API (no audio files needed):
Sound Effects: Dig, Build, Combat Hit, Combat Kill, Ant Hatch, Pheromone Mark, Event Warning, Event Start, Queen Damage, Button Click, Speed Change
Ambient Sounds: Underground Hum (deep drone), Rain (during rain/flood events), Surface Breeze (near surface)
All sounds are synthesized using oscillators, noise generators, and filters for a rich, responsive audio experience. Volume controls are available in the settings panel (Esc key).
- Framework: Next.js 16 with App Router
- Language: TypeScript 5
- Rendering: HTML5 Canvas 2D with custom particle system
- State Management: Zustand
- UI Components: shadcn/ui + Lucide Icons
- Styling: Tailwind CSS 4
- Audio: Web Audio API (synthesized sounds)
- Pathfinding: Custom A* with octile heuristic
- Build: Bun runtime
# Clone the repository
git clone https://github.com/smouj/FerroNest.git
cd FerroNest
# Install dependencies
bun install
# Start development server
bun devOpen http://localhost:3000 to start playing.
bun run build
bun startFerroNest/
βββ .github/
β βββ workflows/
β βββ deploy.yml # GitHub Pages deployment
βββ public/
β βββ logo.svg # Game logo
βββ src/
β βββ app/
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main game page with intro screen
β β βββ globals.css # Global styles
β β βββ api/
β β βββ route.ts # API routes
β βββ components/
β β βββ game/
β β β βββ GameCanvas.tsx # Canvas renderer, camera, & input
β β β βββ HUD.tsx # Heads-up display with selected ant panel
β β β βββ ToolBar.tsx # Bottom toolbar with categorized tools
β β β βββ SettingsPanel.tsx # Settings overlay (Esc)
β β β βββ FPSCounter.tsx # Performance display
β β βββ ui/ # shadcn/ui components
β βββ game/
β β βββ engine.ts # Core simulation engine (mutation-based)
β β βββ renderer.ts # Canvas 2D renderer with noise cache
β β βββ audio.ts # Web Audio API sound system
β β βββ store.ts # Zustand game state store
β β βββ ui-store.ts # Zustand UI settings store
β β βββ types.ts # TypeScript type definitions
β β βββ constants.ts # Game balance & configuration
β βββ hooks/ # Custom React hooks
β βββ lib/ # Utility functions
βββ next.config.ts # Next.js configuration
βββ tailwind.config.ts # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ package.json # Dependencies & scripts
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- New enemy types with unique AI
- New chamber types and effects
- New pheromone types
- Biome system (desert, rainforest, tundra)
- Statistics dashboard
- Save/Load game state
- Achievement system
This project is licensed under the MIT License β see the LICENSE file for details.
FerroNest β Where signals become strategy.