Skip to content
marthofdoomPublic

About

Programmable follower behaviour for Skyrim SE. Per-follower Gambit rules authored live in game (Condition to Action, first match wins) driving combat, logistics, an autonomous economy, and class-based stat growth. FFXII's gambit system rebuilt on the engine's own actor primitives, with a self-declaring add-on API.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

marth's Follower Overhaul (MFO)

Programmable follower behaviour for Skyrim SE. Every follower carries ordered lists of Gambits — [Condition] -> [Action] rules, first match wins — authored live, in game, per follower. Final Fantasy XII's gambit system rebuilt on the engine's own actor primitives.

Status: v2.6.2 (see VERSION and the GitHub releases; the exact point release is in VERSION). As of 2.0.0 MFO runs on Harbinger (APMF), a required control-layer framework of mine that lets several mods drive the same follower without clobbering each other. MFO routes a follower's casting, combat target, packages, and gear through it, so a follower another mod keeps parked still loots, casts, and retreats cleanly. Without Harbinger MFO falls back to its older paths and reminds you it is missing. Gambits execute in both tables and the mod is playable end to end. Follower detection, Rapport, the in-game board, and combat and logistics actuation are built and field-tested. Followers cast (their own AI, animated, at chosen targets), attack, drink, restock, loot, and walk to loot, up to four followers sweeping a battlefield at once, and fall back to your side on their own when badly outmatched (auto-retreat is off by default while it is reworked). They run their own economy, selling their junk and buying, wearing, and managing their own gear out of their own gold. A follower's class shapes its Health, Magicka and Stamina growth on level up (a mage gains Magicka, an archer gains Stamina), fixed-stat unique followers included. The progression system is a self-contained add-on over a general follower API, so MFO is also the worked example for building your own follower add-on. Build order and what's deferred are in ROADMAP.md; the per-version history is in CHANGELOG.md.


Two tables, not one

A follower carries two independent rule lists with separate slots. They never interleave: combat runs in combat, logistics runs out of it.

The combat table

1.  Ally: HP below 40%      ->  Cast Fast Healing
2.  Foe: Weak to fire       ->  Cast Flames
3.  Self: Magicka below 20% ->  Drink magicka potion
4.  Foe: Lowest HP          ->  Attack

Top-down, first match wins, one action per tick. A follower cannot heal and attack in the same cycle — the cost of a heal is the attack not made.

The logistics table

Upkeep, so a follower who runs dry of arrows or is still wearing their recruitment armour isn't something you have to micromanage.

1.  Health potions < 3      ->  Loot health potions
2.  Out of arrows           ->  Loot arrows
3.  Always                  ->  Loot better equipment
4.  Always                  ->  Loot gold

The vocabulary: drink and loot health/stamina/magicka potions (or any potion — low-power restore potions below your load order's own weakest useful tier are ignored, strongest looted first), loot arrows and bolts (separate gambits), loot gold, and loot better equipment. Equipment generalises by category and metric, never by item — a weapon upgrade is judged within the follower's dominant weapon-skill class (a two-hander takes the greatsword over a dagger, an archer won't swap to a mace), armour by rating on the slot within the class they can use — a light-armour follower won't pick up plate they have no skill in. Modded gear works with no patch, and a caster won't hoover up a random sword.

Magic users dress like mages. A follower with cast gambits loots school-appropriate apparel: enchanted robes, hoods, gloves and boots that boost his most-cast school (weighted across his cast gambits' spells, read from the enchantment itself at loot time) beat raw armour rating on those slots — a destruction mage upgrades into Destruction robes; among matches the finer piece wins. He also stocks one melee backup (daggers by default, any one-hander via MCM) so the vanilla AI has something to draw when his magicka runs dry. Both behaviours are MCM toggles under Logistics, on by default.

Followers loot like people, not vacuums:

  • They walk to it. A follower paths to the loot and picks it up — they don't teleport-grab from across the room. How far they'll range is the confidence leash below.
  • They can pick locks they're skilled enough for — a Novice lock at any Lockpicking skill, an Expert lock only near mastery; Master and key-locked are out of reach.
  • First dibs are yours. Arrows and potions a follower restocks at once, but it leaves gear and gold on a fresh corpse for a few seconds first — your pick. It never takes owned goods, and holds off entirely while you're sneaking so they don't blow your stealth. Once you've taken from a source the wait collapses; you've had your look.
  • Not in your house. Followers never loot inside a player home (any cell the game flags as one) unless you opt in.

Followers trade at merchants. Stand a follower next to a vendor and they sell their unworn junk — highest value first, capped by the vendor's own gold — and buy the supplies they've run short on, chosen from what that vendor actually stocks: the best they can afford, up to the number they need, from their own purse. Off by default; enable Follower economy in the MCM. The merchant reads and the transaction run through Papyrus (the path the barter menu itself uses), so it is crash-safe where a raw engine read is not, and it is hardened against a mid-trade save.


How it behaves

Gambits layer on top of vanilla AI; they never replace it. A follower with no matching rule behaves byte-identically to one without MFO installed — no no-op package, no neutral command, no engine call at all.

Confidence, on an invisible string. How far a follower operates from you isn't a fixed follow distance — it's a live readout of how confident they are to survive on their own right now. Healthy in an easy zone, they push ahead and range out to loot; hurt, or in a hard fight, they pull back and fight at your side. You never see a number. You just feel a companion get bold clearing a bandit camp and wary in a dragon's lair. Taken to its conclusion, a follower who has stayed badly outmatched and far from you auto-retreats to your side (off by default since 2.2.2 while retreat is reworked: turn on Auto-retreat in the MCM. It needs about a second and a half of sustained low confidence, a single hard hit does not trigger it, magicka is ignored and it never fires while you are out of combat). It tunes on the Behaviour Layer config page, and it's the model for how MFO adds realism: hidden variables you read through behaviour, not sliders.

Reactions are human, not robotic. A gambit decision is a choice reaction, which in people runs 300–600 ms, so responses are drawn from a right-skewed distribution rather than firing on a metronome. Followers occasionally miss a beat. A companion that reacts at reflex speed to a tactical situation reads as a machine.

Competence is not permission. Teaching a follower a spell doesn't mean they can cast it — if they lack the magicka or the skill, the rule simply fails and the next one is tried. The board tells you why, so a list that doesn't work is legible rather than mysterious.

The list is yours. MFO executes it as written: no reordering, no deduplication, no coordination between followers, no penalty for filling every slot. Two followers both healing the same ally is your authoring, and the fix is yours to make.


Progression

Rule slots are earned through Rapport, built by fighting alongside that specific follower. It's never pooled or transferable, and it survives dismissal — leave someone in Breezehome for two hundred hours and they're exactly as you left them. (Gating the vocabulary by rank — not just slot count — is designed but deferred; see the roadmap.)

Rank Combat slots Logistics slots Reactions
I 3 4 visibly hesitant
III 7 6 ↓
V 12 8 anticipates

What a follower can be told to do depends on their own skills and spellbook — a battlemage opens cast actions a pure warrior never will, and the board shows each follower only what they could actually perform.


The board — Field Orders

Rules are authored in game, per follower, on the Field Orders power — because reading a log after the fact is a hopeless way to develop a behaviour mod.

  • A passive HUD that takes no input, so it stays readable while fighting: per-follower rank, rapport, live health/magicka/stamina, distance.
  • The Field Orders board: a Followers roster and the Gambits editor — cycle each rule's condition, action, and value, with a full-width plain- language summary of every rule so a whole gambit is legible even on a Steam Deck. Styled after MEO, in four skins.

Full controller parity throughout — gamepad navigation is a standing requirement across these mods, not an afterthought. Settings live in an MCM (MCM Helper), including the Behaviour Layer page for the confidence leash and walk-to-loot.


What is new in 2.6.2

  • Needs Harbinger 0.13.1 or newer (ABI 24). Install the two together.
  • Taunt gambit. A new Taunt action and a new condition, Foe: Targeting an ally. The follower plays a taunt animation and, once it has really played, nearby foes roll to be pulled onto him.
  • Animated combat casts. More combat casts now go through the follower's own casting, so they play the hand animation. Heals at the follower himself are real casts too. The combat substrate Harbinger uses for this ships on.
  • Held engagements. A fight MFO starts is held by Harbinger until the target is dead or MFO lets go. Engage on sight drops a target that is too far away.
  • Weapon weighting is an off by default experiment (bWeighWeapons).
  • Followers keep their weapon after loading a save made mid-fight, and the focus key no longer points followers at another follower.

What is new in 2.6.1

  • Archers dual-cast their heals, and with too little magicka they heal one-handed with the other hand empty. They never swap to a melee weapon.
  • Heals that really fired are no longer cut short.

What is new in 2.6.0

  • Remove a follower from the roster. The Follower tab has a remove button with a confirm that works on a gamepad. It is refused while the follower is following you or is still a teammate. It takes back the perks, skills and health, magicka and stamina values MFO wrote, restores the native perks MFO stripped, releases every claim and erases MFO's data for that follower, relic record included. Values something else changed since are left alone. Spells learned from tomes, looted or bought items, gem sockets and the stats of followers who level on their own cannot be undone. The log lists them. Not yet tested in game.
  • Gem choice follows perks. Needs MEO 1.0.20 and bMeoAwareGems on. Skill gems follow the perk direction, crafting and social gems sit one tier lower, and every follower gets one Health gem first. Followers never use Conduit gems. Not yet tested in game.
  • Better weapon and perk handling. Out of combat a follower moves to their best owned weapon of the right class, never over a weapon you gave or a silver, gambit, bound or museum weapon. Style-only perks count as marginal.
  • Spell pickers are sorted by school, then effect, with school headers.
  • Attack on sight finds territorial creatures such as skeevers, wolves and bears, and never engages first against cowards, crime factions or the sEngageOnSightSkip list. The log says why each actor was skipped. Not yet tested in game.

What is new in 2.5.0

  • Silver ammo for bows and crossbows. Switch to silver weapon equips the best matching silver arrows or bolts for an archer and puts the old ammo back afterwards. A follower with none restocks 20 from loot or buys a stack. Silver ammo is never sold or dropped. Restocking silver from loot needs bEconomy and bEconomyBuyGear. On LoreRim and Requiem the bonus comes from the Unholy creature's trait perks. With only the vanilla silver perk, silver arrows may add no damage. Not yet tested in game.
  • Perks a follower can use. Perks that only work for the player show as marginal ("part player-only"). The fighting alone perks (Lone Wolf, Solo, Maverick, One Man Legion) are dead, and a follower who has one gets the points back. Perk text on the board is written from the follower's point of view with an "Affects:" line (English only, other languages get the "Affects:" line). Perk point income is unchanged. Not yet tested in game.

What is new in 2.4.0

  • Switch to silver weapon. A new gambit action with a new condition, Foe targeted: Unholy. While the follower's target is Unholy (hurt more by the silver in your load order, or undead, werewolf or vampire as a fallback), the best silver weapon they carry goes in the main hand. The main weapon returns 2 seconds after. A follower keeps a silver weapon and restocks one by loot or buying. Not yet tested in game.
  • Perks with no listed effect count when a perk condition a follower can meet refers to them.
  • Right hand first covers an Auto spell with weapon style control off.
  • Concentration spells on Auto are billed per second channeled.

What is new in 2.3.0

  • MFO is a Harbinger client on the cast and equip seats. The friendly-fire hold, the concentration limit and weapon order are Harbinger requests now (cast guard, ch.25). That removes about sixty seat conflicts per play session on a large list.
  • Heal reach. A heal ignores a nonsense spell range under 300 units (Requiem Magic Redone's Heal Other is 30) and uses the projectile range, so allies far away are healed again.
  • Decision rulings. A blind heal at the approach floor is released after 5 seconds, a left weapon a heal displaced is given back, AUTO refuses a spell only when every effect is undeclared, and an AUTO buff series keeps the spell in hand between casts.
  • Gem rules (needs MEO and the MEO-aware gems setting, bMeoAwareGems). A follower never sells, drops, donates or removes a socketed item through MFO. Gems come out first. Socketed loot that is not an upgrade is taken for its gems and the gear is kept only if it passes the loot-to-sell value and weight rule. Loose gemmed gear is recognised by MEO's exact title and fetched for its gems. MFO.log prints a [gems] line at load and after an MCM change saying whether the rules are active.
  • Engage on sight works without auto-retreat.
  • One mouse cursor. The double cursor and the misclicks it caused are fixed.
  • Loot reachability. Followers skip loot on a navmesh island they cannot reach. An unknown answer means go. The false NOT ENGAGED warning is gone.
  • Offense approach. When every foe of an offensive rule is out of sight the follower walks toward the foe (standoff 1024 units, touch spells close to 128). Inside the standoff and still blind it lets go for 15 seconds of regular movement instead of blocking the foe.

Every INI key is listed in Docs/INI-REFERENCE.md. The zip no longer ships MCM/Settings/MFO.ini, so updating keeps your MCM settings.


Requirements

  • Skyrim 1.6.1170 (Anniversary Edition), 1.5.97 (Special Edition) or 1.7.104 (Steam). VR is not supported. All three versions get the full feature set: walking to loot, Flee to player, Auto-retreat and cast control have worked on 1.5.97 since v2.0.9. At startup MFO checks every game address it uses against a table made by hand for these versions. On any other version its hooks stay off and the log says so. Support for 1.7.104 was checked against the game files by hand, not yet in play, so please report anything odd there. On 1.7.104 there is no Address Library. MFO carries its own table of game addresses for that version inside the DLL, so you install nothing extra.
  • Harbinger (APMF) — the control-layer framework MFO drives followers through. Install it for the full feature set. This version wants Harbinger 0.13.1 or newer (ABI 24): the cast guard, the animated casts, the equip claims, lockpicking and the fight leash all go through it. Install the two together. With an older Harbinger MFO still runs, keeps one small guard hook of its own and says so in the log. Without Harbinger MFO degrades to its older paths and says so in the log. With Harbinger present MFO installs no hooks of its own on the cast and equip seats.
  • SKSE64
  • Address Library for SKSE Plugins (1.6.1170 and 1.5.97 only, not needed on 1.7.104)
  • SkyUI and MCM Helper (version 9 or newer) — the settings menu
  • powerofthree's Papyrus Extender (po3_papyrusextender.dll) — required only for the optional follower economy (selling/buying); everything else runs without it. If it is absent, the economy stays off and MFO logs one line saying so.
  • Synthesis — MFO reads an item catalog (mfo_items.json) that its Synthesis patcher (added from this repo — see installer/README.md) generates from your load order so gambit categories (potions, ammo, gear classes) cover modded items with no per-mod patch. MFO runs without it, falling back to a shipped catalog; run the patcher for full modded-item coverage.

Installation

  1. Install the requirements above with your mod manager (Mod Organizer 2 or Vortex), each per its own instructions.
  2. Install MFO's archive as a normal mod and enable MFO.esp.
  3. Run the MFO Synthesis patcher as part of your Synthesis build (optional but recommended — see above).
  4. Launch through SKSE. Open the MCM (Mod Configuration → marth's Follower Overhaul) to configure; every behaviour ships off or conservative by default.

Load order is not sensitive — MFO drives followers through runtime AI, not record edits, so it does not conflict with follower mods, AI overhauls, or combat mods. Updating mid-playthrough is safe: all state lives in the co-save and reverts cleanly on load. (Saves that ran versions ≤ 1.0.24 are additionally swept clean of a furniture-breaking alias latch on their first load under ≥ 1.0.26 — automatic, one load, nothing to do.)


Docs

Start at CLAUDE.md, then MAP.md. Docs/INDEX.md sets the full read order and marks which documents are current and which are historical.

Historical, kept for the reasoning trail and banner-marked as such: DESIGN.md (the July 2026 spec), ARCHITECTURE.md (superseded by MAP.md), ROADMAP.md, and the three GAMBIT_* design docs.

Building

C++ lives in native/. The DLL is built by GitHub Actions on windows-latest — CommonLibSSE-NG needs the MSVC linker and there is no Linux cross-build, so CI is the only compiler that ever sees this code. git push is the build button.

Releases are cut with ./release.sh: ./release.sh X.Y.Z stamps and pushes, then ./release.sh --run <run-id> packages the DLL from exactly that green native CI run (a bare ./release.sh lists the recent green runs with branch and sha; --dry-run runs the checks only). It refuses a dirty tree, refuses a run that is not green or whose native/ tree differs from HEAD's, and records commit, run id and artifact hashes in a manifest. vcpkg registry baselines are pinned deliberately — bump them on purpose, never float them.

Licence

MFO's own code is MIT — see LICENSE. All of it lives in native/; no third-party source is vendored here. The shipped DLL statically links CommonLibSSE-NG (MIT, © 2018 Ryan-rsm-McKenzie), Dear ImGui, nlohmann/json, spdlog and fmt (all MIT); their notices are in THIRD-PARTY-NOTICES.md. The three board fonts — Cinzel, EB Garamond and the Noto Sans JP fallback — are licensed under the SIL Open Font License 1.1, reproduced in OFL.txt. Both files ship with every release.

About

Programmable follower behaviour for Skyrim SE. Per-follower Gambit rules authored live in game (Condition to Action, first match wins) driving combat, logistics, an autonomous economy, and class-based stat growth. FFXII's gambit system rebuilt on the engine's own actor primitives, with a self-declaring add-on API.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages