Husbandry
Big herds without the frame cost. Idle tames think less often, the breeding system stops asking the same question sixty times, and animals in zones nobody has loaded heal and slowly get on with it.
About this mod Author’s original text
Husbandry
Keeping a lot of animals should not cost what it costs.
This does three things, and the first two are free — they change what the game spends, not
what it does.
Idle tames think less often
Valheim runs every AI in the world every physics frame. Fifty tames is fifty full AI ticks
fifty times a second, whether any of them is doing anything or not.
So a tame that is standing around — tamed, not alerted, nothing targeted, following
nobody, and a fair distance from you — thinks one tick in four, or one in ten further out.
Three things this deliberately does not do:
- It never touches anything hostile. The test is the game's own tamed flag.
- It never touches anything busy. Alerted, in a fight, or at your heel means full rate.
- It does not slow animals down. UpdateAI decides; Character moves. A throttled wolf
walks, falls and stands on the ground at the full physics rate — it just changes its mind
less often, and the time it skipped is handed to the next tick, so every timer inside it
still lands where it would have.
Breeding stops asking the same question sixty times
The single most expensive thing a large herd does is count itself. Vanilla's breeding check
walks every AI in the world, comparing object names as strings and doing a GetComponent
per match — up to four times per animal, per round. That is the only cost in a tame that grows
with the square of the herd. Thirty wolves is about three and a half thousand string
compares a round; sixty is fourteen thousand.
Husbandry takes one shared population count for everybody, buckets it by species, and puts a
cap check in front of the expensive part. At the default settings the cap is the game's
own cap, so nothing about breeding changes — a full pen just stops paying to rediscover that
it is full.
Nothing is ever culled. The cap stops births; it never causes a death.
Animals you left somewhere get looked after
Tames in zones nobody has loaded slowly heal, and pairs slowly get on with it.
The breeding here does not spawn anything. It sets the same pregnancy stamp the game
sets, and the game itself gives birth — right level, right tamed flag, its own cap check — on
the first frame somebody loads the zone. So the herd grows while you are away; it just comes
through the front door. A pen left a long time delivers when you arrive.
Worth knowing: unloaded tames already get hungry in vanilla, because the feeding timer is
a world-time stamp rather than a loaded timer. That is not something this mod adds. It only
honours it when deciding whether an unattended pair may breed.
This half runs only where the whole world lives — a dedicated server, a host, or
single-player. A plain client is only sent the animals near it, so it could not do this if it
wanted to. On a server, nobody else needs the mod.
Console
husbandry
What it thinks it is doing: ticks thought and skipped, the census, rounds skipped at the cap,
and what the offline sweep is up to.
Settings
Everything is in BepInEx/config/dafini.husbandry.cfg. The ones worth knowing:
| Setting | Default | What it does |
|---|---|---|
| ThrottleIdle | on | Let idle tames think less often |
| NearRange | 24m | Inside this, nothing is throttled at all |
| FarSkip | 10 | One tick in this many, for idle tames far off |
| CheapCensus | on | One shared population count instead of one per animal |
| SoftCap | 0 | 0 uses the game's own cap. Can only ever tighten it |
| OfflineHealing | on | Unattended tames slowly heal |
| OfflineBreeding | on | Unattended pairs slowly get on with it |
| CourtingInterval | 180s | How slowly. This is the away-from-home breeding rate |
If something behaves oddly, ThrottleIdle = false turns off the only part that changes
timing, and CheapCensus = false returns breeding to vanilla's own counting.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: