Enemy AI Enhancement


Smarter biter AI with adaptive resistance, breach reinforcement, scheduled raids, wall regen, and overhaul-mod compatibility.

Overhaul
5 hours ago
2.0
606
Combat
Owner:
IamfindingNemo
Source:
N/A
Homepage:
N/A
License:
MIT
Created:
7 months ago
Latest Version:
9.4.2 (5 hours ago)
Factorio version:
2.0
Downloaded by:
606 users

Smart Enemy AI

Adds smarter behavior to Factorio 2.0's biters and worms. Biters path around your walls when there's a way around, retreat from fights they're losing, reinforce a successful breach, and grow resistant to damage types you over-rely on. Two defensive bonuses ride along: walls and gates regenerate after a damage-free pause, and spitter/worm acid streams stop arcing over walls.

Designed for megabases — the mod ships with a UPS-budget shedding ladder so it gracefully drops features under load instead of spiking your tick time. Compatible with overhaul mods that change biter prototypes; tested with Armored Biters, Pyanodons, Space Age, and Rampant.


v9.3.0 — STATUS PANEL, RAID INTENSITY CONTROLS, AND CUSTOM TUNING


Features

  • Path-around-walls AI — biter groups path around your walls when an alternate route exists. Paths whose detour ratio exceeds 2× or that require destroying obstacles fall back to direct attack instead of indefinite circling.
  • Squad retreat — squads flee toward the nearest spawner when health drops below 50% of their gathering-time baseline within 5 minutes of gathering. One-shot dissolution: the squad commands its members individually so retreating biters keep moving even after the group breaks up.
  • Target pressure — biters reaching their attack area use the engine's local attack_area target choice, naturally keeping pressure on nearby defenses and production without scripted target chains.
  • Breach reinforcement — enemy squads converge when a turret falls nearby.
  • Adaptive resistance — biters spawn with cumulative resistance to damage types you've recently used. Per-prototype damage ledger with exponential decay (~20.8-minute half-life, τ = 30 min) and a hard 30% cap on Normal (15% on Easy, ~40% on Hard).
  • Mega-raids — periodic raids pick from a deterministic core/front/outpost target queue, select out-of-sight spawners near that target, validate a walkable path, and spawn over multiple ticks. Mixed biter/spitter spawner raids preserve both spawners' result_units curves at current evolution. At dispatch, groups spread into assault lanes and pressure the target.
  • In-game status panel — togglable via shortcut bar, the smart-enemy-ai-toggle-status keybind (Controls → Mods), or the /smart-enemy-ai-status command. Live-refreshes once per second while open, showing Advanced AI state, current Raid Intensity, Difficulty Preset, ticks to next raid, raid status (Calm / Building up / Attacking / Off), scheduler shed level, and scheduler load.
  • First-raid countdown banner — a bold red "First Raid Incoming MM:SS" pinned at the top of every player's screen for the entire countdown to the first scheduled raid (Easy 90 min, Normal 60 min, Hard 30 min on default Raid Intensity). Auto-disappears when raid #1 fires.
  • Per-raid alerts — a red skull chart tag is pinned at the target chunk and a "Raid incoming!" chat warning fires shortly before each raid. Both can be quieted via the Raid Alerts setting (see below).
  • Wall and gate regeneration — walls and gates that have taken no damage for 10 seconds regenerate to full HP over the next 10 seconds. New damage during regen pauses and resets the timer. Also covers walls/gates that arrive damaged via warp, build, revive, or clone events (Warptorio etc.).
  • Projectile blocking — spitter and worm acid streams convert to physical projectiles that collide with walls and gates. Player turret projectiles are unaffected.

Emergent: Domesticated Nest Breakouts

Raid spawner selection picks from any biter nest whose chunk is not currently in your vision. That includes nests you've walled in and walked away from — once the chunk drops out of radar range and your character moves on, the mod treats it as a valid raid origin like any other unscouted nest.

In practice this produces a fun emergent pattern: a walled-in nest will sometimes spawn a raid wave that eats its way out through your walls. Domestication isn't permanent unless you keep eyes on it.

If you want a particular nest left alone, cover it with a radar. Vision = ineligible for raid recruitment.


Settings

All settings live under Mod Settings → Map (runtime, changeable mid-save) or Startup (requires reload).

Map settings:

  • Difficulty Preset (Easy / Normal / Hard) — controls biter-behaviour parameters only: resistance cap, retreat threshold, pathfinding detour tolerance, breach-ping radius, and wall regen speed. Does not affect raid frequency or size — those live under Raid Intensity below.
  • Raid Intensity (Off / Low / Normal / High / Custom) — sole control for scheduled mega-raid cadence and size. Off prevents new raids entirely. Custom unlocks the two sliders below.
  • Custom: Raid Cooldown (0.1× to 5.0×) — only used when Raid Intensity = Custom. Multiplier on the wait between raids AND on the grace period before the first raid. 0.5 = raids twice as often, 2.0 = raids half as often.
  • Custom: Raid Size (0.1× to 5.0×) — only used when Raid Intensity = Custom. Multiplier on max biters per raid at evolution 1.0. 1.0 = 1000 biters at full evolution; 2.0 = 2000; 0.5 = 500.
  • Raid Alerts (All / Map icon only / No alerts) — gates the per-raid heads-up. "All" gives map skull + chat warning (default). "Map icon only" suppresses the chat warning. "No alerts" silences both. The first-raid countdown banner is independent and always shows.
  • Show Status Panel — toggle the in-game status GUI on/off. Default on.

Startup settings (require reload):

  • Enemy Advanced AI (master) — when OFF, all offensive AI features are disabled. Use if you want only defensive features (wall regen, projectile block) and vanilla biter behavior.
  • Wall Block Projectile — converts spitter/worm streams to physical projectiles.
  • Wall Regeneration — auto-regen for walls and gates.
  • Biter Build Adaptive Resistance — enables the variant ledger and spawn-time variant swapping.

Note on upgrading from 9.2.0 or earlier: Difficulty Preset used to also scale raid frequency and size; in 9.3.0 it doesn't. If you played on Easy and liked the slower/smaller raids, set Raid Intensity to Low after upgrading. If you played on Hard, set Raid Intensity to High. (Or pick Custom and dial it in exactly.)


Compatibility

Modded enemies are auto-detected. Prototypes whose subgroup contains "enem", "biter", or "spitter" (or is exactly "enemies") are recognized automatically — the heuristic lives in one shared data-stage module so projectile-block, adaptive-resistance, and the validator agree on what counts as an enemy. Modded raid composition reads the spawner's result_units list at runtime — any mod that follows Factorio's standard biter-spawner pattern works without registration.

Vulnerability-aware variants. Overhaul mods that declare biters as vulnerable to specific damage types (negative resistance percent — e.g. Pyanodons' cold spitter at fire = -100%) are handled correctly. A fire-adapted cold spitter spawns fire-resistant rather than just slightly less-fire-vulnerable.

Tested-working overhauls (per playtester confirmation): Armored Biters, Pyanodons, Space Age + Space-Age-extras, Rampant.

Custom enemy forces. Mods that create non-default enemy forces can register them via: