docs: plans checked against the sibling plans

One ownership list in all five design docs, with a Laws line and the
open question named on each part that waits for one, path rules among
them. Package ids and load order include Blax Laws.
This commit is contained in:
Fabian @ Blax Software 2026-12-01 19:31:56 +01:00
parent 2a5effc9f7
commit 9ba62768fc
2 changed files with 14 additions and 5 deletions

View File

@ -4,6 +4,10 @@ Drag a delivery zone and everything you buy from orbital or caravan traders, plu
Status: 1.0 and 1.1 are built and on the Workshop; sleeping zones, work rule areas, storage deliveries, cargo pods and the removal button are designed, no code yet. What the mod covers and the build order: [features.md](features.md). Checked against the RimWorld 1.7.5021 game code on 2026-11-29. RimWorld 1.7, package id `blax.zones`. From the first release a plain unsubscribe leaves a loadable save with vanilla zones intact; once the removal button ships, it removes the mod with no errors.
Changes on 2026-12-01, the five Blax plans checked against each other:
- The ownership list in "Works with the other Blax mods" is the same in all five design docs and has a Laws line; parts that wait on an open question name it, path rules among them. The package ids and the load order include Blax Laws.
Changes on 2026-12-01, review of the plan:
- Build order back to Fabian's decision of 2026-11-30: animal sleeping zones with the removal button, then work rule areas, then storage deliveries, trade from storage and cargo pods, then people zones, then the caste filter. The README and the Workshop planned list follow that order, without version numbers.
@ -773,7 +777,7 @@ Save-safe zone storage shipped with 1.0; its spec stays there ("Save-safe zone s
## Works with the other Blax mods
- Package ids: `blax.slaves`, `blax.castes`, `blax.zones`, `blax.defaults`. No hard dependencies. About.xml has one sibling entry, loadAfter `blax.castes`. Load order is Castes, Zones, Slaves. Slaves lists `blax.zones`, so Zones doesn't list Slaves back, which would form a loadAfter cycle. Defaults lists no sibling and no sibling lists Defaults, so its position doesn't matter.
- Package ids: `blax.slaves`, `blax.castes`, `blax.zones`, `blax.defaults`, `blax.laws` (Laws is designed, not built). No hard dependencies. About.xml has one sibling entry, loadAfter `blax.castes`. Load order is Castes, Zones, Slaves, Laws. Slaves lists `blax.zones`, so Zones doesn't list Slaves back, which would form a loadAfter cycle. Laws lists `blax.castes` and `blax.slaves` and nothing lists Laws. Defaults lists no sibling and no sibling lists Defaults, so its position doesn't matter.
- Detection: one Compat helper calls `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. APIs change additively only and carry an int `Version`.
- Zones offers `BlaxZones.ZonesApi` (static) from 1.0. Blax Slaves already binds it by exact delegate type and reads `Version` as a property or field (Siblings.cs:27, 61, 153-157), so version 1 is frozen and holds only:
- `Version` (static int property), 1.
@ -791,7 +795,12 @@ Save-safe zone storage shipped with 1.0; its spec stays there ("Save-safe zone s
| `PrePick(Pawn, string casteId)` | not used by Zones; takes the token-prefixed id | 3 (Castes' trade-row pre-pick) |
Castes needs no Zones code. Zones reads nothing from Blax Slaves.
- Ownership: Zones owns sleeping spots, beds by zone, every friendly drop location and per-cell work rules (work rule areas); it never changes a pawn's work priorities or allowed area. Castes owns every per-pawn policy default (apparel, food, drug, reading, medical care, schedule, work priorities, weapon loadout, allowed area, hostility, self-tend, carried medicine, fire at will, prisoner interaction); Zones never touches policies. Slaves owns slave status, trade, prices, suppression, rebellion, slave medicine and the slave economy. 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, the same list in all five Blax design docs; a part that waits on Fabian's answer names the open question. Zones never touches policies.
- Castes: every per-pawn policy default of colonists, slaves and prisoners (apparel, food, drug, reading, medical care, schedule, work priorities, weapon loadout, allowed area, hostility, self-tend, carried medicine, fire at will, prisoner interaction except the Maintain only and Release modes Laws sets on colonists it jailed), and the planned ones: the cold-weather apparel policy, the Combat Extended loadout, the Royalty and Biotech switches (room and apparel requirements, psyfocus target, entropy limit, hemogen pack use, deathrest auto-wake), the slave interaction mode a new slave starts on (Castes' open question 2) and per-caste values other Blax mods register, which those mods apply (Castes' open question 1).
- Zones: sleeping spots, beds by zone, every friendly drop location and per-cell work rules (work rule areas), with path rules on those areas (Zones' open question 3); it never changes a pawn's work priorities or allowed area.
- Slaves: slave status (except the status Laws gives back to a slave it jailed, Laws' open question 1), the slave interaction modes (vanilla's plus Recruit and Convert), trade, prices, suppression, rebellion, slave medicine and the slave economy. Slaves routes its silver payouts through `ZonesApi.TryFindDropSpot`, with `DropCellFinder.TradeDropSpot` as fallback. Pawns are never routed into zones.
- 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.
- Laws: the colony's lawbook (which acts are crimes, at which stage, how severe and how they are punished), cases, sentences, trials, judges, attorneys and law votes. It acts through vanilla arrest, capture, release and guilt plus its own non-lethal subdue job, and talks colonists and slaves out of a break, except slaves while Slaves' wardens calm breaks. For the colonists it jailed, and only for them, it writes the prisoner interaction mode (Maintain only after the arrest, Release when the sentence ends) and gives back what the sentence took: bed, grave, throne, deathrest casket, ideoligion role, mech work modes and the weapon the arrest dropped. It puts a slave it jailed back into slavery (Laws' open question 1). It never sets policies, work priorities, allowed areas, zones or suppression. It keeps its state in one GameComponent.
- Slaves routes its silver payouts through `ZonesApi.TryFindDropSpot` and spawns the pod at the returned cell with `TradeUtility.SpawnDropPod`, with `DropCellFinder.TradeDropSpot` and `DropThingsNear` as fallback (Blax Slaves docs/roadmap.md, purchase ledger and payouts). Pawns are never routed into zones. Payouts follow the zone's orbital checkbox, and its tooltip says so while Slaves is active.
- Buying: Zones never routes bought people. Slaves' buy-mode sets `guest.joinStatus` before vanilla `Pawn.PreTraded`, and Castes classifies by the final status in its own PreTraded scope. Zones touches neither.
- Slave sleeping zones use vanilla `BedOwnerType.Slave`, so `Alert_NeedSlaveBeds` counts them with no patch (Alert_NeedSlaveBeds.cs:43). The alert runs only with Ideology (`requireIdeology`, Alert_NeedSlaveBeds.cs:14).
@ -799,7 +808,7 @@ Save-safe zone storage shipped with 1.0; its spec stays there ("Save-safe zone s
- Blax Defaults ("Starting settings for storage, bills, crops, buildings, animals and mechs"): it hooks only `Designator_ZoneAddStockpile` (its 1.0) and `Designator_ZoneAdd_Growing` (its growing-zone defaults), and Zones' zones subclass `Zone` and `Designator_ZoneAdd` directly with their own tabs (`ITab_Delivery`, the animal-zone and people-zone tabs), so no Defaults hook or button reaches a delivery or sleeping zone. A new stockpile or shelf starts unflagged; "Make default" never copies Zones' flags, which live in Zones' component. Defaults' button sits inside the storage tab and Zones' storage-delivery gizmos on the gizmo bar. Zone beds come from `AddCell`, not a frame, so Defaults' build scope for more storage never sees them. Neither mod touches the home area. Defaults' forbid rules (its 1.1) act only inside `Pawn.Kill`, `Pawn_HealthTracker.MakeDowned` and `Pawn.Strip` (Pawn.cs:3895; Pawn_HealthTracker.cs:837), never on goods Zones delivers, so arriving goods keep the forbid flag of the vanilla call. If Defaults ever adds a rule for them, it must act where Zones' routed groups also pass, because routed reward groups drop through `MakeDropPodAt` and orbital goods through `SpawnDropPod`, never through `DropThingsNear`.
- Work rule areas are per cell and never touch a pawn: Castes keeps the allowed area (its allowed-area slot), and the work search already refuses things outside it (JobGiver_Work.cs:219-226; ForbidUtility.cs:111-118, 157-165), so a caste kept to the fields never walks to a "Clean first" hospital and Zones needs no CastesApi member. They aren't vanilla Areas, so they never show in Castes' area picker or match its area labels (`AreaManager.GetLabeled`, AreaManager.cs:86-96). Slaves are colonists for the work search and follow the rules like anyone. With Defaults the two compose: its forbid rules decide whether dropped gear is forbidden (its 1.1), and allow matched gear only once no enemy that can still fight is on the map; work rule areas decide whether haulers fetch it, so a killbox with "Don't haul from here" keeps allowed loot lying until the rule is unticked, and "Haul first" brings it in before other hauling. Neither mod hooks the other's code.
- Each mod keeps its state in its own Map or Game components, or none (Defaults), so removing one leaves the others' saves intact.
- Blax Laws (designed on branch `design/act-catalogue` of `rimworld-blax-laws`, not built): its jail takes any prisoner bed, so its arrests use prisoner zone beds like any vanilla prisoner bed, with no code on either side. Its court place and courtrooms are stored by ThingID in Laws' own component, never as a zone, and Zones adds no jail, court or courtroom zone. Its package id and ownership line join this section once its design is accepted.
- Blax Laws (designed, not built): its jail takes any prisoner bed, so its arrests use prisoner zone beds like any vanilla prisoner bed, with no code on either side. Its court place and courtrooms are stored by ThingID in Laws' own component, never as a zone, and Zones adds no jail, court or courtroom zone. Laws reads nothing from Zones.
- Shared conventions: patches applied one class at a time from a `[StaticConstructorOnStartup]` class, logging "[Blax Zones] N patches applied"; a ModSettings toggle for every feature (zone storage has none, it is the save format); any DLC combination, core only included (see "DLC support"); every hook body in try/catch with a one-time log; the headless in-game test mod copied from blax-castes/Tests (BlaxCastesTests harness, run-tests.ps1) as Tests/BlaxZonesTests, plus a phase 3 that simulates removing the mod.
## Backlog
@ -828,7 +837,7 @@ Save-safe zone storage shipped with 1.0; its spec stays there ("Save-safe zone s
- "Clean here", "Repair here" and "Fight fires here" outside the home area (M, idea; features.md, Work rule areas step 4), for a field, a mine entrance or an outpost wall. Painting the home area there plus a "No cleaning" area does the same today; only auto-rebuild, trap rearming and drops differ, because inside the home area what pawns drop isn't forbidden (ForbidUtility.cs:48-57). Vanilla ignores fires outside the home area; Repair Outside the Home Area is a small mod for repairs. Hooks, checked 2026-12-01: own work givers built like "Clean first", no transpiler.
- Repairs and fires: only `HasJobOnThing` checks the home area (WorkGiver_Repair.cs:35, WorkGiver_FixBrokenDownBuilding.cs:56, WorkGiver_FightFires.cs:55); their job drivers don't, and their candidates are already map-wide (ListerBuildingsRepairable.cs:56-77; `BreakdownManager.brokenDownThings`, WorkGiver_FixBrokenDownBuilding.cs:25; fires by def, WorkGiver_FightFires.cs:14). So each giver takes those candidates on the area's cells outside the home area, repeats vanilla's other checks (WorkGiver_Repair.cs:30-59; WorkGiver_FightFires.cs:50-69, with `FireIsBeingHandled` bound through an `AccessTools` delegate because the class is internal; WorkGiver_FixBrokenDownBuilding.cs:40-77, its private `FindClosestComponent` at :89-92 copied with `GenClosest`) and hands out vanilla's Repair, FixBrokenDownBuilding and BeatFire jobs. Own givers don't override another mod's refusal the way a postfix that flips false to true would.
- Cleaning: the home filth list only holds filth on home cells (ListerFilthInHomeArea.cs:29-35), and `PotentialWorkThingsGlobal` and `ShouldSkip` read only that list (WorkGiver_CleanFilth.cs:17-25), so the giver keeps its own list of the area's filth outside the home area, from the Filth group, cached like Clean first's. The clean driver jumps away from filth outside the home area (JobDriver_CleanFilth.cs:31, 70, through `JumpIfOutsideHomeArea`, ToilJumpConditions.cs:38-45), so the giver hands out its own JobDef with a `JobDriver_CleanFilth` subclass whose `MakeNewToils` repeats vanilla's toils without those two jumps (the base class keeps its work counters private, JobDriver_CleanFilth.cs:9-13).
- Path rules (new 2026-12-01; hook checked against the code on 2026-12-01): "Walk around" per work rule area, a path cost that never blocks a path; the allowed area stays the hard limit. [KV] Path Avoid (1180719857, 44,501 subs) stopped at 1.5. Needs the shared ownership line to read "per-cell work and path rules".
- Path rules (new 2026-12-01; hook checked against the code on 2026-12-01): "Walk around" per work rule area, a path cost that never blocks a path; the allowed area stays the hard limit. [KV] Path Avoid (1180719857, 44,501 subs) stopped at 1.5. The shared ownership line names path rules under Zones, marked with Zones' open question 3.
- Hook: a `PathRequest.IPathGridCustomizer` (PathRequest.cs:11-14). Its `GetOffsetGrid` returns a ushort grid built from the area mask; `ParameterizeGridJob` copies it into the grid job (PathFinderMapData.cs:290) and the job adds it to each cell's cost (PathGridJob.cs:187-189). Offsets stay well below 10000, which makes a cell impassable (PathGridJob.cs:124).
- A prefix on `PathFinder.PushRequest` (PathFinder.cs:514-528) sets `request.customizer` while it is null and the request's pawn is of the player faction. Pawn movement is its only vanilla caller and builds its request without a customizer (Pawn_PathFollower.cs:853-854). Not on `CreateRequest` (PathFinder.cs:507), which also serves the one-off `FindPathNow` checks (:565).
- One customizer instance per map: the grid cache key includes the customizer (PathFinder.cs:83-133), so a shared instance keeps cached grids reusable.

View File

@ -141,5 +141,5 @@ The reasons are in design.md's [Cut](design.md#cut). In short:
1. **When do the other first rules come?** Work rule areas step 2 (mine, cut, plant work, build and repair first) finishes your "Priority zones" request; the Order lists it after the decided steps. Recommendation: right after work rule areas step 1, before storage deliveries, because it reuses step 1's areas and the Haul first giver pattern.
2. **Do other mods' drops follow "Route orbital trade"?** Today `ZonesApi.TryFindDropSpot` follows each zone's orbital checkbox but ignores the global switch (`ZonesApi.cs` calls the router directly; only `DeliveryRouter.Orbital.cs:23` reads `routeOrbital`). Recommendation: follow it. One switch then means "orbital pods go to zones", and its tooltip names Blax Slaves' payouts while Slaves is active.
3. **Path rules widen Zones' ownership line** from "per-cell work rules" to "per-cell work and path rules", in all five docs. No sibling owns pathing, and Castes' allowed area stays the hard limit. Recommendation: yes, and build path rules right after the other first rules, ahead of the home-area ideas: they are the work rule step with demand on record.
3. **Path rules widen Zones' ownership** from per-cell work rules to per-cell work and path rules. The shared ownership line in all five docs already names path rules under Zones, marked with this question; on a no they leave it. No sibling owns pathing, and Castes' allowed area stays the hard limit. Recommendation: yes, and build path rules right after the other first rules, ahead of the home-area ideas: they are the work rule step with demand on record.
4. **Bought animals land in a zone**, for example outside the pen gate. It needs the shared rule "pawns are never routed into zones" narrowed to people. Recommendation: no for now; nobody asked, and that rule is what keeps refugees and raiders out of delivery zones.