From ff492d5260c3084d1bca5400b52d0e3f76da5610 Mon Sep 17 00:00:00 2001 From: "Fabian @ Blax Software" Date: Tue, 1 Dec 2026 19:09:46 +0100 Subject: [PATCH] docs: plan review fixes --- README.md | 2 +- docs/design.md | 55 ++++++++++++++++++++++++--------------- docs/features.md | 67 ++++++++++++++++++++++++++---------------------- 3 files changed, 72 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 245cba3..77fd714 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ A "Forbid rules" section on the settings page. Every rule ships off. `Source/Bla Not built yet. The plan by area and its order are in `docs/features.md`, the specs in `docs/design.md`. -- Storage: graves, sarcophagi, mortars, growth vats (Biotech), biosculpter pods (Ideology) and other storage; your own stockpile types in the Zone menu. +- Storage: graves, sarcophagi, mortars, growth vats (Biotech), biosculpter pods (Ideology) and other storage; named setups you load onto any storage, each with its own stockpile designator in the Zone menu. - Bills: defaults per recipe from the bill window, the bills a new workbench comes with, materials no new bill uses. - Animals: area, follow flags, training and medical care per species, born animals copy their mother, auto-slaughter limits, young animals learn what they outgrew. - Mechs (Biotech): auto-repair, the work mode of the control group a new mech joins, and its area. diff --git a/docs/design.md b/docs/design.md index 790fc14..c64e3ea 100644 --- a/docs/design.md +++ b/docs/design.md @@ -4,6 +4,16 @@ Every new shelf starts at Preferred and pulls meals out of the freezer, every ne Status: 1.0 and 1.1 (forbid rules) are on the Workshop, 1.1.0 since 2026-11-30. The other areas are designed, no code yet. [features.md](features.md) is the plan of record for scope and order and lists the features new in it. Checked against the RimWorld 1.7.5021 game code on 2026-11-29. RimWorld 1.7, package id `blax.defaults`. It keeps nothing in the save, so it can be added to or removed from a running colony at any time. +Changes on 2026-12-01, after an independent review of the plan by area (every hook below checked against the shipped code and the 1.7.5021 game code): + +- Storage: "your own stockpile types" and the idea "several named defaults per kind" become one feature, named setups. Each setup gets its own key, because the shipped stockpile hook keys a modded designator by its class and would give every saved type one template. Its step moves behind mechs and new maps in the order, and bills move up to second. +- Graves, mortars and other storage: a `Building_Storage` without a storage blueprint, such as Rimefeller's chemfuel hopper, gets its default through the frame's own storage settings, because `Frame.CompleteConstruction` copies those onto it after spawn and finds them null. +- Bills: a recipe default saves its ingredient filter as the difference from what a new bill gets, so "Materials no new bill uses" can tell a deliberate re-allow from a saved full list, and a recipe the list would leave with nothing allowed keeps its filter. +- Animals: medical care per species writes only species rows; the every-animal row has none, so vanilla's tamed-animal setting stays the fallback. The Castes boundary below now says Defaults writes medical care for animals only. "Young animals learn what they outgrew" joins the first animal step, takes the wishes from the same source as birth (the mother or the species row), only adds wants, ships off and is named as the second exception to "applies once". +- New maps: areas are made in a postfix on `AreaManager.AddStartingAreas`, before starting animals spawn, rename vanilla's "Area 1", stop at the cap of 10 and skip gravship landing maps. Castes' "Create area" button is named as the other way areas get made, and the ownership line gains the named areas of a new map. +- Build copy: a snapshot taken when the Build copy button is clicked, carried on the storage blueprint or in an unsaved table, instead of a link to the source. +- New colonies moved to Cut, with the open question kept for Fabian and the recommendation changed to no: manual work priorities and other factions' care are not Defaults' ground, and tame-animal care is the fallback of the species rows. + Changes on 2026-12-01, planned by area (Fabian: plan the whole mod, chunked by what belongs together, never by time or size): - [features.md](features.md) is new: the scope of the finished mod, its areas with their steps and status, the order of the areas, what is left out and the open questions. New features there: your own stockpile types, materials no new bill uses, medical care per species, young animals learn what they outgrew, areas every new map starts with, and Build copy carries the source's settings. The last three come from the backlog. New colonies waits for Fabian's call. @@ -40,7 +50,7 @@ Changes on 2026-11-29, forbid rules reworked: | Area | What players get | Needs | Replaces | |---|---|---|---| | Defaults file and settings page | Shipped in 1.0: one defaults file shared by every save that never resets itself, a settings page that works from the main menu, overlap warnings. Designed: "Add a default" from the main menu and dropping names of removed mods | None | The self-resetting settings of 1trickPwnyta's Defaults (75k, no 1.7) | -| Storage | Shipped in 1.0: new stockpiles, dumping stockpiles, shelves, bookcases, hoppers, fridges and weapon racks start with the filter and priority you saved, set from a "Defaults" button in the storage tab; one click makes new shelves start empty. Designed: graves, sarcophagi, mortars, growth vats, biosculpter pods and modded storage too. New: your own stockpile types in the Zone menu | None (growth vats: Biotech, biosculpter pods: Ideology) | [FSF] No Default Shelf Storage (93k), the storage half of 1trickPwnyta's Defaults (75k, no 1.7) and of Set my Defaults (116); new stockpile types partly cover Preset Filtered Zones (16k) and Simple Stockpile Presets (16k) | +| Storage | Shipped in 1.0: new stockpiles, dumping stockpiles, shelves, bookcases, hoppers, fridges and weapon racks start with the filter and priority you saved, set from a "Defaults" button in the storage tab; one click makes new shelves start empty. Designed: graves, sarcophagi, mortars, growth vats, biosculpter pods and modded storage too. New: named setups you load onto any storage, each with its own stockpile designator in the Zone menu | None (growth vats: Biotech, biosculpter pods: Ideology) | [FSF] No Default Shelf Storage (93k), the storage half of 1trickPwnyta's Defaults (75k, no 1.7) and of Set my Defaults (116); named setups partly cover Preset Filtered Zones (16k), Simple Stockpile Presets (16k) and the save by name of [KV] Save Storage (109k) | | Bills | Shipped in 1.0: values for every new bill (radius, drop on floor, repeat mode and more). Designed: defaults per recipe saved from the bill window, the bills a new workbench comes with. New: materials no new bill uses | None ("slaves only": Ideology, "mechs only" and "non-mechs only": Biotech) | Better Workbench Management's default store mode (452k, no 1.7), Default Ingredient Radius (11.6k), the bill values and per-recipe and per-workbench bills of 1trickPwnyta's Defaults and Set my Defaults, Auto Bill Restore (1.1k, no 1.7) | | Forbid rules | Shipped in 1.1: what the game forbids when one of your colony's or an enemy's pawns goes down or dies is allowed when it matches a filter with hit points and quality ranges, once the fight is over. Stripping can forbid what doesn't match. Corpses outside the home area can stay allowed | None (slaves: Ideology, colony mechs: Biotech) | KilledEnemyAutoAllowed (Continued) (5.2k), Allow Dead Animals (67k, no 1.7), Allow Everything (3.8k, no 1.7) for drops, partly Auto Strip on Haul's tainted forbid (18k) | | Animals | Designed: area, follow flags and training per species when an animal joins; born animals copy their mother; auto-slaughter limits for a species you own for the first time and for new maps. New: medical care per species, young animals learn what they outgrew | None | Animal Controls' join defaults (57k, no 1.7), Auto Training (1.2k), the newborn copy of Assign Animal Food (25k, no 1.7) | @@ -48,7 +58,6 @@ Changes on 2026-11-29, forbid rules reworked: | New maps | New: named areas every new map starts with (no spec yet) | None | The default areas of 1trickPwnyta's Defaults | | Growing | Designed: crops for new growing zones and hydroponics basins | None | Default Plant Selector (7), the crop defaults of 1trickPwnyta's Defaults | | Buildings | Designed: settings for new doors, tables, traps, heaters, coolers and lamps, per building or for every door, lamp, heater or cooler. New: Build copy carries the source's settings | None | No Default Gather Spot (8.4k, no 1.7), Default White Lights (656), Always Auto-Rearm (67) | -| New colonies | Idea, waits for Fabian's call (features.md, "Open questions"): play settings and the medical defaults for animals and other factions' pawns at game start | None | The play settings of 1trickPwnyta's Defaults | Workshop numbers are current subscribers from the Steam Web API (GetPublishedFileDetails), read on 2026-11-29 and, for the rows new on 2026-12-01, that day; "no 1.7" means the item has no 1.7 tag. Needs: "None" means the area runs on the core game, and a DLC in brackets marks the parts that switch off without it (see "DLC support"). A DLC alone, as for mechs, means the whole area switches off without it. The order of the areas is in [features.md](features.md). Each spec's effort mark (S, M or L) says how big the feature is; it decides nothing about what ships together. @@ -61,6 +70,7 @@ Change if you disagree. - A default applies once, when the thing is created: designated, built, tamed, bought, born, gestated. Changing or forgetting a default never touches an existing stockpile, shelf, bill or animal. "Load your default" on one thing is the explicit way to update it. - Only what you make or acquire. Ruins, map generation, trader stock and reinstalled minified buildings keep the game's settings. Benches in abandoned outposts never get your bills; a cook walking to one was a complaint about 1trickPwnyta's Defaults (2025-12-07). - The one exception is the forbid rules (1.1). They act on gear and corpses you neither made nor acquired, and they live on the settings page, not behind a "Make default". All of them ship off. +- The second exception, to "applies once": "Young animals learn what they outgrew" (features.md, Animals) acts when an animal you already have reaches its next life stage, including animals that joined before the default existed or changed. It ships off behind its own switch and only ever adds a training want its source asks for, never removes one. - Forbid rules come in two groups: your colony (colonists, slaves, colony mechs, colony animals and prisoners, a rebelling slave or an escaping prisoner included) and enemies (anyone else hostile to you when they go down or die). Neutral visitors, traders and quest lodgers keep the game's rules: a downed visitor that gets up where it fell picks its weapon up again, and a trader's wares sit in its inventory. - Each group's rule is one vanilla item filter with the hit points and quality ranges stockpiles have. What matches is allowed; what doesn't keeps the game's flag. A rule never forbids a dropped thing the game left allowed; only the opt-in strip switch forbids. - Going down and dying share one rule: gear drops once, either when the pawn goes down or when it dies without going down. Raiders downed by violence often die on the spot instead (80% at population intent 0), so one rule covers both. @@ -88,7 +98,7 @@ Three parts carry everything. The library and the designation and blueprint hook ### Defaults library, a file of names -- `DefaultsLibrary` (static) holds one entry per kind, keyed by a string: `stockpile:Stockpile`, `stockpile:Dumping`, `stockpile:`, `storage:` and `bill:*` since 1.0; `forbid:colony` and `forbid:enemies` (the forbid rules' filters) since 1.1; `bill:` and `bench:` with the bills area; `animal:*`, `animal:` and `slaughter:` with animals; `mech:*` and `mech:` (auto-repair, work mode and area) with mechs; `grower:Zone_Growing` and `grower:` with growing; `building:`, `building:*door`, `building:*lamp` and `building:*temperature` with buildings. +- `DefaultsLibrary` (static) holds one entry per kind, keyed by a string: `stockpile:Stockpile`, `stockpile:Dumping`, `stockpile:`, `storage:` and `bill:*` since 1.0; `forbid:colony` and `forbid:enemies` (the forbid rules' filters) since 1.1; `setup:` with named setups (features.md, Storage); `bill:` and `bench:` with the bills area; `animal:*`, `animal:` and `slaughter:` with animals; `mech:*` and `mech:` (auto-repair, work mode and area) with mechs; `grower:Zone_Growing` and `grower:` with growing; `building:`, `building:*door`, `building:*lamp` and `building:*temperature` with buildings. - File: `Config/BlaxDefaults/Defaults.xml` under the game's save data folder (`GenFilePaths.ConfigFolderPath`, Verse/GenFilePaths.cs:178). - Writing, in this order: 1. `Scribe.saver.InitSaving` on `Defaults.xml.tmp`, the library inside a try. On an exception: `Scribe.saver.ForceStop()` (Verse/ScribeSaver.cs:213), delete the `.tmp`, one error in the log, both files untouched. @@ -108,14 +118,14 @@ Every write happens at one creation hook, apart from the forbid rules (1.1), whi - Designation hooks: postfixes on the zone designators' `MakeNewZone` (stockpiles since 1.0, growing zones with the growing area). - Blueprint hook (1.0): a postfix on `Blueprint_Storage.PostMake`, see "New storage buildings start from your default". - Build scope (arrives with graves, mortars and other storage): a prefix on `Frame.CompleteConstruction(Pawn)` (RimWorld/Frame.cs:262) opens a `[ThreadStatic]` scope when the frame's type is exactly `Frame` and its faction is the player's. It records the frame's map, cell, `entityDefToBuild` and `glowerColorOverride` (:17), because the frame destroys itself inside the method (:280). A Harmony finalizer closes the scope, even on an exception. - - Made hook: a postfix on `ThingMaker.MakeThing(ThingDef, ThingDef)` (Verse/ThingMaker.cs:8) while the scope is open and the def is the frame's. It records the new thing and applies the defaults that must be in place before spawn (storage parents without a storage blueprint, temperature targets, door hold-open, gather spot). The postfix runs after the thing's own `PostMake`, so a turret's gun already exists (RimWorld/Building_TurretGun.cs:164-169). Nested `MakeThing` calls inside it, such as `MakeGun` making the gun (:684-688), have another def and are skipped. For every other `MakeThing` call the cost is one static field read. + - Made hook: a postfix on `ThingMaker.MakeThing(ThingDef, ThingDef)` (Verse/ThingMaker.cs:8) while the scope is open and the def is the frame's. It records the new thing and applies the defaults that must be in place before spawn (storage parents without a storage blueprint, temperature targets, door hold-open, gather spot). Storage group members without a storage blueprint get theirs through the frame instead, set in the scope's prefix (see "Graves, mortars and other storage start from your default"). The postfix runs after the thing's own `PostMake`, so a turret's gun already exists (RimWorld/Building_TurretGun.cs:164-169). Nested `MakeThing` calls inside it, such as `MakeGun` making the gun (:684-688), have another def and are skipped. For every other `MakeThing` call the cost is one static field read. - Built hook: a postfix on `Frame.CompleteConstruction` applies the defaults that spawn code would overwrite (bills, crops, trap rearm, lamp colour) to the recorded thing, only if that thing is spawned. - Replace Stuff (3526354009, 539,443, 1.7) revives a destroyed building by spawning the new building and then copying a few settings from the destroyed one it kept: its `Source/DestroyedRestore/ReviveBuilding.cs` wraps this method's `GenSpawn.Spawn` call and calls `DestroyedBuildings.ReviveBuilding` right after it. Its handlers are keyed by exact class (`BuildingReviver.cs`, `CanDo` uses `thing.GetType()`): bills for `Building_WorkTable`, the target temperature for `Building_Heater` and `Building_Cooler`, the plant for `Building_PlantGrower` and the settings for `Building_Storage`. `DestroyedBuildings.SaveBuilding` keeps no other building. The same names are in its 1.7 `Replace_Stuff.dll`. So the built hook runs on every revived building, and everything revival doesn't copy gets the default, as on any rebuild. Temperatures set by the made hook are overwritten by revival afterwards, so the old value wins. - Revival guard: the scope's prefix reads Replace Stuff's `DestroyedBuildings` map component by reflection (`AccessTools.TypeByName("Replace_Stuff.DestroyedRestore.DestroyedBuildings")`, field `destroyedBuildings`, a dictionary keyed by cell) and notes whether it holds a building at the frame's position. Revival removes the entry later in the same call. When the prefix saw one, the built hook adds no bills and sets no crop, since revival restores those. Without Replace Stuff the guard is a null check. - Exact `Frame` only: Replace Stuff's stuff replacement uses `ReplaceFrame : Frame` and completes through its own method (its `Source/Replace/ReplaceFrame.cs`, a prefix on `Frame.CompleteConstruction` that skips the vanilla body for it). That building keeps its settings. - Not covered, on purpose: god-mode instant builds, map generation, minified reinstalls, gravship landings. - Join funnel (arrives with the animal defaults; mechs reuse it): animals and colony mechs entering the player faction. Collected in postfixes on `Pawn.SetFaction(Faction, Pawn)` (Verse/Pawn.cs:2702, a prefix snapshots the old faction) and `PawnGenerator.GeneratePawn(PawnGenerationRequest)` (Verse/PawnGenerator.cs:139). Applied when the outermost known caller returns: prefix and finalizer scopes on `Hediff_Pregnant.DoBirthSpawn`, `CompHatcher.Hatch`, `RecruitUtility.Recruit`, `Pawn.PreTraded` and `Bill_ProductionMech.CreateProducts` push and pop a depth counter, and the outermost finalizer applies the collected pawns. That way the defaults land after each caller's own writes. Outside any scope they apply at the end of the collecting postfix. Humanlike pawns never enter: `RaceProps.Animal` or `IsColonyMech` is the first check. -- Unsaved transient state only: the scope fields, the collected pawn list, the new growing zones of one drag, and for pawns that join without a map a `ConditionalWeakTable` applied when they first spawn. A pawn bought into a caravan has no map, and neither has one bought from an orbital trader: `TradeShip.GiveSoldThingToPlayer` splits it off the ship, calls `PreTraded` and only then drops it in a pod (RimWorld/TradeShip.cs:199-208). `PendingJoin` carries the area label and the auto-slaughter first-animal check. The forbid rules (1.1) add their scope stack with the things recorded in it, the butchering flag and the wait list; a save and reload starts with all of them empty. +- Unsaved transient state only: the scope fields, the collected pawn list, the new growing zones of one drag, and for pawns that join without a map a `ConditionalWeakTable` applied when they first spawn. A pawn bought into a caravan has no map, and neither has one bought from an orbital trader: `TradeShip.GiveSoldThingToPlayer` splits it off the ship, calls `PreTraded` and only then drops it in a pod (RimWorld/TradeShip.cs:199-208). `PendingJoin` carries the area label and the auto-slaughter first-animal check. The forbid rules (1.1) add their scope stack with the things recorded in it, the butchering flag and the wait list; Build copy (features.md, Buildings) adds the snapshot on the selected designator and the table that carries it from blueprint to frame; a save and reload starts with all of them empty. ### Save safety @@ -181,7 +191,7 @@ Where the content lives, checked in the 1.7 `Data` folder and the decompiled Def ## Features by area -Specs grouped by area, in the order of [features.md](features.md), which is the plan of record for scope and order. Shipped features say which release they shipped in. The areas New maps and New colonies, and the features new in that plan, have no spec here yet. +Specs grouped by area, in the order of [features.md](features.md), which is the plan of record for scope and order. Shipped features say which release they shipped in. The area New maps and the other features new in that plan have no spec here yet; their plan lines carry the checked hooks. ### Defaults file and settings page @@ -330,7 +340,8 @@ Designed, no code yet. - **Players get:** Build a grave, sarcophagus, mortar, growth vat or biosculpter pod, or a modded storage building without a storage blueprint such as Rimefeller's chemfuel pump, and it starts with the default you saved for it. The storage tab's Defaults button now shows on them. A grave or sarcophagus that auto-rebuild puts back starts from your default like a new one; vanilla doesn't carry their old filter into the rebuild. Ruins, map generation and trader stock keep the game's settings. Growth vats need Biotech and biosculpter pods Ideology. - **How:** The build scope from the data model arrives here. These parents take the def default while the thing is made, not from a blueprint: graves and sarcophagi (`Building_CorpseCasket.PostMake`, RimWorld/Building_CorpseCasket.cs:51-58), the growth vat (`Building_GrowthVat.PostMake`, :231-238), the biosculpter pod (`CompBiosculpterPod.Initialize`, :249-256), a `Building_Storage` without a storage blueprint (`Building_Storage.PostMake`, RimWorld/Building_Storage.cs:142-150) and mortar shells (`CompChangeableProjectile.Initialize`, :51-58). - - The made hook applies the template to the thing's `IStoreSettingsParent`: the thing, or its first comp that is one, found the way `ITab_Storage.GetThingOrThingCompStoreSettingsParent` finds it (RimWorld/ITab_Storage.cs:153-170). Skipped for defs that have a storage blueprint, which 1.0 covers. + - The made hook applies the template to the thing's `IStoreSettingsParent`: the thing, or its first comp that is one, found the way `ITab_Storage.GetThingOrThingCompStoreSettingsParent` finds it (RimWorld/ITab_Storage.cs:153-170). Skipped for defs that have a storage blueprint, which 1.0 covers, and for the kinds in the next point. + - Storage group members without a storage blueprint (a `Building_Storage` such as Rimefeller's chemfuel hopper): after spawn, `Frame.CompleteConstruction` calls `ThingStoreSettings.CopyFrom(storageSettings)` for every `IStorageGroupMember` (RimWorld/Frame.cs:326-330). `Frame.storageSettings` is set only by `Blueprint_Storage.MakeSolidThing` (RimWorld/Blueprint_Storage.cs:96), `blueprintClass` defaults to `Blueprint_Build` (RimWorld/BuildingProperties.cs:45), and nothing assigns `Blueprint_Storage` by itself. So for these kinds the field is null and `StorageSettings.CopyFrom(null)` throws at `other.Priority` (RimWorld/StorageSettings.cs:92): the built hook never runs and the rest of the method is skipped. A template written by the made hook would survive, since the throw comes before any write, but a mod that fills the null would overwrite it. So the build scope's prefix sends these kinds through vanilla's own copy: when the built def's `thingClass` implements `IStorageGroupMember`, `frame.storageSettings` is null and the kind has a template, it sets `frame.storageSettings` to a new `StorageSettings` holding the def default with the template applied, and vanilla writes it at Frame.cs:329 without throwing. Without a template it leaves vanilla alone. Before this ships, a game without Defaults checks whether vanilla already logs that error for Rimefeller's hopper; the -Compat expectation and the README follow the result. - Turrets: the mortar's shell storage sits on its gun, not on the turret. Core puts `CompProperties_ChangeableProjectile` and `building.defaultStorageSettings` on the gun def `Artillery_Mortar` (`Buildings_Security_Turrets.xml:618-640`), and `Turret_Mortar` names it as `turretGunDef` (:576). When the made thing is a `Building_TurretGun` and has no storage parent itself, the hook resolves the parent as `ITab_Shells` does, on `turret.gun` (RimWorld/ITab_Shells.cs:5-19), and keys the kind by the turret's def, as the tab does. The gun exists by then, because `PostMake` calls `MakeGun` before `MakeThing` returns. - Rebuilds: a grave or sarcophagus has no storage blueprint, so auto-rebuild places a plain blueprint and the made hook gives the new one the template, or the def default without one. Vanilla carries settings only for `Building_Storage` (Verse/Building.cs:322-327). - The quick setup's list widens to every def with a storage tab, with the same preselection rule. @@ -339,10 +350,10 @@ Designed, no code yet. - **Save and removal:** vanilla fields on the building or its comp (`Building_CorpseCasket.ExposeData`, :61-65; `CompChangeableProjectile.PostExposeData`, :44-49). - **Overlaps:** - VFE Security (1845154007, 903,230, 1.7) adds `VFES_Turret_Artillery`, a `VFESecurity.Building_Artillery` with `ITab_Shells` and its shell storage on the gun def `VFES_Artillery_ArtilleryGun` (its 1.6 `Defs/ThingDefs_Buildings/Buildings_Artillery.xml:180-333`). The turret path covers it if that class derives from `Building_TurretGun`, which the -Compat run checks. - - Rimefeller (1321849735, 362,163, 1.7): its chemfuel pump, siphon and unloading bay are `Building_Storage` without a storage blueprint, so they become kinds here. + - Rimefeller (1321849735, 362,163, 1.7): its chemfuel pump, siphon and unloading bay (`ChemfuelHopper`, `ChemfuelSiphon`, `RefineryLoadingBay`) are `Building_Storage` without a `blueprintClass` (its 1.7 `Defs/ThingDefs_Buildings/BuildingsB_Refining.xml:3-8`), so they become kinds here and take their default through the frame's storage settings (see How). - **Replaces:** the grave and other storage defaults of 1trickPwnyta's Defaults and Set my Defaults. - **Effort:** S + S, including the build scope. -- **Tests:** With "Grave: Important, animal corpses only", a grave built through a frame takes its template and a grave spawned directly keeps the def default (humanlike corpses). A built grave narrowed by hand to human corpses and destroyed with auto-rebuild on, then rebuilt through the frame, has the template, not the hand filter. With "Mortar: high-explosive shells only", a `Turret_Mortar` completed through a frame has a gun whose `CompChangeableProjectile` allows only `Shell_HighExplosive`, and `StorageDefaultsMenu.OptionsFor` on the selected turret names "mortars" and stores under `storage:Turret_Mortar`. With Biotech, a growth vat built through a frame takes its template; with Ideology, a biosculpter pod's nutrition storage does (each skipped without). -NoDlc: the quick setup lists neither, and a saved `storage:GrowthVat` entry is kept, drawn as a disabled row with "Needs Biotech", and not counted as an inactive name. -Compat: a `VFES_Turret_Artillery` built through a frame takes its template; Rimefeller's ChemfuelHopper built through a frame takes its template. +- **Tests:** With "Grave: Important, animal corpses only", a grave built through a frame takes its template and a grave spawned directly keeps the def default (humanlike corpses). A built grave narrowed by hand to human corpses and destroyed with auto-rebuild on, then rebuilt through the frame, has the template, not the hand filter. With "Mortar: high-explosive shells only", a `Turret_Mortar` completed through a frame has a gun whose `CompChangeableProjectile` allows only `Shell_HighExplosive`, and `StorageDefaultsMenu.OptionsFor` on the selected turret names "mortars" and stores under `storage:Turret_Mortar`. With Biotech, a growth vat built through a frame takes its template; with Ideology, a biosculpter pod's nutrition storage does (each skipped without). -NoDlc: the quick setup lists neither, and a saved `storage:GrowthVat` entry is kept, drawn as a disabled row with "Needs Biotech", and not counted as an inactive name. -Compat: a `VFES_Turret_Artillery` built through a frame takes its template; Rimefeller's ChemfuelHopper built through a frame with a template takes it, and `CompleteConstruction` finishes without an exception; built without a template, it behaves as it does without Defaults, as found in the check above. - **Risks:** a storage parent that sets its settings in `SpawnSetup` overwrites ours. ### Bills @@ -372,9 +383,9 @@ Designed, no code yet. - **Players get:** A "Defaults" button in the bill window. "Make these the default for new bills" saves the ingredient filter, repeat and count values, pause, radius, skill range, store mode, "slaves only", "mechs only" or "non-mechs only", the counting options and "limit to allowed stuff". "Make these the values for every new bill" copies the shared values into the global set. "Forget the default for " asks first. New bills of that recipe start from it, at any workbench. Values that match your every-bill values aren't saved for the recipe, so they keep following the every-bill values when you change those. - **How:** A postfix on `Dialog_BillConfig.DoWindowContents` (RimWorld/Dialog_BillConfig.cs:114) draws a 150 by 30 button at the top right of the 800 by 664 window (`:46`), right of the title, which ends at x 440 (`:117`). The bill is the protected field `bill` (`:16`). - - BillTemplate: the fields from "Values for every new bill" plus ingredient `allowed` and `refused` defNames (built only from defs the recipe's `fixedIngredientFilter` allows, Verse/RecipeDef.cs:33), special filters, `limitToAllowedStuff` and a restriction (any, slaves only, mechs only, non-mechs only). + - BillTemplate: the fields from "Values for every new bill" plus ingredient `allowed` and `refused` defNames (built only from defs the recipe's `fixedIngredientFilter` allows, Verse/RecipeDef.cs:33), special filters, `limitToAllowedStuff` and a restriction (any, slaves only, mechs only, non-mechs only). The two ingredient lists hold only the difference from what a new bill of that recipe gets (see Sparse): `allowed` the defs the bill allows that a new bill refuses, `refused` the reverse. Applying writes each resolved def onto the new bill's filter with `SetAllow`. - Left out, because they belong to one save: pawn restriction, the store and include groups, the custom name, style and xenogerm. A bill set to "take to stockpile X" saves best stockpile; the button's tooltip says so. - - Sparse: "Make default" stores only the fields whose value differs from what a new bill of that recipe gets at that moment, the game's value with the every-bill values on top. The ingredient filter is stored only when it differs from the recipe's `defaultIngredientFilter` (Verse/RecipeDef.cs:35, copied into every new bill at RimWorld/Bill.cs:156), and the restriction only when it isn't "any". Fields not stored follow the every-bill value, so a later change there still reaches this recipe. The settings page shows them as "follows every-bill value". + - Sparse: "Make default" stores only the fields whose value differs from what a new bill of that recipe gets at that moment, the game's value with the every-bill values on top. The ingredient filter is stored only where it differs from the recipe's `defaultIngredientFilter` (Verse/RecipeDef.cs:35, copied into every new bill at RimWorld/Bill.cs:156), and the restriction only when it isn't "any". Once "Materials no new bill uses" (features.md, Bills) has a list, a new bill gets `defaultIngredientFilter` minus the listed materials, so the difference is taken from that: a listed material the player ticks again is stored as an explicit allow, the only thing that wins over the list. Fields not stored follow the every-bill value, so a later change there still reaches this recipe. The settings page shows them as "follows every-bill value". - Applied in the `MakeNewBill` postfix after the global values, so a stored recipe field wins over the global one. - Restrictions go through `SetAnySlaveRestriction`, `SetAnyMechRestriction` and `SetAnyNonMechRestriction` (Bill.cs:173-197), under the conditions the vanilla menu uses (Dialog_BillConfig.cs:550-575): slaves only with Ideology, mech restrictions with Biotech and `MechWorkUtility.AnyWorkMechCouldDo(recipe)`. Without the DLC a stored restriction is skipped when a bill is made, the bill takes anyone, and the restriction stays in the file for when the DLC is back. The settings page's summary of that recipe default marks it "Needs Ideology" or "Needs Biotech". - The settings page lists recipe defaults with a summary and Forget. Editing happens in the bill window: change a bill, make it the default again. @@ -541,7 +552,7 @@ Designed, no code yet. - Area: `map.areaManager.GetLabeled(label)` (Verse/AreaManager.cs:86) on `pawn.MapHeld`, when `Area.AssignableAsAllowed()` (Verse/Area.cs:115), written with `playerSettings.AreaRestrictionInPawnCurrentMap` (Pawn_PlayerSettings.cs:85-110). Skipped when `SupportsAllowedAreas` is false (:133-143: roamers and races with `disableAreaControl`). A label missing on that map leaves the area alone. An animal with no map yet (bought into a caravan or from an orbital trader) goes into the pending table, and a postfix on `Pawn.SpawnSetup` (Verse/Pawn.cs:1366) applies it on its first spawn that isn't `respawningAfterLoad`. - Follow flags: `followDrafted` and `followFieldwork` (Pawn_PlayerSettings.cs:21-23). - Training, read from `DefDatabase`, so modded trainables appear. Every "don't want" entry is applied before any "want" entry, because `SetWantedRecursive(td, false)` also un-wants everything that needs `td`, and wanting `td` also wants its prerequisites (RimWorld/Pawn_TrainingTracker.cs:199-217). Want: `training.SetWantedRecursive(td, true)`, only when `CanAssignToTrain(td).Accepted` (:95). Don't want: `SetWantedRecursive(td, false)`. Tameness is never turned off. Odyssey's six trainables (`[MayRequireOdyssey]`, RimWorld/TrainableDefOf.cs:12-28) show only when Odyssey loads them; a row naming one is kept and skipped without it. The edit window refuses a row that wants a trainable while its prerequisite is "don't want" (Release wanted, Obedience don't want) and says why. - - Size: `CanAssignToTrain` checks `td.minBodySize` against the pawn's current body size (:137, :152; Core `Trainables.xml:54` Rescue 0.65, `:74` Haul 0.40), so a juvenile or newborn fails it and the want is skipped. Defaults apply once and keep no state, so nothing re-applies when the animal grows; the backlog has the stateless way to do it. + - Size: `CanAssignToTrain` checks `td.minBodySize` against the pawn's current body size (:137, :152; Core `Trainables.xml:54` Rescue 0.65, `:74` Haul 0.40), so a juvenile or newborn fails it and the want is skipped. Defaults apply once and keep no state, so nothing re-applies when the animal grows; "Young animals learn what they outgrew" (features.md, Animals) is the stateless way to add those wants, off by default. - Castes guard: when Blax Castes with its read-only API is active (`CastesApi` version 1), `CastesApi.CasteIdOf(Pawn)` is bound by reflection, and a pawn with a caste is skipped (see "Works with the other Blax mods"). - **Settings:** `animalDefaults` (on). - **Save and removal:** vanilla fields (`Pawn_PlayerSettings.ExposeData`, :199; `Pawn_TrainingTracker.ExposeData`, :37). Pending entries aren't saved: an animal bought into a caravan that is saved and reloaded before it arrives lands unrestricted, as in vanilla. @@ -689,7 +700,7 @@ Designed, no code yet. - Package ids: `blax.slaves`, `blax.castes`, `blax.zones`, `blax.defaults`. No hard dependencies. Defaults lists no sibling in About.xml and no sibling lists Defaults, so the load order doesn't matter. Defaults offers no API in 1.x. - Detection: one Compat helper, `ModLister.GetActiveModWithIdentifier(id, ignorePostfix: true)`. Sibling APIs are bound by reflection (`AccessTools.TypeByName`, `AccessTools.Method`) into cached delegates at startup; a missing sibling or method is a silent no-op. -- Ownership line for every Blax design doc: "Defaults: starting settings of vanilla stockpiles and growing zones, storage buildings, production bills, workbenches, buildings, animals and mechs, and what the game forbids when pawns go down, die or are stripped. It writes when something is made or joins, and through its opt-in forbid rules when a pawn goes down, dies or is stripped. It keeps nothing in the save." +- Ownership line for every Blax design doc: "Defaults: starting settings of vanilla stockpiles and growing zones, storage buildings, production bills, workbenches, buildings, animals and mechs, the named areas a new map starts with, and what the game forbids when pawns go down, die or are stripped. It writes when something is made or joins, and through its opt-in forbid rules when a pawn goes down, dies or is stripped. It keeps nothing in the save." ### Blax Castes: how Defaults defers @@ -698,8 +709,8 @@ Castes owns every humanlike player pawn: colonists, slaves and prisoners, their - Pawn filter: the join funnel checks `RaceProps.Animal` or `IsColonyMech` first, so Defaults never writes to a humanlike pawn, with or without Castes. The forbid rules (1.1: `Pawn.Kill`, `Pawn_HealthTracker.MakeDowned` and `Pawn.Strip`) see any pawn, colonists and slaves included, but write only the forbidden flag on its corpse and on the things it drops or is stripped of, never a caste slot. Castes' join hooks filter the other way round on `RaceProps.Humanlike` (`JoinHooks.Watching` in blax-castes), so no pawn reaches both join funnels. - Caste guard: when Castes' read-only API is active (`CastesApi` version 1, where `CasteIdOf` arrives), Defaults binds `CastesApi.CasteIdOf(Pawn)`, checks `Active`, and skips any animal or mech that has a caste. Today none can; the guard keeps Castes in charge if it ever adds animal or mech castes. - Policies: Defaults never creates, edits or assigns an apparel, food, drug or reading policy and adds nothing to the four policy dialogs. Castes' starter castes still find the Slave outfit and Simple food by their starting labels. -- Medical care: Defaults never writes `PlaySettings` medical defaults or a pawn's medical care. Animal medical care stays with the vanilla "Default medical care" window. -- Areas: Castes' allowed area slot gives humanlike pawns an allowed area by name; Defaults gives animals and mechs one by name. Only Defaults' "Areas every new map starts with" (features.md, New maps) creates areas, the named ones both mods then find. Neither mod can pick one of Zones' work rule areas, which aren't vanilla areas (see "Blax Zones"). +- Medical care: Defaults writes it only for animals: per species when they join, after the game's `ResetMedicalCare` in `SetFaction` (Verse/Pawn.cs:2753), and from the mother when they are born (features.md, Animals, "Medical care per species"). A species without a value keeps vanilla's tamed-animal setting from the "Default medical care" window. Defaults never writes `PlaySettings` medical defaults or the medical care of a humanlike pawn: colonist, slave, prisoner, ghoul, guest or enemy. +- Areas: Castes' allowed area slot gives humanlike pawns an allowed area by name; Defaults gives animals and mechs one by name. Defaults creates its named areas on every new home map ahead of time ("Areas every new map starts with", features.md, New maps); Castes' "Create area" button creates a missing one for its slot on demand (`AreaManager.TryMakeNewAllowed`). Both make plain vanilla allowed areas found by label, so each mod finds the other's. Neither mod can pick one of Zones' work rule areas, which aren't vanilla areas (see "Blax Zones"). - Bills: "slaves only" in a bill default is a bill setting. Castes' work slot decides who does a work type; the bill decides who may take that bill. - Both mods postfix `Pawn.SetFaction`. The postfixes compose, and neither writes the other's pawns. @@ -747,15 +758,16 @@ Laws is designed on its branch `design/act-catalogue` and not accepted yet. Its - Done (2026-11-29), after Zones' work rule areas (its 1.6): Castes `docs/design.md`, Zones `docs/design.md`, Slaves `docs/roadmap.md` and this doc carry the same Zones sentence ("per-cell work rules (work rule areas); it never changes a pawn's work priorities or allowed area") and say "allowed area" for Castes' area slot. Slaves' package ids gain `blax.defaults`. - Done (2026-12-01), from the plan by area, applied by the Castes and Zones plans on their `plan/features` branches: Castes `docs/design.md`, its "Blax Defaults" section, "Defaults 1.3 reads `Active` and `CasteIdOf`" becomes "Defaults' animal and mech defaults read `Active` and `CasteIdOf`". Zones `docs/design.md`, its Blax Defaults note, "`Designator_ZoneAdd_Growing` (its 1.4)" becomes "(its growing area)" and "Defaults' build scope (its 1.2)" becomes "Defaults' build scope (with graves, mortars and other storage)". References to shipped releases (1.0, the forbid rules' 1.1) stay. +- Open (2026-12-01), from the plan review, for Castes `docs/design.md`, Zones `docs/design.md`, Slaves `docs/roadmap.md` and Laws' design on `design/act-catalogue`: the Defaults sentence of the ownership line gains "the named areas a new map starts with" as above, and the Castes sentence reads "every humanlike player pawn's policy default (...)" instead of "every per-pawn policy default (...)", because Defaults writes animals' medical care. +- Open (2026-12-01), from the plan review, Castes `docs/design.md` on `plan/features`: its "Blax Defaults" section lists medical care with Defaults' animal defaults ("area, follow flags, training and medical care per species"), and its backlog line on Blax Defaults adds medical care to what the species rows cover ("follow, training, area, medical care and control group work modes"). ## Backlog -- Planned in features.md (New maps): areas every new map starts with, named and coloured (M): asked for on Defaults' page (2025-06-17, 2025-07-27). Created with `AreaManager.TryMakeNewAllowed` (Verse/AreaManager.cs:147) in a `MapGenerator.GenerateMap` postfix. Castes' allowed area slot and Defaults' animal areas then resolve on new maps. -- New colonies (M), waits for Fabian's call (features.md, "Open questions"): play settings (auto rebuild, auto home area, manual priorities, zone visibility) and the default medical care for tame animals, wildlife, entities and other factions' pawns, written once when a new game starts. Save Storyteller Settings (3744418945, 31,979, no 1.7) and New Game Plus (23k) show demand for new-game setup, but it pays off once per colony and our colonies run for years. It never carries the medical defaults for colonists, slaves, prisoners or ghouls, which are humanlike player pawns and Castes' side. Storyteller and world presets are cut. -- Planned in features.md (Buildings): Build copy carries bills and storage settings (S): vanilla copies stuff, style, precept and lamp colour only (RimWorld/BuildCopyCommandUtility.cs:11-14). Needs an unsaved link from the blueprint to the source building. Asked for in the Steam thread "Why does 'build copy' not copy the settings too?" (2021-10-10, https://steamcommunity.com/app/294100/discussions/0/3087772148447673742/). -- Planned in features.md (Animals, as "Young animals learn what they outgrew"): young animals get size-gated training when they grow (S): a postfix on `LifeStageWorker.Notify_LifeStageStarted` (called from `Pawn_AgeTracker.RecalculateLifeStageIndex`, Verse/Pawn_AgeTracker.cs:577) for player animals, skipped when the previous life stage is null, as it is on load. It wants each trainable the species default wants that the animal was too small for at the previous stage and can be assigned now. No saved state; it would reach animals that predate the default, so it needs its own switch. +- Planned in features.md (New maps): areas every new map starts with, named and coloured (M): asked for on Defaults' page (2025-06-17, 2025-07-27). A postfix on `AreaManager.AddStartingAreas` (Verse/AreaManager.cs:32, called at Verse/MapGenerator.cs:183 before any content) renames vanilla's "Area 1" into the first name and makes the rest with `AreaManager.TryMakeNewAllowed` (:147), on player home maps that aren't gravship landings, up to the cap of 10. Starting animals and mechs spawn later in the same map generation, so their areas resolve; Castes' allowed area slot resolves too. +- Planned in features.md (Buildings): Build copy carries bills and storage settings (S): vanilla copies stuff, style, precept and lamp colour only (RimWorld/BuildCopyCommandUtility.cs:11-14). A snapshot of the source's settings, taken when the Build copy button is clicked and cleared when the designator is deselected, rides on the storage blueprint's own settings or in an unsaved table from blueprint to frame; the plan line has the hooks. Asked for in the Steam thread "Why does 'build copy' not copy the settings too?" (2021-10-10, https://steamcommunity.com/app/294100/discussions/0/3087772148447673742/). +- Planned in features.md (Animals, as "Young animals learn what they outgrew", part of the first animal step): young animals get size-gated training when they grow (S): a postfix on `LifeStageWorker.Notify_LifeStageStarted` (called from `Pawn_AgeTracker.RecalculateLifeStageIndex`, Verse/Pawn_AgeTracker.cs:577) for player animals, skipped when the previous life stage is null, as it is on load. It wants each trainable its source wants that the animal was too small for at the previous stage and can be assigned now. The source is the one birth uses: the living mother's current wishes when she is yours and the species switch "Born animals use this default instead" is off, otherwise the species row, then the every-animal row. It only adds wants. No saved state; it reaches animals that predate the default, so it ships off behind its own switch and is named as an exception in "Defaults I picked". - Preset Filtered Zones support (S): a reflection-guarded postfix on its `Designator_PresetZoneAdd.MakeNewZone`, keyed by its `PresetZoneType`, and its zones accepted by the storage tab button. Only worth it if the mod enters the list. -- Several named defaults per kind, picked from the Defaults menu (S): asked for on Defaults' page (2026-01-31). +- Several named defaults per kind, picked from the Defaults menu (S): asked for on Defaults' page (2026-01-31). Planned in features.md as part of Storage's named setups. - Control groups added later start in a work mode by group number (S): a postfix on the private `Pawn_MechanitorTracker.Notify_ControlGroupAmountMayChanged` (:217). - Beds in a hospital room start as medical beds, refuel targets per building (S each). - Export and import of the defaults file, to share it between players (S). @@ -766,12 +778,13 @@ Laws is designed on its branch `design/act-catalogue` and not accepted yet. Its - A per-colony override ("this colony differs") and multiplayer, moved from the backlog on 2026-12-01: both need the active defaults in the save, and Defaults keeps nothing there. Multiplayer would also need a 1.7 build of the Multiplayer mod to test. - Storyteller, difficulty, world seed and faction presets for new colonies (2026-12-01): a new-game screen tool, not a starting setting of something the player makes, and the bulk that made players find 1trickPwnyta's Defaults too big (Castes' Cut). Save Storyteller Settings (3744418945, 31,979, no 1.7) covers the storyteller part. +- Play settings and medical defaults for new colonies (cut after the plan review, 2026-12-01; features.md's open question 1 asks Fabian whether to take them back): auto home area, auto rebuild, zone visibility and the default medical care for tame animals, wildlife and entities are a new-game screen tool too, for the reason above, and pay off once per colony while our colonies run for years. Manual work priorities (`PlaySettings.useWorkPriorities`, RimWorld/PlaySettings.cs:48) changes how every colonist's work priorities work, which Castes' work slot reads, so it is Castes' ground. Medical care for other factions' pawns sets what humanlike guests and downed raiders get. Tame-animal care is the fallback of "Medical care per species". Save Storyteller Settings and New Game Plus (23k) show demand for new-game setup; the unofficial Defaults 1.7 repack (3836680679, 145, 1.7) still carries these settings. - Anything for colonists, slaves or prisoners: policies, medical care, schedule, work priorities, weapon loadout, hostility, self-tend, carried medicine, fire at will, area, prisoner interaction. Those are Castes'. Pregnancy approach and the starting xenotype are per-pawn humanlike settings too; if anyone builds them, Castes' DLC switches are the place. Baby feeding is stored per baby and per feeder, and Castes cut its baby autofeed slot. - Policy contents and default policies (the starting sets, what a new policy allows): policies are save objects that castes reference, and Castes' caste templates across saves move policies between colonies as files. - Editing defs at startup (`defaultStorageSettings`, `defaultPlantToGrow`, `defaultTargetTemperature`): it also hits ruins, map generation and trader stock, can't tell what the player built, breaks "Load the game's default", and must match across multiplayer clients. - An animal food policy: 1.7 has none (`Pawn_FoodRestrictionTracker.Configurable` is humanlike only, RimWorld/Pawn_FoodRestrictionTracker.cs:34-44). Adding one is a system, not a default; Animal Controls does it. - Per-animal slaughter, milking or shearing flags: vanilla has only per-map, per-species auto-slaughter limits. -- Re-applying defaults on load, on a timer, or to existing things when a default changes: it would fight hand changes. "Load your default" covers the explicit case. +- Re-applying defaults on load, on a timer, or to existing things when a default changes: it would fight hand changes. "Load your default" covers the explicit case. "Young animals learn what they outgrew" is not this: it acts once per life stage, only adds training wants, and ships off (see "Defaults I picked"). - Bills on benches the player didn't build (ruins, outposts): the cook walks there. - Surgery bill defaults: `Bill_Medical`, and Slaves keeps those bills through status changes. - Patching `StorageSettings.SetFromPreset`, `Zone_Growing.SetPlantDefToGrow`, `BillStack.AddBill` or `ForbidUtility.SetForbiddenIfOutsideHomeArea`: one- to five-line methods the JIT may inline. Patching `ForbidUtility.SetForbidden`: player designators use it. The 1.1 recorder on the `CompForbiddable.Forbidden` setter only reads, and only inside a downing or a death. diff --git a/docs/features.md b/docs/features.md index 7d7b3f8..cdf777c 100644 --- a/docs/features.md +++ b/docs/features.md @@ -4,7 +4,7 @@ When Blax Defaults is complete, everything you designate, build, tame or gestate Status: 1.0 (storage defaults, values for every new bill) and 1.1 (forbid rules) are on the Workshop as item 3848261264, 1.1.0 since 2026-11-30. Everything else is designed in [design.md](design.md) or new in this plan, with no code yet. -Planned 2026-12-01. This file is the plan of record for what the mod covers and in which order the areas come. [design.md](design.md) holds the spec of every designed feature. +Planned 2026-12-01 and reviewed the same day (the fixes are listed at the top of design.md). This file is the plan of record for what the mod covers and in which order the areas come. [design.md](design.md) holds the spec of every designed feature. ## Scope @@ -15,11 +15,11 @@ Blax Defaults covers: - what the game forbids when a pawn goes down, dies or is stripped (opt-in forbid rules); - one defaults file per player, shared by every save. -Every feature keeps the design's rules: nothing changes until you save a default or turn a rule on; a default applies once, when the thing is made or joins, never to what you already have; nothing goes into the save; any DLC combination works, core only included; every feature has a toggle; no new art. +Every feature keeps the design's rules: nothing changes until you save a default or turn a rule on; a default applies once, when the thing is made or joins, never to what you already have, apart from the forbid rules and "Young animals learn what they outgrew", which both ship off; nothing goes into the save; any DLC combination works, core only included; every feature has a toggle; no new art. Left to the other Blax mods: -- Blax Castes: every humanlike player pawn and its per-pawn settings (policies, medical care, schedule, work priorities, weapon loadout, allowed area, hostility, self-tend, carried medicine, fire at will, prisoner interaction), and caste templates across saves. Defaults never writes to a humanlike pawn. +- Blax Castes: every humanlike player pawn and its per-pawn settings (policies, medical care, schedule, work priorities, weapon loadout, allowed area, hostility, self-tend, carried medicine, fire at will, prisoner interaction), and caste templates across saves. Defaults never writes to a humanlike pawn. Castes' allowed area slot can create a missing area on demand; Defaults creates its named areas when a map is made, and each mod finds the other's by label. - Blax Zones: delivery and sleeping zones, beds by zone, drop spots and work rule areas. "Make default" for its own zones lives in Zones, in its own file. - Blax Slaves: slave status, trade, prices, suppression, slave medicine and the surgery bills it keeps through status changes. - Blax Laws (designed on branch `design/act-catalogue`, not accepted yet): lawbook, cases, punishments and court. Its "lawbook templates shared across saves" stay in Laws: Laws keeps its own file under the game's Config folder and copies Defaults' write, read-back and backup rules. Defaults' file never holds a lawbook. Laws' arrests and subdue meet the forbid rules only through vanilla calls (design.md, "Blax Laws"). @@ -35,10 +35,9 @@ Defaults are only worth setting up if they survive mod updates, broken files and - **Defaults library and settings page.** One file shared by every save, written through a temporary file, read back and backed up; every saved default with Edit and Forget. Shipped 1.0. - **Overlap warnings.** Mods that set the same things are named on the settings page and once per session, with "Don't remind me". Shipped 1.0; each area adds the mods of its category. - **Add a default and drop inactive names.** Make a default from the main menu, and clear the names a removed mod left in an entry. Designed ([spec](design.md#add-a-default-and-drop-inactive-names)). -- **Several named defaults per kind.** "Meals shelf" and "Medicine shelf" for the same shelf kind, loaded from the Defaults menu; new shelves still take the main one. Idea, asked once on 1trickPwnyta's Defaults page (2026-01-31). - **Export and import of the defaults file.** Share a setup with another player. Idea; 1trickPwnyta's Defaults has backup and restore. -Steps: "Add a default and drop inactive names" ships with the rest of storage, because its picker lists the storage kinds that step adds. The two ideas follow demand. +Steps: "Add a default and drop inactive names" ships with the rest of storage, because its picker lists the storage kinds that step adds. Export and import follows demand. ### Storage @@ -49,7 +48,11 @@ Every new shelf starts at Preferred and pulls meals out of the freezer, and ever - **Defaults button in the storage tab**: make, load, load the game's default, forget. Shipped 1.0. - **Quick setup: new shelves start empty**, per kind, leaving hoppers and single-purpose storage alone. Shipped 1.0. - **Graves, mortars and other storage start from your default**: graves, sarcophagi, mortars, growth vats, biosculpter pods and modded storage without a storage blueprint. Designed ([spec](design.md#graves-mortars-and-other-storage-start-from-your-default)). Needs: growth vats Biotech, biosculpter pods Ideology. It brings the build scope, the hook that bills for new workbenches, growers and building settings use. -- **Your own stockpile types.** Save a stockpile setup under a name ("Freezer", "Armory", "Medicine") and it appears in the Zone menu as a stockpile designator of its own; dragging it makes a plain vanilla stockpile with that setup. Removing the mod keeps every stockpile. New. Demand: custom stockpile types in 1trickPwnyta's Defaults (75k, no official 1.7 build), Preset Filtered Zones (Continued) (16k, 1.7), Simple Stockpile Presets (Continued) (16k, 1.7), and the manual save and load of [KV] Save Storage (109k, 1.7). Hook: one `Designator_ZoneAddStockpile` subclass instance per saved type, added to the Zone category's private `resolvedDesignators` list (`DesignationCategoryDef`; the field and the `AllResolvedDesignators` getter are checked in the 1.7.5021 reference assembly). The shipped stockpile hook applies the type's template. Vanilla stockpile icon, no art. +- **Named setups.** Save the settings of a stockpile or storage building under a name ("Freezer", "Armory", "Meals shelf") and load it onto any stockpile or storage building from the storage tab's Defaults menu; loading never widens what a building takes. A named setup can also go into the Zone menu as a stockpile designator of its own, and dragging it makes a plain vanilla stockpile with that setup. New stockpiles and shelves still start from their kind's default. Removing the mod keeps every stockpile. New; it joins the earlier "your own stockpile types" and the idea "several named defaults per kind" (asked once on 1trickPwnyta's Defaults page, 2026-01-31), since both are named setups of the same storage settings. Demand: custom stockpile types in 1trickPwnyta's Defaults (75k, no official 1.7 build), Preset Filtered Zones (Continued) (16k, 1.7), Simple Stockpile Presets (Continued) (16k, 1.7), and the save and load by name of [KV] Save Storage (109k, 1.7). Hook, checked against the shipped code and 1.7.5021: + - Each setup has its own library key, `setup:`. + - Its designator is an instance of one Blax subclass of `Designator_ZoneAddStockpile`. `AllResolvedDesignators` returns the Zone category's private list itself (Verse/DesignationCategoryDef.cs:77), and the architect reads that list on every draw (RimWorld/ArchitectCategoryTab.cs:49), so adding or removing an instance when a setup is saved, renamed or forgotten needs no reflection. The constructor sets `hotKey = null`: `Designator_ZoneAdd` gives every zone designator Misc6 (RimWorld/Designator_ZoneAdd.cs:40), the dumping stockpile's key. + - The shipped stockpile hook can't tell instances apart as it is: `StockpileTypeOf` keys any modded designator by its class (`Source/BlaxDefaults/StorageKinds.cs:188-198`), and `BuildStockpileTypes` adds one "modded designator" type per class it finds in that list (:294-311). So `StockpileTypeOf` checks for the Blax subclass first and returns that instance's setup, and `BuildStockpileTypes` skips the subclass. + - Vanilla stockpile icon, no art. Test: two named setups, one drag with each; each new zone carries its own setup, and the storage tab's stockpile submenu gains no entry. - **Preset Filtered Zones support.** Its zones get the Defaults button and its designators a default. Idea, only if the mod enters the tested list. - **Gravship-start shelves** (Odyssey). Idea; Odyssey isn't installed on the test machine. @@ -57,7 +60,7 @@ Steps, in order: 1. Shipped in 1.0. 2. Graves, mortars and other storage, with "Add a default and drop inactive names". -3. Your own stockpile types. It reuses the editor "Add a default" opens. +3. Named setups. It reuses the editor "Add a default" opens. ### Bills @@ -66,14 +69,16 @@ Every new bill searches the whole map, takes any ingredient and sends products t - **Values for every new bill**: repeat mode, counts, radius, skill range, where products go, counting options. Shipped 1.0. - **Defaults per recipe from the bill window.** "Make these the default for new simple meal bills", ingredient filter and restrictions included. Designed ([spec](design.md#defaults-per-recipe-from-the-bill-window)). Needs: "slaves only" Ideology, the mech restrictions Biotech. - **Bills for new workbenches.** A new or rebuilt electric stove comes with the bills you saved for stoves, in order. Designed ([spec](design.md#bills-for-new-workbenches)). Needs the build scope from storage. -- **Materials no new bill uses.** A list of materials (hyperweave, thrumbofur, gold, jade) that every new bill refuses where its recipe would take them, unless that recipe's own default allows them. A bill never ends up with no allowed ingredient. New. Demand: Material Filter (11k, no 1.7 build) lets players filter bills by material by hand, one bill at a time. Hook: the shipped `MakeNewBill` postfix, after the recipe default, `ingredientFilter.SetAllow(def, false)` for each listed def the recipe's fixed ingredient filter allows. +- **Materials no new bill uses.** A list of materials (hyperweave, thrumbofur, gold, jade) that every new bill refuses where its recipe would take them, unless that recipe's own default explicitly allows them again. A recipe for which the list would leave one of its ingredients with nothing allowed keeps its filter, so no new bill is left unable to run. New. Demand: Material Filter (11k, no 1.7 build) lets players filter bills by material by hand, one bill at a time. + - Precedence: a recipe default saves its ingredient filter only as the difference from what a new bill of that recipe gets at that moment ([sparse rule](design.md#defaults-per-recipe-from-the-bill-window)), which is the recipe's `defaultIngredientFilter` minus the listed materials. A listed material the player ticks again on a bill is saved as an explicit allow, and only such an allow wins over the list. A recipe default that only refuses human leather leaves the list in force. + - Hook: the shipped `MakeNewBill` postfix, before the recipe default: `ingredientFilter.SetAllow(def, false)` for each listed def the bill's filter allows, skipped for the whole recipe when an entry of `recipe.ingredients` would be left with nothing allowed. The recipe default's allows and refuses then apply on top. Steps, in order: 1. Shipped in 1.0. 2. Defaults per recipe. It needs no build scope. 3. Bills for new workbenches. Each set entry is a full recipe default, and the bench hook needs the build scope. -4. Materials no new bill uses. Its precedence rule ("unless the recipe default allows it") needs recipe defaults. +4. Materials no new bill uses. Its precedence rule needs recipe defaults that save their filter as a difference. ### Forbid rules @@ -95,16 +100,15 @@ Every tamed husky starts with no area and no training, every animal gets the sam - **Species defaults when an animal joins**: area by name, follow when drafted, follow during fieldwork, training, per species and for every animal. Designed ([spec](design.md#species-defaults-when-an-animal-joins)). It brings the join funnel, which mechs reuse. - **Born animals copy their mother**, or take the species default per a switch. Designed ([spec](design.md#born-animals-copy-their-mother)). - **Defaults button in the Training tab.** Designed ([spec](design.md#defaults-button-in-the-training-tab)). -- **Medical care per species.** The species and every-animal rows gain medical care: chickens get no medicine, the thrumbo the best. Born animals copy their mother's. New. Demand: vanilla's "Default medical care" window has one setting for every tame animal, and Animal Controls (57k, no 1.7 build) copies medical care to newborns. Hook: `Pawn_PlayerSettings.medCare` (checked in the 1.7.5021 reference assembly), written in the join funnel after the game's own faction change. +- **Medical care per species.** Species rows gain medical care: chickens get no medicine, the thrumbo the best. A species without a value keeps what the game gives every tame animal, the tamed-animal setting of vanilla's "Default medical care" window; the every-animal row has no medical care, so that window stays the one place for the colony-wide value. Born animals copy their mother's. Animals only: Defaults never writes a humanlike pawn's medical care or the `PlaySettings` defaults. New. Demand: vanilla's window has one setting for every tame animal, and Animal Controls (57k, no 1.7 build) copies medical care to newborns. Hook, checked against 1.7.5021: `Pawn_PlayerSettings.medCare` (RimWorld/Pawn_PlayerSettings.cs:27), written in the join funnel after the game's `ResetMedicalCare` (:342-364), which `Pawn.SetFaction` calls (Verse/Pawn.cs:2753). - **Auto-slaughter limits for new species and new maps.** Designed ([spec](design.md#auto-slaughter-limits-for-new-species-and-new-maps)). -- **Young animals learn what they outgrew.** Training the species default wants, which a pup was too small for, is wanted when it reaches the next life stage. Without it, a species default never gives a newborn Haul or Rescue. New (from the backlog). Hook: a postfix on `LifeStageWorker.Notify_LifeStageStarted`, with its own switch, since it also reaches animals that predate the default. +- **Young animals learn what they outgrew.** When one of your animals reaches its next life stage, it wants the training it was too small for at the previous stage and can be assigned now. The wishes come from the source birth uses: its mother's current wishes while the mother is alive and yours and the species switch "Born animals use this default instead" is off, otherwise the species row, then the every-animal row. Birth copies only what a newborn can be assigned, so without this a pup never gets Haul or Rescue. It only ever adds a want, never removes one. It reaches animals you already have, including ones that joined before the default existed or changed, so it is an exception to "a default applies once" ([design.md](design.md#defaults-i-picked)) and ships off behind its own switch. New (from the backlog). Hook, checked against 1.7.5021: a postfix on `LifeStageWorker.Notify_LifeStageStarted` (called from Verse/Pawn_AgeTracker.cs:577), skipped when the previous life stage is null, as on load. The mother is the Parent relation birth and hatching add (Verse/Hediff_Pregnant.cs:180, RimWorld/CompHatcher.cs:103), read with `GetMother` (RimWorld/ParentRelationUtility.cs:40). No saved state. Test: a player husky mother with Haul wanted and no species row; her pup wants Haul once it reaches the juvenile stage. - **New pens start with your settings.** A pen marker you build takes the animal filter and auto-cut setting you saved for pens. Idea. Hook: `CompAnimalPenMarker.AnimalFilter`, `CompAutoCut.autoCut` and `AutoCutFilter` (checked in the reference assembly), through the build scope. Steps, in order: -1. Species defaults, born animals, the Training tab button and medical care per species. They share one species row, one edit window and the join funnel. +1. Species defaults, born animals, the Training tab button, medical care per species and young animals learn what they outgrew. They share one species row, one edit window, the join funnel and the training code, and the growth step fills the hole birth leaves. 2. Auto-slaughter limits. Same funnel, its own window button. -3. Young animals learn what they outgrew. It completes the training wishes step 1 had to skip. ### Mechs @@ -118,11 +122,15 @@ One step: auto-repair, work mode, area and the gizmo share the mech row, the joi ### New maps -Every new map starts with only the home area, so the defaults that pick an area by name (animals, mechs, Castes' allowed area slot) find nothing until you paint one. +Every new map starts with the home area and one empty allowed area, "Area 1" (Verse/AreaManager.cs:32-45), so the defaults that pick an area by name (animals, mechs, Castes' allowed area slot) find nothing until you make and paint one. -- **Areas every new map starts with.** Named, coloured areas ("Barn", "Inside", "Fields") created empty on every new player home map, ready to paint. New (from the backlog; asked on 1trickPwnyta's Defaults page on 2025-06-17 and 2025-07-27). Hook: `AreaManager.TryMakeNewAllowed` in a `MapGenerator.GenerateMap` postfix. +- **Areas every new map starts with.** Up to 10 named, coloured areas ("Barn", "Inside", "Fields") on every new player home map, empty and ready to paint. Vanilla's empty "Area 1" becomes the first of them, so no unused area is left over. New (from the backlog; asked on 1trickPwnyta's Defaults page on 2025-06-17 and 2025-07-27). Hook, checked against 1.7.5021: + - A postfix on `AreaManager.AddStartingAreas` (Verse/AreaManager.cs:32), which `MapGenerator.GenerateMap` calls once per map before any content is generated (Verse/MapGenerator.cs:183). Starting animals and mechs spawn during content generation (`GenStep_ScenParts`, RimWorld/GenStep_ScenParts.cs:11, generating them at RimWorld/ScenPart_StartingAnimal.cs:167), so their pending area finds its label when they spawn. A `MapGenerator.GenerateMap` postfix would come after them. + - Only when `map.IsPlayerHome` (Verse/Map.cs:354). + - Vanilla's area is the one `Area_Allowed` the base call made; it is renamed and recoloured with `Area_Allowed.SetLabel` and `SetColor` (RimWorld/Area_Allowed.cs:75-84). The others come from `TryMakeNewAllowed` (Verse/AreaManager.cs:147). A name `GetLabeled` already finds is skipped, and creating stops when `CanMakeNewAllowed` is false. A map holds at most 10 allowed areas (:13, :142-145), so the settings list takes at most 10 names and says why. + - Gravship landing maps (Odyssey) are skipped, as vanilla skips its own "Area 1" there (:42). The ship brings its allowed areas and recreates them by label (RimWorld.Planet/MoveableArea_Allowed.cs:31-35), and named areas made first could fill the cap and lose one of the ship's areas with its pawn assignments. -One step. +One step. If Fabian takes in play settings for new colonies (see "Open questions"), the area becomes "New maps and colonies" with that as its second step. ### Growing @@ -138,7 +146,11 @@ One step. Every new door, table, trap, heater and lamp starts with the game's setting, and a copied building forgets what its source had. - **Building settings for new buildings**: door hold-open, gather spot, trap auto-rearm, target temperature and lamp colour, per building or for every door, lamp, or heater and cooler, with a Defaults gizmo. Designed ([spec](design.md#building-settings-for-new-buildings)). -- **Build copy carries the source's settings.** A building placed with Build copy starts with the copied building's storage filter, bills, crop and building settings instead of your default. New (from the backlog; asked in the Steam thread "Why does 'build copy' not copy the settings too?", 2021-10-10). Needs an unsaved link from the blueprint to its source and every applier above. +- **Build copy carries the source's settings.** A building placed with Build copy starts with the copied building's storage filter, bills, crop and building settings instead of your default. New (from the backlog; asked in the Steam thread "Why does 'build copy' not copy the settings too?", 2021-10-10). Needs every applier above. Hook, checked against 1.7.5021, along vanilla's lamp colour path: + - `Building.GetGizmos` passes only the def, stuff, style and lamp colour to `BuildCopyCommand` (Verse/Building.cs:420-428), and the command selects the one `Designator_Build` cached per def, which the architect menu shares (RimWorld/BuildCopyCommandUtility.cs:9-14, :26). Nothing on that path knows the source building. + - A postfix on `Building.GetGizmos` wraps the Build copy command's action, so a click records a snapshot of the source's storage, bill, crop and building settings on the selected designator. A postfix on `Designator_Build.Deselected` clears it, where vanilla clears the lamp colour (RimWorld/Designator_Build.cs:251-258). A snapshot, not a link: deconstructing or replacing the source before the frame completes changes nothing. + - Storage: a postfix on `Designator_Build.DesignateSingleCell` (:455) writes the snapshot onto the placed `Blueprint_Storage`'s settings, which vanilla saves and hands to the frame and the building (RimWorld/Blueprint_Storage.cs:92-100, RimWorld/Frame.cs:326-330). + - Bills, crop and building settings: the same postfix keeps the snapshot for the blueprint placed at :522 in an unsaved table, a postfix on `Blueprint.TryReplaceWithSolidThing` (RimWorld/Blueprint.cs:45) moves it to the frame, and the built hook applies it instead of the default. After a save and reload these fall back to your default; the storage filter stays. - **Beds in a hospital room start as medical beds.** Idea. Hook: the `Building_Bed.Medical` setter (checked in the reference assembly) in the build scope's built hook. Zone beds stay Zones'. - **Fuel settings for new buildings**: auto-refuel on or off and the target fuel level per building (torches, campfires, generators). Idea. Hook: `CompRefuelable.allowAutoRefuel` and `TargetFuelLevel` (checked in the reference assembly). @@ -147,23 +159,17 @@ Steps, in order: 1. Building settings. 2. Build copy carries the source's settings. It comes last of all building work, because it reuses the storage, bill, crop and building appliers. -### New colonies - -Every new colony starts with the game's play settings and default medical care. This area waits for Fabian's call (see "Open questions"). - -- **Play settings and medical defaults for new colonies**: auto home area, auto rebuild, manual work priorities, zone visibility, and the default medical care for tame animals, wildlife, entities and other factions' pawns, written once when a new game starts. Colonist, slave, prisoner and ghoul care stay as the game sets them, since humanlike player pawns are Castes'. Idea. Demand: 1trickPwnyta's Defaults sets both (75k, no official 1.7 build). Hook: the `PlaySettings` fields (checked in the reference assembly); the game-start hook is not checked. - ## Order -1. **Storage**, steps 2 and 3, with "Add a default and drop inactive names". It brings the build scope that workbench bills, growers and buildings need, and finishes the storage the README already sells. +1. **Storage**, step 2, with "Add a default and drop inactive names". It brings the build scope that workbench bills, growers and buildings need, and finishes the storage the README already sells. 2. **Bills.** The most asked-for area: 36 of about 650 comments on 1trickPwnyta's Defaults mention bills or workbenches, 24 storage. Its per-recipe and per-workbench bills are the last reason players keep that mod and Set my Defaults next to Blax Defaults. 3. **Animals.** It brings the join funnel. Animal Controls (57k) has no 1.7 build, and slaughter limits per species were asked for on 1trickPwnyta's Defaults page (2026-01-26). 4. **Mechs.** It reuses the join funnel. Auto-repair On (61k) has no 1.7 build. Biotech only, so after animals. -5. **New maps.** With animals and mechs in place, area names that resolve on a new map make their area defaults and Castes' allowed area slot work from day one. -6. **Growing**, then **Buildings.** The mods they replace are small (8.4k and less). Build copy closes the building work. -7. **New colonies**, if Fabian takes it in. It pays off once per colony. +5. **New maps.** With animals and mechs in place, area names that resolve on a new map make their area defaults, starting animals included, and Castes' allowed area slot work from day one. +6. **Storage**, step 3, named setups. The mods players use for it today have 1.7 builds ([KV] Save Storage, Preset Filtered Zones, Simple Stockpile Presets), while those behind animals and mechs don't. +7. **Growing**, then **Buildings.** The mods they replace are small (8.4k and less). Build copy closes the building work. -The file area's ideas and the forbid ideas come when players ask. +The file area's idea and the forbid ideas come when players ask. ## Left out @@ -171,13 +177,14 @@ Reasons in [design.md](design.md#cut): - Anything on colonists, slaves or prisoners, policy contents and default policies: Castes. - An animal food policy: vanilla has none, so it would be a new system, not a default. -- Editing defs at startup, re-applying defaults on load or to things you already have. +- Editing defs at startup, re-applying defaults on load or to things you already have. The one exception, "Young animals learn what they outgrew", ships off and only adds training wishes. - Surgery bill defaults: Slaves keeps those bills. Bills on benches you didn't build. - Forbid rules for downed visitors, traders and quest lodgers. Forbidding drops the game left allowed (only the strip switch does). - Stack limits per stockpile: a storage mod's job, not a default. - Per-colony override and multiplayer: both need state in the save, which this mod never writes (moved here from the backlog on 2026-12-01). - Storyteller, difficulty and world presets: a new-game screen tool, and the bulk players called too much in 1trickPwnyta's Defaults (Castes' Cut). Save Storyteller Settings (32k) does the storyteller part. +- Play settings and medical defaults for new colonies (cut after review, 2026-12-01; open question 1 asks whether to take them back): what fits Defaults' rules is a new-game screen tool too, and the rest belongs to Castes or to "Medical care per species". ## Open questions for Fabian -1. Should Blax Defaults take in "New colonies" (play settings and the medical defaults for animals, wildlife, entities and other factions' pawns at game start)? Recommendation: yes, as the last area, without storyteller or world presets. It is the part of 1trickPwnyta's Defaults with no 1.7 home besides Castes' pawn defaults, and it stays one settings section. Against it: it pays off once per colony, and your colonies run for years. If yes, the subtitle "Starting settings for storage, bills, crops, buildings, animals and mechs" gains "and new colonies". +1. Should Blax Defaults take in play settings for new colonies after all? Recommendation: no, and it stays in Left out. Only part of it fits Defaults' rules: auto home area, auto rebuild, zone visibility, and the default medical care for tame animals, wildlife and entities, written once per new game. Manual work priorities (`PlaySettings.useWorkPriorities`, RimWorld/PlaySettings.cs:48) changes how every colonist's work priorities work, and Castes' work slot reads it, so it is Castes' ground. The medical defaults for other factions' pawns set what humanlike guests and downed raiders get, against "never humanlike pawns". Tame-animal care is already the fallback of "Medical care per species". What is left is a new-game screen tool, the reason storyteller presets are cut, and it pays off once per colony while your colonies run for years. The unofficial Defaults 1.7 repack (3836680679, 145 subscribers) still carries these settings for the few who want them. If yes: it becomes the second step of an area "New maps and colonies", without manual work priorities and without other factions' care, written in a prefix on `Game.InitNewGame` (Verse/Game.cs:492). That prefix is in time: starting animals are generated during the map generation inside that method and read `defaultCareForTamedAnimal` as they are made (RimWorld/ScenPart_StartingAnimal.cs:167, RimWorld/Pawn_PlayerSettings.cs:364), so a postfix or `GameComponent.StartedNewGame` comes too late. The ownership line then gains "and the play settings of a new game", and the subtitle "and new colonies".