diff --git a/CHANGELOG.md b/CHANGELOG.md index 82edc74..51ce904 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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. @@ -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. diff --git a/DESIGN.md b/DESIGN.md index aa8caf0..f8b20db 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -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) @@ -198,13 +198,13 @@ 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 @@ -212,7 +212,7 @@ The fallback goes through `ConstructionSiteAccessible`, which names the site's o 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 diff --git a/PRODUCT.md b/PRODUCT.md index 8a543ee..0bb06a8 100644 --- a/PRODUCT.md +++ b/PRODUCT.md @@ -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. @@ -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. @@ -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 @@ -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` @@ -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 diff --git a/README.md b/README.md index 999f9f4..6feec2b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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. ``` diff --git a/TESTING.md b/TESTING.md index f94c934..bd223f3 100644 --- a/TESTING.md +++ b/TESTING.md @@ -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 @@ -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) diff --git a/docs/index.html b/docs/index.html index 8a91299..1918429 100644 --- a/docs/index.html +++ b/docs/index.html @@ -182,7 +182,7 @@

Good to know

Compatibility

Game version

Timberborn 1.1.2.4. The hooks were written from that version's code and turn themselves off if a later version moves them.

-
Co-op

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 identical settings file, every player makes identical decisions. The log prints one Simulation settings: line at startup to compare.

With BeaverBuddies MultiColony, 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.

+
Co-op

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 identical settings file, every player makes identical decisions. The log prints one Simulation settings: line at startup to compare.

With Timber Together, 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.

Other mods

Requires Harmony 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.

Saves

Untouched. You can remove the mod at any time.

Language

No interface text, except one dialog in English if the mod switches itself off after an error. Log lines are in English.

@@ -210,7 +210,7 @@

Not yet

diff --git a/source/GameLoad.cs b/source/GameLoad.cs index fc7edb8..c3a33e3 100644 --- a/source/GameLoad.cs +++ b/source/GameLoad.cs @@ -3,7 +3,7 @@ namespace HungryPathing // Every piece of static state that must start fresh with each game, reset in one place. The configurator calls // this once per load on every player, whenever a game is loaded, joined or rehosted, before any beaver decides. // Nothing else may call it, and never mid-game. The offline checks call it too, so they run the same reset the - // game does: the circuit breaker and the MultiColony bridge are the two switch-offs that feed decisions, and a + // game does: the circuit breaker and the Timber Together bridge are the two switch-offs that feed decisions, and a // load that left either one as it was would carry a switch-off from one game into the next on that player only. // What the in-game notice reports about them (SwitchedOff) is cleared with them. internal static class GameLoad diff --git a/source/HungryPathingConfigurator.cs b/source/HungryPathingConfigurator.cs index e5b5933..a25d331 100644 --- a/source/HungryPathingConfigurator.cs +++ b/source/HungryPathingConfigurator.cs @@ -19,7 +19,7 @@ public void Configure(IContainerDefinition containerDefinition) containerDefinition.MultiBind().ToProvider(ProvideTemplateModule).AsSingleton(); // One per game, so the path costs are read again from the templates at every load. containerDefinition.Bind().AsSingleton(); - // Says in the game when the mod, or its MultiColony shift end, switched off after an error. + // Says in the game when the mod, or its Timber Together shift end, switched off after an error. containerDefinition.Bind().AsSingleton(); } diff --git a/source/HungryPathingRootBehavior.cs b/source/HungryPathingRootBehavior.cs index 67aef7d..a48a434 100644 --- a/source/HungryPathingRootBehavior.cs +++ b/source/HungryPathingRootBehavior.cs @@ -580,7 +580,7 @@ private bool InWorkContext() } // When this beaver's working day ends, in hours of the day. The game keeps one value for everyone; - // BeaverBuddies MultiColony keeps one per colony and is asked first when it is present. + // Timber Together keeps one per colony and is asked first when it is present. private float ShiftEndHours() { return MultiColonyBridge.TryEndHours(this, out float endHours) ? endHours : _workingHoursManager.EndHours; @@ -647,7 +647,7 @@ private void LogThresholdsOnce(Config settings) $"so a full bar lasts {24f / Mathf.Max(0.0001f, Mathf.Abs(spec.DailyDelta)) * spec.MaximumValue:0.#}h"); } Log.Info("Needs in this game: " + string.Join("; ", parts) + "."); - Log.Info("MultiColony: " + MultiColonyBridge.Description + "."); + Log.Info("Timber Together: " + MultiColonyBridge.Description + "."); } } } diff --git a/source/MultiColonyBridge.cs b/source/MultiColonyBridge.cs index eb350a5..9f9f5eb 100644 --- a/source/MultiColonyBridge.cs +++ b/source/MultiColonyBridge.cs @@ -5,9 +5,9 @@ namespace HungryPathing { - // BeaverBuddies MultiColony gives each colony its own working hours. It patches the per-beaver "are we working" + // Timber Together gives each colony its own working hours. It patches the per-beaver "are we working" // test, which this mod already goes through, but not WorkingHoursManager.EndHours, which this mod reads for - // "hours left in the shift". So when MultiColony is present, the shift end is asked from it, for the beaver's + // "hours left in the shift". So when Timber Together is present, the shift end is asked from it, for the beaver's // own colony, through reflection: no reference, no dependency, and if its API ever changes the mod says so once // and falls back to the game's value. internal static class MultiColonyBridge @@ -28,7 +28,7 @@ internal static class MultiColonyBridge // An exception while asking switches the bridge off for the rest of that game only. Which shift end a beaver // plans against is simulation state: a player who carried the switch-off into the next game (a rehost reloads // in the same process) would use the game's shift end while a co-op partner with a fresh process asks - // MultiColony. A switch-off is also said in the game (SwitchedOff), since one that only this computer hit + // Timber Together. A switch-off is also said in the game (SwitchedOff), since one that only this computer hit // splits a co-op game. private static readonly Breaker Failure = new Breaker(); private static string _failureDescription; @@ -45,7 +45,7 @@ public static bool Available } // Only GameLoad.Reset calls this, from the configurator, which runs on every player whenever a game is - // loaded, joined or rehosted, before any beaver decides. It asks MultiColony again after an exception in the + // loaded, joined or rehosted, before any beaver decides. It asks Timber Together again after an exception in the // previous game, keeps the probe result and lets go of the previous game's last beaver. Never call it // mid-game. public static void NewGame() @@ -54,7 +54,7 @@ public static void NewGame() _oneSlot[0] = null; if (Failure.NewGame()) { - Log.Info("MultiColony: failure from the previous game cleared; asking it again in this game."); + Log.Info("Timber Together: failure from the previous game cleared; asking it again in this game."); } } @@ -64,7 +64,7 @@ public static void EnsureProbed() Probe(); } - // True with the beaver's colony's shift end when MultiColony is running separate colonies and knows the + // True with the beaver's colony's shift end when Timber Together is running separate colonies and knows the // beaver's colony. False means: use the game's WorkingHoursManager. public static bool TryEndHours(BaseComponent beaver, out float endHours) { @@ -96,8 +96,8 @@ public static bool TryEndHours(BaseComponent beaver, out float endHours) { _failureDescription = "present, but asking it failed (" + exception.GetBaseException().Message + "); using the game's shift end for the rest of this game"; - Log.Warning("MultiColony: " + _failureDescription); - SwitchedOff.Report("the MultiColony shift end (error asking MultiColony)", + Log.Warning("Timber Together: " + _failureDescription); + SwitchedOff.Report("the Timber Together shift end (error asking Timber Together)", "beavers here plan against the game's single shift end"); } return false; diff --git a/source/Planning/Breaker.cs b/source/Planning/Breaker.cs index 8e1aad1..f8d373a 100644 --- a/source/Planning/Breaker.cs +++ b/source/Planning/Breaker.cs @@ -1,6 +1,6 @@ namespace HungryPathing.Planning { - // A switch-off that lasts exactly one game: the circuit breaker's (Safety) and the MultiColony bridge's. It is kept + // A switch-off that lasts exactly one game: the circuit breaker's (Safety) and the Timber Together bridge's. It is kept // apart from the settings, which outlive the game. It feeds decisions, which makes it simulation state. The code // it guards reads only the simulation, so every player should trip it at the same tick (a trip only one player hit // is said in the game, see SwitchedOff), and NewGame is called only when a game is loaded, which every player does diff --git a/source/SwitchedOff.cs b/source/SwitchedOff.cs index 6ec6bc5..dcccb66 100644 --- a/source/SwitchedOff.cs +++ b/source/SwitchedOff.cs @@ -4,7 +4,7 @@ namespace HungryPathing { // What switched itself off after an error in this game, in the order it happened: the circuit breaker (Safety), - // which takes the whole mod off, and the MultiColony bridge, which falls back to the game's shift end. + // which takes the whole mod off, and the Timber Together bridge, which falls back to the game's shift end. // // Both guard code that reads only the simulation, so an error there should throw on every player at the same tick. // That is what the code is built for, not something it can promise: an error that only one computer hits leaves diff --git a/tests/HungryPathing.Tests.csproj b/tests/HungryPathing.Tests.csproj index dedd65c..364d190 100644 --- a/tests/HungryPathing.Tests.csproj +++ b/tests/HungryPathing.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/tests/Program.cs b/tests/Program.cs index 39a8c43..8c794c0 100644 --- a/tests/Program.cs +++ b/tests/Program.cs @@ -4,7 +4,7 @@ using HungryPathing; using HungryPathing.Planning; -// Checks on the planner arithmetic, the circuit breaker, the MultiColony bridge and what the in-game notice says when +// Checks on the planner arithmetic, the circuit breaker, the Timber Together bridge and what the in-game notice says when // either switches off, plus rules for the Harmony hooks read from their source (HarmonyRules.cs). They compile that // source directly and need no game files: // dotnet run --project tests/HungryPathing.Tests.csproj @@ -327,57 +327,57 @@ private static int Main() Safety.NewGame(); Check(!Safety.Active, "safety: a load does not bring back hooks that failed to install"); - // MultiColonyBridge.cs as shipped. Whether MultiColony is there is fixed for the process, but an exception from + // MultiColonyBridge.cs as shipped. Whether Timber Together is there is fixed for the process, but an exception from // it lasts one game, like the breaker: a player who hit one in an earlier game must not keep the game's shift - // end in the next while a co-op partner with a fresh process asks MultiColony. + // end in the next while a co-op partner with a fresh process asks Timber Together. int infos = Log.Infos.Count; int warnings = Log.Warnings.Count; StubBeaver beaver = new StubBeaver(); MultiColonyBridge.NewGame(); - Check(Log.Infos.Count == infos, "multicolony: the first load has nothing to re-arm"); + Check(Log.Infos.Count == infos, "timber together: the first load has nothing to re-arm"); ColonyWorkingHours.Current = new ColonyWorkingHours(); Check(MultiColonyBridge.TryEndHours(beaver, out float endHours) && Near(endHours, 20f), - "multicolony: the shift end comes from the beaver's colony"); + "timber together: the shift end comes from the beaver's colony"); string probed = MultiColonyBridge.Description; - Check(probed.StartsWith("present; "), "multicolony: the probe finds MultiColony's working hours"); + Check(probed.StartsWith("present; "), "timber together: the probe finds Timber Together's working hours"); ColonyWorkingHours.ColonySlot = null; - Check(!MultiColonyBridge.TryEndHours(beaver, out _), "multicolony: a beaver of no colony keeps the game's shift end"); + Check(!MultiColonyBridge.TryEndHours(beaver, out _), "timber together: a beaver of no colony keeps the game's shift end"); ColonyWorkingHours.ColonySlot = 1; ColonyWorkingHours.ThrowOnce = true; - Check(!MultiColonyBridge.TryEndHours(beaver, out _), "multicolony: an exception falls back to the game's shift end"); - Check(!MultiColonyBridge.TryEndHours(beaver, out _), "multicolony: the game's shift end for the rest of the game"); + Check(!MultiColonyBridge.TryEndHours(beaver, out _), "timber together: an exception falls back to the game's shift end"); + Check(!MultiColonyBridge.TryEndHours(beaver, out _), "timber together: the game's shift end for the rest of the game"); Check(Log.Warnings.Count == warnings + 1 && - Log.Warnings[warnings] == "MultiColony: present, but asking it failed (test); " + + Log.Warnings[warnings] == "Timber Together: present, but asking it failed (test); " + "using the game's shift end for the rest of this game", - "multicolony: one warning per game, saying how long it lasts"); + "timber together: one warning per game, saying how long it lasts"); MultiColonyBridge.NewGame(); Check(MultiColonyBridge.TryEndHours(beaver, out endHours) && Near(endHours, 20f), - "multicolony: asked again after the next load"); + "timber together: asked again after the next load"); Check(Log.Infos.Count == infos + 1 && - Log.Infos[infos] == "MultiColony: failure from the previous game cleared; asking it again in this game.", - "multicolony: the load that re-arms it says so"); - Check(MultiColonyBridge.Description == probed, "multicolony: the next game's log line gives the probe result again"); + Log.Infos[infos] == "Timber Together: failure from the previous game cleared; asking it again in this game.", + "timber together: the load that re-arms it says so"); + Check(MultiColonyBridge.Description == probed, "timber together: the next game's log line gives the probe result again"); MultiColonyBridge.NewGame(); - Check(Log.Infos.Count == infos + 1, "multicolony: a load with nothing to re-arm says nothing"); + Check(Log.Infos.Count == infos + 1, "timber together: a load with nothing to re-arm says nothing"); ColonyWorkingHours.ThrowOnce = true; Check(!MultiColonyBridge.TryEndHours(beaver, out _) && Log.Warnings.Count == warnings + 2, - "multicolony: a later game can fail and warn again"); + "timber together: a later game can fail and warn again"); // GameLoad.Reset is the reset the configurator runs at every load, join and rehost. Both bugs were a load that - // left a switch-off in place, so one call must re-arm the breaker and the MultiColony bridge together. + // left a switch-off in place, so one call must re-arm the breaker and the Timber Together bridge together. Plugin.HooksInstalled = true; Safety.Trip("a check before the load", new InvalidOperationException("test")); Stats.Evaluations = 5; Check(!Safety.Active && !MultiColonyBridge.TryEndHours(beaver, out _), - "load: the breaker and the MultiColony bridge are both off before the load"); + "load: the breaker and the Timber Together bridge are both off before the load"); infos = Log.Infos.Count; GameLoad.Reset(); Check(Safety.Active, "load: the configurator's reset re-arms the breaker"); Check(MultiColonyBridge.TryEndHours(beaver, out endHours) && Near(endHours, 20f), - "load: the configurator's reset re-arms the MultiColony bridge"); + "load: the configurator's reset re-arms the Timber Together bridge"); Check(Log.Infos.Count == infos + 2 && Log.Infos[infos] == "Breaker from the previous game cleared; active again for this game." && - Log.Infos[infos + 1] == "MultiColony: failure from the previous game cleared; asking it again in this game." && + Log.Infos[infos + 1] == "Timber Together: failure from the previous game cleared; asking it again in this game." && Stats.Evaluations == 0, "load: the reset says what it re-armed and starts the day's counters over"); @@ -392,13 +392,13 @@ private static int Main() MultiColonyBridge.TryEndHours(beaver, out _); MultiColonyBridge.TryEndHours(beaver, out _); Check(SwitchedOff.Count == 1 && SwitchedOff.ShouldShow(ref shown), - "switched off: the MultiColony fallback is reported once and shows the dialog"); + "switched off: the Timber Together fallback is reported once and shows the dialog"); Check(!SwitchedOff.ShouldShow(ref shown), "switched off: the dialog does not show again on the next frame"); Check(SwitchedOff.TakeReminder(321) == null && SwitchedOff.TakeReminder(321) == null, "switched off: the day of the switch-off has the warning and no reminder"); Check(SwitchedOff.TakeReminder(322) == - "Day 321: switched off on this computer until a game is loaded: the MultiColony shift end (error asking " + - "MultiColony). In multiplayer the other players' computers may not have: the host should save and host " + + "Day 321: switched off on this computer until a game is loaded: the Timber Together shift end (error asking " + + "Timber Together). In multiplayer the other players' computers may not have: the host should save and host " + "that save again, and every player join it, before playing on together.", "switched off: the next day change says what is off for the day that ended"); Check(SwitchedOff.TakeReminder(322) == null, "switched off: one reminder per day"); @@ -409,7 +409,7 @@ private static int Main() Check(SwitchedOff.NoticeText() == "Hungry Pathing\n\n" + "An error on this computer switched this off for the rest of this game:\n\n" + - "- the MultiColony shift end (error asking MultiColony): beavers here plan against the game's single " + + "- the Timber Together shift end (error asking Timber Together): beavers here plan against the game's single " + "shift end.\n" + "- the whole mod (error in HungryPathingRootBehavior.Decide): beavers here behave as in the base game." + "\n\nPlayer.log has the details; please report it.\n\n" + @@ -420,7 +420,7 @@ private static int Main() "switched off: the dialog names each switch-off in order, what beavers do now, and what co-op players do"); Check(SwitchedOff.TakeReminder(323) != null && SwitchedOff.TakeReminder(324).StartsWith("Day 323: switched off on this computer until a game is loaded: " + - "the MultiColony shift end (error asking MultiColony); the whole mod (error in " + + "the Timber Together shift end (error asking Timber Together); the whole mod (error in " + "HungryPathingRootBehavior.Decide). "), "switched off: the reminder names every switch-off, every day"); GameLoad.Reset(); diff --git a/tests/Stubs.cs b/tests/Stubs.cs index 06da69f..3cd3373 100644 --- a/tests/Stubs.cs +++ b/tests/Stubs.cs @@ -48,7 +48,7 @@ public abstract class BaseComponent namespace BeaverBuddies.Colonies { - // The shape of BeaverBuddies MultiColony's ColonyWorkingHours that MultiColonyBridge finds by name: a static + // The shape of Timber Together's ColonyWorkingHours that MultiColonyBridge finds by name: a static // Instance, EndHours for a colony slot, and a static ColonyOf that is null for a beaver of no colony. public class ColonyWorkingHours {