Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ observed in a live game yet; the notice's text and timing have offline checks, t
- A switch-off after an error is now said in the game, not only in Player.log. The mod is built so that an error
throws on every player at the same tick, since the code reads only the simulation, but it cannot promise that. An
error only one computer hits leaves that computer on the base game's behavior while the other players run the mod,
and a co-op game drifts apart from there. When the circuit breaker trips, or the BeaverBuddies MultiColony shift end
and a co-op game drifts apart from there. When the circuit breaker trips, or the Timber Together shift end
falls back to the game's, that computer now:
- shows a dialog that names what switched off and what beavers there do now, and asks co-op players to have the
host save and host that save again, with every player joining it, before playing on. The load turns the mod back
Expand All @@ -30,9 +30,9 @@ change has offline checks that fail on 0.2.2 and pass here (TESTING.md).
happened. A player who hit one and then loaded, joined or rehosted a co-op game ran the base game while the other
players ran the mod. The switch-off now lasts for the rest of that game, and the next load turns the mod back on and
says so in the log. The warning now reads "Switched off for the rest of this game".
- Fixed: when asking BeaverBuddies MultiColony for a colony's shift end threw, the game's single shift end was used
- Fixed: when asking Timber Together for a colony's shift end threw, the game's single shift end was used
for the rest of the process instead of the rest of that game. The fallback now ends at the next load, which asks
MultiColony again and says so in the log.
Timber Together again and says so in the log.
- Fixed: pre-fuel and the builder job check declined when the best-scoring food was a little past
`PreFuelNearFoodHours` while a nearer storage existed. They now choose among the storages within that limit, and a
builder who lets a site go tops off at one of them.
Expand All @@ -53,10 +53,10 @@ change has offline checks that fail on 0.2.2 and pass here (TESTING.md).

## 0.2.2 (beta, preview), 2026-09-22

- BeaverBuddies MultiColony: a colony with its own working hours now gets the right "hours left in the shift".
MultiColony patches the per-beaver working-hours test but not the game's `WorkingHoursManager.EndHours`, which
- Timber Together: a colony with its own working hours now gets the right "hours left in the shift".
Timber Together patches the per-beaver working-hours test but not the game's `WorkingHoursManager.EndHours`, which
the pre-fuel rule reads, so beavers of a colony with a 20-hour day were planned against the game's 16. The mod
now asks MultiColony's `ColonyWorkingHours` for the beaver's own colony through reflection when it is present,
now asks Timber Together's `ColonyWorkingHours` for the beaver's own colony through reflection when it is present,
and uses the game's value otherwise. A log line says which. Not yet observed in a game where a colony has set
its own hours; found by an audit, not by a beaver.

Expand Down
16 changes: 8 additions & 8 deletions DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,17 @@ The fallback goes through `ConstructionSiteAccessible`, which names the site's o
### Guardrails

- **Determinism.** Inputs are the settings, need points, spec values, positions, the working-hours manager (or
MultiColony's per-colony hours), the day-night cycle, the game's path queries and the cheapest path cost per tile
Timber Together's per-colony hours), the day-night cycle, the game's path queries and the cheapest path cost per tile
of the loaded building templates (see Performance). Each beaver's timers and failed-storage list are fields of its
own component, created empty at every load. Lists are iterated in insertion order and sorts have total
tie-breaks. No clock, no randomness, no frame timing. Static state that changes during a game is of two kinds.
The daily counters and log-once flags (`Stats`, one warning flag in `HungryPathingRootBehavior`) and the record
the in-game notice reads (`SwitchedOff`) never feed a decision. Two switch-offs do: the circuit breaker (see
failure containment below) and the MultiColony bridge's (see other mods below). Each should trip at the same tick
failure containment below) and the Timber Together bridge's (see other mods below). Each should trip at the same tick
on every player, because the code it guards reads only the simulation. Each is cleared only by `GameLoad.Reset`,
which the configurator runs on every player when a game is loaded, joined or rehosted; nothing clears them
mid-game. A trip that only one player hits is the one way they can differ, and it is said loudly (see failure
containment). The settings and whether the hooks installed are set at startup, and what the MultiColony probe
containment). The settings and whether the hooks installed are set at startup, and what the Timber Together probe
found is set the first time it is asked. All three then stay fixed for the process and are the same on every
player with the same game and mod versions and settings file.
- **Performance.** Cheap checks first: a beaver with hours to spare sets a wake-up time (at most three hours away)
Expand Down Expand Up @@ -198,21 +198,21 @@ The fallback goes through `ConstructionSiteAccessible`, which names the site's o
The planner checks include a 300-day simulation of this.
- **Other mods that change working hours.** `InWorkContext` uses `WorkerWorkingHours.AreWorkingHours`, which is
the per-beaver test other mods patch. The shift end is one global value in the game, `WorkingHoursManager.EndHours`,
and BeaverBuddies MultiColony keeps one per colony without patching that property. `MultiColonyBridge` finds
MultiColony's `ColonyWorkingHours` by name at runtime, resolves the beaver's colony with its `ColonyOf` and asks
and Timber Together keeps one per colony without patching that property. `MultiColonyBridge` finds
Timber Together's `ColonyWorkingHours` by name at runtime, resolves the beaver's colony with its `ColonyOf` and asks
`EndHours(slot)`. A mismatch in that API leaves the bridge off for the whole process, since the loaded mods do not
change while the game runs. An exception switches it off with one warning for the rest of that game and the game's
value is used; the configurator re-arms it at the next load, like the circuit breaker, so a player who hit one in
an earlier game does not keep the game's value while a co-op partner with a fresh process asks MultiColony. The
bridge reads MultiColony's own synchronized state, so peers running both mods stay identical.
an earlier game does not keep the game's value while a co-op partner with a fresh process asks Timber Together. The
bridge reads Timber Together's own synchronized state, so peers running both mods stay identical.
- **Failure containment.** Every entry point the game can reach (the root behavior, the two answers the hooks ask
for, and the hook bodies themselves) catches exceptions. The first one is logged with its stack trace and the
mod disables itself for the rest of the game; the game's own code never sees an exception from this mod. The next
load turns it back on. The breaker keeps its own flag and never writes `Enabled`: the settings are read once per
process and outlive the game, so a trip stored there would carry into every later game on that machine, and a
player who had tripped it once would run the base game while a co-op partner ran the mod. Hooks that fail to
install stay off for the whole process.
- **A switch-off only one player hit.** The breaker and the MultiColony bridge are built to trip on every player
- **A switch-off only one player hit.** The breaker and the Timber Together bridge are built to trip on every player
together, but nothing can promise that an error is one every computer hits: another mod, a damaged install or a
bug that reads something outside the simulation can throw on one computer only. That computer then runs the base
game's behavior while the others run the mod, and the games drift apart until BeaverBuddies notices. A warning in
Expand Down
12 changes: 6 additions & 6 deletions PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ web
Timberborn players with a working colony, usually a large one (hundreds of beavers), who have watched builders and
haulers drop tools at a far site, work at half speed once hunger hits zero, then walk across the map to the district
center for bread while a stocked warehouse sits next door. Many play co-op through BeaverBuddies (the Stability Fork
or MultiColony) and need to know it won't desync their game. Comfortable enough with mods to unzip a folder, but
or Timber Together) and need to know it won't desync their game. Comfortable enough with mods to unzip a folder, but
mostly not programmers. They arrive from the Timbermods org site, a friend or a forum post, want to know in one look
what changes and whether it's safe to add to an existing colony, install it, and later read one log line to confirm
it works. Returning players come back to update, tune the settings file, or report a problem.
Expand Down Expand Up @@ -56,7 +56,7 @@ by need points before looking at distance, so plain berries next to the site los
nearly every time. Hungry Pathing keeps the game's own behaviors and changes only *when* a working beaver goes and
*which* storage it picks, from measured walking times. It is not a pathfinding mod, not a ration-carrying mod and
adds no buildings. It is built for lockstep co-op (decisions read only the simulation, with fixed ordering and
tie-breaks), and with BeaverBuddies MultiColony each colony's own working hours are used. The numbers are measured,
tie-breaks), and with Timber Together each colony's own working hours are used. The numbers are measured,
not promised: a 355-beaver colony went from 15 beavers in a penalty and 117 within three hours of one to 0 and 0 at
the same hour of the shift. No other mod doing the same job is known to the maintainer; don't name or compare
against any.
Expand All @@ -75,7 +75,7 @@ against any.
- **Co-op:** works with BeaverBuddies. Condition: every player installs the same mod version, runs the same game
version and uses an identical `HungryPathing.cfg` (only `DailyReport` and `Diagnostics` may differ). The
`Simulation settings:` line printed at startup is what players compare. BeaverBuddies itself only warns when mod
versions differ. With **BeaverBuddies MultiColony**, each beaver's shift end comes from its own colony's working
versions differ. With **Timber Together**, each beaver's shift end comes from its own colony's working
hours (asked through reflection, no dependency) and the storage index is per district, so colonies never eat from
each other's storages. 0.3.x changes decisions compared with 0.2.1: co-op players update together.
- **Factions:** Folktails tested; Iron Teeth expected to work, untested. Tubeways and ziplines can hide the quickest
Expand Down Expand Up @@ -160,13 +160,13 @@ against any.
`RedirectCriticalTrips`); "working hours", "off duty", "shift"; "storage" for warehouses and tanks generally;
"switched off" for the circuit breaker (the log says `Switched off for the rest of this game`); "the daily summary
line" (`Day N: trips started by rule: ...`); the `Simulation settings:` line; "path queries"; "the settings file"
(`HungryPathing.cfg`), never "Mod Settings" or "options menu". Co-op mod: BeaverBuddies; BeaverBuddies MultiColony.
(`HungryPathing.cfg`), never "Mod Settings" or "options menu". Co-op mod: BeaverBuddies; Timber Together.
- **Honest status of what has been played:** 0.1.0 and 0.2.0 ran 36 in-game days in one single-district Folktails
colony of 330 to 355 adults, nearly all as a BeaverBuddies host with a guest; three days replayed from the same
save gave identical counters and co-op hashes. The before-and-after table comes from that colony's saves on
0.1.0. One error was found there (the builder job check on the first construction day, 0.2.0) and fixed in 0.2.1.
**Not played in a live game:** 0.2.1, 0.2.2, 0.3.0 and **0.3.1, the current release** (offline checks only); the
builder rule's decisions on a construction-heavy day; a MultiColony game where a colony set its own working hours;
builder rule's decisions on a construction-heavy day; a Timber Together game where a colony set its own working hours;
the switch-off dialog; Iron Teeth; anything but Windows. Say this plainly and without alarm ("try it on a copy of
your save first"). Describe the mod as it is now; version history belongs in CHANGELOG.md. Upgrade facts players
need: close the game, extract over the old folder and choose Replace, keep a copy of an edited `HungryPathing.cfg`
Expand Down Expand Up @@ -203,7 +203,7 @@ against any.
illustrative, and are labeled so.
- **Does not exist and must not be faked:** any in-game screenshot or clip (of beavers eating, the colony, the mod
manager entry, or the switch-off dialog, which has never been seen in a game); any before/after image; Iron Teeth
or MultiColony-with-own-hours results; testimonials, player counts, download numbers, Workshop ratings or press.
or Timber Together-with-own-hours results; testimonials, player counts, download numbers, Workshop ratings or press.
Leave marked slots for the maintainer's own shots if a page wants them.

## Product Principles
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ depend on the faction and on any mods that add buildings. The first time a beave
prints one `Cheapest travel here:` line; every player's should match, and if they differ, the players do not have
the same buildings loaded.

### BeaverBuddies MultiColony
### Timber Together

MultiColony gives each colony its own working hours. The mod already goes through the per-beaver working-hours test
MultiColony patches, and its storage index is per district, so beavers never eat from the other colony's storages.
Timber Together gives each colony its own working hours. The mod already goes through the per-beaver working-hours test
Timber Together patches, and its storage index is per district, so beavers never eat from the other colony's storages.
Since 0.2.2 the "hours left in the shift" used by the pre-fuel rule also comes from the beaver's own colony when
MultiColony is present, asked through reflection with no dependency; without it, or if MultiColony's API changes,
Timber Together is present, asked through reflection with no dependency; without it, or if Timber Together's API changes,
the game's single value is used and the log says so.

## Performance
Expand Down Expand Up @@ -153,7 +153,7 @@ Player.log (`%USERPROFILE%\AppData\LocalLow\Mechanistry\Timberborn\Player.log`)
[HungryPathing] Hooks installed (5/5).
[HungryPathing] Active. ...
[HungryPathing] Needs in this game: Hunger: buffer 3h, decays 0.8/day so a full bar lasts 30h; Thirst: ...
[HungryPathing] MultiColony: ...
[HungryPathing] Timber Together: ...
[HungryPathing] Day 319: trips started by rule: just-in-time 41, pre-fuel 87, builder job 3 (of 60 job checks), critical redirected 9. 2160 evaluations, 4 failed launches, 3104 path queries.
```

Expand Down
10 changes: 5 additions & 5 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ both orders and within the near limit that pre-fuel, the builder check and the b
which storage each rule goes to and why, the straight-line bound on a walk and the cheapest path cost per tile it is
scaled by, the sleep and wake-up delays, and that eating earlier does not eat more over 30 and 300 days.
They also compile `Safety.cs`, `MultiColonyBridge.cs`, `Stats.cs` and `GameLoad.cs` as shipped against the
stand-ins in `tests\Stubs.cs`, and check that the circuit breaker and the MultiColony bridge stay off for the rest of
stand-ins in `tests\Stubs.cs`, and check that the circuit breaker and the Timber Together bridge stay off for the rest of
one game only and come back through `GameLoad.Reset`, the reset the configurator runs at every load. `SwitchedOff.cs`
is compiled the same way, to check what the in-game notice says when either switches off and when: the dialog once
per switch-off and not on the frames after, its exact text, a `Day N: switched off` log line on every later day and
Expand Down Expand Up @@ -149,12 +149,12 @@ intended: the session continued on the game's own behavior with one warning. 0.2
walk the builder has just started instead. The rule's own decisions, whether a hungry builder actually lets a far
site go and tops off first, are still to be observed on a construction day with 0.2.1.

### MultiColony working hours (0.2.2)
### Timber Together working hours (0.2.2)

An audit found that the pre-fuel rule read the game's single shift end while MultiColony keeps one per colony.
0.2.2 asks MultiColony for the beaver's colony. The sessions above all ran MultiColony, but no colony had set its
An audit found that the pre-fuel rule read the game's single shift end while Timber Together keeps one per colony.
0.2.2 asks Timber Together for the beaver's colony. The sessions above all ran Timber Together, but no colony had set its
own hours, so both code paths give the same answer there; a game where one colony chose a different working day
is still to be observed. The `MultiColony:` log line after `Needs in this game` says whether the bridge is active.
is still to be observed. The `Timber Together:` log line after `Needs in this game` says whether the bridge is active.

### The switch-off notice (0.3.1)

Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ <h2>Good to know</h2>
<div class="section-head"><h2>Compatibility</h2></div>
<dl class="sheet-rows">
<div><dt>Game version</dt><dd><p>Timberborn <strong>1.1.2.4</strong>. The hooks were written from that version's code and turn themselves off if a later version moves them.</p></dd></div>
<div><dt>Co-op</dt><dd><p>Every decision reads only the simulation, with fixed ordering and tie-breaks. When every player installs the same version of the mod, runs the same game version and uses an <strong>identical settings file</strong>, every player makes identical decisions. The log prints one <code>Simulation settings:</code> line at startup to compare.</p><p>With <strong>BeaverBuddies MultiColony</strong>, each beaver's shift end comes from its own colony's working hours, and the storage index is per district, so colonies never eat from each other's storage.</p></dd></div>
<div><dt>Co-op</dt><dd><p>Every decision reads only the simulation, with fixed ordering and tie-breaks. When every player installs the same version of the mod, runs the same game version and uses an <strong>identical settings file</strong>, every player makes identical decisions. The log prints one <code>Simulation settings:</code> line at startup to compare.</p><p>With <strong>Timber Together</strong>, each beaver's shift end comes from its own colony's working hours, and the storage index is per district, so colonies never eat from each other's storage.</p></dd></div>
<div><dt>Other mods</dt><dd><p>Requires <strong>Harmony</strong> from the Steam Workshop. A mod that also edits the Hunger or Thirst blueprints merges with this one by load order; a mod that replaces the game's need-picking for beavers would overlap.</p></dd></div>
<div><dt>Saves</dt><dd><p>Untouched. You can remove the mod at any time.</p></dd></div>
<div><dt>Language</dt><dd><p>No interface text, except one dialog in English if the mod switches itself off after an error. Log lines are in English.</p></dd></div>
Expand Down Expand Up @@ -210,7 +210,7 @@ <h3>Not yet</h3>
<ul class="checks open">
<li>The newest changes, which refine which storage a beaver picks, in a live colony (offline checks only).</li>
<li>The builder rule's decisions on a construction-heavy day.</li>
<li>A MultiColony game where a colony set its own working hours.</li>
<li>A Timber Together game where a colony set its own working hours.</li>
<li>The switch-off dialog in a real game.</li>
<li>Iron Teeth, and anything but Windows.</li>
</ul>
Expand Down
Loading
Loading