AI Enemy Director (WIP)


AI Enemy Director (WIP) gives enemy colonies on Nauvis local AI models for scouting and combat. Ordinary Factorio attacks continue. The Director keeps guards at each nest and spends wave credits on missions. It can wait for recruits, explore a quiet sector or commit several groups to an exposed factory. This Project is WIP!

Content
2 hours ago
2.0 - 2.1
21
Combat Enemies

FAQ

Which download do I need?

Joining someone else's game on Windows or Linux? Install AI Enemy Director in Factorio's Mods menu and sync to the server. Match the host's Factorio patch, mod versions, startup settings and required DLC. The host supplies the AI for every player.

Hosting or playing solo? Use the Windows x64 host package for your Factorio series. It includes the matching game ZIP. Back up your save, close Factorio, extract the whole host ZIP and run Start.cmd. For a manual guest installation, put the smaller game ZIP in your mods folder and leave it zipped.

What happens on first launch?

The launcher checks for Microsoft's .NET 10 Desktop Runtime x64. Install it if prompted, run Start.cmd again, and read the host notice. In the default Dual mode, setup downloads the two models (about 1.55 GB of weights) and the selected llama.cpp runtime. An interrupted setup can reuse verified downloads. The launcher installs the game mod and starts Factorio through Steam. Microsoft .NET 10 downloads · Windows host guide

Load a map with hostile nests on Nauvis. Open AI Enemy Director and look for Decision models ready. Laya and d1 identify the two Dual workers. Laya tactics and Laya operations identify a shared Compact worker. Leave Combat test without models off for model-driven play. Mother Brain can stay off.

What should I expect on Standard or Deathworld?

Factorio's Default (standard) and Death world presets set up the world. The Director's default Medium difficulty controls its tactics. On a standard map, it can send a scout or a paid group to one front at a time. A surviving scout can report a gap, and on Medium a group can cross it to pursue an observed target. Cover the approach to your factories, even if the nearest wall already has a turret.

Deathworld gives the same Director more frequent, larger enemy bases and faster native evolution. Which nests have spare animals, where your pollution reaches, and what your defenses let a scout see still govern the next raid. On one prepared Default outpost neither arm suffered damage in the opening three minutes. On Death world both lost buildings in that window. We followed the quiet start for longer to see which missions ran and when a native attack reached the outpost. These are measurements on specific saves. Matched encounters and follow-up Factorio map presets · Release tests

Do harder bursts mean the Director planned them?

On a community megabase, the strongest 30 seconds of combat dealt 8% more building damage with Dual on 2.0.77 and 24% more on 2.1.25. The event log identifies the attacking groups. More than 97% of the damage across those recordings came from native groups that already existed in the save. The Director scouts were operating elsewhere. On a separate Default outpost in 2.0.77, recruits did land 139 hits on their own assigned targets. Damage per interval, attacking groups and outcomes

How do the difficulty settings affect native enemies?

Easy and Medium allow one active Director front. Hard allows up to two and Nightmare up to three with default limits. The colony starts small, can revisit targets and can lose attackers between departures. To keep the map preset's native pressure, leave Scale native attack pollution cost and expansion cooldown (all surfaces) off and Native biter and spitter hatching interval at Map default.

  • Native attack cost and expansion. An admin can enable scaling in the Director window. Easy uses 125% of the save's original cost and cooldowns, Medium 100%, Hard 80% and Nightmare 60%. These percentages apply to the save's own values, including on Deathworld. Lower costs buy more native attackers for the same pollution, and shorter cooldowns allow earlier expansion. The settings apply across the save. Disabled pollution or expansion stays disabled, and peaceful Nauvis pauses scaling. An external edit takes precedence for that setting. To restore managed values, turn scaling off and save before removing the mod.
  • Native hatching. In Settings → Mod settings → Startup, the host can change the birth interval of base biter and spitter nests wherever those prototypes occur. This setting takes effect after restart. With empty spawn slots at zero evolution, both release tests measured median intervals of 451 ticks on Easy, 361 on Medium or Map default, 289 on Hard and 217 on Nightmare. Population caps and evolution affect actual nest output. Birth and settings tests

What are reserve and siege spitters?

The green reserve spitter is a medium spitter. From 30% evolution, evidence of a ranged shortage or a useful spitter-heavy group can lead a nest to pay for a clutch of four. An early, supplied gun turret can outrange this brood in the base game.

The violet siege spitter is a slower big-spitter variant with longer reach. Its earliest evolution threshold is 80%. The colony needs evidence favoring ranged groups, research, credits, and permission under Allow siege brood. Every hostile player force must be able to field a stationary counter that can damage it from at least two tiles beyond its reach. That check concerns what you can field. Your exposed outpost may still need a turret, ammunition or power. A warning announces the range at least 90 seconds of game time before the first eggs can hatch. On Hard or Nightmare certain combat integrations can unlock another two tiles of siege range, subject to a fresh counterweapon check.

The amber runner biter has 30% more speed and 20% less health than a big biter. The blue armored biter has 45% more health and 20% less speed. A turret whose manual priority list covers only the parent species may pass over the new brood. Select the turret in reach and run /enemy-director-target-families, or bind Include enemy variants in selected turret priorities. It extends the existing priorities and preserves circuit-controlled lists.

Can the colony attack a building from an unfamiliar mod?

Yes. If your warehouse is within sight, belongs to a hostile force, can take damage and has a stable entity ID, the Director can offer it as a raid target. It uses the building's Factorio prototype to recognize infrastructure. A working assembler making ammunition has an observable purpose. Storing ammunition in a warehouse gives it no such priority.

In a native test on 0.10.20 and 0.10.21, an unfamiliar warehouse holding 100 magazines appeared as ordinary infrastructure. Identical warehouses outside sight, protected from damage, neutral or allied were excluded. A controlled model reply selected the raid, and six recruited biters went out. The first recorded sample with a hit showed 14 damage on 2.0.77 and 7 on 2.1.25. How the Director works

How do I tell whether a large wave actually attacked?

Wave credits are spending capacity. Committed animals are recruits assigned to a funded operation. Nests retain guards. Even when the colony can afford three groups of 60, it can scout, wait, or choose a smaller raid. Check paid departures to see what left the nests, then check for hits by those groups to see whether they reached the objective.

In a controlled 2.0.77 megabase test, all 180 animals were alive together for 281 ticks when ordered to muster behind the nests. In the regular comparison on that engine, 180 left in stages and at most 102 were alive together. With mod 0.10.21 on Factorio 2.1.25, 31 nests hatched 172 animals in a separate trial. They retained their guards and had 79 recruits available. Liquid chose one scout over three possible raids of 60. The scout was lost at the powered perimeter. Orders, departures and outcomes

Can I run just one local model?

Yes. In PowerShell, from the extracted Windows host folder, run .\Install-and-Play.ps1 -ModelMode compact. Compact downloads 449 MB of Laya 421M weights plus the runtime. One worker chooses colony operations and group tactics. For separate workers, run .\Install-and-Play.ps1 -ModelMode dual. Dual adds Liquid d1-2B for colony operations. Both editions and modes reuse verified files in the same installation. Guests use the same game ZIP in either mode.

What does it cost in UPS and host resources?

UPS is the number of simulation updates Factorio completes per second. To maintain 60 UPS, a tick has about 16.7 ms. Factorio spends some of that budget on Lua, unit groups, pathfinding and combat. You can compare disposable copies of the same save in vanilla and with the Director, keeping the engine, hardware and other mods fixed. Running the pair with the inference host off measures game update time. A separate run with the workers active measures the conditions you will play under.

On an existing 3k science-per-minute megabase, a Core i7-9700K and RTX 5080 ran Factorio 2.0.77 at 53.1 UPS in vanilla and 49.2 with Dual. On 2.1.25 the same machine recorded 57.8 and 53.5 UPS, respectively. Each result combines two 1,200-tick windows after warmup, with the order reversed in the second pair. Both models were ready. Liquid answered four times across the two 2.0 windows and twice across the two 2.1 windows. Laya had no tactical replies in these quiet intervals. The original defenses stayed in place. Live measurements and individual runs

Model inference runs in a separate process on the Windows host. It uses system memory and either a supported GPU and its memory or CPU time. It can compete with the game for hardware resources. In a separate 2.1.25 live encounter on one CUDA machine, four Liquid replies had a median of 80 ms and Laya's two replies took 35 and 40 ms. Factorio keeps simulating while the models answer and rechecks a choice when it arrives. Reply latency by itself gives no UPS estimate. Benchmark method and live measurements

Does every player need a GPU or an AI account?

Only the Windows host runs inference. The local roles can run on a supported GPU or use the CPU fallback. Neither local role needs an AI service account. A host can separately opt into an endpoint for Mother Brain.

How much control do the models have?

In Dual mode Liquid chooses whether the colony scouts, defends, waits or funds a raid. Laya can direct a group already under fire to continue, change its approach or withdraw. Factorio supplies a list of feasible actions, owns budgets and movement, and validates a choice again before applying it. Late or stale answers expire.

Individual biters still use Factorio's movement and attack simulation. Giving every animal its own neural controller would be a different, untested design. In these releases the game records evidence at each front and gives it to the models on later decisions. Their shipped weights stay fixed. AI assistance was also used in developing, documenting and testing the mod. How the Director works

How do I enable Mother Brain?

Mother Brain is an optional strategic planner. It can prioritize a target, concentrate several groups, request more scouting or hold credits for later. The two local roles can still run if the planner is off or its endpoint becomes unavailable.

  1. On the host, open PowerShell in the extracted folder and run .\Install-and-Play.ps1 -Action Profiles. Supply -HostDirectory if you installed to a custom path.
  2. Save a profile with the endpoint's OpenAI-compatible base URL, model ID and any credentials it requires. Reload an open map so the companion reads the profile.
  3. Select its alias under Mother Brain host profile. Choose off to disable it. To let multiplayer admins switch profiles, enable Allow game admins to select approved Mother Brain profiles before the map first initializes the Director. The server console can use /enemy-director-profile <alias> or /enemy-director-profile off.

Planning starts when observations, credits and recruits allow a decision. To send schematic maps, enable vision in the host profile and Share observed sector sketches with Mother Brain on the map. A support report can show the strategic order, the local decision and the outcome.

What data leaves the computer?

Setup downloads model and runtime files from their upstream publishers. The local workers process game observations on the host. If the host enables Mother Brain, the selected endpoint receives a compact game report and, if separately enabled, a sketch of observed positions. Its operator can receive and retain this material. API credentials stay in Windows Credential Manager. Authorized admins select approved profiles by alias.

Can I add a combat mod to an existing save?

The Director works with base Factorio alone, including on Nauvis in Space Age. Run it as the sole controller of enemy groups. Combining it with another enemy AI mod such as Enhanced Enemy AI, Rampant or Rampant, fixed is untested and unsupported. Two controllers can assign different orders to the same group.

Both editions tested the following optional combat content individually and together. Back up the save and sync the mod list before changing it. The Director reads the active prototypes on load and drops obsolete weapon knowledge when combat rules change.

  • Rampant Arsenal (Fork) is the recommended weapons integration. Scouts can distinguish artillery, support weapons and specialized defenses.
  • Combat mechanics overhaul can obstruct spitter fire at a wall, making an opening worth observing.
  • Bob's Warfare adds threats such as sniper fire and plasma splash. Bob's Vehicle Equipment lets a visible vehicle be associated with observed hits while its equipment grid stays private. Both require Bob's Library.
  • Alien Loot Economy supplies ore drops and kill progression. Director brood inherits loot from its parent units. Requires Quality. Compatibility and release checks

Why does the panel say “Waiting for host”?

On the hosting PC, close Factorio, relaunch it through the extracted Start.cmd and reload the save. As a game admin, open AI Enemy Director → Check host connection. Loading models means the companion has answered and its workers are starting.

If the Director is disabled, check Map rules. The game records AI Enemy Director for new maps and Recruitment on new maps when the mod first initializes that map, including an existing save. To change those rules, set them before creating a map or loading a backup from before the mod was added. Director raids need hostile nests on Nauvis.

Why does Active version show older releases?

Active version lists game ZIPs installed in your Factorio profile. Server sync may install an older version a particular save needs. With the game closed, keep the matching game ZIP in the mods directory and move spare versions outside it. The defaults are %APPDATA%\Factorio\mods on Windows and ~/.factorio/mods on Linux. The host setup moves superseded ZIPs beside the mod folder, normally to mods.enemy-director-archive. Separate profiles can keep different series for different saves.

How do I update an existing host?

Back up the save and close Factorio. Extract the new matching host ZIP to a fresh folder and run Start.cmd. If you chose custom paths, run Install-and-Play.ps1 using the same -HostDirectory and -ModDirectory. Guests update the game ZIP to match. When changing Factorio series, open a copy of the save and keep the original with the previous installation.

How do I report a problem?

While the affected map is open, select AI Enemy Director → Save support report. Find enemy-director-support.json in Factorio's script-output directory. For installation or model problems, run .\Install-and-Play.ps1 -Action Diagnostics from the extracted host folder and supply your custom -HostDirectory if needed. It prints the location of the host report. Include the game and mod versions, difficulty, approximate tick and what you saw. Review attachments before sharing and remove any credentials or account files. Report a problem

How can I tell whether the models are keeping up?

In an admin support report, compare each role's requests, replies, choices taken and actions applied. Laya may legally choose to continue the current order. The in-game round trips use simulation ticks. The Windows host's report lists wall-clock timings alongside expired, dropped and superseded requests. For a breach, corridor_counts reports route checks and crossings. paid_objective_hits tells you whether a member of the funded group actually damaged its target.