Optimal, not first-come-first-served
The whole colony is solved at once with the Hungarian algorithm, so the total commute is the smallest the rules allow. It isn't whatever a greedy pass happens to leave over.
Optimized Local Housing re-houses your adult beavers once a day so the whole colony's walk between home and workplace is as short as it can possibly be, without touching your breeding.
Stable release. It has run 16 passes in a row in a live game, including a hosted co-op session, with no errors. See exactly what is and isn't tested.
By the look of the game's code, the built-in home assigner hands out beds in rotation and never asks where a beaver works. Over time a colony ends up with beavers walking across the whole map every day, past homes that are empty-handed and right beside their job.
Not everyone can live next door to work, because beds are limited. So the real question is which arrangement of beavers into beds makes the total walking smallest. That is a classic assignment problem, and this mod solves it exactly, once a day, instead of nudging beavers around a swap at a time.
The whole colony is solved at once with the Hungarian algorithm, so the total commute is the smallest the rules allow. It isn't whatever a greedy pass happens to leave over.
Homes are priced with the game's own route cost, so stairs, platforms and ziplines count. The 32 closest homes to each workplace get a real route query.
Every home keeps exactly the same number of adults, and children never move. Beds set aside for babies stay exactly where they are.
A beaver only moves if it saves at least one route-cost unit. Once a colony is optimized, another pass changes nothing.
The work is spread across ticks with fixed budgets: at most 32 route queries per tick. A pass on a 266-beaver colony takes about 147 ticks.
Whole-number maths, sorted IDs and a fully saved pass state are meant to give every player the same result, even across a save, a reload or a mid-pass join. It has run through a live co-op session without a desync. Details
A pass runs as soon as the game is ticking the first time the mod sees a save, then at the start of every day. The steps are spread over many ticks, so there is no long freeze.
Every housed adult beaver, its home and its assigned workplace, in one quick snapshot.
Real route costs from each workplace's 32 nearest homes. Anything farther is only estimated, and is re-checked before it is ever used.
The best possible way to reassign the adults to the beds that adults occupy today.
Every proposed move is priced again with fresh routes. Moves that would strand a beaver, or that don't save enough, are thrown away.
Whole cycles of moves are applied in a single tick, and rolled back if the game refuses any of them.
We replayed a real 266-beaver save (222 employed adults, 89 homes) through the actual pass engine.
Route-cost units per employed adult, lower is better
| Case | Average commute |
|---|---|
| Before | 53.1 |
| After one pass | 24.1 |
| True optimum | 24.0 |
Distance in this replay is a straight-line stand-in for route cost, so real numbers in your game will differ, and real path queries cost more than the stand-in. The first pass on a badly housed colony moves most adults at once; later passes move only a few.
In the live game: the game logs of a real colony (about 350 adults, 104 homes, 167 workplaces) show 16 consecutive passes, each taking about 183 ticks and about 5,350 route queries, and applying between 0 and 4 move cycles. No errors, warnings or rollbacks were logged.
Stable means the evidence below, not that every situation has been tried. Here is the honest picture.
Verified
Not yet verified