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
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@ Keep a building's working-area outline visible after deselecting it, including w

**Website:** <https://timbermods.github.io/PersistentWorkAreas/> has the feature overview, an install guide, troubleshooting, and an FAQ.

## New in 1.0.0
## New in 1.1.0

First stable release, with no behavior changes from 0.1.3. That build has now been tested in game, single-player and in a two-player BeaverBuddies Stability Fork session. The game-log line now reads its version number from the mod itself, and the release zip now uses standard `/` folder separators, so it extracts correctly on macOS and with non-Windows tools.
- **Planting tools show their planters.** Pick a crop or tree in the planting tools and the working areas of every building that can plant it appear on their own: farmhouses for crops, aquatic farmhouses for aquatic crops, and foresters for trees and bushes, including ones still under construction. They disappear when you leave the tool. **Clear pinned areas** clears only your pins.
- **Pins are remembered.** Each settlement's pins are kept on your own computer in `PersistentWorkAreas\Pins.txt`, next to your Timberborn `Saves` folder, and come back when you load that settlement. They are never written into the save, so each co-op player keeps their own.
- **Faster refreshes with many pins.** A path or terrain change now re-checks only the pinned buildings it can reach, and selecting a pinned building no longer recalculates every pin.
- **Translatable text.** All UI text now comes from `Localizations/enUS_PersistentWorkAreas.csv`, so a translation is one more CSV. The English text is unchanged.

When updating, replace the whole `PersistentWorkAreas` folder. The new DLL reads its text from the CSV, so copying only the DLL over 1.0.0 shows raw keys.

1.1.0 passes 142 automated checks. Its new features have not been playtested in game yet; 1.0.0's behavior has been.

### Earlier versions

- **1.0.0:** First stable release, with no behavior changes from 0.1.3, tested in game single-player and in a two-player BeaverBuddies Stability Fork session. The game-log line reads its version number from the mod itself, and the release zip uses standard `/` folder separators.
- **0.1.3:** Documentation correction only. The game itself draws a Builder's Hut's range outline while it is selected; that is vanilla behavior, not something this mod adds or changes.
- **0.1.2:** Builder's Huts can no longer be pinned, so they no longer show a "Working area" panel.
- **0.1.1:** The pin control gained a clearly drawn checkbox, an ON/OFF badge, a bordered panel, and hover/keyboard-focus highlighting.
Expand All @@ -18,7 +26,7 @@ First stable release, with no behavior changes from 0.1.3. That build has now be
## Install

1. Close Timberborn.
2. Extract `PersistentWorkAreas-v1.0.0.zip` into your Timberborn `Mods` folder (normally `Documents\Timberborn\Mods`). The result should be `Mods\PersistentWorkAreas\version-1.1\manifest.json` and `PersistentWorkAreas.dll` beside it.
2. Extract `PersistentWorkAreas-v1.1.0.zip` into your Timberborn `Mods` folder (normally `Documents\Timberborn\Mods`). The result should be `Mods\PersistentWorkAreas\version-1.1\manifest.json` and `PersistentWorkAreas.dll` beside it.
3. Start Timberborn and enable **Persistent Work Areas** in the mod manager. Restart if prompted.

Requires Timberborn **1.1.2.4** or a compatible 1.1 build. Built and tested on Timberborn 1.1.2.4. Later versions may change the internal renderer API.
Expand All @@ -44,7 +52,7 @@ The mod supports navigation-based working areas. It does not pin district road c

Designed for compatibility with the **BeaverBuddies Stability Fork**. The mod does not patch game methods, change simulation or building data, send multiplayer events, or modify saves; the pins live in their own small local file. It uses the same navigation queries as the game's selected-building visualizer and a separate instance of its outline renderer.

The release build passes 38 automated lifecycle/API checks. The mod has been tested in game on Timberborn 1.1.2.4, both single-player and in a two-player BeaverBuddies Stability Fork session with the mod installed on both computers. See `VALIDATION.md` for what was checked and how.
The release build passes 142 automated checks. 77 of them test the pin, refresh-planning, planting-tool and pin-file logic without the game, and 65 check the mod against the installed game's assemblies and blueprints. Version 1.0.0 was tested in game on Timberborn 1.1.2.4, both single-player and in a two-player BeaverBuddies Stability Fork session with the mod installed on both computers. The features new in 1.1.0 have not been playtested in game yet. See `VALIDATION.md` for what was checked and how.

## Build from source

Expand All @@ -54,9 +62,9 @@ Install the .NET 8 SDK and have Timberborn installed, then run:
.\build.ps1 -GameDir 'C:\Program Files (x86)\Steam\steamapps\common\Timberborn'
```

The script builds the mod, runs checks, and creates `dist\PersistentWorkAreas-v1.0.0.zip`. No game, Unity, Harmony, or BeaverBuddies DLLs are redistributed. The game DLLs are used only as build references.
The script builds the mod, runs checks, and creates `dist\PersistentWorkAreas-v1.1.0.zip`. No game, Unity, Harmony, or BeaverBuddies DLLs are redistributed. The game DLLs are used only as build references.

Without the game, `dotnet run --project tests/Checks.csproj -c Release` runs only the pin-logic checks and reports the rest as skipped. GitHub Actions runs them for pull requests and pushes to `main`.
Without the game, `dotnet run --project tests/Checks.csproj -c Release` runs only the checks that need no game files (pin, refresh-planning, planting-tool and pin-file logic) and reports the rest as skipped. GitHub Actions runs them for pull requests and pushes to `main`.

## License

Expand Down
12 changes: 6 additions & 6 deletions VALIDATION.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Validation — Persistent Work Areas 1.0.0
# Validation — Persistent Work Areas 1.1.0

## In-game testing

- Tested in game on Timberborn 1.1.2.4 with the BeaverBuddies Stability Fork, both single-player and in a two-player co-op session with the mod installed on both computers. Pinning, clearing and outline display worked as expected.
- The tested build was 0.1.3. The 1.0.0 code is the same except for the version number and the startup log line, which now reads the version from the assembly.
- **1.1.0 has not been playtested in game yet.** Its new behavior (planting-tool outlines, pins remembered in a local file, per-pin refresh caching and localized text) is covered only by the automated checks below. Run the release playtest checklist, including steps 8 to 10, to confirm it.
- 1.0.0 was tested in game on Timberborn 1.1.2.4 with the BeaverBuddies Stability Fork, both single-player and in a two-player co-op session with the mod installed on both computers. Pinning, clearing and outline display worked as expected. That tested build was 0.1.3; the 1.0.0 code was the same except for the version number and the startup log line.
- Running the mod on only one of the two co-op computers has not been playtested.

## Automated checks

- Compiled for `netstandard2.1` against the installed Timberborn 1.1.2.4 assemblies: zero errors and zero warnings.
- 38 checks passed: reference-identity pins, duplicate pin/unpin, independent pins, replacement/deletion behavior, global clear, new-map isolation, native renderer constructors/methods/cleanup fields, delegate binding to internal renderer methods, lifecycle/navigation/event interfaces, no simulation persistence interfaces, no Harmony/BeaverBuddies dependencies, package/key-binding consistency, manifest/assembly version agreement, and presence of the Builder's Hut marker component used to exclude it from pinning.
- 142 checks passed. 77 need no game files and also run on GitHub Actions for every pull request: pin-set identity and change tracking, refresh planning against a fake navigation world that counts range queries and outline rebuilds, the planting-tool rule and shown-building bookkeeping, and the pin-file format, escaping, 100-settlement cap, restore by entity id and atomic on-disk writes. 65 need the installed game: reference-identity pins, duplicate pin/unpin, independent pins, replacement/deletion behavior, global clear, new-map isolation, native renderer constructors/methods/cleanup fields, delegate binding to internal renderer methods, lifecycle/navigation/event interfaces, no simulation persistence interfaces, no Harmony/BeaverBuddies dependencies, package/key-binding consistency, manifest/assembly version agreement, presence of the Builder's Hut marker component used to exclude it from pinning, the navigation-change bounds against the game's `BoundingBox`, the service's refresh wiring on a live instance, planting-tool events and the planter pairing against the game's own blueprints, localization CSV layout and the absence of hard-coded UI text in the DLL, and pin-file saving, restoring and retrying on a live instance with the game's settlement and entity-registry types.
- Compared the display path with the installed game's `BuildingRangeDrawer`, `BoundsNavRangeDrawer`, and navigation query calls. The mod uses those same range queries and its own outline-renderer instance.
- Reviewed the BeaverBuddies Stability Fork's `IO/BuildCompatibility.cs`: its handshake identifies Timberborn and the BeaverBuddies/TimberNet binaries. This mod changes none of them.
- The display service only implements frame-update, input, load, and navigation-notification interfaces. Pin state is per game-scoped service instance. Each settlement's pins are also kept, by entity id, in a local text file next to the `Saves` folder (`Documents\Timberborn\PersistentWorkAreas\Pins.txt` on Windows). It is read once after the map loads, and rewritten from the frame update after the pins change, and once after a load that finds the settlement below the top of the file, to keep it among the 100 most recent. A failed write is retried every 10 seconds and again on leaving the map, which never erases the file. A file this version cannot read is kept as `Pins.txt.bak` before it is replaced. There are no Harmony patches, replay events, simulation ticks, random calls, or save writes.
- Renderer geometry refreshes on pin, selection, construction-mode, height-visibility and navigation changes, with navigation refreshes capped at five per second. Empty pin sets do no range queries or drawing. All pins share a combined mesh. Clearing releases the renderer's owned meshes and cloned materials.
- Each pinned or planting-tool building caches its own range. A navigation change re-queries only the buildings whose range it can reach (road-spill ranges are always re-queried), with those refreshes capped at five per second. Selection and visible-level changes redraw from the cache without a query; construction-mode changes re-query every building. With no pins and no planting tool open, nothing is queried or drawn. All outlines share a combined mesh, and the renderer's owned meshes and cloned materials are released once nothing is drawn.

## Not established by the automated checks

These are compiled API and logic checks, not Unity rendering tests or a co-op session; the in-game testing above covers those. Neither establishes frame-rate impact in a very large colony or compatibility with every other mod. Internal renderer reflection is deliberately isolated in `NativeOutline.cs` and checked against the installed assemblies.
These are compiled API and logic checks, not Unity rendering tests or a co-op session. The in-game testing above covers those for the 1.0.0 behavior; for 1.1.0's new behavior, the playtest checklist below still has to be run. Neither establishes frame-rate impact in a very large colony or compatibility with every other mod. Internal renderer reflection is deliberately isolated in `NativeOutline.cs` and checked against the installed assemblies.

## Release playtest checklist

Expand Down
12 changes: 8 additions & 4 deletions docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2>Safety and compatibility</h2>
</details>
<details class="q" id="saves">
<summary>Is it safe for my saves? Can I remove it mid-game?</summary>
<div class="a"><p>Yes. The mod never writes to your save files and doesn't change buildings, beavers or the simulation. Pins aren't saved at all. You can disable or delete the mod at any time and your colony loads as normal.</p></div>
<div class="a"><p>Yes. The mod never writes to your save files and doesn't change buildings, beavers or the simulation. Pins are kept in their own small file outside your saves. You can disable or delete the mod at any time and your colony loads as normal.</p></div>
</details>
<details class="q" id="multiplayer">
<summary>Does it work in multiplayer? Do both players need it?</summary>
Expand Down Expand Up @@ -119,19 +119,23 @@ <h2>Features and limits</h2>
</details>
<details class="q" id="persist">
<summary>Do my pins survive saving and loading?</summary>
<div class="a"><p>No. Pins reset when you leave the map, load a save, or a multiplayer resync happens. That's deliberate, so the mod can never affect a saved colony.</p></div>
<div class="a"><p>Yes, since version 1.1.0. Each settlement's pins are remembered on your own computer in <code>Documents\Timberborn\PersistentWorkAreas\Pins.txt</code> and come back when you load any save of that settlement. They are never written into the save itself, so the mod can't affect a saved colony. A different settlement starts with no pins, and a co-op guest's pins usually don't come back after a resync, because the guest's settlement is named after the host's save. To forget every pin, delete that file.</p></div>
</details>
<details class="q" id="planting">
<summary>Why do farmhouse or forester outlines appear when I pick a crop or tree?</summary>
<div class="a"><p>Since version 1.1.0, picking a crop or tree in the planting tools outlines the working area of every building that can plant it: farmhouses for crops, aquatic farmhouses for aquatic crops, and foresters for trees and bushes, including ones still under construction. The outlines go away when you leave the planting tool. <strong>Clear pinned areas</strong> removes only your pins, not these.</p></div>
</details>
<details class="q" id="overlays">
<summary>Can it pin district road colors, effect radii or placement ghosts?</summary>
<div class="a"><p>No. It supports navigation-based working areas only. Those other overlays aren't included.</p></div>
</details>
<details class="q" id="language">
<summary>Is it translated?</summary>
<div class="a"><p>Not yet. The mod's text is English only.</p></div>
<div class="a"><p>Not yet. The mod's text is English only, but since version 1.1.0 all of it lives in one file, <code>version-1.1/Localizations/enUS_PersistentWorkAreas.csv</code>. A translation is one more file there with the same keys, named for the game's language code, for example <code>deDE_PersistentWorkAreas.csv</code>.</p></div>
</details>
<details class="q" id="perf">
<summary>Will it slow down my game?</summary>
<div class="a"><p>It's designed not to. Outlines recalculate at most five times per second and only when something changes, all pins share one combined mesh, nothing runs while there are no pins, and the mesh is released when you clear. If you notice a drop in a very large colony, <a href="troubleshooting.html#performance">let us know</a>.</p></div>
<div class="a"><p>It's designed not to. A terrain or path change re-checks only the pinned buildings it can reach, at most five times per second, and selecting a building redraws from what was already worked out. All outlines share one combined mesh, nothing runs while there are no pins and no planting tool is open, and the mesh is released once nothing is drawn. If you notice a drop in a very large colony, <a href="troubleshooting.html#performance">let us know</a>.</p></div>
</details>
</div>

Expand Down
14 changes: 8 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ <h3>Supported</h3>
<li>Several pins at once, merged where they overlap</li>
<li>Outlines that follow terrain, path, visible-level and construction-mode changes</li>
<li>Automatic cleanup when a pinned building is deleted</li>
<li>Planting tools that outline every farmhouse or forester able to plant the chosen crop or tree</li>
<li>Pins remembered for each settlement, in a small local file</li>
</ul>
</div>
<div class="card">
Expand All @@ -159,19 +161,19 @@ <h3>Not included</h3>
<li>Effect-radius overlays that are not navigation-based</li>
<li>Building-placement ghosts</li>
<li>Pin controls for Builder's Huts</li>
<li>Saving pins between sessions, and non-English UI text</li>
<li>Translations other than English (adding one takes a single CSV file)</li>
</ul>
</div>
<div class="card">
<h3>Pins are temporary</h3>
<p>Pins reset when you leave the map, load a save or a multiplayer resync happens, and they are never written to your save file. That is deliberate: it keeps the mod from ever affecting a colony.</p>
<h3>Pins are remembered, not saved</h3>
<p>Each settlement's pins are kept on your own computer, in <code>Documents\Timberborn\PersistentWorkAreas\Pins.txt</code>, and come back when you load that settlement. They are never written to your save file, so the mod can't affect a colony and each co-op player keeps their own.</p>
</div>
<div class="card">
<h3>Fails on its own</h3>
<p>If a future game update changes the internals the outline renderer relies on, pinning disables itself for that map and says so in the panel and the game log. Nothing else is affected.</p>
</div>
</div>
<p style="margin-top:18px;color:var(--muted)">Running a large colony? The outline recalculates at most five times per second, does no work while nothing is pinned, and releases its meshes when you clear.</p>
<p style="margin-top:18px;color:var(--muted)">Running a large colony? A terrain or path change re-checks only the pinned buildings it can reach, at most five times per second. Nothing runs while nothing is pinned and no planting tool is open, and the meshes are released once nothing is drawn.</p>
</div>
</section>

Expand All @@ -183,8 +185,8 @@ <h3>Fails on its own</h3>
<tr><th scope="row">Game version</th><td>Timberborn <strong>1.1.2.4</strong> or a compatible 1.1 build. Built and tested on 1.1.2.4; later versions may change the internal renderer API.</td></tr>
<tr><th scope="row">Multiplayer</th><td>Designed for compatibility with the <strong>BeaverBuddies Stability Fork</strong>. Tested in two-player co-op with the mod on both computers, which is the recommended setup. It sends no multiplayer events and pins are always local.</td></tr>
<tr><th scope="row">Other mods</th><td>No required mods. No Harmony patches and no BeaverBuddies dependency.</td></tr>
<tr><th scope="row">Saves</th><td>Untouched. You can remove the mod at any time.</td></tr>
<tr><th scope="row">Language</th><td>English UI text.</td></tr>
<tr><th scope="row">Saves</th><td>Untouched. Pins live in their own small local file. You can remove the mod at any time.</td></tr>
<tr><th scope="row">Language</th><td>English UI text, translatable with one CSV file.</td></tr>
</tbody>
</table>
</div>
Expand Down
Loading
Loading