Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
AiFree
Monsters never abandon their targets when you move away. Enemy factions keep fighting each other, tamed creatures keep defending your base — even after you portal to the other side of the world.
| Last updated | 15 hours ago |
| Total downloads | 23 |
| Total rating | 0 |
| Categories | Tweaks Misc AI Generated |
| Dependency string | LJS-AiFree-1.0.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.
Preferred version: 5.4.2202README
AiFree
Monsters don't stop just because you left.
In vanilla Valheim, monster AI freezes the moment you move too far away — enemy factions stop fighting each other, tamed wolves stand idle while your base burns, and the world around you silently pauses the instant you step through a portal.
AiFree removes that limitation.
What It Does
AI Timeout Removal
Vanilla Valheim monsters abandon their current target after 30 seconds of not sensing it.
AiFree prevents this: as long as the target is alive, the monster never gives up.
- Two enemy factions mid-battle? They keep fighting.
- A troll chasing a deer into the woods? It follows through.
- Your tamed wolf cornered by greylings? It keeps defending.
When the target dies, the AI clears normally — no zombie behavior, no infinite aggro loops.
Zone Loading (Portal Coverage)
When you portal to another area, Valheim unloads the old zone — stopping all AI completely.
AiFree pins the zone of any actively-fighting monster in memory, keeping it simulated even when you're on the other side of the world.
- Portal away mid-raid: the raid plays out for real.
- Leave your tamed creatures at home: they'll actually fight back.
- Come back to find the aftermath, not a freeze-frame.
Configuration
Located in BepInEx/config/captain.aifree.cfg
| Key | Default | Description |
|---|---|---|
SenseTimeout |
0 |
Seconds before a monster gives up on a living target. 0 = never. Original game value: 30 |
KeepZonesLoaded |
true |
Keep combat zones loaded when the player is far away. Covers portal travel in singleplayer. |
Compatibility
- BepInEx 5.4.x required
- No known conflicts with other AI mods
- Works in singleplayer and dedicated servers
- Safe to add/remove mid-save
How It Works (Technical)
MonsterAI patch — UpdateTarget() Prefix
Resets m_timeSinceSensedTargetCreature to 0 before the 30-second check fires, as long as the target character is alive. Uses AccessTools.Field for private field access.
ZNetScene patch — RemoveObjects() Prefix
Before the engine destroys out-of-range GameObjects, adds any actively-fighting monster's ZDO (and its target's ZDO) to the currentNearObjects list. This earmarks them as "near" — preventing destruction and keeping the AI update loop running.
Source
Author: Captain
GitHub: https://github.com/KorCaptain