rimworld-blax-zones/docs/features.md

18 KiB

Blax Zones feature plan

Blax Zones decides where things arrive, where animals and people sleep, and how colonists treat a place. Complete, it routes every friendly arrival (trade, quest rewards, cargo, aid) into zones and storage you pick, beds a whole barn, dorm or prison with one drag, and lets you paint areas where nobody cleans, everything is hauled first or pawns walk around. Every part has its own toggle, works with any DLC combination and leaves a loadable save when you unsubscribe.

Status: 1.0 (delivery zones, caravan camps) and 1.1 (quest rewards, caravan purchases) are on the Workshop as item 3848261160. Everything else below is designed or proposed, with no code yet.

Planned 2026-12-01. This file says what the mod covers, grouped by what belongs together, and in which order it gets built. How each feature works is in design.md.

Status values:

  • Shipped x.y: on the Workshop.
  • Designed: specified in design.md and checked against the RimWorld 1.7.5021 code.
  • New: proposed in this plan. Not checked against the code unless the line says so.
  • Idea: kept on the list; it waits for player demand or for content that uses it.

Scope

Zones covers three things:

  • every friendly drop location: where bought goods, quest rewards, cargo and friendly aid land, and where trader caravans camp;
  • sleeping spots and beds by zone, for animals and people;
  • per-cell work rules (work rule areas).

What it leaves to the other Blax mods:

  • Blax Castes: every per-pawn setting, including work priorities and the allowed area. Work rule areas apply to everyone on a cell and never change a pawn.
  • Blax Defaults: starting settings of vanilla stockpiles, growing zones, storage, bills, animals and mechs, and what gets forbidden when pawns go down, die or are stripped. A new stockpile starts unflagged for deliveries; Zones' flags live in Zones.
  • Blax Slaves: slave status, trade, prices and how much a payout is. Zones only hands Slaves a cell for its silver pods.
  • Blax Laws (designed, not built): the lawbook, arrests, jail, court places and courtrooms. Laws' jail takes any prisoner bed, so prisoner sleeping zones serve it with no code on either side. Court places and courtrooms are Laws' own, stored by ThingID; Zones adds no jail, court or courtroom zone.

Pawns are never routed into zones. Bought people and animals, refugees, quest pawns, ransomed and lent colonists arrive as in vanilla.

Arrivals: deliveries and caravan camps

Vanilla drops everything next to the first trade beacon, quest rewards included, and caravans camp at a random spot outside the base. The mods that fixed this (Trade Ships Drop Spot 206k, Trading Control 111k, the Trading Spot mods) are dead or stop at 1.6. Zones makes a delivery zone the landing pad and the meeting point, then extends it to storage and to every other friendly source.

  1. Delivery zones and caravan camps: Shipped 1.0. The last three lines are ideas that extend it.
    • Delivery zone with item filter, priority, source checkboxes and unusable cells marked red. Shipped 1.0 (spec).
    • Orbital purchases and sale silver land in the best zone, overflow next to it. Shipped 1.0 (spec).
    • Trader caravans and tribute collectors camp next to a zone you pick. Shipped 1.0 (spec).
    • Unusable cells counted by reason in the inspect pane (roof, water, pen, building), next to the red cells. Idea.
    • Fewer drop pods by batching stacks. Idea; the only such mod has 1.8k subscribers and nobody asked.
    • "Visitors gather here" next to "Caravans camp here", for visitor groups. New, Idea; hook checked against the code. Smarter Visitors (3012491521, 137,980 subs, alive on 1.7) has a visitor spot building, so this would stand down while it is active. Visitor groups already call the patched TryFindRandomSpotJustOutsideColony overload (IncidentWorker_VisitorGroup.cs:24, forwarded at RCellFinder.cs:709-714), so a second scope on IncidentWorker_VisitorGroup.CreateLordJob brings them to the zone, and Ideology's skylantern wanderers with them (IncidentWorker_WanderersSkylanterns.cs:10 calls the base), with no Ideology code. Visitors pass no extraValidator, so the camp search adds the reach check vanilla runs in the validator the prefix skips (RCellFinder.cs:791-798). Details in the backlog.
  2. Quest rewards and caravan purchases: Shipped 1.1.
    • Item rewards land in the zone and the letter points there. Shipped 1.1 (spec).
    • Goods bought from caravans and Hospitality guests appear in the zone, roofed or not. Shipped 1.1 (spec).
  3. Storage as a delivery target: Designed. The unbuilt part of Fabian's first Zones request (2026-11-28): bought goods brought inside without hauling, for example medicine. Both keep their flags in the map component, share one storage-group rule and one gizmo family, and most freezers and hospital shelves are roofed, so the delivery flag is worth little without delivery under a roof.
    • A "Receive deliveries" gizmo on stockpiles, shelves, racks and fridges: medicine straight onto the hospital shelf, by the shelf's own filter and priority. Designed (spec).
    • Delivery under a roof: goods appear in place, no drop pod, off by default. Designed (spec).
  4. Trade from storage: Designed. Outbound trade, not an arrival, so it is its own step. It reuses step 3's storage-group rule and gizmo family, with a flag set of its own.
    • Sell zone: orbital traders buy from flagged storage and take payment from it while a powered beacon stands, off by default. Designed (spec).
  5. More arrival sources: independent of steps 3 and 4; it needs only the reward routing from 1.1.
    • Random cargo pod events land in a zone with "Cargo pods" ticked, off by default. Designed (spec).
    • Vanilla Events Expanded's apparel and weapon pods join the cargo pods. Idea (backlog). Needs that mod.
    • Ally reinforcements and aid drop next to a chosen zone, never hostile drops. Idea; Allies Spot (2067847359, 3,678 subs) shows small demand.
    • Returning player caravans unload into a delivery zone. Idea; UnloadHere (522) and Homecoming (207) show small demand.
    • Royal title rewards land in the zone. Idea, waits for content: no vanilla title and no mod in the active list defines title rewards. Needs Royalty.

Why this order: 1.0 built the zone, the router and the API that everything else calls; 1.1 added the delivery context the reward, cargo and aid paths share. Storage targets come before more sources because they change where every existing source can land.

Work rule areas

The home area switches cleaning, firefighting and repairs on and off together, an allowed area restricts a pawn for every job, and nothing orders work by place. CleaningArea (114k, last 1.4) and Cleaning Area Relaunched (23k, 1.6 only) were the usual fix, and neither runs on 1.7. Fabian asked for "No cleaning" and "Priority zones" on 2026-11-29. Work rule areas are one painted layer of named areas that lie over anything, up to 10 per map, each with rule checkboxes.

  1. Areas and the six rules: Designed. One step: Fabian's request covers both kinds of rule, and they share the layer, the mask and the manage window. The last two lines are ideas that extend the "No" rules.
    • Paint, name and manage work rule areas over stockpiles, fields and other zones. Designed (spec).
    • "No cleaning", "No firefighting", "No repairs", "Don't haul from here". Right-click orders still work everywhere. Designed (spec).
    • "Clean first" and "Haul first", within the pawn's own work priorities and allowed area. Designed (spec).
    • "Don't haul from here" with an item filter, for example leave weapons, haul corpses. Idea (backlog).
    • Hide the "Fire in home area" alert for fires in "No firefighting" areas. Idea.
  2. First rules for the other place-bound work: New. "Priority zones" asked for work in general; step 1 covers cleaning and hauling, these cover the rest of the work that happens at a place. Each is a wrapped work giver like Haul first, filtered to the area's cells, with no Harmony patch, and each stands down for the mod that already orders that work, as Clean first does for Cleaning Priority (Continued). Details in the backlog.
    • "Mine first": wraps Mine, whose targets come from the map's Mine and MineVein designations (WorkGiver_Miner.cs:16-19; MineAIUtility.cs:20-24), the same shape Haul first wraps. Checked against the code.
    • "Cut first": wraps PlantsCut, whose targets are the CutPlant and HarvestPlant designations (WorkGiver_PlantsCut.cs:16-35). Checked against the code.
    • "Plant work first": sowing and harvesting first, wrapping GrowerSow and GrowerHarvest. Stands down for Growing Zone Priorities (Continued), which ranks growing zones.
    • "Build first": one wrapped giver per construction giver. Frame order has build-order effects (roofs, walls closing a room), so the spec has to test those cases. Stands down for Smarter Construction (1M subs, 1.7), which already reorders construction.
    • "Repair first": wraps Repair inside the home area, as Clean first wraps cleaning. Stands down for Repairing Priority (3229907892, 2,188 subs, 1.7).
  3. Path rules: New; hook checked against the code. "Walk around" per area, so pawns path around a killbox, a nursery or a freezer door unless there is no other way. It never blocks a path; the allowed area stays the hard limit. Demand: [KV] Path Avoid (1180719857, 44,501 subs) stopped at 1.5; Pathfinding Avoidance (1.6) does it by treating allowed areas with fixed names as costly, so those names also show up in every allowed-area picker. Hook: a PathRequest.IPathGridCustomizer (PathRequest.cs:11-14) whose offset grid comes from the area mask, added to each cell's path cost (PathGridJob.cs:187-189) and kept well below 10000, which makes a cell impassable (PathGridJob.cs:124). A prefix on PathFinder.PushRequest (PathFinder.cs:514-528), whose only vanilla caller is pawn movement (Pawn_PathFollower.cs:853-854), sets it on player pawns' requests. Not a path data source: ParameterizeGridJob never hands a registered source's data to the cost calculation (PathFinderMapData.cs:252-292, 308-315). Details and the 60-pawn timing test in the backlog. Needs the ownership change in the open questions.
  4. Home-area jobs by area: Idea. Each turns one job the home area gates on or off for an area, without moving the home area.
    • "Clean here", "Repair here" and "Fight fires here" for a field, a mine entrance or an outpost wall outside the home area. Painting the home area there plus a "No cleaning" area does this today; only auto-rebuild, trap rearming and drops differ, because inside the home area what pawns drop isn't forbidden (ForbidUtility.cs:48-57). Demand is thin: vanilla ignores fires outside the home area (RimWorld wiki, Firefighting), and a small mod, Repair Outside the Home Area, exists for repairs (subscriber count not read). Hook, checked against the code: own work givers like Clean first, no transpiler. Repairs and fires are gated only in HasJobOnThing and their candidates are already map-wide; cleaning also needs its own filth list and its own job driver, because the home filth list and the clean driver both check the home area (ListerFilthInHomeArea.cs:29-35; JobDriver_CleanFilth.cs:31, 70). Details in the backlog.
    • "No auto-rebuild", for killbox barricades the player wants left broken.

Why this order: step 1 is the decided build. Steps 2 and 3 reuse its areas, mask and manage window. Step 4 waits for players, since the home area covers it today.

Sleeping zones

Animal sleeping spots and dorm sleeping spots are placed one at a time. Designator Shapes and BuilderTweaksReplica help place them in bulk, and the spots then clutter the map (Hidden Spots exists for that). A zone whose every cell is a bed does both jobs. The beds are real but invisible, so ownership, prisoner capture, patients and the bed alerts keep working with vanilla code.

  1. Animals: Designed. Zone beds are built on the simplest sleepers first: no owner types, no prison rules. Ships with the removal button (Zone tools), because zone beds make a plain unsubscribe noisy.
    • Animal sleeping zone: one drag over the barn beds every chicken. Designed (spec).
    • Species checkboxes and a body-size range, so big stalls stay free of chickens, and claimed and free cells in the inspect pane. Designed (spec).
  2. People: Designed. The same zone beds with an owner type.
    • Sleeping zones for colonists, slaves (Ideology) and prisoners; a prisoner zone makes its room a prison cell, and vanilla beds are never flipped without asking. Designed (spec).
    • Medical zones (people and animals), shared zones where nobody keeps a cell, sleeping-spot comfort. Designed (spec).
    • Zone tint by type, and the owner type and prison-cell warnings in the inspect pane. Designed (spec).
  3. By caste: Designed. With Blax Castes, a people zone can be limited to castes, medical zones included. Needs Castes' read-only API (CastesApi version 1) (spec).
  4. Ideas:
    • Age limits on people zones, for example a nursery. Needs Biotech. Nobody asked yet.
    • Animals sleep on a stockpile, so the barn's hay stockpile is also the sleeping area. Zone beds can't overlap zones today, and neither can vanilla sleeping spots; two zones in one barn work.

Why this order: people zones reuse the animal zone beds and add owner types; the caste filter is one more check in the same bed postfix and waits for Castes' API.

Zone tools and removal

What every zone, bed and area needs: a save that survives removing the mod, and setup that doesn't repeat.

  • Save-safe zone storage: zones live in Zones' own map data, never in the game's zone list. Shipped 1.0 (spec).
  • "Remove Blax Zones from this game" button: strips zone beds, work rule jobs and areas, so the save loads with no errors after unsubscribing. Designed (spec). Ships with animal sleeping zones; work rule areas add their two steps to it.
  • "Make default" for new delivery and sleeping zones, kept in Zones' own file, as Blax Defaults does for vanilla zones. Idea.
  • Blax zones and work rule areas fly with Odyssey gravships. Idea; Odyssey isn't on the test machine, so it can't be built or tested yet.
  • A full removal test that relaunches the game without Zones. Idea, test-only.

For other mods

  • ZonesApi version 1, TryFindDropSpot: a cell for one drop pod in or next to a delivery zone. Shipped 1.0. Blax Slaves binds it for its silver payouts.
  • Whether API drops follow the global "Route orbital trade" switch: open question below.
  • A member for sleeping zones, added once a sibling needs one. Idea.

Order

  1. Sleeping zones, step 1 (animals), with the removal button. Decided 2026-11-30.
  2. Work rule areas, step 1. Decided 2026-11-30: right after animal sleeping zones. It needs only the shipped map component, and it adds its two steps to the removal button (end Clean first and Haul first jobs, delete the areas).
  3. Arrivals: storage as a delivery target (step 3), then trade from storage (step 4), then cargo pods (step 5). The unbuilt part of the first Zones request: medicine onto the hospital shelf with no hauling.
  4. Sleeping zones, step 2 (people). The zone beds from step 1 with owner types and the prison rules on top.
  5. Sleeping zones, step 3 (by caste), once Castes ships its read-only API. It needs people zones.
  6. Work rule areas, step 2 (first rules for the other work), then step 3 (path rules). New steps follow the decided order until Fabian places them (open question 1).
  7. The ideas, as players ask.

Left out

The reasons are in design.md's Cut. In short:

  • pack animals walking purchases to the zone, roof-punching pods, and patching the vanilla trade drop spot globally, which would let raiders drop into the zone;
  • sleeping zones without beds, and people and animals in one zone;
  • work rules as vanilla zones or areas, one layer per rule, "first" rules for firefighting, doctors or wardens, and blocking right-click orders;
  • routing ransom returns, lent colonists, quest pawns, wastepacks and royal permit drops;
  • Trading Control's marketplace stall and per-cell spot graphics, which need art;
  • anything Castes, Defaults, Slaves or Laws owns (see Scope);
  • multiplayer, until a 1.7 build of the Multiplayer mod exists to test against.

Open questions for Fabian

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