Smart Enemy AI
Makes Factorio 2.0's biters and worms fight with some sense. They path around walls when there's a way through, retreat when they're losing, swarm a breach the moment a turret falls, and grow resistant to whatever damage type you over-rely on. Scheduled raids go after the parts of your base that matter, and finishing research wakes up the nests near you.
Built with UPS in mind — under load it sheds its own features instead of tanking your tick rate. Runs on megabases.
What it does
- Pathing around walls — biter groups route around your defenses when a path exists, and only chew through directly when there's no reasonable way around. No more whole waves grinding on one wall segment while a gap sits open nearby.
- Retreat — squads that are losing fall back toward a nest instead of feeding themselves into your turrets one at a time.
- Breach reinforcement — when a turret goes down mid-fight, nearby biters drop what they're doing and rush the opening. Forward or thin defenses get punished. It reacts to real breaches rather than pre-scouting your weakest wall — predictive weak-point targeting would just let you funnel every raid into a kill-box.
- Adaptive resistance — lean on one damage type and biters slowly build resistance to it (up to 50% on Normal). Mixed damage matters; a mono-turret wall stops being a permanent answer. The resistance fades as the nest population turns over.
- Mega-raids — periodic raids target the meaningful clusters of your base and rotate across them, so a sprawling base gets hit across its real sections instead of the same corner every time. They scale with evolution and ramp up over the first few rather than dropping a full wave on you at once. Can run on every surface, or just the one you're on.
-
Research Pressure — each completed technology stirs up the nests near you. It mobilizes biters that already exist rather than spawning extras, and stays gentle early, biting harder late-game.
-
Emergent — domesticated nest breakouts: a nest you walled in and walked away from can recruit itself into a raid and eat its way back out through your walls. Keep a radar on it if you want it to stay quiet.
-
Extra defence: walls and gates regenerate after a short damage-free pause, and spitter/worm acid is blocked by walls instead of arcing over them.
Compatibility
Modded biters and spitters are auto-detected — no registration needed for mods that follow the standard spawner pattern. Tested with Armored Biters, Pyanodons, Space Age, and Rampant. Running Rampant or another biter-AI mod? Turn on Yield Biter-Group Control to Other AI Mods and they coexist: Smart Enemy AI keeps its raids and defensive features while the other mod drives biter behavior.
Everything is configurable under Mod Settings → Map / Startup — raid intensity and size, difficulty, research pressure, biter expansion, multi-surface raids, and which defensive features are active.
Console commands
If you'd rather see the AI work than wait for it. These use /c, which disables achievements on the save — use a test save if that matters to you.
-- Force the next raid in ~2 seconds (needs Raid Intensity not Off)
/c remote.call("smart-enemy-ai", "force_next_raid_at", game.tick + 120)
-- Tag what the AI considers a target on your map (add {cluster=true} to see the clusters it aims at)
/c remote.call("smart-enemy-ai", "diag_tag_classified_targets")
/c remote.call("smart-enemy-ai", "diag_clear_classification_tags")
-- Fire a breach at your position so nearby biters converge on you
/c remote.call("smart-enemy-ai", "force_breach_ping", game.player.position, game.player.surface.index)
-- Dump full status to factorio-current.log
/c log(serpent.block(remote.call("smart-enemy-ai", "diag_dump")))