Release 0.0.1.8.8.7

This commit is contained in:
WorldBosse committed 2026-10-29 21:59:06 +04:00
1 parent 3c8a17aa78
commit c7beab414c
16283 files changed
+768761 -2

No files matched your search

@@ -0,0 +1,21 @@
# LonaCraft asset prompts
One line per sprite, the style the owner uses for the mod's generated art. Format: one PNG = one cell,
transparent background, the object standing on the bottom edge, pixel-art in the game's 32 px tile scale
(see docs/TECHNICAL.md "Owner sprites" for sizes and how a file is picked up).
| File name | Cell | Prompt line |
|---|---|---|
| LonaCraft_Anvil.png | 48 x 48 | A blacksmith's anvil on a thick oak stump: dark grey iron with a lighter top face and a pointed horn to the left, a hammer resting on top, the stump banded with iron. |
| LonaCraft_CarpentryBench.png | 64 x 64 | A heavy wooden carpenter's workbench seen from the front, planks and a saw on top, a vice on the right end, wood shavings and a few nails scattered on the surface, tools hanging on the front edge. |
| LonaCraft_TailorTable.png | 64 x 64 | A tailor's table with a bolt of undyed cloth unrolled across it, shears and a pincushion on the surface, a small wooden loom frame with threads standing at the back-left, a stool tucked under the right side. |
| LonaCraft_Boulder.png | 48 x 48 | A rough grey granite boulder a little taller than it is wide, seen from the front, with a few flat chipped faces and pale mineral streaks, small loose stones and gravel at its base, a thin line of moss along the bottom shadow. |
| LonaCraft_LooseStone.png | 32 x 32 | A small grey stone lying on the ground, fist-sized, rounded with one chipped flat face and a pale streak, a soft dark shadow under it, seen slightly from above. |
| Hatchet icon, cell 12 of Graphics/System/Iconset_LonaCraft.png | 24 x 24 | A small hatchet icon: short pale wooden handle angled from bottom-left to top-right, a grey iron wedge head at the top with a bright edge facing right, a strip of dark leather wrapped at the grip, dark outline, transparent background. |
The boulder cell is 48 x 48 (one PNG = one cell, Scripts/45_Nodes.rb picks up Graphics/Characters/LonaCraft_Boulder.png
when it exists, else the game's $_boulder sheet is used). Boulders have no broken or used sprite: like the game's ore
nodes they are deleted when mined out (Data/HCGframes/event/Mining_Saltpeter.rb:17). The Hatchet icon is pasted into cell 12
of the mod icon sheet (24 x 24 cells, 16 per row); a drawn placeholder is there now.
The loose stone is a small one-pick node on the map (one 32 x 32 cell, Scripts/45_Nodes.rb picks up
Graphics/Characters/LonaCraft_LooseStone.png when it exists, else the game's item_icon01 rock drop picture is used).
@@ -0,0 +1,450 @@
# R12 Away-from-base raids and hired mercenaries
Owner roadmap items 2 and 3 (2026-10-06). Research only: no mod or game file was changed. Every number is
PROPOSED with one recommendation; the owner settles them (section 9) before building.
Short forms: `F/` = `LonaRPG/Data/Scripts/Frames/`, `E/` = `LonaRPG/Data/Scripts/Editables/`,
`S/` = `LonaRPG/Data/Scripts/`, `HCG/` = `LonaRPG/Data/HCGframes/`, `NPC/` = `LonaRPG/Data/NPCdata/`,
`LC/` = `LonaCraft_dev/LonaCraft/Scripts/` (dev copy), `RPS/` = `ModScripts/_Mods/RolePlayS/`.
`LC/110_Bases.rb` and `LC/130_Sewer.rb` line numbers are as of 2026-10-06 (another builder is editing them).
Dry run and renders (scratchpad `r12/`): `away_sim.py` (outside-in simulation, Monte Carlo, the tables of 2.6),
`away_raid_2ring.png` (one bandit raid on a 2-ring base), `merc_candidates.png` (16 CHS sprite candidates,
3 head variants each), `male_sheets_contact.png` (the four `-char-M-REGULAR` placeholder sheets),
`chs_render.py`, `evlib.py` / `evsheets.py` / `evfull.py` (event-library dumps), `worldmap02.png`.
## 0. Summary
| Question | Finding | PROPOSED |
|---|---|---|
| When do "days pass" away? | Only at naps: `Game_Map#nap` is the one caller of `$game_date.shift` (`E/70_Game_Map_DayNightAndOvermap.rb:13-14`; grep of `S/`, `HCG/`, `Data/Batch/`: no other `shift` / `addDays` / `oneDayForward`). World-map travel moves no time; the out-of-stamina world-map nap does | Alias `Game_Date#shift` / `addDays` / `oneDayForward` as Homes does (`LC/100_Homes.rb:1052-1072`); one roll per base per game day, at the shift into night |
| Chance | live base raids: about 28 % a nap (`docs/RESEARCH_RAIDS.md` 2.2) | 10 % a day + base-value bonus (max +10), x 1.5 on road / house / sewer, x 0.5 guarded; 1 grace day after leaving, 2-day cooldown |
| Simulation | the record holds the piece grid and HP (`LC/110_Bases.rb:2837-2872`), furniture with chest box ids (`LC/90_Furniture.rb:509-519`, `:540-549`); the map file gives terrain passability without a map load (`LC/100_Homes.rb:618-672` already does this for rooms) | Rooms graph from map file + pieces; the party spends a SWING budget breaking the cheapest boundary piece (doors first), outside in; loot / smash in each room reached |
| Result in the record | | pieces broken (no refund), HP left on the piece that stopped them, chest items taken, furniture smashed; a report list in the base record |
| Lona learns | | marker balloon on the world map at once; popup + report window on her next entry |
| Mercenaries | the game hires companions for 2 beers per 2 days into 3 save slots (front / back / ext) (`E/99_Game_Player_follower.rb:61-66`, `HCG/event/NoerTavernCompHumanWarrior.rb:39-41`) | 3 own NPCs, never in a companion slot, posted at one base; 1 Large Copper Coin a day; 1 / 3 / 7 / 14 days at the guild receptionist |
| Receptionist and RolePlayS | RolePlayS replaces her script through `$mod_load_script` (`RPS/Scripts/0_CORE.rb:1705-1716`); both versions end in the same `QuestBoard/other` menu (game `:271`, RolePlayS `:365`) | Homes' redirect chain (`LC/100_Homes.rb:954-972`, `:1393-1403`), one line appended to that menu |
| Sprites | NPC sprites are CHS composites picked by sheet + index + pattern (`F/39_Game_Event.rb:1781-1797`, `:1843-1847`) | rank and file `-char-M-REGULAR04` [2] pattern 0 "NFLwarrior"; captain `-char-M-REGULAR01` [3] pattern 2 "EliteWarrior" (used by no game template) |
| Build | | 6 items, about 1,150 Ruby lines, new `LC/140_AwayRaids.rb` + `LC/150_Mercs.rb` |
## 1. What the game and the mod give us
### 1.1 Time
| Fact | Evidence |
|---|---|
| `dateAmt` counts half days: `DAY_LENGTH = 2`; `shift` = `@date += 1` | `F/123_Game_Date.rb:9`, `:73-75`, `:198-202` |
| Day / night: `@date % 2` 0 = day, 1 = night; `night?` | `F/123_Game_Date.rb:121-135`, `:304-310` |
| Only `Game_Map#nap` shifts the date; `handleNap` calls it on the map Lona sleeps on, then `setup(map_id)` | `E/70_Game_Map_DayNightAndOvermap.rb:13-14`; `F/Game_InterpreterModifies/Game_Interpreter_Modifies_OM.rb:12-24` |
| So at the shift `$game_map.map_id_rec` is the map Lona naps on: a base she naps on gets the LIVE raid (`LC/120_Raids.rb:441-474`), every other base the away roll | same |
| Rent expiry already rides on every date move | `LC/100_Homes.rb:381-395`, `:1052-1072` |
| Popups shown during a nap are disposed by the setup that follows; Homes queues them | `LC/100_Homes.rb:475-492` (`notice` / `flush_notices`); `F/31_Game_Map.rb:160` |
### 1.2 The base record (`LC/110_Bases.rb`)
| Part | Use here | Evidence |
|---|---|---|
| `rec["pieces"]` `"x,y" => code`: W palisade, B stone (`STONE_VALUE`), D door, S sideways mark, F floor, combos FD / DS / FDS | the boundary grid | `:924-933`, `:976-983`, `:1043-1066` |
| A4 wall = top on (x, y) + face on (x, y+1) when that tile is neither wall nor door; both block | faces must block in the offline grid | `:1164-1212` (`face_at`, `footprint`) |
| `rec["hp"]` only for damaged pieces; `hp_at`, `set_hp`, `clear_hp`; kinds W 600/3, S(B) 1200/8, D 300/3 | HP in, HP out | `:2793-2872` |
| `break_piece` needs the live map (paint, repaint, door event) | away raids edit the record only; `rebuild_tiles` paints from the record at the next setup | `:2887-2916`; `:1307-1333`, `:409-422` |
| `inside_tiles` flood: seeds = play-area edge + tiles next to the exit ring (region 1), doors closed, tile passability only (no events) | the same rule offline | `:1418-1494` |
| `furniture_on(rec)`, `base_empty?`, `remove_record` | furniture in the rooms, revert when nothing is left | `:2349-2357`, `:501-511` |
| `original_data(map)` caches up to 4 map Tables by file | offline Table cache | `:1112-1123` |
| Marker events on the world map, injected in `setup_event_hack` | balloon on raid | `:552-602`, `:685-718` |
| Live map counted as "NPCs present" skips `npc.master == $game_player`; `hostile_near?` too | mercenaries never block building | `:1496-1514`, `:1516-1542` |
### 1.3 Furniture and chests (`LC/90_Furniture.rb`)
| Fact | Evidence |
|---|---|
| Record `{"uid","map_id","x","y","item_name"(,"box")}` in `lonacraft_data["furniture"]`; base furniture keyed by the base's `map_no` | `:50-57`, `:509-519`, `LC/110_Bases.rb:2349-2352` |
| Storage kinds: Chest, Wardrobe (`:storage`); box ids from `BOX_BASE = 66000` | `:79-80`, `:166` |
| Box contents: `$game_boxes.get_box(id)` = `{item object => count}`; `write_box` | `:540-549`; `F/203_Storage Boxes.rb:427-433` |
| Footprint per kind (beds 1x2, BedDark 2x2, ...) | `:400-430`, `:207` (`kind_for`) |
| Offline removal = delete the record (+ box) as `return_furniture`'s fallback does | `LC/110_Bases.rb:2405-2429`; `:766-775` |
| Item value: `price` (Copper Coin 200, Large Copper 2000, Gold 20000, Beer 100) | `Data/Items.rvdata2` ids 50-52, 56; `Data/Effects/Items/other_Coin2.json` |
### 1.4 Live raids (`LC/120_Raids.rb`) reused
| Piece | Evidence |
|---|---|
| Scenario per base region; group weights; `pick_group` | `:103-141`, `:403-427` |
| `base_value` = walls + 2 x doors + 3 x furniture | `:429-435` |
| Breach rule: `max(1, atk - armour) x race factor`; breacher = factor > 0, not ranged, `atk >= min_breach_atk` (3); swing every 60 + rand 30 frames | `:909-934` |
| `EXTRA_UNIT` per group, +1 raider per 30 value (max 4) | `:86-93`, `:697-715` |
| Siege ignores events whose `npc.master == $game_player` when adopting; a raider with a target is left to the game AI | `:684`, `:1013-1033` |
| Config reader: unknown sections skipped (`:254-256`); arrays and hashes refused by `merge_flat` (`:224`) | needs a 10-line extension for new sections |
| Debug menu on Numpad . works only on a base map | `:1304-1316` |
### 1.5 Followers and companions
| Fact | Evidence |
|---|---|
| Three companion slots on `$game_player`: front (1), back (0), ext (-1), each a name + an end `dateAmt` | `E/99_Game_Player_follower.rb:52-66`, `:334-413` |
| Re-summoned by `summon_companion` from the record; disbanded when `dateAmt >= end` | `:491-524` |
| The library templates (`-lib-Follower`, Map143) call `set_this_event_companion_front` in their init block: summoning one WRITES a slot | `r12/evfull.py` dump of CompHumanWarrior / CompHumanSpear; templates loaded from every `-lib-` map, `S/103_FileGetter.rb:422-442` |
| Summoned follower: `@npc.master = $game_player`, drop list cleared, `fraction_mode = 2` | `E/99_Game_Player_follower.rb:430-437` |
| AI `Npc_CompanionCharge`: no target -> no command; a target -> charge unless `follower[:Follower] && !follower[:Following]` (stand mode: only turn) | `E/4000_Npc_CompanionCharge.rb:9-32` |
| Move type from follower flags; no flags -> `:move_type_custom` | `F/39_Game_Event.rb:716-724` |
| Sensor `Eyes_follower` (Eyes + the player's target) | `E/300_Sensor_Map.rb:57-62` |
| Friendliness: same master -> friendly; mode 2 -> master friendly, master's target hostile, else same fraction | `F/281_Game_NonPlayerCharacter.rb:1025-1045` |
| Lona hitting an NPC whose master is her starts no aggro | `F/281_Game_NonPlayerCharacter.rb:874-881` |
| Assembly calls and `follower_goto` only take `follower[:Follower]` / `followerFRONT/BACK` events | `E/99_Game_Player_follower.rb:216-238`; `E/29_Functions_417_Interpreter.rb:225-236` |
| Nap: events not `nappable` are deleted by `reset_events`; summoned events are `foreign_event` | `F/31_Game_Map.rb:359-372`, `:1204-1226` |
| Prices the game asks: Warrior / Bow 2 Beer (200) for 4 units (2 days), Explorer 1 Meat Soup 5 units, Orkind Slayer 1 Good Soup 7 units | `HCG/event/NoerTavernCompHumanWarrior.rb:39-41`, `NoerTavernCompHumanBow.rb:39-41`, `NoerTavernCompHumanExplorer.rb:37-39`, `NoerTavernCompOrkindSlayer.rb:37-39` |
| No "hire guards" / mercenary-squad mechanic exists; the NFL mercenary camp is story (`HCG/event/NFL_MerCamp_*.rb`) | grep of `HCG/event/` |
### 1.6 The guild receptionist
| Fact | Evidence |
|---|---|
| NoerTavern (Map059) event 15 `-point-GuildEmpolyee` at (31,44), `set_npc("NeutralHumanCommonM")`; quest board event 7 at (31,38) | `r12` map dump |
| Script: refuses in combat; quest reports first (`elsif` chain); accept a board quest; else the menu `call_msg("TagMapNoerTavernQuest:QuestBoard/other")` = `\optB[Never mind,About the guild,Cancel quest<r=HiddenOPT0>]` | `HCG/event/NoerTavernGuildEmpolyee.rb:2-6`, `:234-266`, `:268-281`; `Text/ENG/TagMapNoerTavernQuest.txt:177-178` |
| The `\optB` list is INSIDE the translated text, not in the call; `call_msg` wraps the key in `\t[...]` | `E/29_Functions_417_Interpreter.rb:202-207` |
| Hidden options keep their real index (`ConditionalChoice.real_index`), so an appended 4th line is always choice 3 | `F/121_Dialog_Control_System.rb:464-500`; `F/80_Window_ChoiceList.rb:146-161` |
| RolePlayS maps every file of its `HCGframes/event/` over the game's (`$mod_load_script`), incl. this one; its copy adds 4 quest reports and keeps the same final menu | `RPS/Scripts/0_CORE.rb:1705-1716`; `RPS/HCGframes/event/NoerTavernGuildEmpolyee.rb:205-298`, `:363-374` |
| RolePlayS also injects balloon checks into the event | `RPS/Scripts/0_CORE.rb:1163-1183` |
| `load_script` resolves the redirect once (`fetch`) | `S/102_ScriptImport.rb:61-71` |
| Text keys: three-part `LonaCraft:<File>:<id>` keys are the mod's own part | `F/121_Dialog_Control_System.rb:73-158`; `LC/15_Text.rb:4-31` |
## 2. Away raids (item 2), PROPOSED
### 2.1 Trigger
| Point | PROPOSED |
|---|---|
| Hook | alias `Game_Date#shift`, `addDays`, `oneDayForward` (after the original, only when `$game_date.equal?(self)`), as `LC/100_Homes.rb:1052-1072`; `AwayRaids.on_date_moved` |
| Catch-up | each base keeps `away["t"]` (last `dateAmt` handled); every night unit between it and now gets one roll (an `addDays(5)` gives 5 rolls), at most `catchup_days` (14) |
| When | the unit is a night (`dateAmt % 2 == 1`): one roll per game day, night raids as the owner set for live raids |
| Which bases | every record except the base whose `key == $game_map.map_id_rec` (Lona is there: the live raid owns that night) |
| Skips | `raids.enabled` false; the first `grace_days` (1) after Lona left the base (`away["left"]`, written in `Game_Map#setup` when the previous map was a base); `cooldown_days` (2) after an away raid; a base with no wall and no door (nothing to raid) still loses exposed chests (see 2.3) |
| Chance | `p = chance (10) + min(value_bonus_cap 10, value / value_bonus_per 10)` percent, x scenario multiplier (`road`, `house`, `sewer` 1.5; others 1.0), x `deter` 0.5 when a squad is posted there and not down |
| Group | `Raids.pick_group(Raids.scenario_for(rec))` (`LC/120_Raids.rb:403-427`) |
Expected away raids: field base of value 30 = 13 %/day, about 0.8 a week after the cooldown; guarded 0.45 a week.
Recommendation: **one roll per night unit at 10 % + value bonus, cooldown 2 days, grace 1 day**.
### 2.2 Party (no NPCs are made)
`AWAY_UNITS` (config, groups of `EXTRA_UNIT`'s keys) lists each group's units for the 0-25 band, read off
`region_map_wildness_spawn` (`E/34_Functions_RegionMap.rb:361-1115`, counts in `docs/RESEARCH_RAIDS.md` 1.2);
unit stats from `NPC/<unit>.json` (`$data_npcs`, so RolePlayS's overrides count).
| Number | Rule | Example BanditMobs (3 RogueSpear atk 20, 2 RogueScout atk 14) |
|---|---|---|
| breachers | units with race factor > 0, not ranged, atk >= `min_breach_atk` (same as live, `LC/120_Raids.rb:909-920`) + live extras (+1 per 30 value, max 4) | 5 |
| best damage vs armour a | `max(1, atk - a) x race factor` of the strongest breacher | 17 vs palisade / door, 12 vs stone |
| swing budget N | `swings 24 x min(2, 1 + 0.15 x (breachers - 1)) x (1 +- spread 0.25) x (1 + WorldDifficulty x difficulty_scale 0.01)` | 38 (29-48) at difficulty 0 |
| looters | races in `looters` (Human, Moot, Goblin, Orkind, Fishkind); Undead, Abomination, Dog do not carry | 5 |
| carry cap | `carry_per_looter 1500` price units x looters | 7,500 (3.75 Large Copper) |
| power (for mercenaries, 3.6) | sum of `atk x health / 100` | 132 |
One swing = one hit by the best raider; N is how long the party keeps at it in one night. This is the live
model (one raider per stand tile, `LC/120_Raids.rb:942-972`) collapsed to one worker, so live and away
numbers agree: a bandit spear breaks a door in 18 swings (22 s live, `docs/RESEARCH_RAIDS.md` 3.4).
| Group (0-25) | dmg pal/door | dmg stone | swings door / palisade / stone | budget N (mean) | power |
|---|---|---|---|---|---|
| Orkind (4 RandomGoblin, best ~atk 12) | 9 | 4 | 34 / 67 / 300 | 35 | 24 |
| BanditMobs | 17 | 12 | 18 / 36 / 100 | 38 | 132 |
| OrkindPlayGround (Orc atk 20 x 1.5) | 26 | 18 | 12 / 24 / 67 | 42 | 166 |
| UndeadWalking (Elite atk 18 x 0.75) | 11 | 8 | 28 / 55 / 150 | 48 | 339 |
| Fishkind (Commoner atk 17) | 14 | 9 | 22 / 43 / 134 | 35 | 81 |
| WolfGroup, CommonMobs | 0 | 0 | cannot breach | - | 50 / 6 |
(`r12/away_sim.py`; atk from `NPC/*.json`: GoblinSpear 10, GoblinWarrior 15, HobgoblinSpear 20, OrcCommoner 20,
MobHumanRogueSpear 20, MobHumanRogueScout 14, UndeadEliteWarrior 18, FishkindCommoner 17, WildDireWolf 20 race Dog.)
### 2.3 The outside-in simulation
| Step | How |
|---|---|
| Grid | the field map file (`$data_mapinfos[rec["key"]].filename`, Table cached as `Bases.original_data`) + `$data_tilesets[id].flags`; tile passability = `Homes.layer_pass?(data, flags, w, h, x, y, d)` (`LC/100_Homes.rb:618-629`); region ids from layer 3 for the play area and the exit ring (region 1) |
| Pieces overlay | wall tops and their faces blocked (`face_at` rule, `LC/110_Bases.rb:1172-1180`; the lintel over a front door is a top over a door, still blocked), floors passable, wall / door pieces are GATES |
| Rooms | one flood with every wall and door closed: components; the component(s) reached from the seeds of `inside_tiles` (`LC/110_Bases.rb:1440-1460`) = OUTSIDE |
| Edges | each wall / door piece links the components touching its footprint (4 neighbours of the top and of its face) |
| Loop | 1. every furniture piece whose footprint touches a reached component: chest -> loot (cost `loot_swings` 3), others -> smash roll. 2. among pieces linking a reached and an unreached component: cost = `ceil(hp_left / dmg(armour))`; pick the lowest, a door on a tie (doors first, as the live siege). 3. cost <= N: N -= cost, the piece is broken, its components join the reached set (union, no new flood). 4. cost > N: the piece takes `floor(N) x dmg` (HP saved), stop. 5. stop also when the carry cap is full or nothing is left |
| Loot (chest) | sort the box's stacks by unit price, highest first; take whole units until `loot_fraction` 0.5 of the box's value or the carry cap; coins go first because they are worth most |
| Smash | per non-storage piece reached: `smash` 0.25 (stations: Carpentry Bench, Furnace, Anvil, Tailor's Table: `smash_station` 0.10; storage never: it is looted); a smashed piece's record goes, no refund |
| Who | no looters (Undead, wolves, abominations): no loot, smash only; no breachers (wolves, common mobs): only what is outside the walls |
| Break | the record only: W / B / D removed (a door on a floor leaves "F"), `clear_hp`; the next `Game_Map#setup` paints from the record (`LC/110_Bases.rb:409-422`, `:1307-1333`); the door event is not spawned for a gone door (`sync_doors`, `:1913`) |
| Empty | a base left with no piece and no furniture reverts (`remove_record`), as the live end does (`LC/110_Bases.rb:2918-2923`) |
Innermost rooms are reached last: every ring adds its cheapest piece to the cost, and the chests of the outer rooms
use the budget first. A chest standing outside any wall is always exposed.
### 2.4 Report
| Point | PROPOSED |
|---|---|
| Saved | `rec["away"] = {"t" => dateAmt, "left" => dateAmt, "cool" => dateAmt, "reports" => [report, ...]}`; report = `{"at" => dateAmt, "group" => "BanditMobs", "result" => "breached" / "held" / "repelled" / "mercs_beaten", "broken" => [["D", x, y], ...], "damaged" => [["D", x, y, hp], ...], "taken" => [[item_name, count], ...], "smashed" => [item_name, ...], "seen" => false}`; plain types; the last `reports_kept` (5) |
| World map, at once | the base's marker gets balloon 28 (the quest "!" the receptionist uses, `HCG/event/NoerTavernGuildEmpolyee.rb:290-302`) while a report is unseen: set in `Game_Map#setup` after `setup_event_hack` on the world map (marker by name, `LC/110_Bases.rb:552-556`); if Lona is on the world map when the date moves (world-map nap) a queued notice "Smoke over your camp at ..." (`Homes.notice` pattern) |
| On entry | after `Game_Map#setup` of the base map: popup "Your base was raided (N days ago)", then a message window per unseen report: when, who, "Held" or what broke, what was taken, what was smashed; `seen` = true |
| Sewer (named map, no marker) | report on entry only |
| Alternative sprite | `!World Map 02` [6] dir 4 pattern 0 (red debris, `r12/worldmap02.png`) instead of the balloon; not recommended (it hides the base's own picture) |
Recommendation: **balloon + entry report**.
### 2.5 Performance
| Cost | Size |
|---|---|
| Every date move | one `rand` per base (no map work) |
| A raid | one `load_data` of the field map (cached, 4 files), one flood over the play area (Map028: 841 tiles, R4 measured 2.3 ms in Python for the same flood), then union steps per broken piece (no re-flood) |
| Worst | `addDays(14)` with 5 bases: 70 rolls, about 10 raids, all in one frame; fine (no allocation per tile beyond the flood hash) |
### 2.6 Worked examples (`r12/away_sim.py`, 3,000 runs each, pieces only, open plain)
Layouts: 1-room palisade 6x5 with a door (chest, bed, fire inside); 2-ring palisade 18x10 outer ring + 7x4 inner room,
each with a door (yard: chest, fire, station; inner: 2 chests, bed); the same 2-ring all stone; the same with doors at 600 / 6.
| Base | Group | Breached | Inner chest looted | Chests looted | Smashed | With squad: repelled / breached |
|---|---|---|---|---|---|---|
| 1-room palisade | Orkind | 53 % | - | 0.37 | 0.27 | 100 % / 0 % |
| 1-room palisade | BanditMobs | 100 % | - | 1.00 | 0.51 | 100 % / 0 % |
| 1-room palisade | OrkindPlayGround | 100 % | - | 1.00 | 0.51 | 95 % / 0 % |
| 1-room palisade | UndeadWalking | 100 % | - (no looters) | 0 | 0.51 | 0 % / 3 % |
| 2-ring palisade | Orkind | 53 % | 0 % | 0.37 | 0.17 | 100 % / 0 % |
| 2-ring palisade | BanditMobs | 100 % | 32 % | 1.46 | 0.47 | 100 % / 0 % |
| 2-ring palisade | OrkindPlayGround | 100 % | 100 % | 2.93 | 0.60 | 95 % / 0 % |
| 2-ring palisade | UndeadWalking | 100 % | 0 % | 0 | 0.40 | 0 % / 3 % |
| 2-ring stone | all four | same as 2-ring palisade | | | | |
| 2-ring stone, doors 600 / 6 | Orkind / Bandit / PlayGround / Undead | 0 / 25 / 100 / 0 % | 0 % all | 0 / 0.11 / 0.98 / 0 | | |
Reading: depth works (bandits reach the inner room 1 run in 3, goblins never); a door is the weak link of any
ring (300 HP, armour 3: 18 bandit swings against 100 for a stone wall), so a stone keep with wooden doors is no
safer than a palisade. Choice 7 (doors set in stone walls take 600 / 6) fixes that; recommended. Undead and
the squad: 339 power beats a 220 squad (3.6), the squad is beaten, the raid goes on with a smaller budget
(3 % breached because the reduced budget rarely covers a door).
One run drawn: `r12/away_raid_2ring.png` (bandits break the outer door, loot the yard chest, leave the inner
door at 96 / 300 HP).
## 3. Mercenaries (item 3), PROPOSED
### 3.1 Hire at the guild
| Point | PROPOSED |
|---|---|
| Redirect | `Homes.redirect("Data/HCGframes/event/NoerTavernGuildEmpolyee.rb")` from `LC/150_Mercs.rb` (Homes loads first, `loader.rb:30`); wrapper `HCGframes/NoerTavernGuildEmpolyee.rb` = `lonacraft_merc_guild`; it runs the PREVIOUS script through `lonacraft_run_previous_script` (`LC/100_Homes.rb:1393-1403`): RolePlayS's copy when RolePlayS is on (its redirect was set first, `RPS/Scripts/0_CORE.rb:1712-1716`; ours records it as previous, `LC/100_Homes.rb:954-963`), else the game's. No RolePlayS = the game's script, same menu |
| Menu line | while the wrapper runs, a `call_msg` alias (stacked on Homes', `LC/100_Homes.rb:1513-1525`) catches `args[0] == "TagMapNoerTavernQuest:QuestBoard/other"`, reads `$game_text[key]`, appends one entry with `Homes.extend_menu` (`:1017-1031`), stores the result under a runtime key `LonaCraft:Mercs:guild_menu_rt` and calls the original with that key. A literal cannot be passed: the text holds `\CBmp[...]` brackets inside `\t[...]` |
| Index | the line is choice 3 even when "Cancel quest" is hidden (real index, 1.6); picked -> handled inside the alias, then `$game_temp.choice = -1`, so the script's own `case` (`:272-280`) does nothing |
| Line text | not hired: "Hire mercenaries (1 Large Copper a day)"; hired: "Mercenary contract (N days left)" |
| Reach | the menu only shows when no report or board quest is pending (the `else` branch, `:268`); the quest flow is untouched |
| Hire flow | choose 1 / 3 / 7 / 14 days (`\optB`), pay `days x price` Large Copper (`Homes.take_coins` style, `LC/100_Homes.rb:304-316`), the receptionist names the captain; contract starts now |
| Extend from the guild | the same day list adds to the end (as `pay_rent`, `LC/100_Homes.rb:350-363`) |
### 3.2 The squad
| Point | PROPOSED |
|---|---|
| Size | exactly 3: captain + 2 mercenaries |
| NPC data | two new files in the mod, `NPC/LonaCraftMercCaptain.json`, `NPC/LonaCraftMercenary.json`, loaded into `$data_npcs` in a `DataManager.load_mod_database` alias (the RolePlayS way, `RPS/Scripts/0_CORE.rb:160-163`; `S/103_FileGetter.rb:404`). Not the game's CompHuman* data: RolePlayS overrides those (`RPS/NPC/CompHumanWarrior.json`) |
| Stats | mercenary = HumanWarrior without the morality-mark skill: atk 20, def 15, health 300, sta 600, `ai: Npc_CompanionCharge`, sensors `Eyes_follower`, fraction 7, skills `NpcSlashMH`, `NpcSwordHeavy`, `WoodenShieldHeavy`, `WoodenShieldControl` (`NPC/HumanWarrior.json`, `NPC/CompHumanWarrior.json`); captain atk 25, def 20, health 400 |
| Event | runtime `RPG::Event` built like furniture (`LC/90_Furniture.rb:571-635`, spawned with `lonacraft_spawn_event`, `:821`); init block: `set_npc(...)`, `@nappable = false`, `@npc.master = $game_player`, `@npc.fraction_mode = 2`, `@npc.drop_list = []`, `summon_data[:LonaCraftMerc] = "L" / "A" / "B"`; action button -> `lonacraft_merc_talk`. NO `set_this_event_companion_*`, no `set_follower`: no slot used, `follower[:Follower]` stays false |
| Name | captain "Captain <name>" (name picked from `Text/<lang>/Mercs.txt` at hire, saved); mercenaries "Mercenary" |
| Where | the POST base: unset at hire; the squad takes post at the first base Lona enters afterwards ("Captain X: so this is the place.") |
| Post tiles | captain on the walkable tile outside the base's main door (the door nearest the StartPoint), the two beside it; no doors: 3 free tiles next to the base box; fall back to any free inside tile. PROPOSED: guards stand OUTSIDE the main door so they meet raiders before the walls are hit |
| Spawn | after every `Game_Map#setup` of the post base (doors and furniture are re-made the same way, `LC/110_Bases.rb:409-422`); not nappable, so a nap removes and re-makes them (state lives in the save record) |
| Behaviour | no target: a small `update_self_movement` alias (as Raids', `LC/120_Raids.rb:1444-1453`) walks each one back to its post tile and faces out; a target: the game's `Npc_CompanionCharge` charges it (`E/4000_Npc_CompanionCharge.rb:18-31`) |
| Hostility | master = Lona: friendly to Lona and her followers, hostile to her targets and to hostile fractions (`F/281_Game_NonPlayerCharacter.rb:1025-1045`); Lona's hits start no fight (`:874-881`) |
| Down, not dead | at 0 HP the game plays its death; the mod records `down_until = dateAmt + down_days x 2` (1 day) for that one; it is not re-made before; captain down = no talk until then. Nobody is ever killed for good |
| Leader look | distinct sprite (3.4) + name + own lines |
### 3.3 Talking to the captain
| Line | Does |
|---|---|
| Status | days left (`(until - now + 1) / 2`), post base, who is down |
| Add days | 1 / 3 / 7 / 14 days, paid as at the guild |
| Move post | the squad leaves this base now; it takes post at the next base Lona enters (popup) |
| Dismiss | contract ends now, no refund, they leave |
| Cancel | |
### 3.4 Sprites (CHS)
The `-char-` sheets are placeholders (red "?" cells, `r12/male_sheets_contact.png`); the game composes each NPC
from part images: part set number = `(index / 4) x 12 + (index % 4) x 3 + pattern` of the event graphic
(`F/39_Game_Event.rb:1843-1847`, `F/Modules/Charset_System.rb:121-130`, `:250-289`); parts in
`Data/CHSConfig/CHSconfigs_NPC/<sheet>.json`, images in `Graphics/CharacterCharsets/MregC/`. Render:
`r12/merc_candidates.png` (3 head variants each).
| # | Sheet [index] pattern | Part set | Look | Used by (game) | Fit |
|---|---|---|---|---|---|
| M1 | REGULAR01 [5] 0 | 15Warrior | chain / bucket / pot helmet, half plate, sword + metal shield | HumanWarrior (Noer guard) | reads as town guard |
| M2 | REGULAR01 [4] 1 | 13SpearMan | as M1 with a metal spear | HumanSpear | town guard |
| M3 | REGULAR02 [2] 2 | 08CompHumanWarrior | rogue hood, club + wooden shield | CompHumanWarrior (tavern hire) | looks like the tavern hire |
| M4 | REGULAR03 [0] 0 | 00CommonFollowerSpear | headband, wooden spear | CompHumanSpear | |
| M5 | REGULAR03 [2] 0 | 06Scout | bare head, sword, lantern | CompHumanScout | |
| **M6** | **REGULAR04 [2] 0** | **06_NFLwarrior** | **leather armour, sword + painted wooden shield, one fixed look** | **none** | **recommended: mercenary, not guard, not bandit** |
| M7 | REGULAR04 [2] 1 | 07_NFLwarrior2 | red hood version of M6 | none | second mercenary option |
| M8 | REGULAR01 [4] 0 | 12HumanNightKeepers | mixed helmets, sword + lantern | HumanScout | |
| **L1** | **REGULAR01 [3] 2** | **11EliteWarrior** | **great helm, Noer tabard, half plate, sword + metal shield, fixed look** | **none** | **recommended captain** |
| L2 | REGULAR01 [3] 1 | 10EliteLawbringer | L1 with a halberd | HumanLawbringer (an enemy) | |
| L3 | REGULAR01 [0] 1 | 01ShouthGuards | red scarf, pot / chain helmet, no weapon | none | |
| L4 | REGULAR01 [2] 0 | 06HighLanderWarrior | horned helmet, sword + shield | MobHumanHighLander (enemy) | |
| L5 | REGULAR04 [1] 2 | 05_GI_JOE | steel helmet, gas mask, musket | CompMusketeer (tavern hire) | |
| L6 | REGULAR04 [6] 2 | 20 HUM night watch | no armour | none | |
| L7 | REGULAR02 [5] 2 | 17OrkindSlayer | black helm, red crest, sword + shield | CompOrkindSlayer (tavern hire) | distinct but doubles a hire |
| L8 | REGULAR03 [2] 1 | 07BanditWarrior | red hood, sword + shield | MobHumanRogueWarriorElite (bandit) | |
Recommendation: **mercenaries M6 (both the same), captain L1**. Option for variety: one M6 and one M7.
### 3.5 Contract, expiry, save
| Point | PROPOSED |
|---|---|
| Save | `lonacraft_data["mercs"] = {"until" => dateAmt, "base" => id or nil, "name" => "Brann", "down" => {"L" => dateAmt, ...}, "hired" => dateAmt, "warned" => false}`; plain types, no save hook (as Homes, `LC/100_Homes.rb:249-265`) |
| Price | `price_per_day` 1 x `coin` ItemCoin2 (Large Copper, 2,000); 1 / 3 / 7 / 14 days = 1 / 3 / 7 / 14 coins |
| Compare | tavern hire 100 a head a day (2 Beer for 2 days); squad 667 a head a day; inn room 2 Large Copper a WEEK (`LC/100_Homes.rb:164`); guild quests pay 2-7 Copper or 1-4 Large Copper (`HCG/event/NoerTavernGuildEmpolyee.rb:38`, `:51-53`, `:71`, `:98`, `:147`) |
| Expiry | on the date hook (1.1): `now > until` -> contract gone, notice "The mercenaries' contract ended", live squad deleted on the next map frame; 1 day before: notice "One day left on the mercenaries' contract" |
| Base gone | post base removed (destroy-all or emptied): post back to unset, notice |
| Captured / kidnapped | nothing changes (they are at the base) |
### 3.6 Squad and raids
| Raid | PROPOSED |
|---|---|
| Away | if the post base is raided and no member is down: deterrence already halved the chance (2.1); then `squad_power` 220 (x 0.8-1.2) vs party power (x 0.8-1.2): squad wins -> report "The mercenaries drove off <group>", nothing lost; else the squad is down for 1 day and the budget N x (1 - squad / party) |
| Away, numbers (0-25 groups) | repelled: Orkind 100 %, Bandits 100 %, OrkindPlayGround 95 %, UndeadWalking 0 % (2.6); at higher WorldDifficulty party power grows with the same scale as N |
| Live | the squad stands at its posts outside the door; raiders sense them and fight them (they have targets, so the siege driver leaves them to the game AI, `LC/120_Raids.rb:1019`); raid ends as before (raiders only, `:1240`); a downed member stays down |
| Raid code changes | none needed for adoption (`:684` already skips `master == $game_player`) or the build rule; the grace popup gets a captain line when the squad is there |
## 4. Engine and collision notes
| Point | Note | Evidence |
|---|---|---|
| RolePlayS redirect | both chain: RolePlayS sets the map first, Homes-style `redirect` stores RolePlayS's path as previous and points the game path at our wrapper; the wrapper lifts itself for the call so no loop. Without RolePlayS the previous is the game file | `RPS/Scripts/0_CORE.rb:1712-1716`; `LC/100_Homes.rb:954-972`, `:1393-1403` |
| Another mod redirecting later | it would replace ours; ours would then not run (same limit as the two Homes sellers) | same |
| Quest board | untouched: our line exists only in the "nothing pending" menu, picked choices 0-2 run the script's own code | `HCG/event/NoerTavernGuildEmpolyee.rb:268-281` |
| Balloon checks | RolePlayS's injected balloon code and the script's tail run unchanged | `RPS/Scripts/0_CORE.rb:1163-1183`; `:283-302` |
| Companion slots | 3 (front, back, ext); the squad uses none, and must not use the `-lib-Follower` templates (they write a slot in init) | `E/99_Game_Player_follower.rb:52-66`; `r12/evfull.py` |
| Follower commands | assembly call, `follower_goto` and the shift-call skip the squad (no Follower flags) | `E/99_Game_Player_follower.rb:216-273`; `E/29_Functions_417_Interpreter.rb:225-236` |
| Naps | squad events are not nappable: `reset_events` deletes them, `after_setup` re-makes them; a raid spawned by the nap's BIOS meets them | `F/31_Game_Map.rb:359-372`; `LC/120_Raids.rb:500-516` |
| Build rule / threat | `npcs_present?` and `hostile_near?` skip master = Lona; `$game_map.threat` is about NPCs tracking Lona | `LC/110_Bases.rb:1496-1542`; `F/31_Game_Map.rb:951-968` |
| Siege driver | skips them on adoption; the dog check is race Dog only | `LC/120_Raids.rb:684`, `:717-721` |
| Sight through walls | the squad cannot hit through a palisade or a closed door either (tag 4), hence posts outside | `docs/RESEARCH_RAIDS.md` 3.1 |
| Config | `merge_user` skips unknown sections and `merge_flat` refuses lists: add `"away"` and `"mercs"` sections with their own merge (lists: `looters`, `day_choices`, `AWAY_UNITS`) | `LC/120_Raids.rb:218-262` |
| Debug key | every numpad key is taken (0 1 3 5 7 9 + - * / . and the game's 2 4 6 8); extend the Numpad . raid menu: off a base map it offers "away raid on base N now" and "hire squad 3 days free" | `LC/120_Raids.rb:75`, `:1304-1316` |
| Map file for RolePlayS fields | the base key is registered with the right filename (`register_all`), so the offline load works for RolePlayS's file-path maps | `LC/110_Bases.rb:315-375` |
## 5. Config (PROPOSED, `Config/Bases.json`)
```json
{
"away": {
"enabled": true, "chance": 10, "value_bonus_per": 10, "value_bonus_cap": 10,
"scenario_mult": {"road": 1.5, "house": 1.5, "sewer": 1.5},
"grace_days": 1, "cooldown_days": 2, "catchup_days": 14,
"swings": 24, "per_extra_breacher": 0.15, "breacher_cap": 2.0, "spread": 0.25, "difficulty_scale": 0.01,
"loot_swings": 3, "loot_fraction": 0.5, "carry_per_looter": 1500,
"smash": 0.25, "smash_station": 0.10, "reports_kept": 5,
"looters": ["Human", "Moot", "Goblin", "Orkind", "Fishkind"]
},
"mercs": {
"enabled": true, "coin": "ItemCoin2", "price_per_day": 1, "day_choices": [1, 3, 7, 14],
"squad_power": 220, "deter": 0.5, "down_days": 1
}
}
```
## 6. Work breakdown (PROPOSED)
| Item | Scope | Files | Ruby lines | Depends on | Needs the owner's numbers |
|---|---|---|---|---|---|
| AR-1 Room graph + simulation | offline grid (map file + pieces), components, union per break, budget loop, loot / smash, record edits (no live map), revert when empty | `LC/140_AwayRaids.rb` (new) | 300 | base record; `Homes.layer_pass?` | budget, loot, smash (choices 2-5) |
| AR-2 Trigger, reports, notice | date hooks + catch-up, chance, `left` / cooldown, report list, entry popup + window, marker balloon, world-map notice, `away` config section, texts | `LC/140_AwayRaids.rb`, `LC/120_Raids.rb` (config sections, ~20), `Text/<5 langs>/Raids.txt` (+12 keys), `loader.rb` | 220 | AR-1 | chance (choice 1), report form (6) |
| AR-3 Debug + dry run + docs | Numpad . menu off-base entries, console lines, README "Away raids", `away_sim.py` kept as a static check | `LC/120_Raids.rb`, README | 80 | AR-2 | none |
| MC-1 Guild contract | redirect + wrapper, `call_msg` alias with runtime key, hire / extend flow, payment, record, expiry + warnings, `mercs` config, texts | `LC/150_Mercs.rb` (new), `HCGframes/NoerTavernGuildEmpolyee.rb` (new, 5 lines), `Text/<5 langs>/Mercs.txt` (new, ~25 keys), `loader.rb` | 230 | Homes redirect | price, days (choices 8-9) |
| MC-2 Squad on the base | NPC jsons (2), event build + spawn after setup, post tiles, return-to-post driver, down state, captain dialogue (status / add days / move / dismiss) | `LC/150_Mercs.rb`, `NPC/*.json` (new, 2) | 270 | MC-1; base record | sprites, stats, posts (choices 10-12) |
| MC-3 Squad in raids | away: deterrence + power fight + "drove off" report; live: captain line in the warning | `LC/140_AwayRaids.rb`, `LC/150_Mercs.rb`, `LC/120_Raids.rb` (~5) | 50 | AR-2, MC-2 | squad power (choice 13) |
Total about 1,150 lines. Order: AR-1 -> AR-2 -> MC-1 -> MC-2 -> MC-3 -> AR-3 (MC-1 can run beside AR-1).
`LC/110_Bases.rb` is not edited (the other builder holds it); choice 7, if taken, is a 5-line change in
`hp_kind` / `max_hp_of` there (`LC/110_Bases.rb:2820-2835`) once that builder is done.
## 7. Not covered
Raiders taking furniture items whole; raids on homes (Homes rooms); mercenaries following Lona or escorting; more
than one squad; mercenaries repairing walls; an iron door item; away raids changing `WildDangerous`.
## 8. Risks
| Risk | Mitigation |
|---|---|
| Map file events (trees, rocks) are ignored offline, as in `inside_tiles` | same rule as the live enclosure, so both agree |
| A save edited by an away raid while a live map is the base | never: the base Lona is on is skipped |
| `$game_text` runtime key across a language change | rebuilt every time the wrapper runs |
| RolePlayS renames the menu key in a later version | the alias does nothing, the receptionist works as before, console line |
## 9. Choices for the owner
| # | Choice | Options | PROPOSED |
|---|---|---|---|
| 1 | Away chance | 10 % a day + value bonus (max +10), road / house / sewer x 1.5, grace 1 day, cooldown 2 days / a flat % / the live nap roll's numbers | 10 % + bonus, grace 1, cooldown 2 |
| 2 | Strength model | swing budget (24 x breacher factor, +-25 %) / HP points / time in frames | swing budget 24 |
| 3 | Loot | half a chest's value, highest price first, carry 1,500 a looter / whole chests / nothing (break only) | half, carry 1,500 |
| 4 | Smash | 25 % a piece, stations 10 %, chests never / none / always | 25 % / 10 % / never |
| 5 | Who loots | humans, moot, goblins, orkind, fishkind; undead, wolves, abominations only smash | as listed |
| 6 | Telling Lona | marker balloon at once + report on entry / report only / a debris marker sprite | balloon + report |
| 7 | Doors in stone walls | 600 HP / armour 6 / unchanged 300 / 3 / a new iron door item later | 600 / 6 (otherwise a stone keep is no safer than a palisade, 2.6) |
| 8 | Price | 1 Large Copper a day for the squad / 5 Copper a day / 1 Gold a week | 1 Large Copper a day |
| 9 | Days offered | 1 / 3 / 7 / 14 / weeks only like rent | 1 / 3 / 7 / 14 |
| 10 | Sprites | mercenaries M6 x2 + captain L1 / M6 + M7 + L1 / M1 + M2 + L7 | M6 x2 + L1 |
| 11 | Which base | the first base entered after hiring, "move post" from the captain / chosen at the guild from a list / the last base visited | first base entered, move from the captain |
| 12 | Posts | outside the main door / inside the walls / wander the yard | outside the main door |
| 13 | Squad strength | power 220 (beats 0-25 bandits and orcs, loses to undead) and deterrence x 0.5 / stronger / deterrence only | 220 and x 0.5 |
| 14 | Losses | down for 1 day, never killed / killed, rehire / no fighting at all | down 1 day |
| 15 | Config | `away` and `mercs` sections in `Config/Bases.json` / a new file | `Config/Bases.json` |
## Change 2026-10-08: leaving during a raid
Owner rule (2026-10-08): "If the player leaves the map, with a base, during a raid (any raid, night time event), then it needs to get treated like an away raid."
**Hook.** `Scripts/120_Raids.rb` `leave_check`, called from its `Game_Map#setup` alias BEFORE the game's setup (`31_Game_Map.rb:159`). Every way off the map passes there while the raiders are still on it: the map edge / exit menu (`change_map_region_map_exit` -> `change_map_leave_region`, `34_Functions_ChangeMap.rb:377, 271`), the tag-map exit (`change_map_leave_tag_map`, :179), a capture, a story transfer. `change_map_leave_*` only reserve the transfer and miss the other paths; after the setup the old events are gone. A setup of the same map (a nap, `handleNap` -> `setup(map_id_rec)`, the game's own nap test at `31_Game_Map.rb:165`) is not a leave: the raid stays live (and a nap is refused during a raid anyway). No new alias: the existing `setup_lonacraft_raids` row of the self-test covers it; rows added for `Game_NonPlayerCharacter#health`, `#atk`, `#ranged?`.
**When.** A raid in its warning (grace), siege or assault phase, or any `:hostile` siege (always in its siege phase), with at least one unit up. Not while the group is still collected (2 s after the nap) or while it retreats (they gave up); those end as before (`:left`).
**What is handed over.** The units up (the mod's raiders and the hostiles that joined): `$data_npcs` name, race, atk, CURRENT health (wounded raiders are weaker), ranged. Raiders adopted after `reserve_extras` are the extras (`r[:extra_ids]`) and add no swings (option A). The party is `AwayRaids.party_of(units)`: breachers, looters, power exactly as for a rolled away raid; the swing budget `budget(pt)` (24 x min(2, 1 + 0.15 x (own breachers - 1)) x (1 +- 0.25) x World Difficulty x the level's `away_power_mult`). The group: the raid's own; for a `:hostile` siege the nap tag (`summon_data[:WildnessNapEvent]`) most units carry, else "Hostiles" (report: "raiders").
**The run.** `AwayRaids.left_raid!` -> `raid!(rec, now, group, pt, kind)` at once on the record as it stands: pieces keep the HP the siege left (`rec["hp"]`), broken ones stay broken. All away rules hold: break only to reach a target, one breach per boundary, the smash cap, the loot share and carry cap, the mercenaries' fight (guard at the base, knock-down when beaten), the maid, the difficulty level's away multipliers. The report goes into `rec["away"]["reports"]` with `"left" => "raid" / "hostile"`; the report window adds `Away/r_left` ("You left during the raid. They had the place to themselves.") under the first line; the smoke popup is queued; the world-map "!" is set by the world map's own setup (the record is written before it).
**No double hit.** `rec["away"]["cool"] = now` (the cooldown, as after any away raid) and `rec["away"]["skip"]` = that night's date unit (now when odd, the next odd unit by day), which `roll?` refuses; `rec["away"]["t"]` moves to now.
**The live raid's end.** `end_raid(:handed)`: no "The raid is over." popup, no `check_enemy_survival?`, no `revert_if_empty` (as `:left`; the away run removes an emptied base itself). The game's own bookkeeping (`OnRegionMapSpawnRace`, `OverMapEvent_name`, `WildDangerous`) is left to the game: the ordinary leave paths run `change_map_story_stats_fix` (`34_Functions_ChangeMap.rb:131`, the race to 0) and the region entry clears `OverMapEvent_name`, so the game's nap group is not respawned on return (a capture runs `change_map_captured_story_stats_fix`, which keeps the race; the game's own capture flow owns that); the mod clears `@armed` and the debug start. Back on the map: no raid runs, the pieces are drawn from the record, the entry report shows.
**Console / trace.** `raid: Lona left during <raid|hostile siege> at <base>, N raiders, handing to away raid`; `away: left-raid on <base>: <result>, broken N, damaged N, taken [...], smashed [...]` (trace file with debug and trace on).
**Worked case** (`r13/away_sim2.py` port, `leave/case.py`, 4,000 runs, 2-ring palisade base of 2.6, Hard): bandits, 3 spears + 2 scouts, all up, no extras.
| Case | Breached | Pieces broken | Pieces damaged | Half-HP wall broken | Inner chest looted | Loot / raid | Smashed / raid |
|---|---|---|---|---|---|---|---|
| left mid-siege: 5 bandits, one outer palisade at half HP (300) | 100% | 1.62 | 0.38 | 0% | 62% | 5,786 | 0.52 |
| left mid-siege: 5 bandits, that palisade at quarter HP (150) | 100% | 2.00 | 0.00 | 100% | 100% | 7,500 | 0.60 |
| same, all pieces full HP | 100% | 1.62 | 0.38 | 0% | 62% | 5,786 | 0.52 |
| a rolled away raid (group + extras), palisade at half HP | 100% | 1.62 | 0.38 | 0% | 62% | 9,190 | 0.52 |
A palisade at half HP costs the same 18 swings as a door (17 damage a swing) and a door wins a tie, so the half-HP wall changes nothing in this layout; below half it is the cheapest breach and the inner room always falls. The 5 units left carry 7,500 (5 looters) against the rolled raid's larger band.
## Change 2026-10-08: standing tiles and hunting
Owner (2026-10-08): "The mercenary hires need to not block any doors. Easy fix is to prevent them from posting up against any base wall." And: "They need logic that any hostile enemies on the map, they need to just go ahead and start doing a patrol routine so they can find them and attack. Right now they just stand there until they spot an enemy. So a goblin could be attacking the walls on the other side while they stand around. Maybe they don't patrol, and we just change their AI logic to all attack any enemies on the map. This would use the same considerations we use to block building. Wildlife shouldn't count. Also, anything the player attacks, the mercenaries become hostile to and help out." Built: the direct version (no patrol).
**Standing tiles** (`Scripts/150_Mercs.rb` `blocked_tiles`, `post_tiles`, `repost`). Blocked: every piece of the base (walls, doors, floors, furniture: `Bases.pieces_of`) and its 4 neighbours (`POST_GAP` 2: a post is at least 2 tiles, 4 directions, from every piece), and the `DOOR_LANE` 3 tiles straight out of each door in each direction. A post is a free walkable tile (`Raids.free_tile?`) off that set. Order: the outside (`Raids.flood_outside`) by walking distance (`Raids.bfs`) from the tile outside the main door (the door nearest the StartPoint; no door: the outside tile next to the base nearest the StartPoint), ties off the door's straight line first, then by y and x; then the tiles inside the walls (`Bases.inside_tiles`) by distance to the door. Roles in the order A, B, L (the captain takes the third tile). Nothing left: the free tile (outside or inside) farthest from the door, a console line "no free tile 2 from the base pieces for <role>: the farthest free tile from the door, [x, y]", and the post carries a 4th element `true` (never re-checked). Used at every spawn (map setup; only the roles that are missing, the others' posts taken), and every 30 frames when the base's [pieces, doors] count changes: a member whose post is now blocked gets a new one (console line "posts chosen again for ..."), so the walk back after a fight ends on a clear tile.
Sample base (7 x 5 palisade box, walls x 5-11, y 5-9, door at 8,9 in the south wall, open field, StartPoint 8,18; `postsim.py` port of the rule): door outside tile 8,10, face down; A 7,11, B 9,11, captain 6,11; every post 2 tiles from the nearest piece; the row along the wall (y 10) and the lane 8,10 - 8,12 stay free. Same box with the door at 11,7 in the east wall: A 13,6, B 13,8, captain 12,4 (diagonal to the corner).
**Hunting** (`engage`, `engage_one`, `hold`, `foes`, `lona_hit`). Every `CHECK_EVERY` (30) frames while the squad is posted on this map, for each member that is up:
- A target the game's AI took itself (a raider it saw in a live raid, anything its sensor picked) is left to it: the live-raid behaviour is unchanged.
- Foes: every NPC event `Bases.counts_as_hostile?` counts (new in `110_Bases.rb`, the loop body of `blocking_hostile`, so the build rule and the squad share one test: alive, up (sta > 0), no object or missile, not Lona's side; attacking Lona's side now (any race, wildlife included), or no animal and `would_attack_lona?`), plus every NPC Lona hit on this map (`Game_NonPlayerCharacter#set_last_attacker` alias, `@last_attacker` is `$game_player`, the game's own record, `BattleSystem.rb:428` and `281_Game_NonPlayerCharacter.rb:874`, which also sets `$game_player.target` for 300 frames only): animals, traders and guards included; Lona's companions, the maid and the squad never; kept until it dies, is deleted or the map changes.
- The nearest foe (straight-line steps) not skipped is engaged with the game's aggro: `npc.set_aggro(foe.npc, nil, ENGAGE_FRAMES)` (`281:1256`: `@target`, `@alert_level` 2, `@aggro_frame` 300, the game's `@combatAggroTime` base). Only when the member is idle (action state nil / :none), so no skill is cut, and never on a foe with `user_redirect` (set_aggro would aim at its user, `:1264`); Lona's hits on missiles and other non-creatures (`NOT_CREATURE_RACES`) are not recorded. Each check `@aggro_frame` is topped up to 300 while the target is the same.
- Why that is enough: `sense_target` (`281:417`) senses only the target (mode 3) and, unseen, returns while `@aggro_frame` is not 0 (`:459`), so the target holds across the map; `Npc_CompanionCharge#get_move_command` walks to it (`move_toward_TargetSmartAI`, `39_Game_Event.rb:1282`); once sensed, `process_target` -> `decide_ai_state`: `fucker?` is false and `killer?` true while aggro runs (`:731`, `:751`), `friendly?` is false for the aggro target (`:1032`) -> `process_killer` -> `set_killer_skill` (`:904`). `update_aggro_frame` (`:1220`) drops a dead target itself.
- Dead, gone or no longer a foe: the next foe. None: the member is left without a target and the `update_self_movement` alias walks it back to its post (trace "back to post").
- No step nearer in `GIVE_UP_CHECKS` (20 checks, 10 s) while more than 1 tile away: `process_target_lost(false)`, that foe skipped by that member for `SKIP_CHECKS` (60 checks, 30 s), trace "cannot reach".
- Trace (debug + trace on): `mercs: <name> engages <npc> (event N) (reason hostile|lona attacked)`, `mercs: <name> back to post`, `mercs: <name> cannot reach <npc>`; names: "<captain> (captain)", "mercenary A" / "B".
- Cost: one pass over the map's events per 30 frames (the build rule's own test per NPC), no pathfinding of the mod's own (the walk back uses the cached distance map per post, cleared when pieces change).
**Self-test rows** (`98_SelfTest.rb` METHODS): `set_last_attacker_lonacraft_mercs` (1), `set_aggro` (-3), `aggro_frame` (0), `update_aggro_frame` (0), `sense_target` (-2), `killer?` (2), `set_killer_skill` (1), `process_target_lost` (-1), `action_state` (0), `npc_dead?` (0), `event` (0), `user_redirect` (0) of `Game_NonPlayerCharacter`; `Npc_CompanionCharge#get_move_command` (0); `Game_Event#move_toward_TargetSmartAI` (-2).
**Limits.** No patrol: a foe that cannot be reached (across water, inside closed walls) is tried for 10 s, then skipped for 30 s and tried again. The squad keeps the game's own sensing too: what it fights on its own (its tri-state rules) is the game's, as before.
@@ -0,0 +1,493 @@
# R3 Base building research (walls, floors, doors on wilderness world-map tiles)
Board item R3 (owner, 2026-10-06). Research only: nothing in the mod was changed. Options are
PROPOSED, one recommendation each; the owner settles them before design.
Path short forms: `F/` = `LonaRPG/Data/Scripts/Frames/`, `E/` = `LonaRPG/Data/Scripts/Editables/`,
`HCG/` = `LonaRPG/Data/HCGframes/`, `LC/` = `ModScripts/_Mods/LonaCraft/Scripts/`,
`CS/` = `ModScripts/_Mods/Campsites/Scripts/`. Map facts were read from the `.rvdata2` files with
the scratchpad tools (`r3/regmaps.py`, `r3/tilesets.py`, `tools/home_evdump.py`).
## 0. Summary
| Question | Finding | PROPOSED |
|---|---|---|
| Where is "a base on a wilderness tile"? | Entering a tile loads a random map of that region each time (`E/34_Functions_ChangeMap.rb:263`); field maps are small (522-992 passable tiles, plains are a 25 x 25 square; forests are corridors) | Base = the mod's own base map per biome family, entered from the overmap tile and keyed by that tile (option B) |
| Walls with autotiling | Map tiles can be rewritten at runtime (Homes already does it, `LC/100_Homes.rb:1187-1204`); every wilderness tileset has 32 A3 and 24 A4 wall kinds | Walls are TILES: A4 top + face (building look), A3 kind as the cheap "palisade" |
| Floors | Layer-0 swap to an A5 tile, no autotile needed | Tiles |
| Doors | Game doors are 2-page events toggled by `doorEV_setup` (`E/29_Functions_417_Interpreter.rb:943-961`) | Placed door = the same 2-page event, built like a furniture piece |
| Persistence | Furniture records are per map number (`LC/90_Furniture.rb:745-768`) | One record per base in `$game_system.lonacraft_data["bases"]`, tiles as a grid string (596 B for 20 x 20 against 33,403 B as furniture-style records) |
| Build size | | 8 build items in 4 phases, about 1,000-1,200 Ruby lines + 11 generated maps |
## 1. World map model
### 1.1 How a wilderness tile becomes a field map
| Step | Evidence |
|---|---|
| OvermapMain is Map002, note `isOverMap=true`, 170 x 150 tiles, 168 events | Map002 note; `F/31_Game_Map.rb:285-303` reads `isOverMap` from the note, makes the player transparent and the map turn-based |
| Each overmap tile has a region id (layer 3 >> 8); 4,709 of 25,500 tiles have one (ids 1-32), 20,791 are region 0 | `F/31_Game_Map.rb:880-882`; Map002 count |
| The action key on an overmap tile reserves the region event | `F/35_Game_Player.rb:604-620` (`check_region_event`, only when `isOverMap`) -> `F/10_Game_Temp.rb:107-109` -> `E/22_GMI_CommonEvents.rb:41-48` |
| Region menu: Cancel / Relax / Observe / Remove tracks / Enter / Kyaaah | `E/33_Functions_OverMapEvents.rb:27-132` |
| "Enter" calls `change_map_enter_region` | `E/33_Functions_OverMapEvents.rb:106`, `:132` |
| The map is picked AT RANDOM from all maps whose note has `region=<id>`, on every entry | `E/34_Functions_ChangeMap.rb:257-269` (`$data_region_maps[$game_player.region_id].sample`), list built at boot in `F/5_DataManager.rb:351-388` |
| Way back: overmap id and LastOverMapX/Y | `E/34_Functions_ChangeMap.rb:259-260`, `:271-289` |
| The field map is reloaded from disk at every setup, so nothing on it persists | `F/31_Game_Map.rb:172` |
| Its events are rolled again on every entry: BIOS spawns resources and wildlife on in-map region ids while `ReRollHalfEvents` = 1 | Map028 event 1 (BIOS); `E/34_Functions_ChangeMap.rb:138` sets it, `:114` clears it |
| 30 callers of `change_map_enter_region` (region menu, encounters, out-of-stamina nap on the overmap) | grep; Map002 event 9 (NapEvent: `sta <= -100` -> `change_map_enter_region`) |
So the same overmap tile does NOT give the same map: PlainField (region 1) picks one of Map016, 026, 028.
### 1.2 Field map families (wilderness and towns)
| Region (overmap name) | Field maps | Tileset | Passable tiles (measured) |
|---|---|---|---|
| 1 Plainfield | 16, 26, 28 | 14 RMDLC OUTA | 625 each (25 x 25 open square, x 36-60, y 31-55 on Map028) |
| 11 Road | 32, 33, 34 | 14 | 612 (34) |
| 23 Highway | 51, 54, 55 | 14 | 625 (51) |
| 12 Rudesind Slope | 83 | 14 | - |
| 2 / 27 Shore | 27, 147, 149 | 4 RMDLC ACJbeach | 764 (27) |
| 5 Pine Forest | 13, 30, 124 | 10 Exterior417a1 | 587 (30) |
| 7 Mountain | 37 / 184 | 28 / 45 Mountain,Poor | 1,063 (37) |
| 8/25 Swamp, 13/24 Swamp Trail, 15/26 Marsh | 19, 163 / 101, 102 / 108, 125 | 32 Exterior417 swAMP | 522 (19) |
| 4 Rain Forest | 29, 80, 93 | 18 Mack-badlandOUTA | 525 (29, all in narrow paths) |
| 3 Infested Mountain | 39 | 29 AbomMountain | 879 |
| 6 Dead Forest | 21, 127 | 39 badlandTerrian | 522 (21) |
| 14 Wasteland, 16 Infested Creep, 28 Infected Terrain | 107, 112 / 131, 134 / 160, 161 | 17 Mack-badlandINSA | 3,431 (107) |
| 19 Polluted Land | 111, 159 | 40 badlandTown | 992 (111) |
| 9 Abandoned House | 45 / 47 | 23 / 13 | - |
| 20 Refugee Camp | 35 | 13 Interior-poora | - |
| Towns and ruins: 10 Slums, 17 Blighted Road, 18 Infected City Ruins, 21 Town of Noer, 22 Streets of Noer, 29/30 Fortress Ruins, 31/32 Sybaris | 17, 170 / 145, 146 / 150 / 4, 5, 7 / 48, 56, 57 / 191, 192 / 200, 201 | 42, 40, 23, 34, 15 | - |
Region names: `LonaRPG/Text/ENG/OvermapEvents.txt:160-256`. Every playable tile of Map028 has a
spawn region (3, 4, 7, 9-12) and the ring around it is region 1 (exit trigger, Map028 event 4
`set_region_trigger(1)` -> `change_map_region_map_exit`, `E/34_Functions_ChangeMap.rb:377-401`).
Renders: `scratchpad/r3/plainfield1_play.png`, `scratchpad/r3/rainforest1_small.png`.
### 1.3 Sleeping and camping today
| Where | What runs | Evidence |
|---|---|---|
| Overmap, "Relax" | heal from satiety only, no map change | `E/33_Functions_OverMapEvents.rb` Relax branch; `E/100_Game_Player_handle_on_move.rb:135-142` |
| Overmap, nap | Map002 event 9 NapEvent: `handleNap` on the overmap, or forced into a random field map when stamina <= -100 | Map002 event 9 |
| Field map, nap | Map's NapEvent (Map028 event 32) -> `region_map_wildness_nap` -> maybe a raid (`region_map_wildness_nap_stats`, loads `HCG/encounter/<race>`) -> `handleNap` | `HCG/Command_Nap.rb:10`, `F/31_Game_Map.rb:1299-1308`, `E/34_Functions_RegionMap.rb:237-246`, `:1645-1840` |
| Any nap | `$game_map.setup(map_id)` again (tile data reloaded), live events kept only if `nappable`, spriteset re-created | `F/Game_InterpreterModifies/Game_Interpreter_Modifies_OM.rb:12-47`, `F/31_Game_Map.rb:359-372` |
### 1.4 What Campsites does (closest prior art)
| Point | Campsites | Evidence |
|---|---|---|
| Loaded? | No: `Banned = 1` | `UserData/GameMods.ini` |
| Record per camp | `{id, map_id, x, y, region_id, biome, camp_tag, icon_event, raid_event, expire_segment}` in `$game_system.campsites_list` (the OVERMAP tile) | `CS/10_Campsites.rb:203-225`, `:291-303` |
| Biome | overmap region id -> name table, towns included (21, 22, 31, 32) | `CS/10_Campsites.rb:25-58`, `:129-131` |
| City vs wilderness | not checked. `can_setup_here?` needs `isOverMap` and a random tag map; OvermapMain's note has no `event=` tag, so the option never shows on Map002 | `CS/10_Campsites.rb:149-175`, Map002 note `isOverMap=true` |
| Inside of a camp | one fixed tag map per biome via `change_map_enter_tag`; the 21 `Camp_*.rvdata2` maps and `CampEvents.rvdata2` named in `mod.cfg` are not in the mod folder | `CS/10_Campsites.rb:240-244`, `:263-288`; `Campsites/mod.cfg` |
| Overmap marker | an EventLib event re-summoned at every overmap setup | `CS/10_Campsites.rb:184-193`, `:305-317` |
| Expiry / raids | expires after PERSIST_DAYS x 2 nap segments; raid roll in an alias of `process_nap_change` | `CS/10_Campsites.rb:69-71`, `:235-255`, `:319-346` |
| Menu | replaces the whole `overmap_event_EnterMap` | `CS/10_Campsites.rb:348-482` |
Nothing built inside a camp persists; only the overmap record does. The useful parts are the
overmap key (map id + x + y) and the icon re-summon.
### 1.5 What "base on a wilderness tile" can mean (PROPOSED)
| Option | How | For | Against |
|---|---|---|---|
| A. Pin the game's field map | Base record keeps the field map number picked on the first visit; a per-base runtime map number points at that game file, so entering that tile always loads it | no map authoring; real biome, BIOS weather, gathering | space: 25 x 25 on plains, corridors in forests (1.2); BIOS spawns land inside the base unless region filtering (6); StartPoint and the exit ring must stay free; a game update that edits the map moves terrain under the base |
| B. The mod's own base map per biome family | A generated template map per tileset family (about 11), e.g. 40 x 40 open ground of that biome with the exit ring, a BIOS (biome weather) and a NapEvent; one runtime map number per base slot, all pointing at the template file | room to build; no clash with game events; own NapEvent = clean raid hook; immune to game map edits | 11 maps to generate (one script, as `home_build_stonehouse.py`); less "the field Lona saw" |
| C. On the overmap tile itself | Write tiles into Map002 | none | 1 overmap tile = a whole region; overmap is turn-based with the player hidden (`F/31_Game_Map.rb:292-296`) |
Recommendation: **B**. Key the base by the overmap tile like Campsites (Map002 id, x, y), allow it
only on a wilderness region whitelist (PROPOSED: 1-8, 13-16, 19, 24-28; owner to decide roads 11, 23
and Abandoned House 9 / Refugee Camp 20), and enter it with an "Enter base" line in the region menu
plus an alias of `change_map_enter_region` (`E/34_Functions_ChangeMap.rb:257-269`) that sends Lona to
the base when she enters that tile any other way (encounters, out-of-stamina nap). A is the fallback
for plains/roads only.
Per-base runtime map number: `$data_mapinfos[<key>]` with its own `.id` and `.filename` = the
template (or, for A, `Data/MapNNN.rvdata2`), exactly as Homes registers its houses
(`LC/100_Homes.rb:546-576`, setup key fix `:580-590`); `Game_Map#setup` only reads
`$data_mapinfos[map_id].filename` (`F/31_Game_Map.rb:170-172`). Distinct map numbers per base keep
the furniture code working unchanged (its records are per map number, `LC/90_Furniture.rb:745-751`).
## 2. Walls with autotiling
### 2.1 Can a mod change tiles at runtime?
| Point | Evidence |
|---|---|
| Tile data is `@map.data` (a Table, 4 layers: 0-2 tiles, 3 = shadow + region) and is freshly loaded at each setup | `F/31_Game_Map.rb:172`, `:524-526`, `:880-882` |
| Writes before the events are built: `setup_event_hack` runs after load, before `setup_region_map` and `setup_events` | `F/31_Game_Map.rb:193`, `:199`, `:205`, `:223-225` |
| LonaCraft already writes tiles there: `lonacraft_apply_tile_overrides` and the floor fill of owned rooms | `LC/100_Homes.rb:1187-1204`, `:1252-1259`, hook `:1285-1304` |
| Passability reads the live tiles: `check_passage` over `layered_tiles` with the tileset flags | `F/31_Game_Map.rb:734-756`, `:773-776` |
| Pathfinding reads the same `check_passage` | `F/202_pathfinding.rb:399-410`, `:465-475` |
| Drawing: `update_tilemap` assigns `$game_map.data` to the tilemap every frame | `F/49_Spriteset_Map.rb:322-328` |
| Engine is stock RGSS3 (`System\RGSS301.dll`) | `LonaRPG/Game.ini` |
| A nap re-runs setup and re-creates the spriteset | `F/Game_InterpreterModifies/Game_Interpreter_Modifies_OM.rb:24`, `:37-38` |
| The live map (with written tiles) is saved inside `$game_map` and not reloaded on load unless the game version changed | `F/5_DataManager.rb:939`, `:964`, `:994-1000` |
UNVERIFIED (no agent runs the game): that an in-place write shows on the next frame. VX Ace's
Tilemap is known to redraw from the Table it holds, but the first build item must prove it; the
fallback is the nap's own `SceneManager.scene.dispose_spriteset; create_spriteset`
(`Game_Interpreter_Modifies_OM.rb:37-38`), a short hitch per placed piece. Tiles written in
`setup_event_hack` need no redraw at all.
### 2.2 Wall and floor sheets in the wilderness tilesets
| Tileset | Maps (region) | A3 sheet | A4 sheet | A5 sheet | A4 used by the maps |
|---|---|---|---|---|---|
| 14 | 1, 11, 23, 12 | TileA3 | TileA4 (stone, wood, timber, plaster, brick, log walls) | TileA5_exterior1 | none (Map083: 9 kinds) |
| 4 | 2/27 | TileA3 | Village&town A4 Cliffs_And_Mines (cliffs and mine walls only) | TileA5_exterior1 | 113-116, 122 |
| 10, 28, 45, 32 | 5, 7, 8/25, 13/24, 15/26 | Outside_POOR_A3 | Outside_POOR_A4 (stone, brick, wood walls; cliffs 112-127) | Outside_POOR_A5 | 112, 113, 117, 120-125 (cliffs) |
| 18 | 4 | macks_A3 | macks_A4 (brick, plank, timber, plaster walls 96-111) | macks_A5 | none |
| 17, 29, 39 | 14, 16, 28 / 3 / 6 | macks_A3 / TileA3 (39) | macks417_badland_A4 (same wall rows as macks_A4) | macks_A5 / TileA5_exterior3 (39) | 113, 114, 120 (29), 82 (39) |
| 40 | 19 | TileA3Abom | macks417_AbomTown_A4 (stone, wood walls 96-111) | TileA5_exterior1 | none (Map111) |
| 13 | 20, 9 (Map047) | Outside_POOR_A3 | Inside_POOR_A4 (indoor walls) | Inside_POOR_A5 | 83, 84, 92 |
Labelled sheets: `scratchpad/r3/a4_field_1.png`, `a4_field_2.png`, `a3_field.png`, `a5_field.png`.
Flags (checked on tilesets 4, 10, 14, 17, 18, 28, 29, 32, 39, 40):
| Tile group | Passable | Terrain tag | Meaning |
|---|---|---|---|
| A3, all 32 kinds (48-79) | X in all 10 | 4 in all 10 | wall pieces block movement, sight (`F/Modules/Sensors.rb:161-171`) and projectiles (`F/33_Game_CharacterBase.rb:225-234`) for free |
| A4 tops, even rows (80-87, 96-103, 112-119) | O (walkable) in all 10 | 4 in most; 0 on a few kinds (e.g. tileset 29 kinds 96-103) | tops must be made impassable by the mod (2.4) |
| A4 faces, odd rows (88-95, 104-111, 120-127) | X in all 10 | 4 in most | face blocks for free |
| A5 | O in 14, 4, 17, 18, 29, 39, 40; mixed O / X / directional in 10, 28, 32 | | floor ids must come from the O cells |
No tileset swap and no new sheet is needed: every family has building-wall kinds. Only Shore (4)
lacks A4 building walls (its A4 is cliffs), so Shore uses A3 walls. Adding a custom sheet would mean
a cloned `RPG::Tileset` with one `tileset_names` slot replaced (`Cache.tileset` prepends
`Graphics/Tilesets/`, `F/4_Cache.rb:71-73`; the "../../" mod-path trick of `LC/90_Furniture.rb:15-23`
works the same) and a runtime tileset id that exists before a save loads; not needed for phase 1-3.
### 2.3 Autotile shape formulas (PROPOSED code, checked against `tools/home_render.py:28-42`)
Tile id = `2048 + kind * 48 + shape`. `same[d]` = the neighbour in direction d is the same kind
(PROPOSED: off-map counts as same, as the editor does).
Wall type, 16 shapes (all A3 kinds, A4 odd rows):
```ruby
def wall_shape(same) # bit set = edge drawn on that side
(same[:w] ? 0 : 1) | (same[:n] ? 0 : 2) | (same[:e] ? 0 : 4) | (same[:s] ? 0 : 8)
end
```
Ground / ceiling type, 47 shapes (A2, A4 even rows):
```ruby
def ground_shape(same)
n, s, w, e = same[:n], same[:s], same[:w], same[:e]
c = lambda{|a, b, d| a && b && !same[d] } # inner corner: both sides same, diagonal not
case [!w, !n, !e, !s] # edges drawn: west, north, east, south
when [false, false, false, false]
(c[n, w, :nw] ? 1 : 0) | (c[n, e, :ne] ? 2 : 0) | (c[s, e, :se] ? 4 : 0) | (c[s, w, :sw] ? 8 : 0)
when [true, false, false, false] then 16 + (c[n, e, :ne] ? 1 : 0) + (c[s, e, :se] ? 2 : 0)
when [false, true, false, false] then 20 + (c[s, e, :se] ? 1 : 0) + (c[s, w, :sw] ? 2 : 0)
when [false, false, true, false] then 24 + (c[s, w, :sw] ? 1 : 0) + (c[n, w, :nw] ? 2 : 0)
when [false, false, false, true ] then 28 + (c[n, w, :nw] ? 1 : 0) + (c[n, e, :ne] ? 2 : 0)
when [true, false, true, false] then 32
when [false, true, false, true ] then 33
when [true, true, false, false] then 34 + (c[s, e, :se] ? 1 : 0)
when [false, true, true, false] then 36 + (c[s, w, :sw] ? 1 : 0)
when [false, false, true, true ] then 38 + (c[n, w, :nw] ? 1 : 0)
when [true, false, false, true ] then 40 + (c[n, e, :ne] ? 1 : 0)
when [true, true, true, false] then 42
when [true, true, false, true ] then 43
when [true, false, true, true ] then 44
when [false, true, true, true ] then 45
else 46
end
end
```
Placing or removing one wall tile changes at most its 8 neighbours' shapes (9 tiles for the 47-shape
top, 5 for the 16-shape face); recompute those only.
Building look with A4 (as the game's own buildings and the Stone House builder `scratchpad/tools/home_build_stonehouse.py`):
wall tiles W get the TOP kind with `ground_shape` over W; every tile directly south of a W tile that
is not itself W (and not a door) gets the FACE kind with `wall_shape` over that face set. Mock-up
written with exactly these formulas (`scratchpad/r3/mockup.py`), TileA4 top 97 / face 105 on the left,
TileA3 log kind 76 on the right, A5 1609 floor, game door sprite:
`scratchpad/r3/base_mockup_plainfield.png`.
### 2.4 Walls as tiles vs walls as events
| | Tiles (PROPOSED) | Events with a wall sprite sheet |
|---|---|---|
| Look | the game's own wall art, same as its buildings; A4 gives top + face, A3 a one-tile strip | needs a 16-piece (or 47-piece) sheet drawn per wall style; events draw above tiles, can look pasted on |
| Autotile correctness | the engine draws the shape from the tile id; the mod computes the id (2.3) | the mod picks the piece the same way; mistakes are visible the same way |
| Passability | A3 and A4 faces: from the flags. A4 tops: walkable, so an alias of `Game_Map#check_passage` (`F/31_Game_Map.rb:734`) returns false for the base's wall tiles from a per-map Hash; that one alias covers walking (`:773-776`) and pathfinding (`F/202_pathfinding.rb:406-409`, `:465-468`). `@forced_block_dir` (`F/31_Game_Map.rb:56`, `:134`, `:777-779`) is NOT enough: pathfinding skips it and it is a linear Array | one non-through event per tile, as furniture blockers (`LC/90_Furniture.rb:608-632`); pathfinding sees them (`F/202_pathfinding.rb:399-404`) |
| Sight / projectiles | terrain tag 4 from the flags (2.2) | needs `ev_terrain_tag` 4 per event (`F/31_Game_Map.rb:858-877`) |
| Save size, 20 x 20 base (76 walls) | in the base record (5) | 76 furniture-style records + 76 live events in the saved map |
| Events on the map | 0 | 76 walls, 400 with floors; the busiest game map has 207 (Map121), PlainField has 6 |
| NPC pathing, fog, lighting | as any game wall; KHAS shadows are off (`E/50_System_Settings.rb:132`) and editor shadows are cleared at setup (`E/50_System_Settings.rb:131`, `F/RVscript/460_KHAS_LightLib.rb:1866-1880`) | events are characters: NPCs collide, sprites sort by y |
| Nap / reload | rewritten in `setup_event_hack` at every setup and nap | events must stay `nappable` (`F/31_Game_Map.rb:359-366`) |
Recommendation: **tiles**. A3 (one kind, no passability work) for the first build; A4 top + face
with the `check_passage` alias as the "building wall".
## 3. Floors
| | Layer-0 tile swap (PROPOSED) | Event |
|---|---|---|
| How | layer 0 = an A5 floor id; layers 1-2 cleared on that tile | walkable event (`LC/90_Furniture.rb:571-573` style, priority below characters) |
| Autotile | A5 has none; grass/dirt A2 neighbours keep their shapes (small seam) unless recomputed with `ground_shape` | none |
| Passability | must pick an O-flag A5 id (2.2) | through |
| Cost | 0 events, 1 char per cell in the record | 324 events for an 18 x 18 floor |
| Limit | building only where layer 2 is empty (Map028's playable area has 0 layer-2 tiles; forests have trees) | same |
Recommendation: **tile swap**. Candidates per family to be picked by the owner from
`scratchpad/r3/a5_field.png` (1609 = wood planks on TileA5_exterior1, used in the mock-up).
## 4. Doors
### 4.1 The game's doors (NoerTavern, Map059)
| Point | Evidence |
|---|---|
| 6 doors named `WoodenDoorSide4`, sprite `!Door4` (cells 32 x 96: 384 x 768 sheet) | Map059 events 49, 54, 55, 60, 61, 62 |
| Page 1 = OPEN: through ON, priority "same as characters", action button | Map059 event 49 page 1 |
| Page 2 = CLOSED: through OFF, same priority, action button | Map059 event 49 page 2 |
| Starts closed: init block `init_jump_page(2, tag)` (tag 1 side door, 4 front door) | `F/39_Game_Event.rb:1997-2002` |
| Action key: `doorEV_setup(id, page, tag, sound)` plays openDoor / closeDoor and forces the other page + terrain tag; refuses to close while a living NPC stands in the doorway | `E/29_Functions_417_Interpreter.rb:943-961`, `:1082-1086` |
| Animation: none, a page swap (sprite pattern changes) | Map059 pages |
| Closed tag 4 blocks sight and projectiles | `F/31_Game_Map.rb:858-877`, `F/Modules/Sensors.rb:161-171` |
Render: `scratchpad/r3/tavern_doors.png`, sheet `scratchpad/r3/door4_sheet.png`.
### 4.2 A placed door (PROPOSED)
| Point | How |
|---|---|
| Event | built at runtime like `LC/90_Furniture.rb:542-606`, with the two pages above and `doorEV_setup(get_character(0).id, ...)` in each page (works on summoned events: it only uses `$game_map.events[id]`) |
| Tile under it | a floor tile; the door tile is not in the wall set, so no face is drawn under it (mock-up) |
| Lona | opens with the action key, walks through (page 1 through ON), closes it from either side |
| NPCs and companions | no NPC ever opens a door (only the player's action key starts it, `F/35_Game_Player.rb:604-614`); a closed door blocks them (`collide_with_characters`, and pathfinding `F/202_pathfinding.rb:399-404`). Companions wait outside a closed door, as in towns |
| State | closed at every setup (init block); PROPOSED keep it that way (an open door after a nap is the raid follow-up's question) |
| Injection | added to `@map.events` in `setup_event_hack`, as the home doors (`LC/100_Homes.rb:1262-1283`), so a nap rebuilds it the same way |
## 5. Persistence (PROPOSED)
Where: `$game_system.lonacraft_data["bases"]` (plain types, no save hook, as furniture
`LC/90_Furniture.rb:475-509` and homes `LC/100_Homes.rb:71-73`).
```ruby
lonacraft_data["bases"] = {
"next" => 2,
"list" => [{
"id" => 1,
"om" => [2, 88, 61], # overmap map id, x, y (the owner's "the tile")
"region" => 1, # overmap region at creation
"family" => "plain", # template / tile table row
"slot" => 1, # runtime map number = BASE_MAP_ID + slot
"ox" => 5, "oy" => 5, "w" => 40, "h" => 40,
"rows" => ["....WWWWWW....", ...], # one char per cell: "." untouched, "W"/"w" wall kinds, "F"/"f" floor kinds
"doors" => [[12, 9, "Door_Wood"]]
}]
}
```
| Format, 20 x 20 base (76 walls, 323 floor, 1 door), Ruby Marshal | Bytes |
|---|---|
| furniture-style record per piece (`{"uid","map_id","x","y","item_name"}`) | 33,403 |
| per-base `[x, y, kind]` list | 3,262 |
| per-base grid string (PROPOSED) | 596 |
| a current save, for scale (`UserData/SavAuto*.rvdata2`) | 1,132,145-1,284,524 |
Rebuild: alias `setup_event_hack` (`F/31_Game_Map.rb:193`): when the map number is a base slot,
write walls (top + face), floors and their shapes into `@map.data`, fill the wall Hash for
`check_passage`, inject door events; furniture inside the base keeps working through
`LC/90_Furniture.rb:899-911` because each base has its own map number. Overmap marker: an event
re-added at every Map002 setup, as `CS/10_Campsites.rb:184-193` / `:305-317`. This is Campsites'
model (overmap tile record + re-summon) with the inside kept as well.
## 6. Engine limits for this
| Limit | Fact | PROPOSED handling |
|---|---|---|
| Random field map per entry | `E/34_Functions_ChangeMap.rb:263` | base map number per slot; alias `change_map_enter_region` for the base tile |
| Field maps reloaded each setup | `F/31_Game_Map.rb:172` | rebuild from the record in `setup_event_hack` |
| Small field maps | 522-992 passable tiles; plains 25 x 25 (1.2) | option B (40 x 40 template) |
| Spawns inside the base | BIOS / encounters place events at `region_map[id].sample` (Map028 event 1; `E/34_Functions_RegionMap.rb:361-1100`); `region_map` is built from layer 3 after `setup_event_hack` (`F/31_Game_Map.rb:199`, `:270-281`) | B: template paints spawn regions only outside the build area. A: drop base cells from `@region_map` after `setup_region_map`, never emptying a region (BIOS does `region_map[11].sample[0]` and would crash on nil) |
| NPC pathing | tiles: through `check_passage` (2.4); doors: event collision | as 2.4 / 4.2 |
| Enemies through walls | no destructible tiles or door-breaking in the game | raid follow-up R4 (new AI) |
| Map events | no hard cap (new id = max + 1, `LC/90_Furniture.rb:787-799`); every event costs update + sprite each frame | tiles: only doors and furniture are events |
| Fog / lighting | KHAS fog is a screen overlay (`F/RVscript/480_KHAS_Fog.rb:398-420`); shadows off (`E/50_System_Settings.rb:132`) | nothing to do |
| Live redraw | UNVERIFIED (2.1) | proven in build item B2; fallback spriteset re-create |
| Nap on the base | field NapEvent -> `region_map_wildness_nap` (1.3) | B: template's own NapEvent (raid hook for R4) |
| Saved live map | `$game_map` incl. written tiles is in the save (`F/5_DataManager.rb:939`) | consistent; nothing extra |
## 7. Build plan (PROPOSED)
| Phase | Item | What | Files | Lines (rough) |
|---|---|---|---|---|
| 1 minimum | B1 Base record and entry | wilderness whitelist, "Build a base here" / "Enter base" in the region menu (append, not replace, unlike Campsites), `change_map_enter_region` alias, slot map numbers, setup key, PlainField template map (generated) | new `LC/110_Bases.rb`, `loader.rb`, `Maps/LonaCraftBase_Plain.rvdata2`, `Text/*/Bases.txt` (6 languages) | 220 + map |
| | B2 Wall + floor tiles | one A3 wall kind and one A5 floor as items + recipes; placement cursor reusing the furniture ghost loop; tile write + neighbour shapes; live-redraw proof with fallback; rebuild in `setup_event_hack` | `110_Bases.rb`, `90_Furniture.rb` (route tile kinds, ~30), `Item/`, `Recipes/` (2 + 2 JSON), texts | 280 |
| | B3 Door | 2-page door event with `doorEV_setup`, record, injection, item + recipe | `110_Bases.rb`, `Item/`, `Recipes/`, texts | 110 |
| 2 building | B4 A4 building walls | top + face kinds, `check_passage` alias, per-family kind table | `110_Bases.rb` | 150 |
| | B5 Remove and furniture | pick up a wall / floor / door (refund, shapes recomputed), furniture allowed inside a base (`Furniture.map_allowed?`) | `110_Bases.rb`, `90_Furniture.rb` (~15) | 90 |
| 3 all biomes | B6 Templates for the other 10 families | generator script + 10 maps, tile table (A3 / A4 / A5 ids per family) | `Maps/LonaCraftBase_*.rvdata2`, `110_Bases.rb` | 60 + maps |
| | B7 Overmap marker and limits | marker event on Map002, max bases, base list | `110_Bases.rb`, texts | 70 |
| 4 follow-up | B8 Raids (board R4) | base NapEvent rolls a raid, enemies spawn on the exit ring, doors / walls as obstacles; new AI to break doors | `110_Bases.rb`, template NapEvent | owner research first |
Raid hooks for R4: the field map NapEvent (Map028 event 32) -> `HCG/Command_Nap.rb:10` ->
`F/31_Game_Map.rb:1305-1308` -> `region_map_wildness_nap` (`E/34_Functions_RegionMap.rb:1645`) ->
`region_map_wildness_nap_stats` (`:237-246`) -> encounter script (`:232`); Campsites' place for its
raid roll: `process_nap_change` alias (`CS/10_Campsites.rb:319-346`). With option B the base
template carries its own NapEvent, so the raid code is the mod's, not a patch of the game's.
## 8. Choices for the owner (design phase)
| # | Choice | PROPOSED |
|---|---|---|
| 1 | Base location: A pinned field map / B own template / C overmap | B |
| 2 | Which overmap regions count as wilderness | 1-8, 13-16, 19, 24-28; roads 11 / 23, Abandoned House 9, Refugee Camp 20 open |
| 3 | Wall look: A3 palisade, A4 building wall, both | both (A3 in phase 1, A4 in phase 2) |
| 4 | Template size and buildable area | 40 x 40 map, 30 x 30 buildable |
| 5 | Max bases | 3 (Campsites' default, `Campsites/mod.cfg`) |
| 6 | Costs (materials per wall / floor / door) | from existing LonaCraft materials, set in the recipe JSONs |
| 7 | Doors after a nap | closed |
## 9. Design for the owner's decisions (2026-10-06)
Binding owner decisions: option A, pinned only while buildings stand; a marker on Map002 in phase 1;
the game's own resource respawn kept; allowed tiles by rule; A3 palisade first, A4 later; "Destroy all
bases" on the System page; raids stay research. B1 is built (9.8); this section is its spec.
### 9.1 Record schema (`$game_system.lonacraft_data["bases"]`, plain types)
```ruby
lonacraft_data["bases"] = {
"next_id" => 3,
"list" => [{
"id" => 2,
"om" => [2, 47, 92], # overmap map number, tile x, y (the owner's "the tile")
"region" => 1, # overmap region id of that tile
"field" => 28, # the $data_region_maps entry picked on that visit: a game map
# number, or a mod map key (RolePlayS adds file-path keys,
# RolePlayS/Scripts/0_CORE.rb:147-156)
"key" => "LonaCraftBase_2", # $data_mapinfos key of the pinned map
"map_no" => 9202, # its runtime map number ($game_map.map_id there; furniture keys by it)
"pieces" => {"40,38" => "debug"}, # "x,y" => kind; B2/B3 put walls, floors, doors here
"made" => 1234 # $game_date.dateAmt
}],
"maps" => {"LonaCraftBase_2" => [9202, 28]}, # runtime map registry (kept while a save can stand on it)
"entry" => {"om" => [2, 47, 92], "region" => 1, "event" => 0, "to" => 28, "base" => nil}
}
```
`entry` = the last region entry (written on the overmap, cleared at the next overmap setup). A base
can only be created on the map named in `entry["to"]`, so the record knows its tile without
reading the overmap again.
### 9.2 Pin and revert
| Rule | How | Evidence |
|---|---|---|
| Every way into a field map goes through one function | `change_map_enter_region` is the only reader of `$data_region_maps`. Callers: region menu Enter, 27 encounter scripts, the pregnancy-pain overmap event, Map002 NapEvent (out of stamina), Map211 | `E/34_Functions_ChangeMap.rb:257-269`; `E/33_Functions_OverMapEvents.rb:132`; `E/40_OverEvent_Check.rb:351`; grep of `Data/HCGframes/encounter/` and `Data/Map*.rvdata2` |
| Pin | alias in `GIM_ADDON` (included in Game_Interpreter, `F/40_Game_Interpreter.rb:19`). On the overmap, `$data_region_maps[region]` is set to `[pick]` for the call and restored after: `pick` = the base's key when a record holds Lona's tile, else one `sample` of the list (so the entry knows `to`) | the original's own `.sample` then returns `pick` (`:263`) |
| Pinned map | `$data_mapinfos[key]` = new MapInfo: `.filename` = the field map's file, `.name` = the field map's name, `.id` = `map_no`. `Game_Map#setup` only reads those | `F/31_Game_Map.rb:169-172`; Homes does the same (`LC/100_Homes.rb:546-576`) |
| Numbers back to keys | `Game_Map#setup` alias turns a base `map_no` into its key (a load after a game update calls setup with the number) and registers a missing key from `maps` | `F/5_DataManager.rb:994-1000`; `LC/100_Homes.rb:580-590` |
| After a load | `DataManager.extract_save_contents` alias registers every key in `maps` (a nap on a pinned map calls `setup(map_id_rec)` with the key) | `F/5_DataManager.rb:954-964`; `F/Game_InterpreterModifies/Game_Interpreter_Modifies_OM.rb:12`, `:24` |
| Created by | the first piece: `Bases.on_piece_placed(map, x, y, kind)` on the map named in `entry["to"]`, tile and entry passing 9.4 | |
| Reverted by | `Bases.on_piece_removed(map, x, y)` taking the last piece, or `Bases.destroy_all!`: the record goes, the next entry picks a random map again, the marker goes | |
| Map numbers | `9200 + id`; moved to a free number if another mod took it (furniture records follow) | `F/5_DataManager.rb:390-405` (`extra_map_register` takes max + 1) |
Resources (decision 3): field maps have no regrow timer. Every entry reloads the map file
(`F/31_Game_Map.rb:172`) and its BIOS rolls resources and wildlife again because
`change_map_story_stats_fix` sets `ReRollHalfEvents` = 1 (`E/34_Functions_ChangeMap.rb:138`, called at
`:264`; Map028 event 1 rolls `RandomRootVegetables` and `StaticRockInsect0` on in-map regions 9 and 11,
then `region_map_wildness_*`). Trees and nodes are plain map events without self-switch conditions
(Map030). The pin runs the same function on the same file, so this is unchanged. The only
difference is the map number (9200 + id), which only separates self switches
(`[map_id, event_id, key]`, `F/39_Game_Event.rb:1992-1995`); field maps use none.
### 9.3 Marker on Map002
| Point | How |
|---|---|
| Where | injected into `@map.events` in `setup_event_hack` when the map note has `isOverMap=true`, one per record of that overmap, like the home doors (`LC/100_Homes.rb:1262-1283`, `:1285-1304`), so a nap rebuilds it |
| Sprite | `!World Map 02` index 4, direction 4, pattern 0, a small fenced camp (`scratchpad/r3/worldmap02_sheet.png`) |
| Page | below characters, through, action button, command `lonacraft_base_marker` = `$game_temp.reserve_region_event(region)`. Any event under Lona takes the action key first, so without this the region menu would not open on a base tile (`F/35_Game_Player.rb:604-620`, `:331-345`) |
| Removed | not injected once the record is gone; `destroy_all!` on the overmap also deletes the live events |
### 9.4 Allowed tile rule (`Bases.allowed_tile?`)
| # | Rule | Evidence |
|---|---|---|
| 1 | the map is a world map (note `isOverMap=true`) | `F/31_Game_Map.rb:285-287` |
| 2 | the tile has a region id > 0 with field maps in `$data_region_maps` (an enterable tile) | `F/5_DataManager.rb:381-388`, `E/34_Functions_ChangeMap.rb:263` |
| 3 | no map event stands on the tile: every town, cave and quest place is a Map002 event (`-point-*`, `AbanHouse1`, `DfRefugeeCamp`, ...) and takes the action key before the region does | Map002 events; `F/35_Game_Player.rb:604-614` |
| 4 | not inside the walls of Noer: three boxes on OvermapMain, x 22-28 y 94-103, x 28-40 y 95-103, x 33-37 y 92-96, read off the wall art (`scratchpad/r3/om_noer.png`; gates `-point-NoerGate` (40,99), `-point-NoerGate2` (31,95)) | Map002 render |
| 5 | not a settlement region (deny list): 10 Slums, 12 Rudesind Slope, 18 Infected City Ruins, 20 Refugee Camp, 21 Town of Noer, 22 Streets of Noer, 29/30 Fortress Ruins, 31/32 Sybaris | `Text/ENG/OvermapEvents.txt:160-256` |
| 6 | creation only: a plain visit, `OverMapEvent_name` was 0 when Lona entered. Every world-map event sets it before entering (`HCG/encounter/RefugeeCamp.rb:1`, `E/33_Functions_OverMapEvents.rb:128`, `:178-201`); the game clears it after the BIOS (`E/34_Functions_ChangeMap.rb:111`), so it is kept in `entry["event"]` | |
Dry run over Map002 (`scratchpad/r3/allowed_tiles.py`, same constants):
| Result | Tiles |
|---|---|
| allowed | 4,246 |
| refused, settlement region | 345 |
| refused, event on the tile | 104 |
| refused, inside Noer's walls (regions 23, 7, 11 inside the boxes) | 14 |
| region 0, not enterable | 20,791 |
| allowed tiles inside the Noer boxes / static events on allowed tiles | 0 / 0 |
Abandoned House (region 9): 83 tiles allowed; the `AbanHouse1` / `AbanHouse2` points (41,90),
(108,90) are event maps and stay refused by rule 3. Renders: `scratchpad/r3/om_allowed.png`,
`scratchpad/r3/om_allowed_noer.png` (green allowed, red refused by rules 3-5, yellow Noer boxes).
### 9.5 Destroy all bases (System page)
| Point | How |
|---|---|
| Line | appended last in `Menu_System#create_sprites` (`F/194_menu_08_0_System.rb:67-90`; RolePlayS replaces that method, `RolePlayS/Scripts/Frames/194_menu_08_0_System.rb:22-39`, and loads first, so the alias sits on top of either), row 9 under Keybinding (`BASE_LINE + UNIT_HEIGHT * 9`), text "Destroy all bases (N)" |
| Prompt | an overlay like the hardcore prompt (`:408-440`): title, two lines, Confirm / Cancel keys. `update_input` and `mouse_update_input` answer it first (`:487-500`, `:502-506`); `mouse_force_main_menu_pause` is true while it shows (`:909-912`) |
| Yes | `Bases.destroy_all!`: every record; the map registry except the map Lona stands on; furniture records on base map numbers (no refund); live markers when on the overmap |
| No bases | the line buzzes |
### 9.6 Option A space and spawn mitigations (B2)
| Problem | Measure |
|---|---|
| Small or corridor maps (1.2: 522 passable tiles on Map019 swamp and Map021 dead forest, 525 on Map029 rain forest, all in paths, 587 on Map030) | allowed (the rule is about the tile); the map limits what fits |
| BIOS spawns inside a built area | after `setup_region_map` (`F/31_Game_Map.rb:199`, `:270-281`) drop built cells from `@region_map[id]` unless the list would become empty (Map028's BIOS does `region_map[11].sample[0]`) |
| StartPoint, exits | no piece on the region-1 exit ring (Map028 event 4, `set_region_trigger(1)`), on `-point-StartPoint` or its 4 neighbours |
### 9.7 Raids (R4, research only)
On a pinned GAME map the nap event is the game's: Map028 event 32 `region_map_wildness_nap`
(`E/34_Functions_RegionMap.rb:1645`), reached through `HCG/Command_Nap.rb:10` and
`F/31_Game_Map.rb:1305-1308`. Two hooks: (1) alias `region_map_wildness_nap` /
`region_map_wildness_nap_stats` (`:237-246`) when `Bases.base_at_map?` is true; (2) alias
`Game_Actor#process_nap_change`, as Campsites does (`CS/10_Campsites.rb:319-346`). Different
scenarios per tile type (Abandoned House vs field) are wanted later; the record's `region` and
`field` give the type.
### 9.8 Phase 1, updated
| Item | Scope | Files | State |
|---|---|---|---|
| B1 | record, pin / revert, entry note, marker, allowed rule, Destroy-all line + prompt, debug key Numpad / (adds or removes a debug piece), public API | `Scripts/110_Bases.rb` (new), `loader.rb`, `Text/<lang>/Bases.txt` (5 language folders), README, BOARD | built, owner's run pending |
| B2 | A3 palisade wall + A5 floor tiles; placement through the furniture cursor, calling `Bases.on_piece_placed` / `on_piece_removed`; tile rebuild and region-map filter (9.6) | `110_Bases.rb`, `90_Furniture.rb`, items, recipes | after the 90_Furniture.rb work |
| B3 | door event (4.2) | `110_Bases.rb`, items, recipes | after B2 |
API for B2: `Bases.record_for_tile(om_map, x, y)`, `Bases.record_for_map(map)`,
`Bases.base_at_map?(map)`, `Bases.can_build_here?(map)`, `Bases.on_piece_placed(map, x, y, kind)`,
`Bases.on_piece_removed(map, x, y)`, `Bases.allowed_tile?(x, y, om_map = nil)`, `Bases.destroy_all!`.
### 9.9 B2 / B3 as built (2026-10-06)
| Point | Built |
|---|---|
| Items | Palisade Wall (2 Plank + 1 Rope), Plank Floor (2 Plank), Wooden Door (3 Plank + 1 Rope); hand and Carpentry Bench, Common, new recipe category / craft group "building"; `0_Core.rb` ITEMS rows, icons in cells 13-15 of `Iconset_LonaCraft.png` |
| Tile table (by sheet name, all 13 tilesets of allowed regions) | wall A3 kind: TileA3 68, TileA3Abom 68, Outside_POOR_A3 66, macks_A3 70 (vertical logs); floor A5: TileA5_exterior1 1600, TileA5_exterior3 1600, Outside_POOR_A5 1552, macks_A5 1570, Inside_POOR_A5 1552 (picked to stand apart from the logs). Flags checked: wall impassable in all 13 (terrain tag 4, tag 0 on tileset 13), floor passable in all 13 |
| Wall shape | 16-shape from the 4 neighbours (2.3), neighbours repainted; dry run 3x3 ring = 3 10 6 / 5 . 5 / 9 10 12, L = 7 / 5 / 9 10 14 |
| Storage | the base record's `pieces` ("W", "F", "D", "FD", "S" = sideways door); no furniture records |
| Rebuild | `setup_event_hack` writes the tiles, `setup_region_map` alias drops built cells from the spawn lists, doors spawned after setup and closed after every nap |
| Live repaint | `REDRAW = :table` (a fresh Table copy, so the tilemap's next `map_data =` sees a new object, `F/49_Spriteset_Map.rb:322-328`); fallback `:spriteset`. Unverified until the owner's run |
| Doors | the game's two-page door (open through, closed solid, `doorEV_setup`); the side-door sprite (`!Door4` [4]) is a small hatch, so both orientations use the front door [0] (one-line switch `DOOR_SIDE`) |
| Taking down | action key facing a wall / floor: Take down / Cancel; open door: Close / Take down / Cancel; full refund; the last piece reverts the tile (B1) |
| Render | `scratchpad/r3/b2_base_plainfield.png` (`scratchpad/r3/b2_render.py` reads the table from the Ruby file) |
@@ -0,0 +1,358 @@
# Difficulty levels and per-base danger (board R10) - research and design
Status: research done 2026-10-07; DECIDED and built 2026-10-07 (see the next section), pending the owner's run.
Paths: `G/` = LonaRPG/Data/, `E/` = G/Scripts/Editables/, `F/` = G/Scripts/Frames/, `M/` = LonaCraft_dev/LonaCraft/Scripts/,
`CD/` = LonaRPG/ModScripts/_Mods/CustomDifficulty/. Line numbers from B.0.10.8.26 and the dev copy as read today.
Simulations: scratch Python, 40,000 runs each, the RESEARCH_RAIDS 2.2 model (it reproduces that table: 10 23 30 33 33 33 %).
## Decided 2026-10-07 (owner) and built in the dev copy
Owner's words: "Make three modes, and make them align with the game's difficulty modes. We don't need that many
different modes." Then, the same day: "Let's keep it from following the game mode, to give users customizability.
It'll just be in a config file with everything else."
| Choice | As built |
|---|---|
| C1 levels | three, named like the game's modes: Hard (default, today's numbers = the Normal column), Hell (= Harsh), Doom (= Brutal); no Easy. The Hell / Doom live-raid trim against the game's own HELL +25 was dropped once the level stopped following the game's mode |
| C2 setting | `Config/Bases.json` `"difficulty"`: `"level"` plus the tables `"hard"`, `"hell"`, `"doom"` (25 knobs each, `_add` added, `_mult` multiplied) and `"base_danger"` {lower, higher}; strict merge (negative `_add` allowed) and the defaults file as the other sections. No System-page row, no in-game setting |
| C3 game mode | independent: the level is never read from Setup_Hardcore or CustomDifficulty. Read once at config load (`Raids.resolve_level`); console `LonaCraft difficulty: Hell (Config/Bases.json)`; an unknown name falls back to hard with a console line. README says the game's HELL / DOOM add danger of their own on top |
| C4 per-base Danger | as proposed: "Danger (Normal)" beside "Rename base" on the world-map tile menu and the Deep Sewer ladders, steps Normal -> Higher -> Lower, popup; refused while a live raid runs on that base; `rec["danger"]` -1 / 0 / 1, missing = Normal; Lower -4, x0.67, -1 extra, -10 sewer points; Higher +4, x1.5, +1, +10 |
| C5 | nothing new |
| C6 costs | mercenary contract ceil(days x price x merc_price_mult), maid hire fee + maid_fee_add; maid pay, crafting, rents, house prices fixed |
| C7 mid-game | the level changes only with a restart; a live raid fixes its give-up time when it begins; paid days and a hired maid keep their terms |
| C8 | config section + defaults, `rec["danger"]`, 4 self-test rows (every level has every knob; defaults hard pinned to 0 / 1.0; the level names a table; Danger text keys in 5 languages), README "Difficulty", CHANGELOG, header comments of 120 / 130 / 140 / 150 / 160 / 170 |
Simulated live raid chance (40,000 runs, WD 30, survival 5, base value 30, naps 1..6 from W = 0, scratchpad
r10b/sim_levels.py): Hard 10 23 30 32 33 34 %, Hell 15 32 39 40 42 42 %, Doom 21 40 47 50 52 52 %. First nap after
arriving at night (W = world-map step x1.2), game mode HARD: Hard 78, Hell 81, Doom 84 %; game HELL / DOOM: 92, 94, 96 %.
## 1. Inventory: every danger and cost knob today
"File" = a player can change it without editing Ruby. "Lvl" = the section 4 id that the PROPOSED level scales, "-" = untouched.
BJ = Config/Bases.json section (defaults in M/120_Raids.rb DEFAULTS :110-182), RJ = Config/Recipes.json, const = Ruby constant.
| # | System | Knob | Today | Lives in | File | Lvl |
|---|---|---|---|---|---|---|
| 1 | Live raid | enabled | true | BJ raids | yes | - |
| 2 | Live raid | danger_per_value (bonus to the game's roll per base value) | 0.1 | BJ raids | yes | L2 |
| 3 | Live raid | danger_cap | 10 | BJ raids | yes | L2 |
| 4 | Live raid | base value = walls + 2 x doors + 3 x furniture | formula | const M/120_Raids.rb:503-509 | no | - |
| 5 | Live raid | night_only | true | BJ raids | yes | - |
| 6 | Live raid | grace_frames (warning before they move) | 480; forest, sewer 300 | BJ raids + scenarios | yes | L5 |
| 7 | Live raid | dog_extra_frames | 300 | BJ raids | yes | - |
| 8 | Live raid | give_up_frames (siege without a breach) | 10800 (3 min) | BJ raids | yes | L6 |
| 9 | Live raid | retreat_frames | 1200 | BJ raids | yes | - |
| 10 | Live raid | swing_frames / swing_rand | 60 / 30 | BJ raids | yes | - |
| 11 | Live raid | spawn_min_distance | 8 tiles | BJ raids | yes | - |
| 12 | Live raid | door_bias | 0.5; road 0.7, house 0.8 | BJ raids + scenarios | yes | - |
| 13 | Live raid | extra_raider_per_value | 30 | BJ raids | yes | L3 |
| 14 | Live raid | extra_raiders_max | 4 | BJ raids | yes | L3 |
| 15 | Live raid | max_raiders | 12 | BJ raids | yes | L3 |
| 16 | Live raid | min_breach_atk | 3 | BJ raids | yes | - |
| 17 | Live raid | refuse_nap | true | BJ raids | yes | - |
| 18 | Live raid | breach factor per race | Orkind 1.5, Goblin 1, Human 1, Fishkind 1, Undead 0.75, Abom 1.25 | BJ raids.breach | yes | L4 on top |
| 19 | Live raid | scenarios (8) x group weights | field .. sewer | BJ raids.scenarios | yes | - |
| 20 | Live raid | EXTRA_UNIT (unit added per extra raider) | 12 groups | const M/120_Raids.rb:92-99 | no | - |
| 21 | Live raid | game nap roll: W += clamp(rand10 + WD/2 - 2 x surv, 10, 50); raid if W >= rand100 + surv | game | E/34_Functions_RegionMap.rb:237-246 | no | L1 adds |
| 22 | Live raid | group size by WorldDifficulty band 0-25 / 25-50 / 50-75 / 75+ | game | E/34_Functions_RegionMap.rb:361-1115 | no | - |
| 23 | Pieces | W palisade hp / armour | 600 / 3 | BJ pieces | yes | - |
| 24 | Pieces | S stone wall | 1200 / 8 | BJ pieces | yes | - |
| 25 | Pieces | D door | 300 / 3 | BJ pieces | yes | - |
| 26 | Pieces | SD door in stone walls | 600 / 6 | BJ pieces | yes | - |
| 27 | Repair | item / hp / frames / blocked_after_hit_frames | Plank / 150 / 120 / 180 | BJ repair | yes | - |
| 28 | Repair | REPAIR_STONE | Stone Block / +300 | const M/110_Bases.rb:2990 | no | - |
| 29 | Away raid | enabled | true | BJ away | yes | - |
| 30 | Away raid | chance a night | 10 % | BJ away | yes | A1 |
| 31 | Away raid | value_bonus_per / value_bonus_cap | 10 / 10 | BJ away | yes | A1 (whole chance) |
| 32 | Away raid | scenario_mult | road, house, sewer 1.5 | BJ away | yes | - |
| 33 | Away raid | grace_days after founding | 1 | BJ away | yes | A2 |
| 34 | Away raid | cooldown_days after a raid | 2 | BJ away | yes | A2 |
| 35 | Away raid | catchup_days | 14 | BJ away | yes | - |
| 36 | Away raid | swings / per_extra_breacher / breacher_cap | 24 / 0.15 / 2.0 | BJ away | yes | A3 |
| 37 | Away raid | spread | 0.25 | BJ away | yes | - |
| 38 | Away raid | difficulty_scale (x WorldDifficulty on budget and party power) | 0.01 | BJ away | yes | - |
| 39 | Away raid | loot_fraction | 0.5 | BJ away | yes | A6 |
| 40 | Away raid | carry_per_looter | 1500 | BJ away | yes | - |
| 41 | Away raid | smash / smash_station | 0.25 / 0.10 | BJ away | yes | A4 |
| 42 | Away raid | smash_cap (the owner's hard cap) | 3 | BJ away | yes | A5 |
| 43 | Away raid | reports_kept | 5 | BJ away | yes | - |
| 44 | Away raid | looters | Human, Moot, Goblin, Orkind, Fishkind | BJ away | yes | - |
| 45 | Away raid | AWAY_UNITS (party per group, 0-25 band) | 12 groups | const M/140_AwayRaids.rb:93-106 | no | - |
| 46 | Mercs | enabled / coin | true / ItemCoin2 (Large Copper, price 2000) | BJ mercs | yes | - |
| 47 | Mercs | price_per_day | 1 LC | BJ mercs | yes | C1 |
| 48 | Mercs | day_choices | 1 / 3 / 7 / 14 | BJ mercs | yes | - |
| 49 | Mercs | squad_power | 220 | BJ mercs | yes | - (A3 scales the raiders) |
| 50 | Mercs | deter (x away chance where posted) | 0.5 | BJ mercs | yes | - |
| 51 | Mercs | down_days | 1 | BJ mercs | yes | - |
| 52 | Mercs | squad stats: captain atk 25 / health 400, 2 x atk 20 / 300 | | NPC/LonaCraftMerc*.json | JSON, not a config | - |
| 53 | Maid | enabled / coin | true / ItemCoin1 (Copper, price 200) | BJ maid | yes | - |
| 54 | Maid | hire_fee | 5 Copper | BJ maid | yes | C2 |
| 55 | Maid | pay a day | 1 Copper | BJ maid | yes | - (cannot be split) |
| 56 | Maid | grace_days unpaid | 3 | BJ maid | yes | - |
| 57 | Maid | catchup_days | 14 | BJ maid | yes | - |
| 58 | Maid | dishes_per_day / pantry_cap / cook_skill / need_fire | 2 / 6 / 10 / true | BJ maid | yes | - |
| 59 | Maid | wander / flee_radius | 3 / 6 | BJ maid | yes | - |
| 60 | Maid | away_kill | 0.5 | BJ maid | yes | M1 |
| 61 | Maid | health / atk | 150 / 1 | NPC/LonaCraftMaid.json | JSON, not a config | - |
| 62 | Rest | enabled | true | BJ rest | yes | - |
| 63 | Rest | ground_sta_mult / ground_sta_cap_pct / ground_health_mult | 0.6 / 80 / 0.5 | BJ rest | yes | - |
| 64 | Rest | ground_mood / ground_dirt | 10 / 15 | BJ rest | yes | - |
| 65 | Rest | ground_sick_chance | 10 % | BJ rest | yes | R2 |
| 66 | Rest | ground_danger (W added, kept) | 10 | BJ rest | yes | R1 |
| 67 | Rest | bed_mood | 10 | BJ rest | yes | - |
| 68 | Rest | bed_roll_mult (that roll only) | 0.75 | BJ rest | yes | R3 |
| 69 | Rest | meal_sat + 4 switches | 30 | BJ rest | yes | - |
| 70 | Sewer | NAP_CHANCE_DAY / NAP_CHANCE_NIGHT | 35 / 60 % | const M/130_Sewer.rb:108-109 | no | S1 |
| 71 | Sewer | raid groups | CommonMobs 50, AbomBreedlingRaid 30, SewerRats 30, UndeadWalking 10 | BJ raids.scenarios.sewer | yes | - |
| 72 | Sewer | rat raid size 4 + 2 x (WD / 30), cap 10 | | const M/130_Sewer.rb:493-494 | no | - |
| 73 | Sewer | VERMIN Rattus / Roach / Giant Mice | 4-6 / 4-6 / 3-5 | const M/130_Sewer.rb:121 | no | S2 |
| 74 | Sewer | HOBO_COUNT / GOBLIN_COUNT | 2-4 / 2-4 | const M/130_Sewer.rb:123-125 | no | S2 |
| 75 | Sewer | ENTRANCES_OPEN (parked 2026-10-06) | false | const M/130_Sewer.rb:100 | no | - |
| 76 | Crafting | hand-crafting cost multiplier | 1.25 | RJ stations.hand.cost (const M/55_Recipes.rb:87) | yes | - |
| 77 | Crafting | other stations cost | 1.0 (1-10) | RJ stations | yes | - |
| 78 | Crafting | recipe inputs / skill / max_tier; bow_rope | per recipe; 1 | RJ recipes, rules | yes | - |
| 79 | Homes | Old Shack / Stone House price | 5 / 15 Gold | const M/100_Homes.rb:164, :313 | no | - |
| 80 | Homes | inn rooms a week | Noer 2, Pirate's Bane 3, Doom Fortress 2, Fish Town 4, Coastal Fortress 1 LC; South FL 8 Copper | const M/100_Homes.rb:184-298 | no | - |
| 81 | Building | BUILD_ENEMY_RADIUS / EDGE_GAP | 8 / 2 | const M/110_Bases.rb:110, :1075 | no | - |
| Where it lives | Rows |
|---|---|
| Config/Bases.json | 62 |
| Config/Recipes.json | 3 |
| Ruby constant or formula | 12 |
| Game code | 2 |
| NPC JSON | 2 |
| Total | 81 (26 scaled by the proposed level) |
Finding: the dev copy's `Config/Bases_defaults.json` is stale (no "SD", "away", "mercs", "rest", "maid"); the game rewrites
it at the next start because its text changed (M/120_Raids.rb:446-458). Not a bug; the release build must ship a fresh one.
## 2. The game's own difficulty signals, and CustomDifficulty
| Signal | Values | What it does near bases | Evidence |
|---|---|---|---|
| `$story_stats["Setup_Hardcore"]` | 0 HARD, 1 HELL, 2 DOOM (labels `menu:system/DiffHard/DiffHell/DiffDoom`) | each world-map step sets W = rand100 + WD/2 + 25 x (HC >= 1), x0.8 day / x1.2 night, and W is kept on entering the field map: HELL adds about +30 to the first nap roll on a base at night. Captured: WD -13 (HELL+) instead of -22. Rot in the bag and boxes 65533/65535 (mod chests never rot); +12 satiety a nap; no leaving a map under threat (the sewer follows it, M/130_Sewer.rb:578); DOOM: no manual save | E/100_Game_Player_handle_on_move.rb:163-168, E/33_Functions_OverMapEvents.rb:19-24, E/34_Functions_RegionMap.rb:1839, E/97_Game_Actor_Stats&State&Nap.rb:128-135, :183, F/111_Scene_Save.rb:25 |
| `Setup_HardcoreAmt` | date the mode was set | achievements only | F/RVscript/495_ACH_CORE.rb:200 |
| `WorldDifficulty` (WD) | 0-100, float | +0.35 every nap (cap 100), -22 / -13 when captured; picks the band (count and kind) of every nap group; the mod already uses it: away budget and party power x (1 + WD x 0.01), sewer rats 4 + 2 x (WD / 30); shop prices; HUD number | E/97:118, E/34:369-1081, M/140_AwayRaids.rb:274-286, M/130_Sewer.rb:493 |
| `WildDangerous` (W) | accumulator | the nap roll (row 21); set to 0 on leaving a region map; the mod adds the base bonus, ground +10, bed x0.75 | E/34_Functions_ChangeMap.rb:278, M/120_Raids.rb:515-525, M/160_Rest.rb:202-216 |
| actor survival | 0 to about 20 | -2 x survival on the nap increment, +survival on the threshold | E/34:239-240 |
Note on the model: RESEARCH_RAIDS 2.2 starts W at 0. In play W starts at the last world-map step's value (mean about
50 + WD/2, x1.2 at night, +25 on HELL), so the first nap after arriving is riskier than the tables; later naps match.
The level steps below add to W, so they keep their size either way.
### CustomDifficulty (the owner runs it; LonaCraft may detect it, never depend on it)
| Key in CD/mod.cfg | Effect | Owner's value |
|---|---|---|
| MANUAL_SAVE_ENABLED, SAVE_DESTROYED_ON_LOAD, SAVE_LOST_ON_DEATH | DOOM save rules on / off | default |
| FOOD_SPOILAGE_ENABLED | rot on naps (swaps Setup_Hardcore around `process_nap_change`) | default |
| LEAVE_COMBAT_MAP_ALLOWED | leaving a threatened map | default |
| REST_HP_RECOVERY, RELAX_SKILL_ENABLED | rest HP, the Relax option | default |
| EXTRA_SAT_DRAIN | extra satiety a nap (HELL 12) | default |
| WORLD_DIFFICULTY_INCREASE / _REDUCTION | WD a nap (0.35) / on capture (22 / 13) | default |
| FETISH_HARDCORE_ENABLED | addictions | true |
| OVERMAP_DANGER_BONUS | rand(n) on StepOvermapDangerous (HELL 20); does NOT touch the +25 W of `overmap_gen_WildDangerous` | default |
| DDR_TIMER, DDR_MIN_GRIDS, INTIMATE_EXTRA_DAMAGE | minigame, health drain | default |
| EFFECTIVE_HARDCORE_LEVEL | the answer of `CustomDifficulty.hardcore_level` (never writes Setup_Hardcore) | default |
With the owner's file every base-relevant number is vanilla. Readable at run time (CD/Scripts/0_Config.rb, 10_CustomDifficulty.rb:440-456):
`defined?(::CustomDifficulty)`, `CustomDifficulty.hardcore_level` / `hell_or_higher?` / `doom_mode?`, `world_difficulty_increase`,
`overmap_danger_bonus`, `CustomDifficulty::CONFIG` (raw strings). Trap: CD sets Setup_Hardcore to 0 or 1 for the length of
`process_nap_change` (10_CustomDifficulty.rb:122-140), and M/160_Rest.rb aliases the same method, so a mode read inside the
nap math can see the swapped value: read the game's mode outside `process_nap_change`.
| Readable by LonaCraft | How |
|---|---|
| Setup_Hardcore, WorldDifficulty, WildDangerous, survival | `$story_stats[...]`, `$game_player.actor.survival`, any time |
| CustomDifficulty's level | `defined?(::CustomDifficulty) && ::CustomDifficulty.respond_to?(:hardcore_level)` |
| Not useful | Setup_HardcoreAmt, DDR, fetish keys |
## 3. Design (PROPOSED)
New: one level for the whole save (C1-C3) and a Danger step per base (C4). Both are factors or additions at the existing
read sites; Normal is exactly today's numbers. One helper, `LonaCraft::Raids.diff(knob)` / `diff_for(rec, knob)`, reads the
level table; every system calls it where it reads its config today.
### C1 Global level
| Option | For | Against |
|---|---|---|
| a. 3 levels (Easy / Normal / Hard) | short | no room above "hard" for a veteran |
| b. 4 levels Easy / Normal / Harsh / Brutal (PROPOSED) | one step down, two up; fits 4 columns at x 356-608 on the System page | "Harsh", not "Hard": the game's own lowest mode is labelled HARD |
| c. one free multiplier (0.5-2.0) | finest control | one number cannot move chance, size and costs sensibly together |
Touches (section 4): live roll add, base-value bonus, extra raiders, wall and door damage, warning time, give-up time; away chance,
grace and cooldown days, swing budget and party power, smash chances and cap, loot share; Deep Sewer nap chance and
population; mercenary price, maid hire fee, maid away-raid death; ground danger, ground sickness, bed roll cut.
Never touches: crafting, recipes, station costs (hand 1.25), tiers, skill, piece HP and armour, repair, race breach factors,
scenario group lists, night_only, refuse_nap, squad power, maid cooking and pay, rest recovery, meal, bath, homes and rents.
Recommendation: **b**, with the four level tables editable in Config/Bases.json.
### C2 Where it is set
| Option | For | Against |
|---|---|---|
| a. Config/Bases.json only | no UI work | restart to change; one level for every save |
| b. System page only, saved in `$game_system.lonacraft_data["difficulty"]` | per save, no file edit | no default for new saves, no table tuning |
| c. both (PROPOSED): Bases.json `"difficulty": {"level": "normal", "levels": {...}}` is the default; the System page row below "Destroy all bases" sets the save's own level, which then wins | per save, a file default, tables tunable | two places to explain (README) |
System row: "LonaCraft difficulty" + 4 columns like the game's hardcore row (F/194_menu_08_0_System.rb:186-189). Row 10 sits at
y 335 on a 640x360 screen (BASE_LINE 125 + 21 x 10): it fits by a few pixels; the owner's screenshot decides, fallback = the
level on row 9 and "Destroy all bases" as that row's last column. Bases.json rather than LonaCraft.json: the level is
gameplay, and Bases.json already has the strict merge, the defaults file and the README section.
Recommendation: **c**.
### C3 Relation to the game's mode and to CustomDifficulty
| Option | For | Against |
|---|---|---|
| a. independent (PROPOSED) | predictable; HELL already raises base raids through W (+25 on entry) and slower WD recovery, so nothing is counted twice | a HELL player picks Harsh by hand |
| b. follow by default: HARD / HELL / DOOM -> Normal / Harsh / Brutal until the player picks (CD's `hardcore_level` when loaded) | one choice for the player | counts HELL's W bonus twice; CD's swap trap |
| c. add on top: +1 step on HELL, +2 on DOOM | | as b, and Brutal + 2 has nowhere to go |
Recommendation: **a**; the console line at start and the self-test log name the game's mode and whether CustomDifficulty is loaded (information only).
### C4 Per-base Danger
| Step | Live roll add | Away chance | Extra raiders max | Sewer nap chance |
|---|---|---|---|---|
| Lower | -4 | x0.67 | -1 | -10 points |
| Normal | 0 | x1 | 0 | 0 |
| Higher | +4 | x1.5 | +1 | +10 points |
Stacks with the level (additions add, factors multiply; chances floored at 0, raiders capped by max_raiders).
Simulated live raid chance on naps 1..6 at WD 30, survival 5, base value 30, Normal level: Lower 6 15 22 26 27 26 %, Normal
10 23 30 33 33 33 %, Higher 14 30 37 38 41 40 %. Extremes: Easy + Lower 1 4 8 11 13 14 %; Brutal + Higher 25 47 54 57 60 59 %.
| Question | Options | Recommendation |
|---|---|---|
| Entry point | world-map tile menu line "Danger: Normal" beside "Rename base" (the same `Homes.extend_menu` path, M/110_Bases.rb:3386-3410); the Deep Sewer ladders beside their Rename (M/130_Sewer.rb:615) | both; picking cycles Lower -> Normal -> Higher; refused during a live raid on that base |
| Pay back for Higher | a. pure choice: more raiders already mean more drops and kills (PROPOSED); b. +25 % coin drops from live raiders; c. mercenaries x0.75 at that base | **a** |
| Deep Sewer (parked) | takes part through the ladder menu (code only, untestable until the entrances open) / left out | takes part |
| Owned houses, inn rooms | never raided (R13 decision 4) | no Danger line |
| Save | `rec["danger"]` -1 / 0 / 1, missing = 0 (old saves unchanged) | as listed |
### C5 Scaling over time
| Option | For | Against |
|---|---|---|
| a. nothing new (PROPOSED) | two growth axes exist: WorldDifficulty (+0.35 a nap up to 100: bigger nap groups, away budget and power up to x2, sewer rats 4 -> 10) and base value (live bonus up to 10, extras up to 4, away bonus up to 10) | |
| b. days since founding: away chance +1 point per 7 days, cap +10 | old bases feel hunted | a third axis to balance; punishes keeping a base |
| c. stored wealth: chest value adds to the chance, cap +10 | "raiders come for loot" | a chest walk every night per base |
Recommendation: **a**.
### C6 Costs
| Option | For | Against |
|---|---|---|
| a. every cost fixed | simplest | "costs" are in the owner's R10 line |
| b. mercenary contracts and the maid's hire fee scale (PROPOSED); maid pay, crafting, rents, house prices fixed | the hired help is the base's defence cost | a 1-day contract cannot go below 1 LC |
| c. b + the hand-crafting multiplier and rents | | crafting is outside the owner's line ("raids, away raids, spawns, costs" of the base systems) |
Contract price = ceil(days x price_per_day x level factor): 1 / 3 / 7 / 14 days cost Easy 1/3/6/11, Normal 1/3/7/14, Harsh
2/4/9/18, Brutal 2/5/11/21 LC. Maid fee = ceil(5 x factor). Recommendation: **b**.
### C7 A change in mid-game
| Thing | PROPOSED |
|---|---|
| Live raid running | the System row and the Danger line buzz while `Raids.busy?`; the raid keeps the numbers it began with |
| Raid armed by a nap roll, not spawned yet | uses the level at spawn |
| Away raid | worked out at once on the date hook, never "in progress"; the next roll uses the new level; catch-up nights after a long sleep use the level at catch-up time |
| Hired squad | days paid stay, no refund, no surcharge; extensions at the new price |
| Maid | a hired maid keeps her terms; a new hire pays the new fee |
| Piece HP | unchanged: the level scales damage, not HP, so the records' HP tables never need rescaling |
| Reports | unchanged |
Options: a. change any time except during a live raid (PROPOSED); b. lock the level once the first base is founded; c. one
change per N days. Recommendation: **a**.
### C8 Self-test and release
| Item | PROPOSED |
|---|---|
| Config | Bases.json section "difficulty": `"level"` (easy, normal, harsh, brutal) and `"levels": {name: {knob: value}}`; strict merge like the other sections (an unknown key or a bad value is skipped with a console line) |
| Defaults file | Bases_defaults.json gains the section; the header comment lists the knobs |
| Save | `lonacraft_data["difficulty"]` (string; missing = the file's level), `rec["danger"]` (integer) |
| Self-test rows | (1) each level has every knob, numbers in range; (2) the "normal" table equals today's numbers (Normal = no change, pinned); (3) the text keys exist in all 5 languages; (4) the Menu_System row index and the 4 column positions fit 640 x 360 |
| Text | Text/{CHT,ENG,KOR,RUS,UKR}/Bases.txt: menu/difficulty, 4 level names, Danger/opt, 3 step names, the refused line (about 10 keys each; level names short, 6-7 letters, for the 60-px columns) |
| README | new "Difficulty" section after "Raids", one line in "Config files"; CHANGELOG entry; next release |
## 4. Multiplier table (the current values are Normal)
| Id | Knob | Easy | Normal (today) | Harsh | Brutal |
|---|---|---|---|---|---|
| L1 | live: added to W on a base nap | -4 | 0 | +4 | +8 |
| L2 | live: base-value bonus factor / cap | x0.5 / 5 | x1 (0.1 a value point) / 10 | x1.5 / 15 | x2 / 20 |
| L3 | live: extra raider per value / extras max / max_raiders | 45 / 2 / 10 | 30 / 4 / 12 | 25 / 5 / 14 | 20 / 6 / 16 |
| L4 | live: wall and door damage a swing | x0.75 | x1 | x1.25 | x1.5 |
| L5 | live: warning time | x1.25 (600) | x1 (480; forest, sewer 300) | x0.85 (408) | x0.7 (336) |
| L6 | live: give-up time | x0.67 (7200) | x1 (10800) | x1.33 (14400) | x1.67 (18000) |
| A1 | away: chance a night | x0.5 | x1 (10 + min(10, value / 10)) | x1.5 | x2 |
| A2 | away: grace days / cooldown days | 2 / 3 | 1 / 2 | 1 / 2 | 1 / 1 |
| A3 | away: swing budget and party power against mercenaries | x0.75 | x1 | x1.25 | x1.5 |
| A4 | away: smash / smash_station | 0.15 / 0.05 | 0.25 / 0.10 | 0.30 / 0.12 | 0.40 / 0.15 |
| A5 | away: smash_cap | 2 | 3 | 4 | 5 |
| A6 | away: loot_fraction | 0.30 | 0.50 | 0.60 | 0.75 |
| S1 | Deep Sewer nap chance day / night | 25 / 45 | 35 / 60 | 40 / 70 | 50 / 80 |
| S2 | Deep Sewer population (vermin, hobos, goblins) | x0.75 | x1 | x1.25 | x1.5 |
| C1 | mercenary contract price | x0.75 | x1 (1 LC a day) | x1.25 | x1.5 |
| C2 | maid hire fee | 4 | 5 Copper | 7 | 8 |
| M1 | maid away_kill | 0.25 | 0.50 | 0.60 | 0.75 |
| R1 | rest: ground_danger | 5 | 10 | 15 | 20 |
| R2 | rest: ground_sick_chance | 5 % | 10 % | 15 % | 20 % |
| R3 | rest: bed_roll_mult | 0.60 | 0.75 | 0.85 | 0.90 |
What the levels do (simulated, or worked out from the decided numbers; away figures at WD 0):
| Effect | Easy | Normal | Harsh | Brutal |
|---|---|---|---|---|
| Live raid chance naps 1..6, base value 0 (WD 30, survival 5) | 3 10 15 19 21 21 % | 7 17 24 28 28 28 % | 11 24 32 34 34 35 % | 15 31 39 41 42 42 % |
| same, value 30 | 4 12 18 22 23 23 % | 10 23 30 32 33 34 % | 15 31 39 40 43 42 % | 21 41 47 51 51 52 % |
| same, value 100+ | 8 19 26 30 29 29 % | 17 35 41 44 46 46 % | 26 48 56 58 61 61 % | 35 61 68 74 77 77 % |
| Bandit spear swings to break door / palisade / stone (live, one breacher, about 1.25 s a swing) | 24 / 47 / 134 | 18 / 36 / 100 | 15 / 29 / 80 | 12 / 24 / 67 |
| Away raids a week, value 30 (chance a night) | 0.37 (6.5 %) | 0.70 (13 %) | 0.95 (19.5 %) | 1.43 (26 %) |
| Away raids a week, value 100+ | 0.56 (10 %) | 1.01 (20 %) | 1.31 (30 %) | 2.00 (40 %) |
| Orkind away raid breaks the door (budget 35 +-25 % against 34 swings) | 0 % | 56 % | 95 % | 100 % |
| BanditMobs away raid breaks door + palisade (budget 38 +-25 % against 18 + 36) | 0 % | 0 % | 23 % | 61 % |
| The squad beats BanditMobs (power 132 x A3 against 220) | 100 % | 100 % | 96 % | 73 % |
| Pieces smashed at most a raid | 2 | 3 | 4 | 5 |
## 5. Build estimate
| File | Change | Lines |
|---|---|---|
| M/120_Raids.rb | DEFAULTS "difficulty", merge_difficulty, the `diff` / `diff_for` helper, level source (save, then file), L1-L6 at before_roll, reserve_extras, swing_damage, start_grace, update | +150 |
| M/140_AwayRaids.rb | A1-A6 at roll?, budget, raid!, simulate, loot_box; the per-base step | +30 |
| M/130_Sewer.rb | S1, S2, the Danger line on the ladder menu | +30 |
| M/150_Mercs.rb | C1 contract price (ceil) | +10 |
| M/170_Maid.rb | C2 fee, M1 away_kill | +10 |
| M/160_Rest.rb | R1-R3 | +10 |
| M/110_Bases.rb | System row (4 columns, buzzer during a raid), world-map "Danger" line, `rec["danger"]` | +120 |
| M/98_SelfTest.rb | 4 rows | +60 |
| Text/*/Bases.txt (5 languages) | about 10 keys each | +50 |
| README.md, CHANGELOG.md | Difficulty section, Config files line | +50 |
| Total | 10 files (5 of them text) | about 520 |
Risk: low to medium. Every change is a factor at an existing read site and the self-test pins Normal to today's numbers.
Highest risks: the System row at y 335 on 640x360 (screenshot), the choice index of the world-map tile menu with two added
lines, and the CustomDifficulty swap if the mode were read inside `process_nap_change` (this design never does).
In-game checklist sketch (the owner's run):
| # | Step | Expect |
|---|---|---|
| 1 | New save, open System | row "LonaCraft difficulty", Normal lit, inside the screen |
| 2 | Pick Brutal, save, load | Brutal kept; console "LonaCraft Raids: difficulty brutal (save)" |
| 3 | Bases.json `"difficulty": {"level": "easy"}`, a new save | Easy lit |
| 4 | Brutal, nap on a base | console shows W +8 and the bonus x2 |
| 5 | Debug raid (Numpad .) at Brutal | a bandit spear breaks a door in about 12 swings; more raiders than at Normal |
| 6 | The System row during that raid | buzzer, no change |
| 7 | World-map tile of a base | "Danger: Normal" beside Rename; cycles Lower / Normal / Higher |
| 8 | Higher + Brutal, debug away raid (Numpad . off a base) | report: up to 5 smashed, a larger loot share |
| 9 | Hire the mercenaries at Harsh | 7 days = 9 LC |
| 10 | Hire the maid at Easy | fee 4 Copper |
| 11 | Ground nap at Brutal | console: ground danger +20 |
| 12 | Back to Normal | every number as before R10 (spot-check one raid and one away report) |
@@ -0,0 +1,262 @@
# Research R16: rentable rooms in every inn
Owner (2026-10-06): the Noer tavern room (rent, furnish, sleep) must work in every inn of the game, at a
price that depends on the place. This file: which inns exist, one candidate room per inn with its
numbers, the `LOCATIONS` rows ready to paste, the shared code changes, and the owner's choices.
Game files are relative to `LonaRPG/`; `Homes` = `LonaCraft/Scripts/100_Homes.rb` (dev copy).
Renders (session scratchpad `r16/`, not in the mod): `<Map>_overview.png` and `<Map>_room.png` for
NoerTavern, PirateBaneInn, DoomFortressInn, FishTownInn, SouthFL_INN, NorthFL_INN; in the room renders
green = room tiles, red = door tiles, blue box = wall tiles, `E<n>` = event id. Tile numbers below were worked out with the same
flood fill as `Homes.flood_room` (100_Homes.rb:595-623); the script reproduces the Noer room's 11 tiles.
## 1. Inns found
An inn = a map whose NapEvent script gives a paid sleep for a room key bought from a keeper. There
are exactly six; every key is item price 550 trade points, sold at item price (Barters json, default
price = item price, `Data/Scripts/Editables/29_Functions_417_Interpreter.rb:69-71`).
| # | Inn (MapInfos name, map) | Keeper (event, tile) | Keeper script, menu | Nap script (NapEvent) | Key (item id) | Price today |
|---|---|---|---|---|---|---|
| 0 | Noer tavern `NoerTavern` (Map059) | Boss Mama `-point-TavernWaifu` EV69 (38,37) | `NoerTavernWaifu.rb`, `call_msg("\\optB[...]")` (Homes SELLERS 100_Homes.rb:110-112) | `NoerTavern_Nap.rb` EV38 (37,49) | `ItemNoerTavernNapKey` (106) | key 550/night; **rent 2 LC/week (exists)** |
| 1 | Pirate's Bane inn `PirateBaneInn` (Map081) | `-point-Keeper` EV8 (25,20) | `PirateBaneInnKeeper.rb:9-21`, `call_msg("\\optB[#{cmd_text}]")`, Barter = `commonNPC/Barter` (:11) | `PirateBaneInn_Nap.rb` EV56 (31,31) | `ItemPirateBaneInnNapKey` (114) | 550/night (`Data/Barters/PirateBaneInnKeeper.json:8-11`) |
| 2 | Doom Fortress inn `DoomFortressInn` (Map097) | `-point-Keeper` EV13 (32,34) | `DoomFortressInnKeeper.rb:8-20`, `\optB`, Barter :10 | `DoomFortressInn_Nap.rb` EV12 (17,26) | `ItemDoomFortressInnNapKey` (116) | 550 (`DoomFortressInnKeeper.json:8-11`) |
| 3 | Fish Town inn `FishTownInn` (Map117) | Deepone `-point-Keeper` EV72 (37,21) | `FishTownInnKeeper.rb:12`, **`call_msg("TagMapFishTownInn:InnKeeper/Begin")`: a text key whose text ends in `\optB[...]`** (`Text/ENG/TagMapFishTownInn.txt:8-10`) | `FishTownInn_Nap.rb` EV13 (40,14) | `ItemFishTownInnNapKey` (119) | 550 (`FishTownInnKeeper.json:8-11`) |
| 4 | South front-line camp inn `SouthFL_INN` (Map135) | guard `asd` EV14 (22,18) | `InnKeeper_SouthFL_INN.rb:7-21`, `\optB`, Barter :10 | `SouthFL_INN_Nap.rb` EV9 (37,25) | `ItemSouthFL_INN_Key` (125) | 550 (`InnKeeper_SouthFL_INN.json:8-10`, no price = item price) |
| 5 | Coastal Fortress inn `NorthFL_INN` (Map148) | `-point-Keeper` EV66 (42,21) | `NorthFL_INN_Keeper.rb:13-28`, `\optB`, Barter :17 | `NorthFL_INN_Nap.rb` EV54 (23,29) | `ItemNorthFL_INN_Key` (129) | 550 (`NorthFL_INN_Keeper.json:8-11`) |
Coins (Items.rvdata2 price): Copper `ItemCoin1` 200, Large Copper `ItemCoin2` 2000, Gold `ItemCoin3`
20000. A week of keys = 7 x 550 = 3850 trade points, about 2 LC: the Noer rent (4000) is "a key a night".
**Not inns** (nap scripts checked; no keeper sells a sleep):
| Place | Why no rent | Ref |
|---|---|---|
| Noer Golden Bar (Map082) | nap always "drive away" | `NoerGoldenBar_Nap.rb:105-109` |
| Arise village (Map165) | nap: death if aggro, else drive away | `AriseVillage_Nap.rb:7-23` |
| Refugee camps (Map035, 073, 133, 166), Noer slums/roads | free field nap, no keeper, no rooms | `NoerWildness_Nap.rb:108` (region_map_wildness_nap) |
| Saint Monastery (Map064/126) | sleep only for the SaintBeliever title, else drive away | `SaintMonastery_Nap.rb:132-136` |
| SM Cloud Village (Map182) | free nap, no keeper | `SMCloudVillage_Nap.rb:236-248` |
| Fish Town T / FishTownL/R | guards / drive away, no keeper | `FishTownT_Nap.rb:112-137` |
| Orkind caves/camps, bandit camps, Deepone caves, hives | hostile; capture naps | `OrkindCave_Nap.rb`, `BanditCamp1_Nap.rb` ... |
| Noer tavern 2F (Map076) | same inn and key as Noer (`NoerTavern2F_Nap.rb:108-125`); optional 2nd Noer room, not drafted | - |
| Sybaris | no inn map exists (only `Syb_WarBossRoom`) | - |
## 2. What each inn's paid sleep gives
All six paid branches are the same code: lose 1 key, health / stamina / satiety to max (the "meal"),
4 x `Command_Bath.rb`, dirt 0, `handleNap`. No day/night rule in any of them. Before that branch each
script runs the night-visitor loop (`NapFucker` NPCs within 3-5 tiles) and its own capture checks, which
a rented room does **not** bypass (the Homes nap wrapper only makes the key count as held,
100_Homes.rb:1098-1118, 1391-1408).
| Inn | Paid branch | Checks before it (still apply in the rented room) | Without key |
|---|---|---|---|
| Noer | `NoerTavern_Nap.rb:129-136` | Boss Mama gone / Cocona quest -> drive away; slave -> turned out (:117-128) | turned out (:125-128) |
| Pirate's Bane | `PirateBaneInn_Nap.rb:133-140` | slave or morality < 1 -> guards kidnap (:107-126) | drive away (:128-131) |
| Doom Fortress | `DoomFortressInn_Nap.rb:136-143` | slave or morality < 1 -> kidnap (:109-129) | drive away (:131-134) |
| Fish Town | `FishTownInn_Nap.rb:136-143` | slave or morality < 1 -> Fishkind kidnap (:109-126) | sent out to FishTownL (:129-134) |
| South FL camp | `SouthFL_INN_Nap.rb:122-129` | **morality < 1 -> death** (:109-120) | plain `handleNap` (:130-131): a key only adds the restore |
| Coastal Fortress | `NorthFL_INN_Nap.rb:172-179` | slave of the inn -> rape loop; slave or morality < 1 -> kidnap (:110-165) | drive away (:167-170) |
So the rented room's sleep needs nothing per inn: `:nap_keys` = that inn's key, the wrapper is the
same two lines. Keepers: none of the five has a night or day rule on its event (Map081 EV8, Map097
EV13, Map117 EV72, Map135 EV14, Map148 EV66 have no `$game_date` line); every keeper script returns at
once while `$game_map.threat` (line 1-5 of each); Fish Town's keeper attacks a slave Lona
(`FishTownInnKeeper.rb:6-10`) and the Coastal Fortress keeper only gives the slave-work line to the
inn's own slave (`NorthFL_INN_Keeper.rb:7-10`): no menu, so no rent / collect then. Boss Mama is
deleted in some Cocona quest states (Map059 EV69).
## 3. RolePlayS
RolePlayS redirects every file in its `HCGframes/event/` (`RolePlayS/Scripts/0_CORE.rb:1707-1718`). That
folder (34 files) holds none of the 5 keeper scripts and none of the 5 nap scripts (inn files in it:
companion scripts, `NoerTavernGuildEmpolyee.rb`, `NoerTavernQuestBoard.rb`). It also redirects
`Command_AreaNap.rb` (the bed command; not touched here). It adds goods to the PirateBane and Noer
keepers' barter lists (0_CORE.rb:487-488, 582-585): data only. **No collision**; the Homes redirect
chains anyway (`Homes.redirect` keeps the previous target, 100_Homes.rb:955-964). No other mod in
`_Mods` sets `$mod_load_script` for these files.
## 4. Candidate rooms (one per inn: the inn's own paid bedroom)
Each is the room holding the inn's `-point-WakeUp` bed (as in Noer). Small: these inns have 2 x 3 cells.
| Inn | Seed | Bounds | Door tiles | Floor tiles (+override) | Baked table override | Events in room -> action | Points moved to | Floor rule | Wall tiles (decor) | Windows |
|---|---|---|---|---|---|---|---|---|---|---|
| Noer (exists) | 32,30 | 30,27,35,33 | 31,33; 33,32 | 10 + 1 = 11 | 31,29 <- 31,30 | WakeUp, EV087 bucket, SexPoint2; torch EV024 at 31,28 | 31,34; 32,34 | 32,30 | 31..34,28 | 33,27 |
| Pirate's Bane | 41,21 | 40,19,43,23 | 41,23; 42,23 (EV6/EV4 doors) | 5 + 1 = 6 | 42,20 <- 42,21 (A2 3198 on 1590) | `-point-WakeUp` EV11 (41,21) move; `-point-SexPoint2` EV27 (42,21) move; MapBlockBox EV38 (41,20, bed head, Command_AreaNap) delete | 41,24; 42,24 | none (keeps the door curtains, layer 2 tiles 349/350 at 41,22 / 42,22) | 41,19; 42,19 | none (window 42,18 is above the wall row) |
| Doom Fortress | 29,22 | 27,20,31,26 | 30,26 (EV5 door) | 7 + 1 = 8 | 30,22 <- 30,23 (3198 on 1598) | `-point-WakeUp` EV23 (28,23) move; `-point-SexPoint2` EV15 (29,22) move; MapBlockBox EV24 (28,22) delete | 29,27; 31,27 | none needed (only layer-0 carpet pieces) | 28..30,21 | none (window 30,20 above wall row) |
| Fish Town | 22,22 | 20,19,24,24 | 24,23 (EV34 door) | 8 + 1 = 9 | 22,21 <- 22,22 (3198 on 1595) | `-point-WakeUp` EV63 (21,22) move; `-point-SexPoint4` EV64 (21,23) move; LinkBox EV62 (21,21, bed head) delete; EV1 water bucket (23,21, Command_AreaWater) delete | 25,22; 25,21 | 22,23 (floor 1595): clears layer-2 clutter 508 (21,23), 509 (23,22) | 21..23,20 | none |
| South FL camp | 14,21 | 12,19,16,23 | 16,22 (EV22 door) | 7 + 1 = 8 | 13,22 <- 13,21 (stand B18 + torch event) | `-point-WakeUp` EV19 (13,21) move; `-point-SexPoint2` EV32 (14,20) move; MapBlockBox EV20 (13,20, bed head) delete; MapBlockBox EV56 (13,22, `give_light("torch")`) delete (light goes, as Noer's torch) | 17,22; 18,22 | see 6.2: carpet is a layer-1 autotile, so the current rule would flatten its border; use `:floor_layers => [2]` (new) to clear clutter 627 (14,20), 11 (14,22) | 13,19; 14,19; 15,20 | none |
| Coastal Fortress | 31,14 | 30,12,34,18 | 33,18 (EV19 door) | 7 + 1 = 8 | 32,14 <- 32,15 (3198 on 1580) | `-point-WakeUp2` EV6 (31,14, the inn bed, Command_AreaNap) erase in place (looked up only on NoerArenaB1, `NoerArenaB1_Begin.rb:213`); `-point-SexPoint2` EV36 (32,15) move; EV23 water bucket (33,14) delete; wall torch EV43 (32,13) via remove_event_tiles (as Noer) | SexPoint2 -> 33,19 | 32,15 (no decor left after override) | 31..33,13 | none (arrow slit 31,12 above wall row) |
All move targets checked: passable 4 ways by layers, no event on the tile (Map081 41/42,24; Map097
29/31,27; Map117 25,21/22; Map135 17/18,22; Map148 33,19). Every room event above is restored at rent
expiry (the map file is never changed; Homes reloads it, 100_Homes.rb:1225-1290).
## 5. LOCATIONS rows (paste after `noer_inn_room`, 100_Homes.rb:142-195)
Prices are the proposal of section 8; change `:price` / `:coin` per the owner's choice.
```ruby
# Pirate's Bane inn (Data/Map081 PirateBaneInn), the paid bedroom (the
# right one of the three cells at the top; the other two hold sleeping
# customers EV23/EV24). Floor 5 tiles (41,20..22) (42,21..22) plus the
# small table (42,20). Doors: WoodenDoorSide4 EV6 (41,23), EV4 (42,23).
{:id => "piratebane_inn_room", :name => "piratebane_inn_room/name", :mode => :rent,
:price => 3, :coin => "ItemCoin2", :seller => "PirateBaneInnKeeper",
:map => "PirateBaneInn",
:room_seed => [41, 21], :room_bounds => [40, 19, 43, 23],
:door_tiles => [[41, 23], [42, 23]],
:keep => [],
:move_points => {"-point-WakeUp" => [41, 24], "-point-SexPoint2" => [42, 24]},
:tile_overrides => [[42, 20, 42, 21]],
:remove_event_tiles => [],
# no :floor_ref: the door curtains (layer 2, 41,22 / 42,22) stay
:window_tiles => [],
:nap_script => "Data/HCGframes/event/PirateBaneInn_Nap.rb",
# PirateBaneInn_Nap.rb:128, 133-134 (by name)
:nap_keys => ["ItemPirateBaneInnNapKey", 114],
:clear_existing => true},
# Doom Fortress inn (Data/Map097 DoomFortressInn), the middle cell of the
# three at the top: 2 x 2 floor + the passage to its door EV5 (30,26),
# plus the small table (30,22).
{:id => "doomfortress_inn_room", :name => "doomfortress_inn_room/name", :mode => :rent,
:price => 2, :coin => "ItemCoin2", :seller => "DoomFortressInnKeeper",
:map => "DoomFortressInn",
:room_seed => [29, 22], :room_bounds => [27, 20, 31, 26],
:door_tiles => [[30, 26]],
:keep => [],
:move_points => {"-point-WakeUp" => [29, 27], "-point-SexPoint2" => [31, 27]},
:tile_overrides => [[30, 22, 30, 23]],
:remove_event_tiles => [],
:window_tiles => [],
:nap_script => "Data/HCGframes/event/DoomFortressInn_Nap.rb",
# DoomFortressInn_Nap.rb:131, 136-137
:nap_keys => ["ItemDoomFortressInnNapKey", 116],
:clear_existing => true},
# Fish Town inn (Data/Map117 FishTownInn), the bottom-left room: 3 x 3
# floor with the small table (22,21); door EV34 (24,23).
{:id => "fishtown_inn_room", :name => "fishtown_inn_room/name", :mode => :rent,
:price => 4, :coin => "ItemCoin2", :seller => "FishTownInnKeeper",
:map => "FishTownInn",
:room_seed => [22, 22], :room_bounds => [20, 19, 24, 24],
:door_tiles => [[24, 23]],
:keep => [],
:move_points => {"-point-WakeUp" => [25, 22], "-point-SexPoint4" => [25, 21]},
:tile_overrides => [[22, 21, 22, 22]],
:remove_event_tiles => [],
# floor 1595; clears the clutter at (21,23) and (23,22) (with the
# new :floor_layers => [2], (23,22) keeps its own floor 1603)
:floor_ref => [22, 23],
:window_tiles => [],
:nap_script => "Data/HCGframes/event/FishTownInn_Nap.rb",
# FishTownInn_Nap.rb:129, 136-137
:nap_keys => ["ItemFishTownInnNapKey", 119],
:clear_existing => true},
# South front-line camp inn (Data/Map135 SouthFL_INN), the top-left room;
# door EV22 (16,22). (13,22) is the torch stand (EV56), made floor.
{:id => "southfl_inn_room", :name => "southfl_inn_room/name", :mode => :rent,
:price => 8, :coin => "ItemCoin1", :seller => "InnKeeper_SouthFL_INN",
:map => "SouthFL_INN",
:room_seed => [14, 21], :room_bounds => [12, 19, 16, 23],
:door_tiles => [[16, 22]],
:keep => [],
:move_points => {"-point-WakeUp" => [17, 22], "-point-SexPoint2" => [18, 22]},
:tile_overrides => [[13, 22, 13, 21]],
:remove_event_tiles => [],
# carpet = layer-1 autotile: only layer 2 (clutter 627, 11) is cleared.
# NEEDS the new :floor_layers option (section 6.2); without it leave
# :floor_ref out (clutter stays) rather than flatten the carpet border.
:floor_ref => [14, 21], :floor_layers => [2],
:window_tiles => [],
:nap_script => "Data/HCGframes/event/SouthFL_INN_Nap.rb",
# SouthFL_INN_Nap.rb:122-123
:nap_keys => ["ItemSouthFL_INN_Key", 125],
:clear_existing => true},
# Coastal Fortress inn (Data/Map148 NorthFL_INN), the right one of the
# three cells at the top: 2 x 2 + the passage to its door EV19 (33,18),
# plus the small table (32,14).
{:id => "northfl_inn_room", :name => "northfl_inn_room/name", :mode => :rent,
:price => 1, :coin => "ItemCoin2", :seller => "NorthFL_INN_Keeper",
:map => "NorthFL_INN",
:room_seed => [31, 14], :room_bounds => [30, 12, 34, 18],
:door_tiles => [[33, 18]],
:keep => [],
# -point-WakeUp2 (the inn bed) stays as an invisible point: nothing on
# this map looks it up (only NoerArenaB1_Begin.rb:213, another map)
:move_points => {"-point-SexPoint2" => [33, 19]},
:tile_overrides => [[32, 14, 32, 15]],
# the wall torch above the table (EV43, give_light "torch_weak")
:remove_event_tiles => [[32, 13]],
:floor_ref => [32, 15],
:window_tiles => [],
:nap_script => "Data/HCGframes/event/NorthFL_INN_Nap.rb",
# NorthFL_INN_Nap.rb:167, 172-173
:nap_keys => ["ItemNorthFL_INN_Key", 129],
:clear_existing => true}
```
`SELLERS` lines (100_Homes.rb:100-113):
```ruby
"PirateBaneInnKeeper" => ["Data/HCGframes/event/PirateBaneInnKeeper.rb", "commonNPC:commonNPC/Barter"],
"DoomFortressInnKeeper" => ["Data/HCGframes/event/DoomFortressInnKeeper.rb", "commonNPC:commonNPC/Barter"],
# menu is a text key (FishTownInnKeeper.rb:12) whose \optB has its own
# words: no marker (UKR says "Обмін" there, "Бартер" in commonNPC/Barter)
"FishTownInnKeeper" => ["Data/HCGframes/event/FishTownInnKeeper.rb", nil],
"InnKeeper_SouthFL_INN" => ["Data/HCGframes/event/InnKeeper_SouthFL_INN.rb", "commonNPC:commonNPC/Barter"],
"NorthFL_INN_Keeper" => ["Data/HCGframes/event/NorthFL_INN_Keeper.rb", "commonNPC:commonNPC/Barter"]
```
Wrappers (`HCGframes/`, two lines each like `HCGframes/NoerTavernWaifu.rb` / `NoerTavern_Nap.rb`):
`PirateBaneInnKeeper.rb`, `DoomFortressInnKeeper.rb`, `FishTownInnKeeper.rb`, `InnKeeper_SouthFL_INN.rb`,
`NorthFL_INN_Keeper.rb` -> `lonacraft_home_seller("<key>")`; `PirateBaneInn_Nap.rb`,
`DoomFortressInn_Nap.rb`, `FishTownInn_Nap.rb`, `SouthFL_INN_Nap.rb`, `NorthFL_INN_Nap.rb` ->
`lonacraft_home_nap("Data/HCGframes/event/<file>")`.
## 6. Shared code changes in 100_Homes.rb
| # | Change | Why | Size |
|---|---|---|---|
| 6.1 | **Text-key menus** in the `call_msg` alias (100_Homes.rb:1535-1547): when no `\optB` is in `args[0]` and it looks like a text key, resolve `$game_text[key, true]`; if that text has `\optB[`, run `lonacraft_home_menu(full)` and show the extended text with `$game_message.background/position = args[1]/args[2]` (defaults 0/2), `$game_message.add(text)`, `wait_for_message` (what `call_msg` does, `29_Functions_417_Interpreter.rb:202-207`, minus the `\t[...]` wrapper: the text holds `]`, and `\T[([^\]]+)]` (`Frames/53_Window_Base.rb:248`) would cut it) | Fish Town keeper | ~20 lines |
| 6.2 | **`:floor_layers`** (default `[0, 1, 2]`): the decor rule (100_Homes.rb:1264-1276) copies and compares only these layers of `:floor_ref` | South FL carpet is a layer-1 autotile (room tiles' layer 1 = 3008..3048): the current rule would turn every border piece into the centre piece; Fish Town keeps its 1603 tile | ~5 lines |
| 6.3 | `marker = nil` already means "no marker" (100_Homes.rb:1376 gives "", `extend_menu` skips the check, :1042) | Fish Town | none |
| 6.4 | Several rooms per map: `owned_rooms_on` / `furniture_allowed_at?` already take every room of a map; `home_at_map?` returns the first (100_Homes.rb:691-704) | only needed for a 2nd room on one map (e.g. Noer 2F); not in this draft | none now |
| 6.5 | Self-test rows (98_SelfTest.rb:211-213 ITEM_LISTS + the 5 keys and `ItemCoin1`; :247-258 MAPS + 81, 97, 117, 135, 148 with their tileset ids 22, 22, 38, 22, 22; :275-280 GAME_FILES + the 10 scripts). No TILESETS row: the overrides copy tiles of the same map, no tile id is baked | gate coverage | ~20 lines |
| 6.6 | Docs: README "Homes" + TECHNICAL "Homes" table (TECHNICAL.md:515-519) and the room paragraphs | - | - |
## 7. Work breakdown (builder)
| Item | Per inn | x5 |
|---|---|---|
| LOCATIONS row (section 5) + SELLERS line | paste | 5 |
| `HCGframes/<keeper>.rb`, `HCGframes/<nap>.rb` | 2 two-line files | 10 files |
| Texts `Text/<lang>/Homes.txt`: `<id>/name`, `rent_opt`, `extend_opt`, `status_opt`, `coin_week` (coin word per inn: "LC a week" / "copper a week"), `rented`, `extended`, `no_coins`, `status`, `expired` (names that inn's keeper: "the innkeeper is holding your belongings") | 10 keys x 5 languages (CHT ENG KOR RUS UKR) | 250 entries |
| Shared: 6.1 (Fish Town only), 6.2 (South FL, Fish Town), 6.5, 6.6 | once | - |
| Verify in game (runner): rent / extend / status / collect at each keeper; sleep in the room with no key = paid sleep; outside the room unchanged; expiry restores bed / bucket / table; screenshot each room rented and furnished | per inn | 5 |
Order: Pirate's Bane, Doom Fortress, Coastal Fortress (row + wrappers only), South FL (needs 6.2),
Fish Town (needs 6.1 + 6.2).
## 8. Choices for the owner
Proposed rent per week, relative to Noer (2 LC = about a key a night):
| Inn | Place (keeper's own words) | Proposed | Trade points (keys/night equiv.) | Reasoning | Alternative |
|---|---|---|---|---|---|
| Noer tavern | the capital | 2 LC (keep) | 4000 (1.0) | base | - |
| Pirate's Bane | "one of the few safe havens under the Rudesind Family protection" (`TagMapPirateBane.txt` InnKeeper/About_here) | **3 LC** | 6000 (1.6) | safest, noble-protected, refugees crowd in: dearest | 2 LC |
| Doom Fortress | Ingalend's front-line fortress ("always been the front lines") | **2 LC** | 4000 (1.0) | royal fortress, steady soldier trade: as Noer | 3 LC |
| Coastal Fortress (NorthFL) | ex salt field, villages around fell; the keeper takes slaves | **1 LC** | 2000 (0.5) | besieged, dangerous to sleep in | 2 LC |
| South FL camp | a keep that fell, rebuilt as a camp from the ruins | **8 Copper** | 1600 (0.4) | ruined camp, worms; sleeping there is free anyway without a key | 1 LC |
| Fish Town | Deepone town, keeper hostile to outsiders ("you all will be extinct") | **4 LC** | 8000 (2.1) | outsider surcharge in a hostile town | no rent at all |
| Golden Bar, refugee camps, Arise, Orkind/bandit camps, Saint Monastery, Sybaris | no paid sleep / no inn | no rent | - | section 1 | - |
| Question | Recommendation |
|---|---|
| Which inns get a room | all five above (Fish Town last; it needs 6.1) |
| Coin | Large Copper everywhere except South FL in Copper (8); Gold nowhere (1 Gold = 10 LC a week, above every inn) |
| Pirate's Bane room is 6 tiles (the inn's cells are 2 x 3) | accept; the other cells hold sleeping customers |
| South FL: make the torch stand (13,22) floor (torch light goes, 8 tiles) or keep it (7 tiles) | make it floor, as Noer's torch |
| Coastal Fortress: remove the wall torch over the table (EV43) | remove, as Noer |
| Noer 2F second room | not now |
@@ -0,0 +1,271 @@
# R6 Localization research (2026-10-06)
Status: research, nothing built. Every choice is PROPOSED; the owner decides.
Paths: `<game>` = LonaRPG root, `<mod>` = `<game>/ModScripts/_Mods/LonaCraft`, `<mods>` = `<game>/ModScripts/_Mods`.
Line numbers are as read on 2026-10-06; other executors are editing the mod, so mod lines may shift by a few.
## Summary
| # | Finding |
|---|---|
| 1 | The mod is already almost fully behind text keys: 302 keys, 66 item files (132 key refs, none missing), 0 text in Recipes/*.json, 0 text in Maps. Hard-coded player-visible words: 9 (3 error box headers, 5 fallback tier names, 1 composed sentence), plus 15 punctuation/format joins, plus 6 debug-popup bits. |
| 2 | All five other language folders (CHT, KOR, MTL, RUS, UKR) are byte-identical copies of ENG: 0 translated keys out of 302 each. |
| 3 | The game never selects MTL (language list = folders of `<game>/Text/`, which has no MTL). Delete it. |
| 4 | A missing KEY shows the raw key text; a missing FILE shows a blocking `msgbox` error then raw keys; neither falls back to ENG. The game has no fallback. |
| 5 | A fallback hook fits in one new file (about 30 lines) because the mod already aliases `Text#[]` (`Scripts/50_Tiers.rb:537-554`). |
| 6 | Recommendation: (a) key the 1 composed sentence only, leave error boxes, debug and glue; (b) add the ENG fallback hook; (c) machine-translate CHT/KOR/RUS/UKR with Claude, marked for review, after the key set settles; (d) scratchpad checker; (e) drop MTL. 4 build items (section 5). |
## 1. How the game picks a language and loads text
| Fact | Evidence |
|---|---|
| Language code is read from `UserData/GameLona.ini` `[LonaRPG] Language` (now `ENG`). | `<game>/UserData/GameLona.ini:2-9`; `<game>/Data/Scripts/Frames/5_DataManager.rb:105-108` |
| Supported codes = the sub-folders of `<game>/Text/`: today CHT, ENG, KOR, RUS, UKR. The list is built by scanning the folder, not hard-coded. | `5_DataManager.rb:273-286` (`createLangArray`); `<game>/Text/` listing |
| An unknown code at boot resets to `ENG` and starts the first-run language pick. | `5_DataManager.rb:94-102` |
| The language picks (title options, first-run setup, in-game System menu) all list `createLangArray`. | `Data/Scripts/Editables/122_Scene_TitleOption.rb:75`; `123_Scene_FirstTimeSetup.rb:56`; `Frames/194_menu_08_0_System.rb:339, 804` |
| Adding a language = a new folder under `<game>/Text/` plus a `Fonts/SYS-<CODE>-*.ttf`. | `<game>/Fonts/_HowToAddFontToYourLang.txt` |
| Fonts per language: CHT, KOR, RUS, UKR, ENG each ship a `SYS-<code>` font. CHT/KOR/JPN get a larger message size. | `<game>/Fonts/` listing; `Editables/50_System_Settings.rb:12, 40` |
| A mod declares `"texts": "Text"` in `_ModInfo.json`; the loader stores it and registers the folder `<mod path>/Text/<$lang>` as part `<mod id>`. | `<mod>/_ModInfo.json:6`; `Frames/RVscript/710_Mod_InGameUI_ClassMod.rb:31`; `730_Mod_InGameUI_mod_manager.rb:240-244` (`link_texts`) |
| Key syntax: `Part:File:id`. A mod key is `LonaCraft:<File>:<id>`, which reads `<mod>/Text/<lang>/<File>.txt`, block `<id>`. Two-part keys (`File:id`) are the game's own `<game>/Text/<lang>/`. | `121_Dialog_Control_System.rb:87-96` (`split_key`), `98-111` (`[]`), `113-121` (`load_file`) |
| File format: blocks separated by a blank line; first line = id, then body lines; `#` lines skipped; body lines joined with `\f`. A body line containing `:` is split as `speaker: text` (the trap noted in every mod Text file header). | `121_Dialog_Control_System.rb:123-148`, esp. `137` |
| Text is read lazily: a file is loaded on the first lookup and cached in the `Text` object. The `Text` object is rebuilt (cache cleared) at boot, on every `update_Lang`, and whenever `create_game_objects` runs (new game, load). `update_Lang` re-links all mod parts. | `5000_Mod_loader.rb:4-7` (`<game>/ModScripts/`); `5_DataManager.rb:114-117, 530-534`; `121_...rb:103-105` |
| Switching language in a menu rebuilds at once (`update_Lang`); title/first-run options also show a "restart recommended" notice. | `194_menu_08_0_System.rb:802-806`; `122_Scene_TitleOption.rb:380-388` |
| Item names and descriptions: JSON `"textFlag": {"name": "<key>", "description": "<key>"}`; the key is read through `$game_text` by every item screen. | `Frames/Modules/ItemConfig.rb:159-161`; mod example `<mod>/Item/Plank.json` |
| Mods menu: a `_ModInfo.json` description starting with `$` is resolved as a key (`LonaCraft` uses `$LonaCraft:Info:ModInfo/description`). | `710_Mod_InGameUI_ClassMod.rb:93-94`; `720_Mod_InGameUI_MOD SCENE.rb:474`; `<mod>/_ModInfo.json:5` |
| Popups given a string go through `$game_text[...]`, so keys work in `$game_map.popup`; a plain sentence with no `:` passes through unchanged. | `Frames/200_Galv_Event_Popup.rb:109` |
| Escape `\t[key]` inside a message resolves a key (this is what `call_msg("key")` does). | `Frames/53_Window_Base.rb:246-248`; `Editables/29_Functions_417_Interpreter.rb:202-207` |
### Fallback behaviour when something is missing
| Case | What happens | Evidence |
|---|---|---|
| Key missing in the chosen language, file exists | `$game_text[key]` returns the key string itself (e.g. `LonaCraft:Items:Plank/item_name`). With `noError = true` it returns `""`. No crash, no ENG fallback. | `121_Dialog_Control_System.rb:105-110` |
| Mod folder `Text/<lang>/<File>.txt` missing | A blocking `msgbox "ERROR: missing translation file ..."` (once per file per rebuild of `$game_text`), then every key of that file shows as the raw key. | `121_...rb:113-121` (118 is the `msgbox`), cached empty hash at `100-104` |
| Mod part not registered (mod disabled / `texts` empty) | Returns the key. | `121_...rb:100` |
| Malformed key (not 2 or 3 parts) | Returns the key. | `121_...rb:87-96, 100` |
Real-world check: RolePlayS ships only `Text/CHT` (1 file, `GGININDER.txt`), `ENG` and `RUS` (`<mods>/RolePlayS/Text/`), so in KOR and UKR (and CHT for most files) RolePlayS shows error boxes and raw keys. Nothing in RolePlayS hooks a fallback (its attempt is commented out: `RolePlayS/Scripts/999_tmp_CORE.rb:821-837`).
### Can a mod hook a fallback?
Yes. `Text` is an ordinary Ruby class; LonaCraft already reopens it and aliases `[]` (`Scripts/50_Tiers.rb:537-554`, answers its `LCTier:` keys and decorates base names). A second alias on `[]` and one on `load_file(part = nil, file)` (`121_...rb:113`) can answer a missing `LonaCraft:` key or file from `Text/ENG`. See 5(b). `Text#parse` (`121_...rb:123`) can be reused to read the ENG file.
### What MTL is
| Fact | Evidence |
|---|---|
| The game never loads a folder called MTL: `createLangArray` lists `<game>/Text/` only (CHT, ENG, KOR, RUS, UKR), and a mod folder is read only as `Text/<$lang>`. | `5_DataManager.rb:273-286, 106`; `730_...mod_manager.rb:242`; `<game>/Text/` listing |
| "MTL" appears nowhere in the game scripts or the mod's scripts; only in `docs/BOARD.md:16` and the lore notes ("MTL tier" = machine-translated quality). | grep of `<game>/Data/Scripts`, `<mod>/Scripts`, `<mod>/docs`; `<mods>/LonaRPG_Lore_B.0.10.8.26.md:510, 1843, 2255` |
| The booba mod carries the same dead `Text/MTL/` (an identical copy of ENG), so MTL looks like a layout copied between mods, not a language. | `<mods>/Lona_Booba_Graphics/Text/` (CHT, ENG, KOR, MTL, RUS); its `MTL/booba.txt` = ENG |
| Result: dead folder, 8 files, 302 keys of English. Candidate for deletion. | section 2 |
## 2. Current state of `<mod>/Text`
Counted with the game's own block rule (blank-line separated blocks). Snapshot 15:5x on 2026-10-06; the Menu file is new that hour.
| File | Keys | ENG lines | What it holds |
|---|---|---|---|
| Craft.txt | 31 | 98 | crafting screen heads, groups, labels, messages, station names |
| Furniture.txt | 173 | 586 | 54 pieces x (item_name, description, menu) = 162, 4 `menu_town`, 7 shared (Place/*, Storage/*) |
| Homes.txt | 29 | 101 | 3 homes (shack, stone house, inn room), seller menu labels, purchase text |
| Info.txt | 2 | 10 | Mods-menu description, load-order warning |
| Items.txt | 24 | 76 | 12 materials x (item_name, description) |
| Menu.txt | 7 | 26 | main-menu "Craft" page (`Scripts/85_MenuCraft.rb`) |
| Station.txt | 22 | 75 | pot prompt, 9 process labels, 7 salvage texts |
| Tiers.txt | 14 | 49 | 5 tier names, bonus words, skill name, level-up popup |
| Total | 302 | 1,021 | 367 text lines, about 1,983 words, about 11.5k characters, 20,651 bytes, 0 non-ASCII |
| Language | Files | Keys | Differs from ENG | Verdict |
|---|---|---|---|---|
| ENG | 8 | 302 | (source) | real |
| CHT | 8 | 302 | 0 files (`diff -rq`) | English copy |
| KOR | 8 | 302 | 0 files | English copy |
| MTL | 8 | 302 | 0 files | English copy, never loaded |
| RUS | 8 | 302 | 0 files | English copy |
| UKR | 8 | 302 | 0 files | English copy |
Other mods for comparison (`<mods>/*/Text/`):
| Mod | Languages shipped | Translated for real |
|---|---|---|
| LonaCraft | ENG CHT KOR MTL RUS UKR | ENG only |
| RolePlayS | ENG, RUS (20 files each), CHT (1 file) | RUS yes (human, Cyrillic); CHT 1 file |
| Campsites | ENG (`strings.txt`) | ENG only |
| Otto_PassiveRegen | ENG, RUS | RUS |
| Lona_Booba_Graphics | CHT ENG KOR MTL RUS (1 file) | none (copies) |
| CustomDifficulty, EasyTravel | `"texts": ""`, labels hard-coded in code/JSON | n/a |
Encoding: the game's own Text files are UTF-8 without BOM, LF (`<game>/Text/CHT/DataEquip.txt`, first bytes `# #`). The loader does `File.read(...).encode("utf-8")` (`121_...rb:115`); write mod files as UTF-8 without BOM, LF.
## 3. Audit of strings not read through a text key
Method: every string literal in `Scripts/*.rb`, `HCGframes/*.rb`, `loader.rb` outside comments and `p` lines, plus every `Item/*.json` (66) and `Recipes/*.json` (56), plus `Maps/*.rvdata2` and `Salvage/*.json`.
Clean (no hard-coded text): `Item/*.json` (all 66 carry `textFlag`; all 132 keys exist in ENG), `Recipes/*.json` (item ids and numbers only), `Maps/*.rvdata2` (only `-point-` event names), `Salvage/1000_LonaCraft_Salvage.json` (`export_name` is internal), `HCGframes/*.rb` (one call each), menu labels, crafting screen headers, popups, choice labels, station names, furniture names and menus, home texts, "(Common)" tier word (key `Tiers:Tier/name1`). The mod's `name` "LonaCraft" is a brand.
### 3a. Player sees it, not behind a key (normal play)
| # | Where | String | Verdict |
|---|---|---|---|
| H1 | `Scripts/0_Core.rb:134` | `msgbox("LonaCraft failed to load its data.\n" + message + backtrace)` | error box with Ruby backtrace; keep English |
| H2 | `Scripts/50_Tiers.rb:207` | `msgbox("LonaCraft failed to build quality tiers. ...")` | same, keep English |
| H3 | `Scripts/55_Recipes.rb:214` | `msgbox("LonaCraft failed to build its recipes. ...")` | same, keep English |
| H4 | `Scripts/50_Tiers.rb:49-53` | `TIERS` fallback names Common, Uncommon, Rare, Epic, Legendary; used only when the tier key is missing (`50_Tiers.rb:154-157`, `tier_name`) | this is already an in-code ENG fallback; the hook (5b) makes it redundant but harmless; keep |
| H5 | `Scripts/30_Process.rb:155` (with `108-113`) | `"\t[Process/fibre_used] " + "<plant> x2, <plant> x1" + "."` : the sentence is the key, but the list, the `x`, the `, ` and the final `.` are glued in code. Korean and Chinese put the verb after the list, so the sentence cannot be translated properly. | KEY IT: make the key a template with `%s` |
### 3b. Punctuation and format glue (language-neutral enough; leave)
| Where | Glue |
|---|---|
| `Scripts/50_Tiers.rb:449, 473` | `"<name> (<tier>)"` ASCII parentheses |
| `Scripts/50_Tiers.rb:502` | `", "` between bonus stats |
| `Scripts/50_Tiers.rb:507` | `"+"` sign |
| `Scripts/30_Process.rb:111-112` | `" x2"` and `", "` between plants |
| `Scripts/80_CraftScene.rb:517, 590` | `"x2"` output quantity |
| `Scripts/80_CraftScene.rb:611` | `"have/need"` |
| `Scripts/80_CraftScene.rb:623` | `"Need 3 You 2 (Level 1)"` spacing and parentheses |
| `Scripts/80_CraftScene.rb:656` | `"50%"` |
| `Scripts/80_CraftScene.rb:669` | two-space join of ATK/DEF parts |
| `Scripts/85_MenuCraft.rb:111` | `"<Craft/level> <n>"` |
| `Scripts/0_Core.rb:162` | `", "` between mod names in the load-order box |
Count: 15 sites. A Chinese translator might prefer full-width brackets; not worth a key (PROPOSED: leave).
### 3c. Debug (visible only while `DEBUG = true`, `Scripts/95_Debug.rb:18`; the hotkeys are numpad)
| Where | String |
|---|---|
| `Scripts/95_Debug.rb:52` | `"LonaCraft debug +10 x N <label>"` with labels `"materials"` (80), `"furniture"` (83), `"raw inputs"` (85) |
| `Scripts/95_Debug.rb:62` | `"LonaCraft debug crafting level N"` |
| `Scripts/95_Debug.rb:89` | `"LonaCraft debug all homes owned or rented 52 weeks (N)"` |
Developer tool; stays English. Note `DEBUG = true` ships on today: the owner may want it `false` for a release (outside this item).
### 3d. Console only (`p` lines; stay English)
About 90 `p "..."` lines (per file: 0_Core 5, 100_Homes 27, 10_Icons 1, 30_Process 1, 40_Mining 1, 50_Tiers 10, 55_Recipes 6, 60_Skill 4, 70_Save 13, 80_CraftScene 1, 85_MenuCraft 2, 90_Furniture 18, 95_Debug 1). `0_Core.rb:161` is the console twin of the keyed load-order box.
### 3e. Translation traps found in the existing keys (not hard-coded strings, but they affect (c))
| Trap | Evidence | Why it matters |
|---|---|---|
| `\optB[a,b,c]` lists live inside the translation; the count and order of entries must equal ENG, because code maps pick index to action. | `Text/ENG/Furniture.txt:7-8` header; `Scripts/90_Furniture.rb:1028` (`actions_for(kind, town)[pick]`, defined `:212`) | A translator that adds or drops an entry breaks furniture actions. 68 lines carry `\optB`; 42 of them are the same `Pick up,Cancel` list. |
| No commas or `[` `]` in labels that get spliced into a seller's `\optB` (Homes `*_opt`, `common/collect_opt`, `common/gold`, Process labels). | `Text/ENG/Homes.txt:1-11` header; `Scripts/100_Homes.rb:996-1008`; `Text/ENG/Station.txt:4` | A comma splits one choice into two. |
| Choice window is about 600 px wide; a longer line is squeezed. | `Text/ENG/Homes.txt:7-11` | Russian/Ukrainian run about 30% longer; CJK glyphs are double width. |
| No ASCII `:` in body lines (parsed as `speaker: text`). | `121_...rb:137`; headers of every mod Text file | Translators write `:` by habit in RUS/UKR/CHT; use full-width `:` or rephrase. |
| A blank line ends a block; `#` lines are dropped; `\n` ends each description line; `\}` opens it; `\narr`, `\cg[..]`, `#{$story_stats["HiddenOPT0"]}` and `%s` must be copied verbatim. | `121_...rb:123-148`; `Text/ENG/Items.txt`, `Homes.txt:76`, `Tiers.txt:4, 25` | Counted in the checker (5d). |
| Process labels name vanilla items ("Wooden Club", "Crystal Ore", "Iron Ore") in full sentences. | `Text/ENG/Station.txt:14-41` | Translators must use the game's own item words (glossary below). |
| Homes: `<price> <coin_week>` and `<buy_opt> <price> <gold>` fix the order (price after the label). | `Scripts/100_Homes.rb:999-1008` | Acceptable; translators put the unit word in the key (`LC/week`). |
| Menu keys for a new `:hand` station and arrow group are coming (`Station/hand`, `Group/Ammo`, Pot text removed). `Craft:Station/hand` is not in `Craft.txt` yet; today `:hand` is not in `Stations::LIST` (`55_Recipes.rb:49`) so the screen falls back to the pot (`80_CraftScene.rb:35`). | `docs/SPEC_MENU_CRAFT.md:74, 165-166, 276-278`; `Scripts/85_MenuCraft.rb:49` | The key set is still moving; translate after it settles or run the checker per batch. |
Vanilla glossary that the translations should reuse (read from `<game>/Text/<lang>/`):
| Term used in LonaCraft ENG | Vanilla key | ENG | CHT | KOR | RUS | UKR |
|---|---|---|---|---|---|---|
| Wooden Club | `DataEquip:MhWoodenClub/item_name` | Wooden Club | 木棒 | 나무 몽둥이 | Дубинка | Дерев’яна палиця |
| Crystal Ore | `DataItem:Mineral/item_name` | Crystal Ore | 晶礦 | 광석 | Кристаллическая руда | Кристалічна Руда |
| Large Copper Coin | `DataItem:Coin2/item_name` | Large Copper Coin | 大銅幣 | 큰 동전 | Большой медяк | Велика мідна монета |
| Gold Coin | `DataItem:Coin3/item_name` | Gold Coin | 金幣 | 금화 | Золотая монета | Золота монета |
| ATK | `menu:equip/atk` (`Text/ENG/menu.txt:646`) | ATK | 攻擊 | 공격 | АТК | АТК |
| DEF | `menu:equip/def` (`:649`) | DEF | 防禦 | 방어 | ЗАЩ | ЗАХ |
| HP | `menu:core_stats/hp` (`:121`) | HP | 生命 | 생명 | ОЗ | Здоров’я |
| STA | `menu:core_stats/sta` (`:127`) | STA | 體力 | 스태미너 | СИЛА | Сили |
| SPD | `menu:equip/spd` (`:679`) | SPD | 敏捷 | 속도 | СКОР | ШВД |
| Level | `menu:main_stats/level` (`:184`) | Level | 等級 | 레벨 | Уровень | Рівень |
`Tiers.txt:5` already says "Bonus/*: stat words as in the game's DataEquip.txt"; the vanilla keys above are the real source and are localised in all four languages.
## 4. How RolePlayS localises, and what to copy
| Aspect | RolePlayS | Evidence | LonaCraft today |
|---|---|---|---|
| Mechanism | `"texts": "Text"`; items use `"textFlag": {"name": "RolePlayS:DataItem:<Id>/item_name", ...}`; no per-language JSON fields | `<mods>/RolePlayS/_ModInfo.json:12`; `RolePlayS/Item/BehelitAbom.json` | same mechanism (`textFlag` + `Text/<lang>/`) |
| File layout | Mirrors the game's files: `DataItem.txt`, `DataEquip.txt`, `DataSkill.txt`, `DataState.txt`, `menu.txt`, `QuickMsg.txt`, `Locations.txt`, plus `mail/` | `<mods>/RolePlayS/Text/ENG/` (20 files) | by topic: Items, Furniture, Homes, Craft, Station, Tiers, Menu, Info: fine, keep |
| Key style | `<Id>/item_name`, `<Id>/description`; menu keys `menu:attr_up/up` | `RolePlayS/Text/ENG/DataItem.txt:280-286`; `RolePlayS/Scripts/05_Attr_Exp.rb:190-193` | same `<Id>/item_name`, `<Id>/description` |
| Description style | `\}` first line, each line ends `\n`, first-person Lona voice | `RolePlayS/Text/ENG/DataItem.txt:284-285`; vanilla `<game>/Text/ENG/DataEquip.txt:555-558` | `\}Crafting material. ...\n` : matches |
| Translations | Real RUS (same keys, same line structure, 296 vs 295 lines in DataItem); CHT 1 file; no KOR, no UKR | `RolePlayS/Text/RUS/DataItem.txt:281-286`; `Text/CHT/GGININDER.txt` | none |
| Reuse of vanilla keys | Campsites reuses `OvermapEvents:World/Region_option_Cancel` etc. instead of new words | `<mods>/Campsites/Scripts/10_Campsites.rb:365-368` | own words for ATK/DEF/Level/Cancel |
| Missing language | no fallback; error boxes in KOR/UKR | section 1 | no fallback (all copies) |
Conventions LonaCraft should copy: keep `<Id>/item_name` + `<Id>/description` keys and the `\}`..`\n` description shape (already so); describe vanilla terms with the vanilla words (glossary); reuse vanilla keys for universal words (Campsites precedent); real translations go in the same file and key layout as ENG so a diff works (RolePlayS RUS is line-for-line with ENG). With RolePlayS only in ENG/RUS (and one CHT file), LonaCraft cannot look "consistent" with it in KOR/UKR: that gap is RolePlayS's, not fixable here (PROPOSED: do not touch it).
## 5. PROPOSED plan
### (a) Text-key sweep
| Option | Effect | Cost |
|---|---|---|
| A1 Key all 9 hard-coded words incl. error boxes, tier fallback, debug | 100% literal | error boxes carry backtraces (cannot be keyed usefully); debug never leaves the owner |
| A2 (RECOMMENDED) Key only what needs a different sentence shape: H5 (`Process/fibre_used` becomes `"... out of %s."` and the code does the `gsub`; `Desc/header` already uses `%s`, `Tiers.txt:4, 25`). Leave H1-H4, glue (3b), debug (3c), console (3d) | every normal-play sentence is translatable; 0 new keys, 1 changed key | `Scripts/30_Process.rb:108-113, 155` (about 6 lines) + `Text/<lang>/Station.txt` `Process/fibre_used` |
| A3 A2 plus format keys for the glue in 3b | full-width brackets etc. | 3-5 new keys x 5 languages; low value |
Also PROPOSED within A2 (optional, in the same item): read ATK, DEF, HP, STA, SPD, Level from the vanilla keys in the glossary table instead of owning 8 keys of our own (`Craft:Label/Level, Atk, Def`; `Tiers:Bonus/atk, def, sta, health, move_speed`). Saves 8 keys x 4 languages (32 translations) and matches the equipment screen in every language. Risk: low; the 8 keys stay in ENG as the fallback if the vanilla key is ever missing. Use: `$game_text["menu:equip/atk"]`.
### (b) ENG fallback for a missing key
| Option | How | Cost |
|---|---|---|
| B1 (RECOMMENDED) Runtime hook for the `LonaCraft` part: new `Scripts/5_TextFallback.rb`, loaded right after `0_Core.rb` in `loader.rb`. (1) Alias `Text#[]`: split the key, if part is `LonaCraft` and the result equals the key or is empty and `$lang != "ENG"`, return the same id from `Text/ENG/<File>.txt`. (2) Alias `Text#load_file(*args)`: for part `LonaCraft`, if `Text/<lang>/<File>.txt` is missing, return the parsed ENG file and skip the blocking `msgbox`. The ENG file is read once per file per session with `Text#parse` and kept in a module-level Hash (survives `Text.new` on language switch, since ENG never changes). | one new file about 30 lines, one line in `loader.rb`; cost at run time: a Hash lookup only on a miss. It coexists with the Tiers alias (`50_Tiers.rb:537-554`), whichever loads first. |
| B2 Tool-synced files: the checker copies missing ENG keys into each language file | no runtime code | re-creates today's problem (English copies cannot be told from translations); needs a re-run on every key added |
| B3 Nothing: raw keys and error boxes in the untranslated languages | zero | unacceptable: a player on KOR sees `LonaCraft:Furniture:Bed/menu` |
| B4 Generic hook for every mod part (fixes RolePlayS in KOR/UKR too) | same code, no `LonaCraft` check | changes other mods' behaviour without their authors; not recommended |
With B1, a language folder may hold only the keys that are really translated (a missing key or file shows ENG), which also fixes the "copies look like translations" problem. The owner can still hot-test: switch language and back in the System menu to rebuild `$game_text` and reload the files without a restart (`194_menu_08_0_System.rb:802-806`).
### (c) How the translations get made
| Option | Quality | Cost | Risk |
|---|---|---|---|
| C1 Owner-provided | best | owner time, about 2,000 words x 4 | slow; blocks release |
| C2 (RECOMMENDED) Claude translates CHT, KOR, RUS, UKR, one executor per language, with the vanilla glossary (section 3e) and the rules in 3e as input; each file starts with a `#` comment line `# Machine-translated by Claude on <date>, not reviewed by a native speaker` (comment lines are dropped by the parser, `121_...rb:129`); the checker (d) gates it (keys, `\optB` counts, control codes, `:`); the owner or a community reviewer corrects later and removes the comment | good for UI/short text; flavour text and Lona's voice in CHT/KOR need review | about 2,000 words per language; order of 20-25k output tokens per language plus glossary input; Sonnet for RUS/UKR, Opus for CHT/KOR | tone and register errors; labelled so players know |
| C3 Leave English | n/a | zero | mixed UI; fine only with (b) |
Timing: do C2 after the in-flight key changes land (`docs/SPEC_MENU_CRAFT.md:74, 165-166, 276-278`: `Station/hand`, `Group/Ammo`, pot text removal, arrows; also R3 base building and R5 nodes add keys). Until then (b) covers every new key. After C2, only the delta (checker's "missing" list) is translated per milestone.
### (d) The checker (describe, not written)
A single Python 3.10 script run from the scratchpad (not shipped in the mod folder), `python lc_text_check.py [--lang CHT] [--code]`, output as tables, exit code 1 when anything is missing. It uses the game's parse rule (blank-line blocks, `#` skipped) and prints per language and per file:
| Check | Reports |
|---|---|
| Missing keys | in ENG, absent in `<lang>` |
| Extra keys | in `<lang>`, absent in ENG |
| Untranslated | body identical to ENG (excluding keys that are numbers or names) |
| `\optB` entry count / order | count differs from ENG |
| Forbidden characters | ASCII `,` `[` `]` in labels spliced into `\optB` (Homes `*_opt`, `common/*`, Process labels); ASCII `:` in any body line |
| Control codes | the multiset of `\narr`, `\}`, `\n`, `\cg[..]`, `\C[..]`, `#{..}`, `%s` differs from ENG |
| Width | display width of `\optB` lines over ENG width x 1.3 (CJK counted double) |
| Format | empty body, duplicate key, BOM, CRLF, non-UTF-8, id with a space or colon |
| `--code` (optional) | keys referenced by the Ruby/JSON (static `"LonaCraft:File:id"` strings and `#{}` prefixes such as `Process/#{key}`) that ENG does not define (typos), and ENG keys nothing references |
It also prints a coverage table (`lang | translated | missing | untranslated | %`). A first draft of the code-reference part already ran (`audit.py` in the scratchpad): 302 keys defined, all 132 `textFlag` references resolve.
### (e) Drop MTL
PROPOSED: yes, delete `<mod>/Text/MTL/` (8 files). The game cannot select it (section 1); keeping it adds one more copy to keep in step with every new key. If the owner ever wants a machine-translated tier, it would have to be a real game language folder under `<game>/Text/` plus a font (`_HowToAddFontToYourLang.txt`), which is out of scope for a mod.
### Recommendation in one line
A2 + B1 + C2 + the checker + delete MTL, as four build items; start with L1 and L2 (small, no translation), run L3 once the owner has settled the key set.
### Work breakdown
| Item | Builds | Files touched | Strings | Executor |
|---|---|---|---|---|
| L1 Fallback hook and sentence key | B1; A2 (H5) and optional vanilla-key reuse | new `Scripts/5_TextFallback.rb`; `loader.rb` (+1 line); `Scripts/30_Process.rb:108-113, 155`; `Text/ENG/Station.txt` (`Process/fibre_used`); optional `Scripts/80_CraftScene.rb`, `Scripts/50_Tiers.rb` text lookups for the 8 stat/level words | 1 key reworded (x1 ENG; the other languages get it in L3); optional 8 keys retired | Sonnet builder (small); owner decides the optional part |
| L2 Checker, MTL removal, baseline | (d), (e) | scratchpad `lc_text_check.py`; delete `Text/MTL/` (8 files); `docs/BOARD.md` note; README one line on languages | 0 strings; baseline table (302 keys, 0 translated x 4) | Sonnet |
| L3 Translations (4 in parallel, one per language) | C2 | `Text/CHT/*.txt`, `Text/KOR/*.txt`, `Text/RUS/*.txt`, `Text/UKR/*.txt` (8 files each, 32 total) | 302 keys per language (294 if the vanilla reuse in L1 lands), about 1,983 words, about 11.5k characters of ENG source each; 4 languages = about 1,200 keys | Sonnet RUS/UKR, Opus CHT/KOR; checker gate; no shared files so no merge conflict |
| L4 Delta passes (recurring) | keep languages current | the files above, only the checker's missing list | the keys added by each milestone (R2 B1/B3, R3, R5) | Sonnet, after each milestone |
Gate for each build item stays as the board says (static checks by Claude, then the owner's in-game run, no agent launches the game). L3's extra gate: the checker prints 0 missing, 0 control-code mismatches, 0 `\optB` mismatches, 0 forbidden characters.
## Questions for the owner (one choice each, recommendation first)
| # | Question | Recommendation |
|---|---|---|
| Q1 | Add the ENG fallback hook (B1)? | Yes |
| Q2 | Key only the fibre sentence (A2), keep error boxes, debug, glue in English? | Yes |
| Q3 | Reuse the vanilla words for ATK/DEF/HP/STA/SPD/Level? | Yes |
| Q4 | Translations by Claude with a review note (C2)? | Yes, after the key set settles |
| Q5 | Delete `Text/MTL`? | Yes |
| Q6 | Set `DEBUG = false` (`Scripts/95_Debug.rb:18`) for a release? | Outside R6; flag only |
@@ -0,0 +1,309 @@
# R13 The maid
Owner roadmap (2026-10-06): "another base upgrade, similar to the mercenaries, we should be able to hire a maid ...
cook the best meals ... from the food in any chests in the base (inside walls) ... physically there ... needs
protecting, will not fight anything, if she dies she's gone, gets paid a copper daily, takes from your storage chest.
Where do we hire her from?" Research only: no mod or game file was changed. Every number is PROPOSED with one
recommendation; the owner settles them (section 8) before building.
R15 (settlers, minor settlement mechanics): deferred by the owner (2026-10-06), not researched here.
Short forms: `F/` = `LonaRPG/Data/Scripts/Frames/`, `E/` = `LonaRPG/Data/Scripts/Editables/`,
`S/` = `LonaRPG/Data/Scripts/`, `HCG/` = `LonaRPG/Data/HCGframes/event/`, `NPC/` = `LonaRPG/Data/NPCdata/`,
`FX/` = `LonaRPG/Data/Effects/`, `CHS/` = `LonaRPG/Data/CHSConfig/CHSconfigs_NPC/`,
`LC/` = `LonaCraft_dev/LonaCraft/Scripts/` (dev copy), `MR` = `docs/RESEARCH_AWAY_RAIDS_MERCS.md`.
`LC/110_Bases.rb` and `LC/120_Raids.rb` line numbers as read on 2026-10-06 (other builders are editing them;
`LC/140_AwayRaids.rb` and `LC/150_Mercs.rb` did not exist yet when this was written).
Renders and scripts (scratchpad `r13/`): `maid_candidates.png` (8 CHS looks, 3 part variants each),
`maid_render.py`, `allmaps.py` + `allev.pkl` + `q.py` (every event of every game map, queryable),
`foods.py`, `foodvals.py`, `tags.py` (pot tags, satiety, type tags of the food items).
## 0. Summary
| Question | Finding | PROPOSED |
|---|---|---|
| Hire point | Boss Mama's script is already redirected by Homes and her menu already takes extra lines (`LC/100_Homes.rb:100-107`, `:1344-1370`, `:1512-1525`); she runs the tavern's working girls (her "Work" line, `HCG/NoerTavernWaifu.rb:207`; `Text/ENG/TagMapNoerTavern.txt:115` "Waitress, Dancer") | **Boss Mama**, one line "Hire a maid" through a small provider hook in Homes |
| Look | `CHS/-char-F-REGULAR01.json:161` part 2 "02Maid": black dress, white apron (sheet `-char-F-REGULAR01`, index 0, pattern 2); used by no library template | W1 "02Maid", hair fixed per maid at hire |
| Never fights | an NPC's AI is a Ruby class named in its json, built by `eval(@ai).new` (`F/Modules/NonPlayerCharacter.rb:226-229`); `Npc_RunAway` runs from killers but fights when cornered (`E/4003_Npc_RunAway.rb:24-30`) | own class `Npc_LonaCraftMaid < Npc_RunAway`, no skills, hides in the far corner of her room |
| Gone for good | the game's unique NPCs die through a death event that writes `$story_stats["UniqueChar<name>"] = -1` (`EffectUniqueCharDed`, Map001 `-lib-MapObject`); their events check it in init (Map059 ev69) | own record; a `process_death` alias (`F/281_Game_NonPlayerCharacter.rb:797`) ends the hire; rehire at Boss Mama |
| Cooking | the dark pot is data driven: `$data_AlchemyRecipes` from `FX/Alchemy/*.json` (`S/103_FileGetter.rb:526-544`, `F/5_DataManager.rb:169`), applied by `darkPot_translate_recipe` (`E/29_Functions_DarkPot.rb:292-490`) | reuse the recipe table; each morning the dish with the most satiety her ingredients allow, up to 2, into the pantry chest |
| "Cooked" | no cooked flag in the item data (type tags are rot classes: Good Soup is tag `RawMeat`, `FX/Items/food_SoupLv2.json:10-15`); the inn meal is a satiety refill, not an item (`HCG/NoerTavern_Nap.rb:133`) | cooked = an output item of a dark-pot food recipe (3.2); raw food alone feeds nobody |
| Pay | Copper Coin = `ItemCoin1`, price 200 (`FX/Items/other_Coin1.json`) | 1 Copper a day from a chest inside the walls; 3 unpaid days -> she leaves |
| Build | | 4 items, about 740 Ruby lines, new `LC/160_Maid.rb` |
## 1. What the game and the mod give us
### 1.1 Hire points compared
| Place | NPC / script | Fit | Cost to wire | Verdict |
|---|---|---|---|---|
| **Noer tavern, Boss Mama** | Map059 ev69 `-point-TavernWaifu`, `HCG/NoerTavernWaifu.rb`; menu `\optB` built at `:200-215` | she hires out girls (Work -> Waitress / Dancer, `:207`, `:326`) and already sells Lona the inn room (`LC/100_Homes.rb:164`); a maid "from Boss Mama's girls" reads naturally; the place Lona already goes for food, rooms and the guild | lowest: redirect + menu hook exist (`LC/100_Homes.rb:954-972`, `:1344-1370`, `:1512-1525`; wrapper `LonaCraft/HCGframes/NoerTavernWaifu.rb`); RolePlayS has no copy of her script (not in `RolePlayS/HCGframes/event/`) | **recommended** |
| Guild receptionist | Map059 ev15, `HCG/NoerTavernGuildEmpolyee.rb:268-281` | a mercenary desk, not domestic staff | the MC-1 chain (MR 3.1); RolePlayS replaces this script (MR 1.6) | fallback only, while Boss Mama is gone |
| Bank, Maani | Map015 ev14, Homes seller `NoerBankMaani` (`LC/100_Homes.rb:103`) | sells houses, not staff | low (same Homes hook) | no |
| Back street women | Map063 `CommonWhore` and EV015-EV058, `set_npc("NeutralBSHumanwhoreF")` (`r13/q.py`) | prostitutes; popup lines only, no menu to hook | high (a new event script) | no |
| Refugee camps | hobo women on Map035 / Map073 / Map133 / Map166, `HCG/CommonRefugeeF.rb:15-24` (`\optB[Cancel,Barter,Begging]`) | a destitute woman working for food and a copper fits, but this is the natural entry point of the deferred settlers (R15) | medium (one more redirect) | keep for R15 |
| Saint Monastery nuns | Map064 `nun` / `Nun2`, `SaintHumanPriestF` | church staff, not for hire | high | no |
Boss Mama is deleted while `UniqueCharUniqueTavernWaifu == -1` or Cocona's quest is at 14-20 or 25 (Map059 ev69
init block). PROPOSED fallback: the same line is offered by the guild receptionist (MC-1's chain) while she is gone.
### 1.2 Homes' seller menu (reuse)
| Fact | Evidence |
|---|---|
| Sellers: game script + marker option; the wrapper runs the previous script and arms the extra lines | `LC/100_Homes.rb:100-107`, `:1344-1370` |
| Extra lines come only from `LOCATIONS` (houses, rooms) | `LC/100_Homes.rb:991-1012` (`menu_entries_for`) |
| A pick runs `lonacraft_home_action`, a `case` on `:buy / :rent / :status / :collect` | `LC/100_Homes.rb:1455-1463` |
| Boss Mama's `call_msg("\optB[...]")` is caught and extended (`extend_menu`, marker "Barter") | `LC/100_Homes.rb:1017-1031`, `:1512-1525` |
| The menu is armed only when there is at least one entry | `LC/100_Homes.rb:1352-1361` |
Needed: a provider hook, about 20 lines in `LC/100_Homes.rb`: `Homes.add_menu_provider(seller){ [[label, proc], ...] }`;
`menu_entries_for` appends the providers' lines; `lonacraft_home_action` calls `action.call(self)` when it is a Proc.
Any later seller line (R11 shopkeepers) can use the same hook.
### 1.3 Time, notices, coins, chests
| Fact | Evidence |
|---|---|
| `dateAmt` counts half days, `% 2 == 0` is day; only naps shift the date | MR 1.1; `F/123_Game_Date.rb:121-135` |
| Homes hooks `Game_Date#shift / addDays / oneDayForward` (rent expiry) | `LC/100_Homes.rb:1049-1072` |
| Popups during a nap are lost; Homes queues them (`notice`, `flush_notices`) | `LC/100_Homes.rb:475-492`, `:1108-1110` |
| `take_coins` (party coins) | `LC/100_Homes.rb:303-316` |
| Chest contents `{item => count}`, `get_box` / `write_box` | `F/203_Storage Boxes.rb:427-433` |
| Mod storage: Chest, Wardrobe (`:storage`), box ids from 66000, opened with size 0 = no limit | `LC/90_Furniture.rb:79-80`, `:166`, `:1146-1158`; `F/203_Storage Boxes.rb:438-439` |
| Food in mod chests never rots: the nap rots only the party, box 65533 and box 65535 | `E/97_Game_Actor_Stats&State&Nap.rb:132-134`; `F/203_Storage Boxes.rb:376-397` |
| Cooking pieces: Stove and Campfire ("Cooking Fire"), action `:cook` = the game's pot | `LC/90_Furniture.rb:86`, `:98`, `:1131-1133`; `Text/ENG/Furniture.txt:247-248` |
| Beds: Bed, BedDark, BedBlue, the Bedroll (kind key `PottedPlant`) | `LC/90_Furniture.rb:76-78`, `:108`; `Text/ENG/Furniture.txt:347-348` |
| Doors are closed again after every nap | `LC/110_Bases.rb:415` (`sync_doors`, B3) |
| Inside the walls, live map: `Bases.inside_tiles(map, rec, rm)` | `LC/110_Bases.rb:1567-1640` |
| Furniture of a base: `Bases.furniture_on(rec)` | `LC/110_Bases.rb:2523-2527` |
| Inside the walls, offline: AR-1's room graph from the map file + pieces | MR 2.3, MR 6 (AR-1) |
### 1.4 A non-fighting NPC
| Fact | Evidence |
|---|---|
| Town women `NeutralHumanCommonF`: fraction 3, health 100, def 3, `ai: Npc_RunAway`, killer skills `NpcBasicSh`, `BasicHeavy`, death event `EffectCommonCharDed` | `NPC/NeutralHumanCommonF.json:4`, `:17`, `:21`, `:38`, `:108` |
| `Npc_RunAway`: no target -> random step; killer / assaulter -> moves away, but turns and fights when 4 ways are blocked | `E/4003_Npc_RunAway.rb:14-41` |
| The json's ai string is evaluated as a class name: a class defined by the mod works | `F/Modules/NonPlayerCharacter.rb:226-229`; `F/39_Game_Event.rb:1891-1903` |
| With `master = $game_player`, fraction mode 2: friendly to Lona; Lona's hits start no fight | `F/281_Game_NonPlayerCharacter.rb:1025-1045`, `:874-881` (MR 1.5) |
| Raiders pick targets with their own tri-state AI; a non-friendly NPC can be one | `F/281_Game_NonPlayerCharacter.rb:549-566`, `:695-708` |
| Death: `process_death` -> death animation -> `summon_death_event`; `EffectCommonCharDed` leaves the body (cannibal drops only if Lona has the Cannibal trait) | `F/281_Game_NonPlayerCharacter.rb:797-808`, `:842-845`; `E/151_Game_Character_RangeCheck.rb:9-15` |
| Permanent death of uniques: `EffectUniqueCharDed` sets `UniqueChar<npc_name>` to -1 | Map001 `-lib-MapObject` (`r12/evfull.py` dump) |
| NPCs with `master == $game_player` are skipped by the build rule and the raid adoption | `LC/110_Bases.rb:1654`, `:1682`; `LC/120_Raids.rb:743` |
| Movement helpers: `Raids.bfs`, `Raids.step_down`, the `update_self_movement` alias | `LC/120_Raids.rb:867`, `:1054`, `:1512-1520` |
### 1.5 Sprites
`r13/maid_candidates.png` (3 part variants each). NPC looks are CHS composites: sheet + index + pattern select part
set `(index / 4) x 12 + (index % 4) x 3 + pattern` (MR 3.4); female cells 72 x 66, part images in
`Graphics/CharacterCharsets/FregC/`.
| # | Sheet [index] pattern | Part set | Look | Used by (game) | Fit |
|---|---|---|---|---|---|
| **W1** | **F-REGULAR01 [0] 2** | **02Maid** | **black dress, white apron; 13 hair choices** | **no template; one PirateBaneInn day NPC (Map081 ev30)** | **recommended** |
| W2 | F-REGULAR01 [0] 0 | 00Commoner | town dress, random colours | NeutralHumanCommonF (every town) | blends with townsfolk |
| W3 | F-REGULAR01 [1] 0 | 03Teller | red hair, headband, purple dress | the bank teller look | reads as a known NPC |
| W4 | F-REGULAR02 [0] 0 | 00OldMama | old woman, brown dress | none in the library | a housekeeper option |
| W5 | F-REGULAR02 [3] 0 | 09RefMAMA | refugee mother, rags | SMRefugeeCamp `-point-Mother` (Map133 ev51) | too poor for a hired maid |
| W6 | F-REGULAR01 [2] 1 | 07RandomPoorMiner | rags | hobo women in the refugee camps | keep for R15 |
| x | F-TEEN01 [3] 2 | 11CoconaMaidNoWeapon | Cocona's maid dress | Cocona (story character) | never |
Random parts are re-rolled at every map load (`create_chs_configuration` samples each part,
`F/Modules/Charset_System.rb:121-130`; called from `F/39_Game_Event.rb:1791`), so W1's hair would change every
visit. PROPOSED: at hire draw one hair (`head_equip`) and face (`head`), save their names; after the spawn overwrite
those two entries in `chs_configuration` and refresh (about 15 lines; checked in the build's first run).
## 2. Hiring, pay, leaving (PROPOSED)
| Point | PROPOSED |
|---|---|
| Line in Boss Mama's menu | not hired: "Hire a maid (1 Copper a day)"; hired: "Your maid, <name>" (post base, unpaid days); after a death: the hire line again |
| Hire flow | Boss Mama's lines about one of her girls; pay `hire_fee` 5 Copper Coins from Lona's purse (`take_coins` style); a name drawn from `Text/<lang>/Maid.txt`; hair and face drawn and saved; record written; notice "She will come to the next camp you enter" |
| Only one | `max` 1 maid at a time |
| Taking post | at the first base Lona enters that has a closed room (`inside_tiles` not empty); else she waits (line on entry: "no safe room here yet"). Same rule as the mercenaries (MR 3.2 "Where") |
| Pay | at the shift into day (`dateAmt % 2 == 0`), per day caught up (at most `catchup_days` 14): take `pay` 1 `ItemCoin1` from the storage pieces inside the walls (pantry first); none -> `unpaid` + 1; a paid day resets it |
| Not paid | `unpaid >= grace_days` (3): she leaves; notice "<name> left: no wages for 3 days"; Boss Mama can send another |
| Pay day while Lona is away | the same, offline (AR-1's inside lookup, section 5) |
| Dismiss | from her talk menu; no refund; the event fades, the record goes |
| Save | `lonacraft_data["maid"] = {"name", "hired", "base" (id or nil), "post" [x, y], "t" (last day handled), "unpaid", "look" {"head_equip", "head"}, "cooked" (total), "last" [[item, n], ...]}`; `lonacraft_data["maid_lost"] = {"name", "at", "how"}` for the report; plain types, no save hook (as Homes, `LC/100_Homes.rb:249-265`) |
| Cost compared | 200 a day; the mercenary squad 2,000 a day (MR 3.5); the inn room 2 Large Copper a week (`LC/100_Homes.rb:164`) |
## 3. Cooking (PROPOSED)
### 3.1 The pot's table
| Fact | Evidence |
|---|---|
| A recipe has `requirements` (pot tag => count), `conditions.excludeIngredients`, `conditions.MinStatReq` (`"$game_player.actor.survival_trait": 10`), `bannedItem`, `output` (item => quantity formula), `postProcess` (deductions) | `FX/Alchemy/2000_darkPot_UniqueFoodFormula.json:4-40`; `FX/Alchemy/6000_darkPot_MeatAndSoups.json:64-416` |
| An item's pot tags: `item.pot_data` (Apple Plant 1 + Fruit 1; Carrot Plant 1 + Vegetable 1; Raw Meat Meat 1; Potato Plant 1 + Starch 1; Nuts Starch 1 + Fat 2; Smoked Meat SmokedMeat 1 + Fat 2; Oil Oil 1; the mod's Plank Wood 1) | `F/Modules/ItemConfig.rb:146`; `FX/Items/food_*.json`, `other_Oil.json`; `LonaCraft/Item/Plank.json:16` (`r13/foods.py`) |
| The player's pot sums every tag of everything put in, then runs all recipes in file order; Wood in the pot blocks the soups (`bannedItem` Wood) | `HCG/Command_DarkPot.rb:64-80`; `E/29_Functions_DarkPot.rb:494-507`; `6000_...json:93-98` |
| A dish's satiety: `item.use_item_effect`, attribute `sat` without a `stats_key` | `F/Modules/ItemConfig.rb:296-317`; `F/25_Game_Actor.rb:1372-1378` |
### 3.2 What counts as cooked (shared with R14)
No cooked flag in the data: `type` is Food / FoodBad / Waste and `tag` is a rot class (Good Soup and the meat soups
are tag `RawMeat`, Plant Soup and Meat Salad `RawPlant`; `r13/tags.py` over `FX/Items/food_*.json`). The inn meal
sets satiety to full and gives no item (`HCG/NoerTavern_Nap.rb:133`). So, PROPOSED, one rule for the maid and the
R14 rest: **cooked = an output item of a dark-pot food recipe**, read at runtime from `$data_AlchemyRecipes`
(`output` keys whose item `type` is Food or FoodBad: `FX/Alchemy/2000_darkPot_UniqueFoodFormula.json:26-30`,
`FX/Alchemy/6000_darkPot_MeatAndSoups.json` `output` blocks). Raw meat, vegetables, fruit, nuts and herbs never count:
raw food alone in a chest feeds nobody. Her morning cooking turns the raw food in the chests into dishes, and those
dishes are what the rest eats.
| Dish (pot output) | Needs (pot tags) | Survival | sat / mood | Note |
|---|---|---|---|---|
| ItemMeatSalad | SmokedMeat 1, Plant 4, Fruit 2, Vegetable 2, Oil 1, Starch 1, Fat 2 | 10 | 80 / 40 | best; no human or mystic meat (`2000_...json:5-28`; `FX/Items/food_SF_MeatSalad.json:34-42`) |
| ItemSopGood | Plant 1, Meat 1 (no Wood) | - | 32 / 20 | `6000_...json:164-185`; `food_SoupLv2.json` |
| ItemSmokedMeat | Meat 2, Wood 1 | 10 | 26 / - | keeps; a salad ingredient (`:290-313`) |
| ItemDryFood | Plant 2, Wood 1 | 10 | 16 / - | keeps (`:187-210`) |
| ItemSopMeat | Meat 2 | - | 16 / 10 | `:398-416` |
| ItemSopPlant | Plant 2 | - | 16 / 10 | `:315-333` |
| ItemJunkFood (x3) | Plant 1, Starch 1, Oil 1 | - | 1 / 3 each | FoodBad; never the best |
| the Human / Mystery variants | the same + HumanMeat / MysticMeat | | 12-32, mood -10, puke | refused by default (`refuse_bad_meat`) |
Raw for comparison: Raw Meat sat 8 (+15 puke), Apple / Carrot / Potato 5 each (`r13/foodvals.py`). One meat and one
carrot eaten raw = 13; cooked into Good Soup = 32.
Open, shared with R14: prepared foods that are not pot outputs (Bread sat 10, Cheese 32, Sausage 26; type Food,
tag Food) are not "cooked" under this rule. PROPOSED: they are not, to keep one definition.
### 3.3 The morning cook
| Step | PROPOSED |
|---|---|
| When | the shift into day, after pay (2), once per day caught up; only while posted and alive |
| Needs | a Stove or Cooking Fire inside the walls (else no cooking, notice "<name>: no fire to cook on"); the fire stands in for the recipes' Wood (Smoked Meat, Dry Food); planks and clubs are never burnt |
| Pool | items in the storage pieces inside the walls whose `pot_data` has a food tag (Plant, Meat, Fruit, Vegetable, Starch, Oil, Fat, SmokedMeat) and whose type is Food (plus ItemOil); FoodBad (rats, roaches, flesh) and human / mystic meat left alone (`refuse_bad_meat`) |
| Skill | `MinStatReq` gates use her `cook_skill` 10 in place of Lona's survival trait (the key is read, not evaluated) |
| Pick | per food recipe: cover its requirements with whole items, greedily (the item covering most still-missing tags first, then the cheapest); score = sat of the dish - sat of cooked items used up (a Smoked Meat used in a salad counts 26 against it); best score > 0 wins |
| Make | remove the items used, add 1 dish to the pantry; repeat up to `dishes_per_day` 2; stop when the cooked dishes inside the walls reach `pantry_cap` 6 (raw food does not rot in chests, 1.3, so waiting wastes nothing) |
| Pantry | the storage piece inside the walls nearest the fire (else nearest her post) |
| Report | queued notice for the wake-up: "<name> cooked Good Soup x2"; nothing possible: "<name>: the pantry is bare" (once, until food appears) |
| R14 | the rest eats one cooked dish from the chests inside the walls (R14's rule); the maid keeps that supply going |
Worked example: one chest inside a 1-room palisade with a Stove, holding 3 Raw Meat, 4 Carrot, 2 Apple, 1 Potato,
1 Oil. Day 1: Good Soup x2 (meat + carrot each) = 64 sat; left 1 meat, 2 carrots, 2 apples, 1 potato.
Day 2: Good Soup (meat + carrot) 32, then Plant Soup (carrot + apple) 16. Day 3: Plant Soup (apple + potato) 16;
the chest now holds only the Oil, so nothing more (the salad would have needed a Smoked Meat, 2 vegetables and
2 fruit at once). Eaten raw the same food was worth 3 x 8 + 7 x 5 = 59 sat; cooked, 128.
## 4. The maid at the base (PROPOSED)
| Point | PROPOSED |
|---|---|
| NPC data | `NPC/LonaCraftMaid.json` in the mod, loaded with the mercenary files (MR 3.2): a copy of `NeutralHumanCommonF` with `ai: Npc_LonaCraftMaid`, `skills_killer` / `skills_assaulter` empty, `drop_list` empty, `health` 150, def 3, sensors Eyes, death event `EffectCommonCharDed` |
| AI class | `Npc_LonaCraftMaid < Npc_RunAway` in `LC/160_Maid.rb`: never picks a skill; `get_move_command` returns nil so the driver below owns her steps |
| Event | runtime `RPG::Event` as the mercenaries / furniture (`LC/90_Furniture.rb:571-635`), sheet `-char-F-REGULAR01` index 0 pattern 2; init: `set_npc("LonaCraftMaid")`, `@nappable = false`, `npc.master = $game_player`, `fraction_mode = 2`, `summon_data[:LonaCraftMaid] = true`, saved hair applied; action -> `lonacraft_maid_talk` |
| Spawn | after every `Game_Map#setup` of the post base (as doors and furniture, `LC/110_Bases.rb:409-416`); not nappable, so a nap removes and re-makes her (`F/31_Game_Map.rb:359-372`, MR 1.5) |
| Her room | the inside room (component of `inside_tiles`) holding the fire, else a bed or Bedroll, else the largest; post tile = a free tile next to the fire or bed |
| Calm | a random step every few seconds, only onto tiles of her room, at most `wander` 3 tiles from the post |
| Flee | a hostile within `flee_radius` 6 tiles (the `hostile_near?` test centred on her, `LC/110_Bases.rb:1665-1690`) or a live raid (`Raids.active?`, `LC/120_Raids.rb:584`): walk to the tile of her room farthest from its doors (`Raids.bfs` from the door tiles over the room, then `step_down` toward the maximum, `LC/120_Raids.rb:867`, `:1054`) and stay there; doors are closed after naps (1.3), so raiders reach her only by breaking in. One more branch in the `update_self_movement` dispatch (MR 3.2 "Behaviour") |
| Raiders | they target her through their own AI (1.4) and can kill her: Lona has to keep them out. A bandit spear (atk 20) against def 3: about 9 hits at 150 HP |
| Death | `process_death` alias: an event with `summon_data[:LonaCraftMaid]` -> record moved to `maid_lost`, notice "<name> was killed", never spawned again; the body stays as for any NPC. Rehire at Boss Mama |
| Talk | Status (post base, days with you, unpaid days, last dishes, cooked dishes in the pantry); Come with me (post cleared, she takes post at the next base entered); Dismiss; Cancel |
| Bed | not needed (keep it simple: she sleeps at her post); option in 8 |
| Her own food | none (paid in coin) |
### 4.1 Away raids
| Point | PROPOSED |
|---|---|
| Hook | in AR-1's loop, when a room is reached (MR 2.3, step 3): if it is the maid's room and the budget left is at least `loot_swings` (3), roll `away_kill` 0.5: she dies (report line "<name> was killed"); else "<name> hid and lived" |
| Who | any group that reaches her room rolls (killing needs no looters: undead too) |
| Mercenaries | a squad that repels the raid (MR 3.6) protects her as well |
| Expected | 1-room palisade on a field base: P(raiders reach her room) = (Orkind 70 x 0.53 + Bandits 30 x 1.0 + Undead 20 x 1.0 + Wolves 20 x 0) / 140 = 0.62 per raid (weights `LC/120_Raids.rb:139`, reach MR 2.6); x 0.5 = 0.31 per raid; at about 0.8 away raids a week (MR 2.1) about 0.25 deaths a week. 2-ring base with her in the inner room: bandits reach it 32 %, goblins 0 % (MR 2.6): about 0.1 a week. With a squad posted: about 0 |
| Live raid on the base | section 4: she hides; raiders who break in can kill her for real |
## 5. Shared with the mercenaries build (what `150_Mercs.rb` / `140_AwayRaids.rb` should expose)
| Need | From | Form |
|---|---|---|
| NPC jsons from the mod's `NPC/` folder into `$data_npcs` | MC-2 | load every `NPC/*.json` of the mod, not only the two mercenary files |
| Runtime NPC event builder | MC-2 | `Mercs.build_npc_event(npc_name, sheet, index, pattern, x, y, summon_key, talk_method)` |
| Spawn after setup of a post base | MC-2 | a resident list (`key`, base of, spawn proc) and one `after_setup` loop |
| Post base rule ("first base entered", move post) | MC-2 | `Mercs.claim_post(record)`; the maid adds "has a closed room" |
| Movement dispatch | MC-2 | the `update_self_movement` alias dispatching on `summon_data` keys (`:LonaCraftMerc`, `:LonaCraftMaid`) |
| Death / down hook | MC-2 | one `process_death` alias dispatching on `summon_data` keys (mercenary: down; maid: gone) |
| Date hook | MC-1 / AR-2 | one alias of `Game_Date#shift` / `addDays` / `oneDayForward` calling a list of day callbacks: mercenary expiry, away raids, maid pay + cook, in that order |
| Offline "inside the walls" | AR-1 | `AwayRaids.inside_furniture(rec)` (furniture records in a non-outside room) and `AwayRaids.room_of(rec, x, y)`; live maps may use `Bases.inside_tiles` |
| Room reached | AR-1 | `AwayRaids.on_room_reached(rec, room, budget_left)` returning report lines |
| Config section | `LC/120_Raids.rb` | `"maid"` in `DEFAULTS` (next to `"away"` / `"mercs"`, `:147-161`) and in `merge_user` (`when "away", "mercs"`, `:276`) |
| Seller line | `LC/100_Homes.rb` | the provider hook (1.2) |
## 6. Config (PROPOSED, `Config/Bases.json`)
```json
{
"maid": {
"enabled": true, "hire_fee": 5, "coin": "ItemCoin1", "pay": 1, "grace_days": 3, "catchup_days": 14,
"dishes_per_day": 2, "pantry_cap": 6, "cook_skill": 10, "refuse_bad_meat": true, "need_fire": true,
"health": 150, "wander": 3, "flee_radius": 6, "away_kill": 0.5
}
}
```
## 7. Work breakdown (PROPOSED)
| Item | Scope | Files | Ruby lines | Depends on | Owner choices |
|---|---|---|---|---|---|
| MD-1 Hire, pay, leave | Homes provider hook; Boss Mama line + hire flow (+ guild fallback while she is gone); record; day callback: pay, unpaid, leave; notices; `maid` config section; texts | `LC/100_Homes.rb` (~20), `LC/160_Maid.rb` (new), `LC/120_Raids.rb` (~5), `Text/<5 langs>/Maid.txt` (new, ~25 keys), `loader.rb` | 200 | Homes; MC-1 / AR-2 date hook | 1-3 |
| MD-2 The maid at the base | `NPC/LonaCraftMaid.json`; `Npc_LonaCraftMaid`; spawn, room and post, wander, hide in the far corner, fixed hair, talk menu, death = gone | `LC/160_Maid.rb`, `NPC/LonaCraftMaid.json` (new) | 280 | MC-2 resident helpers (5) | 4, 5, 11-13 |
| MD-3 Cooking | recipe reader over `$data_AlchemyRecipes`, cooked list (shared with R14), pool from chests inside the walls, greedy cover, best dish, pantry, catch-up, wake-up notice | `LC/160_Maid.rb` | 180 | AR-1 inside lookup; MD-1; R14 reads the cooked list | 6-9 |
| MD-4 Raids, debug, self-test | AR-1 room-reached kill roll + report lines; Numpad . menu: hire free / cook now / kill maid; self-test rows (`ItemMeatSalad` in `$data_ItemName`, `Npc_RunAway` defined, `$data_AlchemyRecipes` not empty, `-char-F-REGULAR01` part 2 is "02Maid") | `LC/140_AwayRaids.rb` (~25), `LC/120_Raids.rb` (~15), `LC/98_SelfTest.rb` (~10), `LC/160_Maid.rb` | 80 | AR-1, AR-2, MD-2 | 10 |
Total about 740 lines. Order: MD-1 -> MD-2 -> MD-3 -> MD-4, after MC-2 and AR-1 are in. Note for MD-4:
`food_SF_MeatSalad.json` names itself under the key `"ItemOil"` (`FX/Items/food_SF_MeatSalad.json:2`, a game typo);
the item still exists as `Data/Items.rvdata2` id 153 named `ItemMeatSalad`, hence the self-test row.
## 8. Choices for the owner
| # | Choice | Options | PROPOSED |
|---|---|---|---|
| 1 | Hire point | Boss Mama / guild receptionist / refugee camp women / Maani | Boss Mama; guild receptionist while Boss Mama is gone |
| 2 | Hire fee | none / 5 Copper / 1 Large Copper | 5 Copper |
| 3 | Wages | 1 Copper a day from a chest inside the walls, leaves after 3 unpaid days / from Lona's purse / prepaid weeks | chest, 3 days grace |
| 4 | Look | W1 Maid / W2 Commoner / W4 OldMama (`r13/maid_candidates.png`) | W1, hair fixed per maid |
| 5 | Where she stands | the room with the fire (else a bed), wandering 3 tiles / anywhere inside / by the door | the fire room |
| 6 | Fire needed to cook | yes, Stove or Cooking Fire inside the walls (also the "Wood" for smoking and drying) / no | yes |
| 7 | Dishes a day | 1 / 2 / as many as the food allows; pantry cap 6 | 2, cap 6 |
| 8 | Bad meat | refuse human / mystic meat and FoodBad / cook anything | refuse |
| 9 | "Cooked" (shared with R14) | dark-pot outputs only / also Bread, Cheese, Sausage | pot outputs only |
| 10 | Away raid danger | 50 % death when raiders reach her room with budget left / 25 % / never | 50 % |
| 11 | Live raid | killed for good (owner's words) / only knocked down | killed for good |
| 12 | Bed | not needed / a bed or Bedroll inside the walls required to take post | not needed |
| 13 | Health | 150 / 100 (town woman) / 300 | 150 |
| 14 | Config | `maid` section in `Config/Bases.json` / a new file | `Config/Bases.json` |
## Change 2026-10-07: a house as her post
Owner, 2026-10-07: "The maid should also be able to be sent to any houses you own, not just bases."
Built in the dev copy with these decisions (dispatcher's recommendation, applied unless the owner says
otherwise):
| Point | Built |
|---|---|
| Which houses | the bought homes of `LC/100_Homes.rb` LOCATIONS: rows with their own map (`:interior`), not `:mode => :rent` (today `noer_shack` Old Shack, `noer_stonehouse` Stone House); a rented inn room is never a post |
| Save | `lonacraft_data["maid"]["base"]` (base id) or `["home"]` (location id string), never both; `Maid.post` gives `[:base, record]` / `[:home, id]`, `Maid.post_ref` the saved shape; a save with only `"base"` works as before; `70_Save.rb` unchanged (no maid key in a remap table) |
| Bed rule | unchanged: a Bed / Dark Bed / Blue Bed / Bedroll must be placed in the house, else "There is nowhere for me to sleep." and no charge |
| Inside the walls | the whole house, as `Rest.inside` (`LC/160_Rest.rb:120`, `:all` for an owned home): every furniture record whose `map_id` is the house's runtime map number (`Homes.map_id_for`); wages, the pantry and the fire are read from these as from a base's |
| Spawn | after every `Game_Map#setup` of the house map (`Homes.home_at_map?` of the live map = her house; `Homes.setup_key` already turns a map number back into the file key); despawned on Move / Dismiss as before |
| Her room | `Homes.floor_tiles(map, id)` minus the tiles on or next to the map's `-point-StartPoint` / `-point-ExitPoint` (Shack 15,17 / 15,18; Stone House 15,18 / 15,19), so she never blocks the stairs; post tile = the free room tile nearest the fire, else a bed |
| Hiding tile | the free room tile farthest (`Raids.bfs` over the floor) from the StartPoint / ExitPoint; she goes there only when a hostile comes within `flee_radius` (no live raids in a house) |
| Raids | away raids never touch a house (`Maid.away_tile` only answers for a base post); `Raids.active?` is not read for a house post |
| Menus | hire and Move: `lonacraft_maid_choose` lists `Bases.pick_list` names, then the owned houses by `Homes.text(loc[:name])`, Cancel last, through the maid's own `\optB` ask (commas, brackets, colons and backslashes dropped); `Bases.choose_base` unchanged (the mercenaries keep it, base-only) |
| Texts | `Text/<lang>/Maid.txt`: Hire/offer, Hire/ask_base, Hire/no_base, Talk/opt_move, Talk/ask_base reworded for "camp or house"; new Talk/where "I look after BASE." appended to her status |
| Debug | Numpad . "Hire a maid free" inside an owned house posts her to that house |
| Self-test | runtime row "maid posts (bases and houses)": the saved shapes, every bought house can be a post, no rented room can |
## Change 2026-10-08: Boss Mama's bed refusal
Owner, 2026-10-08: "'There's no place for me to sleep' needs to be changed to 'There's no place for her to sleep' and fix the translations for it as well. We are talking to Big Momma, not the maid she sends."
| Key | Who says it | Before | Now |
|---|---|---|---|
| Hire/no_bed | Boss Mama (hire, `lonacraft_maid_offer`) | "There is nowhere for me to sleep." (CHT 這裡沒有我睡覺的地方。 KOR 제가 잘 곳이 없어요. RUS Мне негде спать. UKR Мені немає де спати.) | "There is nowhere for her to sleep." (CHT 那裡沒有她睡覺的地方。 KOR 그녀가 잘 곳이 없다. RUS Ей негде будет спать. UKR Їй ніде буде спати.) |
| Talk/no_bed (new) | the maid (her Move menu, `lonacraft_maid_talk`; it used Hire/no_bed) | - | her speaker line + "There is nowhere for me to sleep there." (CHT 那裡沒有我睡覺的地方。 KOR 거기엔 제가 잘 곳이 없어요. RUS Там мне негде спать. UKR Там мені немає де спати.) |
The other lines Boss Mama speaks were checked and already speak of the maid in the third person: Hire/offer ("One of the girls ... She cooks ..."), Hire/ask_base ("Which camp or house should she keep?"), Hire/no_base, Hire/no_coins, Hire/done ("NAME will be at BASE ..."), Hire/status ("NAME keeps BASE ..."). No other line was in the maid's voice. Talk/ask_base ("Which camp or house should she keep?") shows in the maid's own menu as a prompt (no speaker), unchanged.
@@ -0,0 +1,421 @@
# R4 Raids on a base (night raids, wall and door damage)
Board item R4 (owner, 2026-10-06). Research only: no mod or game file was changed. Every number is
PROPOSED with one recommendation; the owner settles them (section 10) before building.
Short forms: `F/` = `LonaRPG/Data/Scripts/Frames/`, `E/` = `LonaRPG/Data/Scripts/Editables/`,
`HCG/` = `LonaRPG/Data/HCGframes/`, `NPC/` = `LonaRPG/Data/NPCdata/`, `LC/` = `ModScripts/_Mods/LonaCraft/Scripts/`,
`CS/` = `ModScripts/_Mods/Campsites/Scripts/`, `RPS/` = `ModScripts/_Mods/RolePlayS/Scripts/`.
`LC/110_Bases.rb` line numbers are as of 2026-10-06 17:11 (another executor is editing that file).
Frame counts are at 60 fps (`F/102_00_Scene_Map.rb:97-104`; the fast-forward key runs 120 fps, so
timers kept in frames stay fair).
Dry run and render: `scratchpad/r3/r4_raid_plan.py` -> `scratchpad/r3/r4_raid_plan.png` (Map028,
the B2 sample base, a BanditMobs 0-25 group planned with the numbers below).
## 0. Summary
| Question | Finding | PROPOSED |
|---|---|---|
| Trigger | Every field map's NapEvent calls `region_map_wildness_nap`; the game rolls `WildDangerous` and, after the nap, its BIOS spawns the group on the outer regions (2.1) | Keep the game's roll (about 28 % a nap at steady state), plus a base-value bonus; scenario table per overmap region on base maps; every raid is a night raid |
| Spawn | Spawns read `$game_map.region_map`, already pruned of built and inside tiles by B2/R8a | Spawn tiles at least 8 tiles from the base; half the group on the side of the door nearest Lona; +1 raider per 30 base value (max +4, cap 12) |
| Can an NPC hit a wall or door with the game's skills? | No. A palisade tile and a closed door carry terrain tag 4: a skill's hit line ending on a tag-4 tile is blocked and its damage factor is `1 - 4 x 0.25 = 0` (3.1) | The mod keeps an HP table per piece and applies the damage itself when a raider swings at it (option B) |
| What does an NPC do with no path? | Greedy step, then a 25-ring BFS from the target, then random steps; it never targets an object by itself (3.1) | Siege AI: while Lona is enclosed, raiders are driven by the mod to stand tiles next to walls/doors and swing |
| HP | none in the game | Palisade 600 HP / armour 3, door 300 / 3, A4 wall (phase 2) 1200 / 8; a bandit spear breaks a door in 22 s, a palisade in 44 s; weak mobs and wolves cannot get in |
| Break | | piece removed from the record, tiles repainted, no refund, no rubble; the base never reverts during a raid |
| Repair | | action key: Repair, 1 Plank = +150 HP, 120 frames, not while that piece was hit in the last 3 s |
| End | | all raiders down, or 180 s of siege without a breach (they retreat), or Lona leaves the map; no nap during a raid |
| Build | | 4 items, about 730 Ruby lines, new `LC/120_Raids.rb` + `Config/Bases.json` |
## 1. What the game does today
### 1.1 The nap and the nap group
| Step | Evidence |
|---|---|
| Nap command: refused while `$game_map.threat`, else the map's nap event | `HCG/Command_Nap.rb:2`, `:9`; `F/31_Game_Map.rb:1300-1309` |
| `threat` = an NPC that tracks Lona within 8 tiles (recomputed every `NON_THREATEN_COUNT` frames); a raider hitting a wall is NOT a threat | `F/31_Game_Map.rb:951-968` |
| Every field map's NapEvent ends in `region_map_wildness_nap` (Map028 ev 32, Map045 ev 4, Map047 ev 4, Map030, Map107) | event dumps (`tools/home_evdump.py`) |
| `region_map_wildness_nap`: if a nap group from the last roll still lives (`check_enemy_survival?`) -> `RapeLoop` -> capture or death branch by race; else roll and `handleNap` | `E/34_Functions_RegionMap.rb:1645-1846`, capture branches `:1657-1828`, roll `:1832-1833` |
| Roll: `WildDangerous += clamp(rand(10) + WorldDifficulty/2 - survival*2, 10, 50)`; group if `WildDangerous >= rand(100) + survival`; group picked from a weighted list by the OVERMAP region (`OnRegionMap_Regid`) | `E/34_Functions_RegionMap.rb:237-246`, list `:248-337`, pick `:339-359`; `E/100_Game_Player_handle_on_move.rb:109` |
| `handleNap`: time shifts one segment (day <-> night, 2 segments a day), map set up again, non-`nappable` events deleted, map events re-initialised | `F/Game_InterpreterModifies/Game_Interpreter_Modifies_OM.rb:11-47`; `E/70_Game_Map_DayNightAndOvermap.rb:13-14`; `F/123_Game_Date.rb:198-201`, `:304-310`; `F/31_Game_Map.rb:165`, `:206`, `:359-372`; `F/39_Game_Event.rb:1957-1964` |
| The re-run BIOS (Map028 ev 1) sets the outer / inner spawn regions (`[4,9,10,11,12]` / `[3]`) and calls `region_map_wildness_spawn`, which reserves the group on `region_map[outer].sample` tiles and sets `RapeLoop = 1` | Map028 ev 1; `E/34_Functions_RegionMap.rb:361-1115`, `:1114`; `F/31_Game_Map.rb:1243-1246` |
| Group NPCs: `@nappable = false`, `summon_data[:WildnessNapEvent] = race`; `wildSpawnEnemy_setup` returns early after a nap (OverMapEvent_name 0), so they keep move type 1 (random walk) until they sense Lona | Map001 ev 384 (MobHumanRogueSpear); `F/39_Game_Event.rb:2351-2361` |
| On waking with a group alive: message `WildnessNapSpawn`; napping again with them alive = captured or killed | `E/34_Functions_RegionMap.rb:1844`, `:1647-1660` |
| So today walls do NOT protect a sleeping Lona: the second nap captures her whatever stands between | `:1848-1866` counts living group NPCs only |
Game quirks in the list: region 2 matches `when 2` (`:258`) before `when 2,3,6,14` (`:305`); regions 13
(Swamp Trail) and 16 (Infested Creep) fall to `else` (bandits and guards, `:329-335`).
### 1.2 Nap groups (difficulty 0-25 / 75+; `WorldDifficulty` bands), counted from `:361-1115`
| Group | Units 0-25 | Units 75+ | Can break a palisade (3.4)? |
|---|---|---|---|
| Orkind | 4 RandomGoblin | 5 Goblin, 1 Hobgoblin, 1 Orc | yes, slowly (goblins), fast (orc) |
| OrkindPlayGround | 3 Goblin, 2 Hobgoblin, 1 Orc | 4 Hobgoblin, 3 Orc, Butcher, Shaman | yes |
| Fishkind | 2 Charger, 2 Commoner | + 2 Spear, 2 Fat | yes |
| FishPPL | Deepone spear, bow, watcher | 7 | yes |
| BanditMobs | 3 RogueSpear, 2 RogueScout | 8 incl. warriors | yes |
| CommonMobs | 3 Commoner, Moot, PickAxe | 9 | no (atk 0-2) |
| UndeadWalking | 3 Commoner, 3 Sickle, Elite warrior, Elite spear | 14 | elites only |
| WolfGroup | 1 DireWolf | 1 | no (animal) |
| AbomManager / AbomSpider | 5 | 10 | yes |
| HumanGuard / NobleGuards | 4 | 7-8 | (not in base raids, 2.3) |
### 1.3 NPC AI facts that decide the design
| Fact | Evidence |
|---|---|
| An NPC picks targets only through its sensors; `sense_target` scans all characters, `process_target` needs `target.actor` | `F/281_Game_NonPlayerCharacter.rb:417-468`, `:550-570` |
| Map sensors ignore objects (`ignore_object? true`), so no NPC ever targets a `Game_DestroyableObject` on its own | `F/Modules/Sensors.rb:14`, `:97-109` |
| Sight: a line to the target; any tile with terrain tag 4 on it blocks (sight hp -1), tags 1-3 subtract | `F/Modules/Sensors.rb:161-172` |
| The palisade tile and a closed door have tag 4 (event tag overrides the tile's) | `docs/RESEARCH_BASE_BUILDING.md` 2.2; `F/31_Game_Map.rb:858-876`; door tag `LC/110_Bases.rb:890-895` |
| Skill hits: `hit_detection.scan` with a Battle_Sensor (hits objects, no friend check) but the same sight line, sight hp 10 | `F/Modules/BattleSystem.rb:382`; `F/Modules/Sensors_Battle.rb:12-13`; `E/301_Skill_RangeMap.rb:77-80` |
| Damage factor of the target's own tile: `max(1 - tag x 0.25, 0)` -> 0 on a tag-4 tile; RolePlayS keeps the same factor | `F/Modules/BattleSystem.rb:517-519`; `RPS/160_BattleSystem.rb:79`, `:250` |
| An NPC launches a skill only if its target is in range by the same sensor (`target_in_range?`), unless forced (`launch_skill(skill, true)`) | `F/Modules/BattleSystem.rb:58-69`, `:149-157` |
| Projectiles stop on tag >= 4 tiles | `F/33_Game_CharacterBase.rb:224-230` |
| Chasing: `move_toward_TargetSmartAI` = greedy step; on failure `createPath(target, 25)` (BFS from the target, 25 rings), follow it for `move_speed x 2` steps, then random steps | `F/39_Game_Event.rb:1211-1232`; `F/202_pathfinding.rb:330-418`; greedy `F/34_1_Game_Character.rb:258-280`; charge AIs `E/4000_Npc_Charge.rb:5-19`, `E/4000_Npc_OrkindCharge.rb:5-19` |
| With Lona enclosed the BFS floods only the inside and fails, so chasers jitter at the wall nearest her | same |
| Pathfinding passability: tiles (`check_passage`) and the first event on a tile (non-through, same-as-characters priority blocks) | `F/202_pathfinding.rb:470-482`; the last live `find_path` definition wins (`:484-518`; `:49-319` and `:535-604` are commented out) |
| `find_path` allocates a width x height array per call (Map028: 100 x 100 = 10,000 cells) | `F/202_pathfinding.rb:485` |
| "Go and look": `anomally = FakeTarget(x, y)` + alert 1 makes an NPC walk there with the SmartAI path | `E/480_EventCharacterBatch.rb:880-902`; `F/39_Game_Event.rb:1359-1388` |
| NPCs never use action-button events: only the player starts a door | `F/35_Game_Player.rb:604-614` |
| Doors: `doorEV_setup` swaps pages (open = through, closed = solid + tag 4), refuses to close on a living NPC | `E/29_Functions_417_Interpreter.rb:943-961` |
### 1.4 Breakable things in the game (none is a wall or a door)
| Object | How | Evidence |
|---|---|---|
| AbomWall0-3 / RandomAbomWall | event with `set_npc("NeutralHp1Sandbag")`: `Game_DestroyableObject`, health 1, def 200, fraction 9; the player breaks it | Map001 ev 606-618; `NPC/NeutralHp1Sandbag.json` |
| GobWatchTower | `NpcProtectTower`, health set to 4; collapse animation on death | Map001 ev 980; `NPC/NpcProtectTower.json` |
| SandBag, SandBagArmored, NeutralSandbagImmortal | training dummies (`Game_DestroyableObject` / `Game_SandboxObject`) | `NPC/SandBag.json`; `E/4000_Game_SandboxObject.rb`; `RPS/160_BattleSystem.rb:240-279` |
| AbomHiveHeart + AbomHiveHitBox | hit box event linked to its master (`hit_LinkToMaster`) | Map001 ev 564, 566 |
| AbomCreatureCocoon, Bomb_* , NeutralBBQ_rack, WildAnimalRattus | traps / destroyable objects | `NPC/*.json` (`ai` field) |
| MapBlockBox | invisible blocker, no HP | Map001 ev 230 |
| `Game_DestroyableObject` | NPC class with HP that never senses, never aggroes | `F/282_Game_DestroyableObject.rb:6-53` |
No siege, gate or barricade code exists (`grep -i "siege|barricade"` over `HCG/` and `Data/Scripts`: none).
### 1.5 Raid-like prior art
| What | How | Evidence |
|---|---|---|
| Campsites raid roll | per nap, `rand(100) < chance` by biome (5-35 %, default 15), sums one raid event at Lona's tile; the raid events file is missing | `CS/10_Campsites.rb:227-236`, hook `:305-316`; `Campsites/mod.cfg` BIOME_RAID_CHANCE |
| Mercenary camp raid waves (story) | wave NPCs `moveto` named invasion points (`InvadePTT/D/L/R`), move type 3 | `HCG/event/NFL_MerCamp_RaidWave3.rb:12-31` |
| rfuCAMP / OrkVsFish on Map002 | overmap encounters (refugee camp; orc vs fish fight on a tag map), not attacks on a structure | Map002 ev 20, 25; `HCG/encounter/OnMap_OrkVsFish.rb` |
| Abandoned House nap | capture by BanditMobs if a nap group lives | `HCG/event/AbanHouse1_Nap.rb:1-21` |
## 2. Trigger (PROPOSED)
### 2.1 Hooks (all in `GIM_ADDON`, `E/34_Functions_RegionMap.rb:51-1949`)
| Hook | What it does on a base map (`Bases.base_at_map?`) |
|---|---|
| alias `region_map_wildness_nap_stats` (`:237`) | adds the base-value danger bonus to `WildDangerous`, then the original roll |
| alias `region_map_wildness_nap_stats_create_race_list` (`:248`) | returns the scenario list (2.3) instead of the region list |
| alias `region_map_wildness_spawn` (`:361`) | original spawn, then marks a raid pending (race, base id) and reserves the extra raiders (3.2) |
| alias `region_map_wildness_nap` (`:1645`) | refuses the nap while a raid is active (buzzer + text), else original |
| alias `Game_Map#nap` (`E/70_Game_Map_DayNightAndOvermap.rb:13`) | skips the one `$game_date.shift` when a raid is pending and the nap would end in the day (2.2) |
Outside bases nothing changes.
### 2.2 Chance and time
| Option | For | Against |
|---|---|---|
| A. Game roll + base bonus (PROPOSED) | ties into WorldDifficulty and survival; clearing a raid lowers danger (-50, `:1859-1864`) | |
| B. Own roll per nap (Campsites style, flat % by biome) | simple to read | a second danger system beside the game's |
Base value = walls x 1 + doors x 2 + furniture pieces x 3 (floors 0). Bonus per nap = min(10, value / 10).
Simulated chance of a raid on nap 1..6 (40,000 runs, raid cleared = -50):
| WorldDifficulty / survival | bonus 0 (no base) | bonus 3 (value 30) | bonus 10 (value 100+) |
|---|---|---|---|
| 10 / 3 | 8 17 24 27 27 27 % | 11 23 30 32 32 32 % | 18 34 41 43 45 44 % |
| 30 / 5 | 7 17 24 28 28 28 % | 10 22 30 32 33 33 % | 17 34 42 44 46 46 % |
| 60 / 10 | 5 19 28 31 31 32 % | 9 24 34 35 37 39 % | 16 36 44 48 49 50 % |
Night: every raid happens at night (owner: "night raids"). Napping by day ends at night anyway; napping at
night with a raid rolled skips the time shift once, so Lona is woken in the same night. Nap effects
(`process_nap_change`) still apply, as in the game's own nap-spawn. Recommendation: **A, night always**.
### 2.3 Scenarios (by the base record's overmap `region`; `LC/110_Bases.rb` record 9.1)
| Scenario | Regions | Group weights (PROPOSED) | Flavour |
|---|---|---|---|
| Open field | 1 | Orkind 70, BanditMobs 30, UndeadWalking 20, WolfGroup 20 | from all sides; grace 8 s |
| Road | 11, 17, 23 | BanditMobs 60, Orkind 20, CommonMobs 20 | bandits; door bias 0.7 |
| Forest, mountain | 4, 5, 7 | Orkind 70, BanditMobs 20, UndeadWalking 30, WolfGroup 40 | ambush: grace 5 s |
| Shore | 2, 27 | Orkind 50, BanditMobs 40, FishPPL 20 | |
| Swamp, marsh | 8, 13, 15, 24, 25, 26 | Fishkind 70, Orkind 30, UndeadWalking 20 | |
| Wasteland, infested ("desert") | 3, 6, 14, 16, 19, 28 | AbomManager 40, AbomSpider 30, Orkind 30 | abominations: breach x 1.25 |
| Abandoned House | 9 | BanditMobs 60, CommonMobs 30, Orkind 10 | squatters; door bias 0.8 |
HumanGuard and NobleGuards are left out (guards do not siege a camp; in the game they only arrest a
Lona with morality < 30, `:1688-1704`). WolfGroup and CommonMobs stay in on purpose: a closed base
beats them (3.4), which is the reward for building. Recommendation: **this table**, editable in config.
### 2.4 Warning
| Point | PROPOSED |
|---|---|
| Wake-up | instead of `WildnessNapSpawn`: popup "Something is moving outside..." + the race's spot sound (`SndLib.sound_goblin_spot`, `FishkindSmSpot`, `dogSpot`, as `HCG/encounter/OnMap_OrkVsFish.rb:1`, `E/34_Functions_RegionMap.rb:1782`) |
| Grace | raiders hold their spawn tiles (move type 0) for 8 s = 480 frames (scenario value), so Lona can close doors, repair, arm |
| Dog companion (`NPC/CompDoggy.json`, follower record names in `E/99_Game_Player_follower.rb:491-510`) | barks first (`SndLib.dogSpot`), grace +5 s |
## 3. Spawn and attacker AI (PROPOSED)
### 3.1 Why the game's combat cannot break a wall
| Way | Blocked by |
|---|---|
| NPC targets a wall-HP event by itself | map sensors ignore objects (`Sensors.rb:14`, `:104-109`) |
| NPC skill hits an event standing on a palisade tile | the hit line ends on a tag-4 tile -> blocked (`Sensors.rb:168`) and the damage factor is 0 (`BattleSystem.rb:517-519`) |
| Set that event's terrain tag to 0 so it can be hit | the wall then stops blocking sight and missiles (`F/31_Game_Map.rb:858-876` takes the event's tag first) |
| Closed door event | same: its tag is 4 |
### 3.2 Spawn
| Point | PROPOSED | Dry run (Map028, B2 sample base) |
|---|---|---|
| Where | the game's own spawn (outer spawn regions, already without built and inside tiles, `LC/110_Bases.rb:1067-1091`, `:1109-1178`), then each raider is moved (`moveto`) to a tile at least 8 tiles from the base's bounding box | 402 outer tiles, 230 at >= 8 |
| Door side | DOOR_BIAS 0.5 of the raiders on tiles on the side of the door nearest Lona (dot product with base centre -> door) | 188 tiles |
| Size | the group as the game makes it, +1 raider (copy of the group's first unit) per 30 base value, at most +4, at most 12 raiders in all (the game's biggest group is 14, UndeadWalking 75+) | value 34 -> +1 |
| Marking | `summon_data[:LonaCraftRaid] = raid id` on every adopted NPC; `WildnessNapEvent` kept, so the game's bookkeeping (`:1848-1866`) still works | |
### 3.3 Options for wall damage
| | A. Wall-HP events | B. HP table + siege driver (PROPOSED) |
|---|---|---|
| How | an invisible `Game_DestroyableObject` event per wall / door tile while a raid runs | `rec["hp"]["x,y"]` per damaged piece; the mod moves each raider to a stand tile next to a breach tile; when it swings, the mod subtracts damage |
| Can raiders hit it | no without patching sensors, the hit line and the damage factor (3.1) | yes: the swing is cosmetic (`launch_skill(first melee skill, true)`), the damage is the mod's |
| Events | +1 per wall (a 9 x 7 ring = 30) | 0 |
| Side effects | ev tag change breaks sight blocking; patches touch the whole battle system (and RolePlayS's copy) | an alias of `Game_Event#update_self_movement` (`F/39_Game_Event.rb:962`) only for raid NPCs |
| Save | events in the saved map | plain numbers in the base record |
Recommendation: **B**.
### 3.4 Numbers
Damage per swing = max(1, NPC `atk` - armour) x race factor. A swing every 60 + rand(30) frames (mean 1.25 s).
| Race factor | Orkind 1.5 | Goblin 1.0 | Human 1.0 | Fishkind 1.0 | Undead 0.75 | Abomination 1.25 | Dog, Others, Animal 0 (do not breach) |
|---|---|---|---|---|---|---|---|
| Piece | HP | Armour | Repair |
|---|---|---|---|
| Palisade Wall (A3, built) | 600 | 3 | 1 Plank = +150 |
| Wooden Door (built) | 300 | 3 | 1 Plank = +150 |
| A4 building wall (phase 2) | 1200 | 8 | 1 Stone Block = +300 |
Time for ONE raider to break a piece (s), `atk` from `NPC/*.json` (dry run output):
| Unit | atk | Palisade | Door | A4 wall |
|---|---|---|---|---|
| GoblinCommoner | 5 | 375 | 188 | 1500 |
| Goblin, mean of RandomGoblin kinds | 10 | 107 | 54 | 750 |
| HobgoblinSpear | 20 | 44 | 22 | 125 |
| OrcCommoner | 20 | 29 | 15 | 83 |
| OrcButcher | 25 | 23 | 11 | 59 |
| MobHumanCommoner | 0 | 750 | 375 | 1500 |
| MobHumanRogueScout | 14 | 68 | 34 | 250 |
| MobHumanRogueSpear | 20 | 44 | 22 | 125 |
| FishkindCharger | 15 | 62 | 31 | 214 |
| FishkindFat | 23 | 38 | 19 | 100 |
| UndeadCommoner | 5 | 500 | 250 | 2000 |
| UndeadEliteWarrior | 18 | 67 | 33 | 200 |
| AbomCreatureSpider | 10 | 86 | 43 | 600 |
| AbomCreatureZombie | 15 | 50 | 25 | 171 |
| WildDireWolf | 20 | - | - | - |
With the give-up time of 180 s, goblin commoners, common mobs, undead commoners and wolves never get
through a closed palisade. One raider per stand tile, so raiders work on different pieces side by side;
the first breach is the strongest raider's time plus its walk.
Dry run, BanditMobs 0-25 (3 spears, 2 scouts) on the sample base, Lona inside (r4_raid_plan.png):
| Raider | From | Target | Walk (tiles) | Breach after |
|---|---|---|---|---|
| Spear | (55,53) | front door (44,42) | 21 | 28 s |
| Spear | (56,44) | side door (40,39) | 22 | 28 s |
| Spear | (56,47) | wall (48,42) | 12 | 47 s |
| Scout | (37,53) | wall (40,42) | 13 | 72 s |
| Scout | (59,41) | wall (48,41) | 10 | 71 s |
So about 8 s grace + 28 s before the first door falls.
### 3.5 Siege driver (in `LC/120_Raids.rb`)
| Step | How |
|---|---|
| Enclosed? | flood from the play-area edge and exit ring as `Bases.inside_tiles` (`LC/110_Bases.rb:1109-1178`) but with LIVE doors (open door = passable); Lona's tile not reached = enclosed. Run at raid start, after every break, and when a door's `through` changes (polled every 30 frames) |
| Breach candidates | wall / door pieces with an outside-reached 4-neighbour; stand tile = that neighbour (sample base: 28 candidates, 32 stand tiles, 562 reached tiles) |
| Pick | per raider: min(walk frames + break time) over free stand tiles; doors win by their lower HP; reserved, one raider per stand tile |
| Walk | BFS distance map per stand tile, cached until the next re-plan, raider steps down it (as `find_next_tag`, `F/202_pathfinding.rb:381-395`); blocked 60 frames -> re-pick |
| Swing | on the stand tile: face the piece; every swing interval `launch_skill(first killer skill, true)` (animation, sound); if launched: HP -= damage, damage popup (`$game_damage_popups.add`, as `F/Modules/BattleSystem.rb:549`), `SndLib.sys_KnockDoor` (wood_chop, `E/509_SoundsLibs.rb:315-319`) at distance volume |
| Roles | ranged AIs (`npc.ranged?`) wait 4-6 tiles out and shoot once Lona is in sight; race factor 0 (animals) circle near the walls; both leave at give-up |
| Not enclosed (door open, wall down) | the mod lets go; raiders without a target get `anomally` = Lona's tile every 120 frames (1.3), the game's charge AI takes over once they see her |
| Who is driven | adopted raiders, alive, `action_state` nil / `:none`, no target; never during skill, sex, grab, stun |
### 3.6 Break, persistence
| Point | PROPOSED |
|---|---|
| HP storage | `rec["hp"] = {"x,y" => hp}` only for damaged pieces (absent = full); taking down or rebuilding a piece deletes its entry |
| At 0 HP | `Bases.break_piece(map, x, y)`: piece out of `pieces` (a door on a floor leaves the floor, as `take_down` `LC/110_Bases.rb:1242-1276`), door event removed, `paint` + `repaint` + `orient_doors_near` + `refresh_spawn_lists`; `SndLib.stoneCollapsed`; no refund |
| Rubble | none (the ground shows); a rubble piece is a later option |
| Revert | a break never ends the base during a raid (the normal `on_piece_removed` would remove the record when the last piece goes, `:383-390`); `base_empty?` (`:1748`) is checked when the raid ends |
| Across visits | broken stays broken, damaged stays damaged: the record is the truth |
## 4. Lona's side (PROPOSED)
| Point | Finding / PROPOSED |
|---|---|
| Fight from inside | melee and missiles cannot cross a palisade or a closed door (tag 4, 1.3). The fight is at the door: open it and the raiders come through one tile |
| Shoot over walls | not with the palisade. Later piece "Low fence": impassable tile with terrain tag 2: sight and arrows pass (`Sensors.rb:168`, `F/33_Game_CharacterBase.rb:224-230`), both ways; needs a tile hunt per sheet |
| Repair mid-raid | yes: action key on a damaged wall / door (from either side): Repair / Take down / Cancel; 1 Plank = +150 HP, 120 frames; refused when the piece was hit in the last 180 frames ("It is being hit") |
| Build mid-raid | allowed (B4' build mode), but not within 3 tiles of a living raider |
| Nap mid-raid | refused (hook 2.1); otherwise the game's rule would capture her through the walls (1.1) |
| End | all raiders dead, stunned out or gone -> "The raid is over" + the game's clear (`WildDangerous` -50); 180 s (10,800 frames) of siege without a breach -> raiders walk to the exit ring and are deleted; Lona leaves the map -> raid dropped, damage kept |
| Rewards | the raiders' own `drop_list` drops, unchanged; no bonus |
| Defeat | the game's combat defeat and capture flow, unchanged |
## 5. Companions and doors
| Point | Finding / PROPOSED |
|---|---|
| Open door | page 1 through ON: anyone walks through (raiders too), pathfinding sees it as open (`F/202_pathfinding.rb:470-475`) |
| Closed door | blocks everyone; only Lona opens it (`F/35_Game_Player.rb:604-614`); raiders break it |
| Companions | spawned next to Lona after setup (`summon_companion`, Map028 ev 1; `E/99_Game_Player_follower.rb:491`), so inside after a nap; they fight at the door; outside ones wait. PROPOSED unchanged; "companions pass closed doors" would need a collision alias, later |
| Dog | early warning (2.4) |
## 6. Engine limits
| Limit | Fact | PROPOSED |
|---|---|---|
| NPC count | sensors scan all characters each tick (`F/281_Game_NonPlayerCharacter.rb:417-440`), cost grows with n x n; game groups 1-14 | cap 12 raiders |
| Path cost | `find_path` = width x height array + BFS per call (`F/202_pathfinding.rb:484-518`); enclosure flood on Map028: 841-tile play area, 562 reached, 2.3 ms in Python | flood only on events (start, break, door change); one distance map per stand tile, cached; largest allowed family Map107 (3,431 passable tiles) about 4x |
| Events | no hard cap (new id = max + 1, `LC/90_Furniture.rb:787-799`) | option B adds 0 events |
| Nap reload | the raid starts AFTER the nap (spawned by the re-run BIOS), so no running raid crosses a nap; nap during a raid refused | |
| Map change | raiders are summoned, not nappable: gone on any setup (`F/31_Game_Map.rb:359-366`) | raid state cleared in `after_setup` (`LC/110_Bases.rb:345-358`) when the map is not the raid's |
| Save / load mid-raid | `$game_map` with events and `summon_data` is in the save (`F/5_DataManager.rb:939`); not set up again on load (`:994-1000`) | `lonacraft_data["raid"]` = {"id", "base", "map_no", "race", "grace", "siege", "since_hit"} (frames, plain types); after load re-adopt by `summon_data[:LonaCraftRaid]`, re-plan; HP is in the record |
| Fast-forward | 120 fps doubles real speed (`F/102_00_Scene_Map.rb:97-104`) | all timers in frames |
| RolePlayS | no AI, sensor or pathfinding override (grep of `RPS/`); its `take_damage` keeps the tag factor | nothing to do |
## 7. Config (PROPOSED)
`Config/Bases.json` (user file, never written by the mod) + generated `Config/Bases_defaults.json`, read
by the strict `LonaCraft::ConfigJSON` reader (`LC/55_Recipes.rb:585-596`), same rules as
`Config/Recipes.json` (`//` comments, a mistake = a console line). One file per feature, as Recipes;
pieces and raids both belong to bases. Recommendation: **`Config/Bases.json`** over a shared
`Config/LonaCraft.json`.
```json
{
"pieces": {
"W": {"hp": 600, "armour": 3, "repair_item": "ItemLonaCraftPlank", "repair_hp": 150},
"D": {"hp": 300, "armour": 3, "repair_item": "ItemLonaCraftPlank", "repair_hp": 150},
"A4": {"hp": 1200, "armour": 8, "repair_item": "ItemLonaCraftStoneBlock", "repair_hp": 300}
},
"repair": {"frames": 120, "blocked_after_hit_frames": 180},
"raids": {
"enabled": true,
"danger_per_value": 0.1, "danger_cap": 10,
"night_only": true,
"grace_frames": 480, "dog_extra_frames": 300,
"give_up_frames": 10800,
"swing_frames": 60, "swing_rand": 30,
"spawn_min_distance": 8, "door_bias": 0.5,
"extra_raider_per_value": 30, "extra_raiders_max": 4, "max_raiders": 12,
"no_build_near_raider": 3,
"refuse_nap": true,
"breach": {"Orkind": 1.5, "Goblin": 1.0, "Human": 1.0, "Fishkind": 1.0, "Undead": 0.75, "Abomination": 1.25},
"scenarios": {
"field": {"regions": [1], "groups": {"Orkind": 70, "BanditMobs": 30, "UndeadWalking": 20, "WolfGroup": 20}, "grace_frames": 480}
}
}
}
```
`repair_item` = the mod's item names (`LC/0_Core.rb:37`, `:44`).
As built (2026-10-06): repair keys moved to their own `"repair"` section (`item`, `hp`, `frames`,
`blocked_after_hit_frames`), plus `raids.retreat_frames` and `raids.min_breach_atk`; the full key list is
in README "Raids" and `Config/Bases_defaults.json`.
## 8. Work breakdown (PROPOSED)
| Item | Scope | Files | Ruby lines | Needs the owner's numbers |
|---|---|---|---|---|
| R4-1 HP, break, repair | `rec["hp"]`, `Bases.break_piece` (no revert mid-raid), repair entry in the wall / door menus, HP in the menu text, Config/Bases.json loader + defaults file | `LC/110_Bases.rb` (~90, after the R8 executor is done), `LC/120_Raids.rb` (config ~60), `Text/<5 langs>/Bases.txt` (+5 keys) | 150 | HP, armour, repair cost and time |
| R4-2 Trigger, scenarios, spawn, end | the 5 hooks of 2.1, scenario table, value bonus, extra raiders, spawn move and door bias, warning + grace, adoption, end checks, give-up retreat, nap refusal, raid state + save/load | `LC/120_Raids.rb` (new), `loader.rb` (1 line), `Text/<5 langs>/Raids.txt` (~10 keys) | 250 | chance model, night rule, scenario table, guards, end rules |
| R4-3 Siege driver | live enclosure flood, candidates, pick + reservation, cached distance maps, `update_self_movement` alias, swing + damage, roles, release + `anomally` hunt | `LC/120_Raids.rb` | 260 | race factors, swing interval |
| R4-4 Debug, docs, dry run | debug key "raid now" (a free numpad key; `LC/95_Debug.rb` and `LC/110_Bases.rb:58` hold 0 1 3 5 7 9 + - * /), console lines, README "Raids", Python port of the planner as a static check | `LC/120_Raids.rb`, README, `scratchpad/r3/r4_raid_plan.py` | 70 | none |
Total about 730 lines. Order R4-1 -> R4-2 -> R4-3 -> R4-4. R4-1 can start once the piece numbers are
set; R4-2 needs the trigger and scenario choices; R4-3 the race factors.
## 9. Not covered
Raiders damaging furniture or stations; a rubble piece; the low fence; companions passing closed
doors; raids on bases the player is not on (off-screen damage). All later options.
## Change 2026-10-08: every hostile sieges, the side-wall breach
Owner bug report 2026-10-08 (in game): after a nap the game's own wilderness group came, did not
attack the base at all; one that Lona aggroed lost her when she went in and shut the door.
| Finding | Evidence (game B.0.10.8.27, LC = Scripts/ before the change) |
|---|---|
| Only the mod's raiders were driven: the movement hook ran for `summon_data[:LonaCraftRaid]` only, set by `adopt_scan` for a group whose race the mod's own roll had armed | LC/120_Raids.rb:1735-1739 (alias), :956-974 (adopt), :779-797 (`after_spawn` returns unless `@armed` and race match) |
| A nap group the mod did not arm is never adopted: the overmap-encounter race overrides the roll (`OnRegionMapEncounterRace`), a re-entry spawns the remembered group again, a raid that already ended | E/34_Functions_RegionMap.rb:353-358; LC/120_Raids.rb:742-753 (`after_roll` "the game's group comes instead") |
| The game's nap group random-walks until it senses Lona (move type 1); inside walls it never sees her | research 1.1; F/Modules/Sensors.rb:161-172 (tag 4 ends the sight line) |
| Even adopted raiders went back to the game's AI once they had a target | LC/120_Raids.rb:1303 (`drive` returns false), :1468 (`update_swings` skips) |
| De-aggro: no target drop on "no path"; the drop is on lost sight. `sense_target` with a target (mode 3) finds nothing through a tag-4 wall top or closed door, counts `targetLock_HP` (10) down per sensor tick, then `process_target_lost` (target nil, alert 0, ai :none) | F/281_Game_NonPlayerCharacter.rb:417-468 (456-463), :490-504; sensor tick F/39_Game_Event.rb:698-707; chasing without a path F/39_Game_Event.rb:1211-1232 |
| Side-wall breach: `face_at` drew the face of the wall above on any tile under a wall that is not a piece, so a broken piece in a wall running up and down became a (solid) face | LC/110_Bases.rb:1340-1347 (before) |
Change (LC/120_Raids.rb, LC/110_Bases.rb):
| Point | Now |
|---|---|
| Who joins | every 30 frames on a base map while Lona is shut in: an NPC outside the enclosure that targets Lona's side (Lona, followers, mercenaries, maid) while that target is shut in ("aggro"), or the game's nap group of the map (`summon_data[:WildnessNapEvent] == OnRegionMapSpawnRace`, not the sewer's own population) that would attack Lona by the game's own test (`friendly?` false and `check_ai_state` killer / fucker / assaulter, as F/35_Game_Player.rb:355) ("nap group"). Not: projectiles, traps, objects, Lona's side, idle wanderers, non-hostile NPCs, anyone while Lona is not shut in |
| State | no raid running: a siege state of its own (`:hostile`), siege at once, no warning, no extras, no relocation; a raid in its siege phase: they join it (`r[:joined]` by event id, never tagged) |
| Driver | the same: roles, stand tiles, swings, damage `max(1, atk - armour) x breach factor x damage_mult`, breaks, re-plan, give-up and retreat; a unit with a target is driven while that target is shut in, the game's AI as soon as it can reach it |
| Target kept | alias `Game_Event#update_npc_sensor` (F/39_Game_Event.rb:698): before the game's sensor tick, a unit in the siege phase whose target is Lona's side, alive and shut in gets `targetLock_HP = 10`, so `sense_target` never reaches `process_target_lost` |
| End of `:hostile` | units down, or Lona not shut in (released, the game's AI), or give-up (they walk off); no popup, no `check_enemy_survival?` |
| Not doubled | the game's own spawn on a base map that the mod did not arm only gets a console line; its units join |
| Config | `raids` `"hostiles": true` (false: only the mod's raiders) |
| Trace | `siege: <name> targets <piece> at (x,y), reason no path / breach (...)` and `siege: <name> released, reason ...` in UserData/LonaCraft_trace.log (debug + trace on) and the console |
| Breach | `face_at`: no face on a tile under a wall when the tile below it is a wall or a door, unless both walls run left and right (two walls with one row between keep their face); `around` repaints the rows that depend on it; a rebuilt piece paints its top again |
Breach check (Python port of `paint` / `face_at` / `update_block` on Map028, ring (50,47)-(54,52),
inside 3 x 3, `scratchpad/r20/breach_check.py`, renders `scratchpad/r20/shots/breach_*.png`):
| Case | north piece (52,47) | its face (52,48) | east piece (54,50) | outside reaches inside |
|---|---|---|---|---|
| intact | blocked | blocked | blocked | no |
| east broken, old rule | blocked | blocked | blocked (face) | no |
| east broken, new rule | blocked | blocked | walkable | yes |
| north + east broken, new rule | walkable | walkable | walkable | yes |
| both rebuilt, new rule | blocked | blocked | blocked | no (tiles equal the intact map) |
## 10. Choices for the owner
| # | Choice | Options | PROPOSED |
|---|---|---|---|
| 1 | Chance | A game roll + base bonus / B own flat roll per nap | A, bonus min(10, value / 10) a nap |
| 2 | Time of day | night only (skip the shift once when napping at night) / any nap | night only |
| 3 | Scenarios | table 2.3 / the game's region lists unchanged | table 2.3 (no guards; wolves and mobs kept) |
| 4 | Bigger bases, bigger raids | +1 raider per 30 value (max +4, cap 12) / none | +1 per 30 |
| 5 | Warning and grace | 8 s (forest 5 s), dog +5 s / none | 8 s, dog +5 s |
| 6 | Spawn | >= 8 tiles from the base, half on the door side / the game's spawn | >= 8, half on the door side |
| 7 | Damage model | B HP table + siege driver / A wall-HP events | B |
| 8 | HP and armour | palisade 600 / 3, door 300 / 3, A4 1200 / 8 | as listed |
| 9 | Who breaches | race factors 3.4, animals 0, ranged wait | as listed |
| 10 | Break result | piece gone, no refund, no rubble / rubble piece / 50 % refund | gone, no refund |
| 11 | Repair | 1 Plank = +150 HP, 2 s, not while hit / rebuild only | 1 Plank = +150 |
| 12 | Raid end | all down / 180 s give-up / leave the map | all three |
| 13 | Nap during a raid | refused / the game's capture rule | refused |
| 14 | Build during a raid | allowed except within 3 tiles of a raider / allowed / blocked | allowed except near |
| 15 | Rewards | drops only / a bonus loot sack | drops only |
| 16 | Config | `Config/Bases.json` / a `raids` section in a new `Config/LonaCraft.json` | `Config/Bases.json` |
@@ -0,0 +1,297 @@
# Rest tiers, food and bath on sleep (board R12 + R14) - research and design
Status: research done, design PROPOSED (2026-10-06). Owner decisions taken as fixed:
ground poorer and riskier than a Bedroll; a Bed inside walls = full rest; a Bed does NOT refill food by
itself (only the inn does); a COOKED dish in a chest inside the walls -> eat one meal from the chest and get
the inn's food refill; something to bathe with inside the walls -> sleeping cleans Lona like the inn.
Paths: `G/` = LonaRPG/Data/, `E/` = G/Scripts/Editables/, `F/` = G/Scripts/Frames/, `M/` = LonaCraft_dev/LonaCraft/Scripts/.
All line numbers from B.0.10.8.26 and the dev copy as read today.
## 1. Facts: how a nap works today
### 1.1 Entry points (all end in one funnel)
| Path | What runs | File:line |
|---|---|---|
| Bed / Bedroll piece, action "Sleep" | `lonacraft_furniture_action(:sleep)` -> `load_script(Command_AreaNap.rb)` | M/90_Furniture.rb:1125-1127, :169 |
| Game's own camp bed ("PlayerBed", Action_BuildCamp) | summons `PlayerBed`, which runs Command_AreaNap.rb | G/HCGframes/Action_BuildCamp.rb:12-16; Map001 holds the one `Command_AreaNap.rb` string |
| Command_AreaNap.rb, choice "Sleep" | `napEventId.nil? ? handleNap : $game_map.call_nap_event` | G/HCGframes/Command_AreaNap.rb:69-75 |
| Nap skill with Shift (sleep anywhere = GROUND) | `BasicNap` summons EffectMCBasicNap, autorun -> Command_Nap.rb | E/480_EventCharacterBatch.rb:1983-2013; G/HCGframes/Command_Nap.rb:2-10 |
| Field / base map NapEvent | `region_map_wildness_nap` -> roll `region_map_wildness_nap_stats` (OnRegionMap >= 1) -> `handleNap` | E/34_Functions_RegionMap.rb:1645, :1832-1833 |
| Home with no NapEvent (shack, stone house) | Command_AreaNap.rb -> `handleNap` directly | M/100_Homes.rb:65-67 |
| Inn room (rented) | NapEvent -> NoerTavern_Nap.rb (redirected with keys counted held) -> `handleNap` | M/100_Homes.rb:1367-1387; G/HCGframes/event/NoerTavern_Nap.rb:129-136 |
| Deep Sewer | its own NapEvent `lonacraft_sewer_nap` -> `Sewer.nap_roll` (35 % day / 60 % night) -> handleNap | M/130_Sewer.rb:97-98, :380-396, :618-626 |
| Funnel | `handleNap`: NPC nap changes, `pre_nap`, `$game_map.nap` (date shift), **`$game_player.actor.process_nap_change`**, `$game_map.setup`, spriteset, `check_wakeup_event` | F/Game_InterpreterModifies/Game_Interpreter_Modifies_OM.rb:12-47 (actor :23, setup :24, wake :42) |
| Refusals (raid running) | `call_nap_event` and `region_map_wildness_nap` aliases return early | M/120_Raids.rb:1461-1470, :1485-1494, :1338-1345 |
Every nap that changes Lona's stats goes through `Game_Actor#process_nap_change` exactly once (E/97_Game_Actor_Stats&State&Nap.rb:63),
called only from handleNap (OM.rb:23). The danger roll runs BEFORE handleNap (34_Functions_RegionMap.rb:1832-1833).
### 1.2 What a plain nap does to Lona (vanilla)
| Stat (range, E/94_Game_Actor_Stats.rb:233-236) | Nap change | File:line |
|---|---|---|
| Stamina (-100..100) | `+= 20+rand(20)+sat` TWICE (once in process_nap_change, once in update_nap_sat_vs_health_and_sta) | E/97:75, :164 |
| Health (-100..200) | `+= -20 + 0.6*sat` (sat before the drop; negative = hunger damage) | E/97:166-172 |
| Satiety (0..100) | `-= 18` (WeakSoul 15, captured WeakSoul 12), `-= 12` more on Hardcore, `-= 3+2*preg` when pregnant | E/97:177-183, :84 |
| Dirt (0..255) | `+= 26` every nap; DirtState stack = dirt/100 (max 2) | E/97:86, :435-438, :447; G/Effects/States/DirtState.json |
| Mood (-100..100) | from satiety after the drop: 0 -> -30, <=10 -> -20, 20 -> 0, >=20 +10, >=40 +20, >=80 +30; Pessimist -20 | E/97:192-200 |
| Daily states | one stack of each daily state removed (FeelsSick is daily) | E/97:90-91, :389-404 |
| Rot | Hardcore only, Lona's bag + boxes 65533/65535; mod chests (66000+) never rot | E/97:128-135; M/90_Furniture.rb:166 |
RolePlayS replaces process_nap_change: stamina is added ONCE (`+= 20+rand(20)+sat`), rest the same
(ModScripts/_Mods/RolePlayS/Scripts/25_Skills.rb:476-525). Campsites, CustomDifficulty and BabyProtection alias it
(Campsites/10_Campsites.rb:308-315; CustomDifficulty/10_CustomDifficulty.rb:120-137; BabyProtection/10_BabyProtection.rb:81-89).
=> the mod must scale DELTAS measured around the call, never re-implement the numbers.
Worked example, vanilla, Lona at stamina 0, health 100, satiety 50:
| | Stamina | Health | Satiety after | Mood | Dirt |
|---|---|---|---|---|---|
| plain nap | 100 (gain ~159, capped) | 110 | 32 | +10 | +26 |
| same at satiety 20 | 99 | 92 | 2 | -20 | +26 |
| same at satiety 0 | 59 | 80 | 0 | -30 | +26 |
### 1.3 The inn's paid sleep (what "the inn rest" is)
NoerTavern_Nap.rb, the branch with a room key (:129-136), all BEFORE handleNap:
| Step | Code | Effect |
|---|---|---|
| pay | `lose_item($data_items[106], 1)` | one Noer inn key (:130) |
| restore | `health = attr_dimensions["health"][2]`, `sta = attr_dimensions["sta"][2]` | full health and stamina (:131-132) |
| meal | `sat = attr_dimensions["sat"][2]` | satiety to max (100) (:133); no food item is involved |
| bath | `4.times{ load_script("Data/Batch/Command_Bath.rb") }` then `dirt = 0` | (:134-135), see 1.4 |
| nap | `handleNap` | the normal nap math then runs on top: sat 100 -> 82, health +40, dirt 0 -> 26, mood +30 |
### 1.4 The bath
| Function | Effect | File:line |
|---|---|---|
| `batch_take_bath(scale)` | body cum meters x(1-scale), CreamPie/MoonPie x(1-0.1*scale), mouth cleared, `dirt -= dirt*scale`; erases EffectWet, EffectBleedVag, EffectBleedAnal, EffectScat, Masturbationed | E/480_GameActorBatch.rb:4-25 |
| Batch/Command_Bath.rb (inn, x4) | `batch_take_bath(0.5)` (0.25 if cuffed) + a little EXP | G/Batch/Command_Bath.rb:2-6, :15-26 |
| Inn total | dirt -> 0 (forced), body cum x1/16, groin cum x0.81, the five states erased | NoerTavern_Nap.rb:134-135 |
| Water spot / Water Trough "Bathe" | HCGframes/Command_bath.rb: the scene (strip, spotted check, mood loss if seen, sta -15) | G/HCGframes/Command_bath.rb:6-71; M/90_Furniture.rb:170, :1128-1130 |
The game has no "filthy" state other than DirtState (dirt/100) and EffectWet; "smell" is dirt itself.
### 1.5 Sickness (the only "cold-like" state)
`FeelsSick` (G/Effects/States/FeelsSick.json): max 3 stacks, daily (one stack goes each nap), stamina max x0.9,
stamina drain 0.3 x stacks per step (E/100_Game_Player_handle_on_move.rb:301-303). The game already gives it
on a nap at satiety <= 1 on Hardcore (50 %, same JSON `player_nap_get_state_when`). No cold/weather state exists.
### 1.6 The danger roll
`WildDangerous += clamp(rand(10) + WorldDifficulty/2 - survival*2, 10, 50)`; a group comes if
`WildDangerous >= rand(100) + survival` (E/34_Functions_RegionMap.rb:237-245). WildDangerous persists on the map,
-50 when the group is cleared (:1860), 0 on map change (E/34_Functions_ChangeMap.rb:184). The mod adds the base
bonus `min(10, value/10)` the same way (M/120_Raids.rb:500-511). Raiders spawn only outside the walls
(M/110_Bases.rb:1484-1509). Homes have no NapEvent, so no roll there.
### 1.7 Food: what a "cooked dish" is
The game has no "cooked" flag: dishes carry tags like `RawMeat` / `RawPlant` (for rotting) and most carry `pot_data`
(they can go back into the pot: SopGood `{"Fat":1}`, SmokedMeat `{"Fat":2,"SmokedMeat":1}`), so neither tag nor
pot_data separates dish from ingredient. The one clean source is the dark pot's recipe OUTPUTS: the live pot runs
`$data_AlchemyRecipes` (E/29_Functions_DarkPot.rb:494-498, loaded from G/Effects/Alchemy/*.json by F/103_FileGetter.rb:526-544;
the hard-coded pot in E/29_Functions_DarkPot.rb:3-290 is commented out). Food recipes live in
`2000_darkPot_UniqueFoodFormula.json` and `6000_darkPot_MeatAndSoups.json`.
PROPOSED definition: **a cooked dish = an output of a food recipe (files 2000 and 6000) whose item type is "Food"**
(item type from `tag_main_settings.type`, F/Modules/ItemConfig.rb:121-126). The inn has no meal items (the meal is
`sat = max`, NoerTavern_Nap.rb:133), so it adds nothing to the list.
| Item (item_name) | Item JSON (G/Effects/Items/) | Satiety | Mood | Side effect when eaten | Default eatable from chest |
|---|---|---|---|---|---|
| ItemMeatSalad (rgss 153) | food_SF_MeatSalad.json | 80 | +40 | DailyPlusHealthy | yes (*) |
| ItemSopGood (good soup) | food_SoupLv2.json | 32 | +20 | - | yes |
| ItemSmokedMeat | food_SmokedMeat.json | 26 | - | - | yes |
| ItemSopMeat (meat soup) | food_SoupLv1_meat.json | 16 | +10 | - | yes |
| ItemSopPlant (plant soup) | food_SoupLv1_plant.json | 16 | +10 | - | yes |
| ItemDryFood | food_DryFood.json | 16 | - | - | yes |
| ItemSopGoodMystery | food_MysticGoodCook.json | 24 | - | FeelsSick (95 %) | no (knob) |
| ItemSmokedMeatMystery | food_SmokedMeatMystery.json | 18 | - | FeelsSick | no (knob) |
| ItemSopMeatMystery | food_MysticCook.json | 12 | - | FeelsSick | no (knob) |
| ItemSopGoodHuman | food_HumanGoodCook.json | 32 | +20 | Cannibal: mood -100 | no (knob) |
| ItemSmokedMeatHuman | food_SmokedMeatHuman.json | 32 | - | Cannibal | no (knob) |
| ItemSopMeatHuman | food_HumanCook.json | 16 | +10 | Cannibal | no (knob) |
| ItemSopGoodHumanMystery | food_HumanMysticGoodCook.json | 24 | - | Cannibal + FeelsSick | no (knob) |
| ItemSmokedMeatHumanMystery | food_SmokedMeatHumanMystery.json | 18 | - | Cannibal + FeelsSick | no (knob) |
| ItemSopMeatHumanMystery | food_HumanMysticCook.json | 12 | - | Cannibal + FeelsSick | no (knob) |
Not dishes (excluded): ItemJunkFood (pot output but type FoodBad, sat 1); ItemCheese (pot output of
7000_darkPot_ToolsAndOthers.json from Milk, sat 32: a processed food, not in a food-recipe file; owner choice C7);
ItemDryProtein (FoodSemen); Bread, Sausage, fruit, vegetables, nuts, raw meat, fish, herbs, milk, beer (ingredients
or bought goods, never pot outputs).
(*) Game data bug: food_SF_MeatSalad.json:2 has `"ItemOil": "ItemMeatSalad"` instead of `"item_name"`, so the name
may not be registered (ItemConfig.rb:118); match it by `$data_items[153]`.
Satiety values are the first `use_item_effect` entry with `attribute_name "sat"` and no `stats_key` (ItemConfig.rb:296-317;
read at runtime from `item.use_item_effect`, F/25_Game_Actor.rb:1372-1377).
### 1.8 Chests, bath pieces, beds (the mod)
| Piece | Kind key / item | Facts | File:line |
|---|---|---|---|
| Bed, Dark Bed (2x2 double), Blue Bed | Bed / BedDark / BedBlue | `:sleep`, solid: Lona sleeps BESIDE it, never on it | M/90_Furniture.rb:76-78, :600-605 |
| Bedroll | kind "PottedPlant" (ItemLonaCraftFurniturePottedPlant, ENG name "Bedroll") | `:sleep`, `:walk` (Lona may stand on it) | M/90_Furniture.rb:108; Text/ENG/Furniture.txt:347-354 |
| Chest, Wardrobe | `:storage` | own box id from 66000 (`rec["box"]`) | M/90_Furniture.rb:79-80, :164, :759 |
| Water Trough | `:bathe` | runs the water-spot bath scene | M/90_Furniture.rb:88, :1128-1130 |
| Wash Tub | no action today | pick up only | M/90_Furniture.rb:87 |
| Box contents | `Hash{RPG::Item => count}`; `remove_item(item, n, box_id)` | F/203_Storage Boxes.rb:87-92, :129-138, :427-429 |
| Records | `$game_system.lonacraft_data["furniture"]`, `rec["map_id"] == map.map_id` | M/90_Furniture.rb:504-528, :779-784; base: M/110_Bases.rb:2523-2527 |
"Inside the walls" today: `Bases.inside_tiles(map, rec, rm)` = walkable tiles inside the base's bounds that a flood
from the play-area edge and the exit ring cannot reach, doors counted closed, wall tiles excluded, on the sewer the
black ceiling excluded (M/110_Bases.rb:1561-1631). Furniture are events, not tiles, so a bed's floor tile is counted
(the flood uses tile passability, M/110_Bases.rb:1634-1638).
## 2. Design (PROPOSED)
### 2.1 Three tiers
| Tier | When | Recovery | Mood | Dirt / sickness | Raid roll |
|---|---|---|---|---|---|
| GROUND | a nap with no bed: the Shift nap skill anywhere on a field or base map, or a bed that is none of the below | stamina gain x0.6 and capped at 80 % of max; health GAIN x0.5 (hunger damage unchanged) | -10 | dirt +15 on top of the +26; 10 % chance of 1 FeelsSick stack | WildDangerous +10 before the roll (kept, like the game's own increment) |
| BEDROLL | the Bedroll's "Sleep", or the Shift nap while standing on a Bedroll, or the game's own camp bed (PlayerBed) | plain nap | plain | plain | plain |
| BED | a Bed / Dark Bed / Blue Bed whose own tile is inside the walls (or any bed in an owned home) | health and stamina set to max BEFORE the nap math (as the inn, NoerTavern_Nap.rb:131-132); no satiety refill | +10 | plain | WildDangerous x0.75 for this roll only (not kept) |
A Bed standing outside the walls counts as BEDROLL. Towns, dungeons, quest and captured naps are untouched
(guard: OnRegionMap >= 1 or a base / owned home map, and `Captured == 0`, `RapeLoop == 0`).
Mood steps of 10 match the game's own nap steps (E/97:192-200); "1" would be invisible on the -100..100 scale.
Worked example, vanilla math, stamina 0, health 100, satiety 50:
| Tier | Stamina | Health | Satiety after | Mood | Dirt | Sick |
|---|---|---|---|---|---|---|
| GROUND | 80 (gain 95, cap 80) | 105 | 32 | 0 | +41 | 10 % |
| BEDROLL | 100 | 110 | 32 | +10 | +26 | - |
| BED | 100 | 200 | 32 | +20 | +26 | - |
| BED + dish in chest | 100 | 200 | 82 | +40 | +26 | - |
| BED + dish + trough | 100 | 200 | 82 | +40 | 0 -> 26 | - |
| Inn (reference) | 100 | 200 | 82 | +30 | 0 -> 26 | - |
At satiety 20 the ground stamina is 59 (bedroll 99); at satiety 0 it is 35 (bedroll 59). With RolePlayS (single
stamina gain) ground at satiety 50 gives about 48.
Raid chance per nap 1..6 on one field map (40,000 runs, WorldDifficulty 30, survival 5, cleared raid = -50,
same model as docs/RESEARCH_RAIDS.md:130-135; scratch simulation):
| Base bonus | BEDROLL (plain) | GROUND +10 kept | GROUND x1.5 roll | BED x0.75 roll | BED -10 kept |
|---|---|---|---|---|---|
| 0 (no base) | 7 17 25 28 28 28 % | 17 34 42 44 46 45 % | 12 27 35 35 34 34 % | 4 12 18 22 23 24 % | 7 8 9 9 10 10 % |
| 3 (value 30) | 10 22 30 33 33 34 % | 20 39 45 49 50 51 % | 17 34 41 40 39 40 % | 6 16 23 26 28 29 % | 7 11 14 16 18 18 % |
| 10 (value 100+) | 17 34 42 44 46 46 % | 27 50 57 60 63 63 % | 27 50 52 52 53 51 % | 12 26 33 37 40 41 % | 7 17 24 28 28 28 % |
Recommendation: GROUND +10 kept (clearly riskier, same mechanism as the base bonus); BED x0.75 on this roll only
(a modest cut; "-10 kept" would almost erase raids at small bases). The Deep Sewer roll (35/60 %, not WildDangerous)
stays as it is in this build (C9).
### 2.2 Food from a chest (R14)
| Rule | PROPOSED |
|---|---|
| Who | BED tier only (knob `food_on_bedroll` false) |
| Where from | storage pieces (`kind[:storage]`) on this map whose own tile is inside the walls (owned home: any chest on the house map). Never Lona's bag. |
| What counts | cooked dishes only (1.7): default the six plain dishes; mystery and human dishes by knobs (off) |
| One meal | `meal_sat` = 30 points (about one good soup, 32; the nap itself takes 18, +12 on Hardcore, E/97:177-183) |
| Pick | the smallest single dish worth >= 30 (good soup 32 before meat salad 80); if none, add dishes from the largest down until >= 30 (e.g. smoked meat 26 + meat soup 16; or two soups 16+16). Chests in record order. |
| Not enough | fewer than 30 points of dishes inside the walls: nothing is taken, no refill (raw food is ignored even if present) |
| Effect | satiety to max BEFORE the nap math (as NoerTavern_Nap.rb:133), so Lona wakes at 82 like the inn. The dish's own mood/side effects are NOT applied (it is a meal, not an item use). |
| When taken | inside process_nap_change, i.e. only when the nap really happens (a refused nap during a raid takes nothing) |
| Text | queued popup after waking: "Lona ate a meal from the chest." / none when nothing was eaten |
### 2.3 Bath (R14)
| Rule | PROPOSED |
|---|---|
| Who | BED tier only (knob `bath_on_bedroll` false) |
| Bath piece | any piece whose actions include `:bathe` with its own tile inside the walls (owned home: on the house map). Give the Wash Tub the `:bathe` action (1 line, M/90_Furniture.rb:87) so it counts and can be used awake. |
| Effect | the inn's: 4 x `batch_take_bath(0.5)` (0.25 if cuffed) then `dirt = 0`, before the nap math (NoerTavern_Nap.rb:134-135; E/480_GameActorBatch.rb:4-25). No scene, no stripping, no spotted check, no stamina cost; the Batch script's small EXP is skipped (C8). |
| Text | "Lona washed before bed." in the same queued popup |
### 2.4 Scope
| Place | PROPOSED |
|---|---|
| Base on a field map | all three tiers; inside = `Bases.inside_tiles` |
| Field map without a base | GROUND for the Shift nap; game camp bed (PlayerBed) = BEDROLL |
| Old Shack, Stone House (owned) | the whole house map counts as inside walls: a placed Bed = BED; dish chest and trough on the house map apply |
| Rented inn room | unchanged: the inn script already gives the full rest; the mod skips while `Homes.nap_keys_active` is set (M/100_Homes.rb:789-794, :1382-1386) |
| Deep Sewer base | tiers apply; inside = the same flood (ceiling excluded); a pocket without walls is not inside, so a Bed there = BEDROLL; sewer roll unchanged |
| Towns, dungeons, quest/captured naps | untouched |
### 2.5 Interactions
| With | Effect |
|---|---|
| Raids (120) | nap refusal unchanged; tier danger added in an alias over the Raids alias of `region_map_wildness_nap_stats` (160 loads after 120); night-kept raid (`after_map_nap`) unchanged |
| Away raids / mercs (140/150) | none; an away raid that loots a chest may take the dishes |
| Maid (R13) | she cooks the best dishes from the food in chests inside the walls; her outputs are exactly the 1.7 dish list, which is what the bed meal eats. Raw food she has not cooked never feeds a nap. |
| Other mods | RolePlayS/Campsites/CustomDifficulty/BabyProtection hook process_nap_change; the mod measures deltas around the whole chain, so any of their math is scaled, not replaced |
| Save | nothing new (the tier is per nap; chest contents are already saved boxes) |
| Hardcore rot | mod chests never rot (E/97:128-135), dishes keep |
| Texts | Text/<lang>/Bases.txt: Rest/ate, Rest/bathed, Rest/ground (optional "Lona slept badly on the bare ground."), Rest/no_dish not shown (silent) |
| Config | `Config/Bases.json` section `rest` (2.6) |
### 2.6 Config `rest` (Config/Bases.json)
The config reader takes only numbers >= 0 (M/120_Raids.rb:230-238), so cuts are written as positive values.
| Key | Default | Meaning |
|---|---|---|
| enabled | true | whole feature |
| ground_sta_mult | 0.6 | ground stamina gain factor |
| ground_sta_cap_pct | 80 | ground stamina never above this % of max |
| ground_health_mult | 0.5 | ground health GAIN factor |
| ground_mood | 10 | mood taken on the ground |
| ground_dirt | 15 | extra dirt on the ground |
| ground_sick_chance | 10 | % chance of 1 FeelsSick stack |
| ground_danger | 10 | WildDangerous added before a ground roll |
| bed_mood | 10 | mood given in a bed inside walls |
| bed_roll_mult | 0.75 | WildDangerous factor for a bed roll (this roll only) |
| meal_sat | 30 | satiety points of dishes that make one meal |
| food_on_bedroll | false | chest meal on a Bedroll too |
| bath_on_bedroll | false | bath on a Bedroll too |
| mystery_dishes | false | allow mystery-meat dishes |
| human_dishes | false | allow human-meat dishes |
## 3. Build breakdown
Hook choice: one stat hook, `Game_Actor#process_nap_change` (E/97:63), reached by every nap through handleNap
(OM.rb:23); one capture hook pair, `Game_Map#call_nap_event` (F/31_Game_Map.rb:1305) and `GIM_OM#handleNap`
(OM.rb:12), where Command_AreaNap.rb:75 / Command_Nap.rb:10 hand over; one roll hook,
`GIM_ADDON#region_map_wildness_nap_stats` (E/34:237).
Tier detection: the furniture `:sleep` action records the piece (uid, kind) as "pending" before it loads
Command_AreaNap.rb (alias of `lonacraft_furniture_action`, no edit in 90). At `call_nap_event` / `handleNap`, if
nothing is pending, the running event (`$game_map.interpreter.event_id`, F/40_Game_Interpreter.rb:24) named
"PlayerBed" -> BEDROLL; else Lona's tile under a Bedroll record -> BEDROLL; else GROUND. Pending holds map id
and Lona's x,y and is dropped when they differ or after the nap (a refused or cancelled nap leaves nothing behind).
BED needs the bed record's tile in `Bases.inside_tiles` (base map) or an owned home map.
| Item | Files | Rough size |
|---|---|---|
| B1 Rest core | NEW M/160_Rest.rb: tier capture (3 aliases), `process_nap_change` alias (before: bed restore, chest meal, bath; after: ground scaling, mood, dirt, sickness), `region_map_wildness_nap_stats` alias (ground +danger kept, bed x0.75 temporary), dish list + picker, queued popups + Scene_Map flush (as M/100_Homes.rb:479-491, :1103-1112); loader.rb line after 130 | ~280 lines |
| B2 Config | M/120_Raids.rb: DEFAULTS `"rest"` + `merge_user` case (:256-280); Config/Bases.json comment block; Bases_defaults.json regenerates. AFTER the M1 builder hands 120 back. | ~35 lines |
| B3 Wash Tub + texts | M/90_Furniture.rb:87 add `:bathe`; Text/<5 langs>/Furniture.txt WashTub/menu gets "Bathe"; Text/<5 langs>/Bases.txt Rest/* lines; README "Furniture" (Wash Tub, beds), "Homes" (bed rest at home), "Raids" (ground/bed roll) | ~40 lines |
| B4 Self-test + checks | M/98_SelfTest.rb: methods exist (process_nap_change, handleNap, call_nap_event, region_map_wildness_nap_stats, batch_take_bath), dish items resolve ($data_ItemName / $data_items[153]); static checks; owner checklist (ground vs bedroll vs bed numbers in the console, meal taken from the chest, trough clean) | ~30 lines |
## 4. Choices for the owner
| # | Question | Options | Recommendation |
|---|---|---|---|
| C1 | Ground recovery | (a) stamina x0.6 + cap 80 %, health gain x0.5; (b) x0.6 / x0.5 without the cap; (c) cap only | (a): without the cap a fed Lona still wakes almost full on the ground |
| C2 | Ground extras | (a) mood -10, dirt +15, 10 % FeelsSick; (b) only mood and dirt; (c) none | (a) |
| C3 | Ground danger | (a) +10 WildDangerous kept; (b) x1.5 on the roll only | (a) |
| C4 | Bed danger | (a) x0.75 on the roll only; (b) -10 kept; (c) none | (a) |
| C5 | Bed restore when starving | (a) full restore anyway (hunger still costs 20 health, mood, satiety stays low); (b) no restore at satiety 0 | (a), the inn order |
| C6 | One meal | (a) dishes worth >= 30 points; (b) any one dish; (c) points = the nap's own drop (18, 30 on Hardcore) | (a) |
| C7 | Cheese | (a) not a dish; (b) counts (pot output from milk, 32) | (a) |
| C8 | Bath EXP | (a) skip the Batch script's EXP; (b) keep it (4 small gains like the inn) | (a) |
| C9 | Deep Sewer roll | (a) unchanged; (b) ground +10 / bed -25 % on its 35/60 % | (a) |
| C10 | Food and bath on the Bedroll | (a) Bed only; (b) any sleep inside the walls | (a): the Bed is the "inn rest at home" |
| C11 | Mystery / human dishes | (a) off (side effects skipped would make them free food); (b) on | (a) |
| C12 | Wash Tub | (a) gets the Bathe action and counts; (b) only the Water Trough counts | (a) |
@@ -0,0 +1,188 @@
# R9 Sewer bases (research)
Board item R9 (owner, 2026-10-06): "I want some sewer maps as well. Sewer maps that can be built on
with our new systems. ... It should function as a dangerous place, that Lona can live at if she
has no money." Research and design only; options PROPOSED with one recommendation each.
Short forms: `F/` = `Data/Scripts/Frames/`, `E/` = `Data/Scripts/Editables/`, `HCG/` =
`Data/HCGframes/`, `LC/` = `ModScripts/_Mods/LonaCraft/Scripts/`. Map facts from the `.rvdata2`
files (scratchpad `r3/map053_events.txt`, scripts in `r3/`). Renders: scratchpad `r3/`.
## 0. Summary
| Question | Finding | PROPOSED |
|---|---|---|
| The game's sewer | One map, Map053 NoerSewer (tag map `event=NoerSewer`, 100 x 70, tileset 19): the new-game start, two quests, rats and roaches every entry, hobos after day 15; walkways 1-2 tiles wide beside sewage channels, largest open square 4 x 4 | not a good building site |
| Tileset | tileset 19 "Mack-Sewer" (and 20 "Mack-Tomb" for the catacomb cellars) use `macks_A3`: the palisade kind 70 is there, so today's Palisade already draws; the A5 sheet `macks417_Tomb_A5` is not in the floor table | add a Stone Wall piece (macks_A3 kind 77, grey stone) and the floor row `macks417_Tomb_A5 => 1570` |
| How to make a sewer buildable | A on the game's map / B the mod's own sewer map / C sewer field maps behind world-map tiles | **B**: one mod sewer map ("Deep Sewer") reached by a ladder in the game's sewer, base keyed by map name |
| Danger | nap raids with a "sewer" scenario (rats, hobos, breedlings), more at night, spawns from the tunnel mouths | numbers in 3.3 |
| Live there with no money | free entry, free nap point, everything else brought or made by hand | 3.4 |
| Build | 4 items, about 700 lines + 1 generated map | 5 |
## 1. The game's sewers
### 1.1 Maps
| Map | Name / tag | Size | Tileset (sheets A1 / A2 / A3 / A4 / A5) | Entered | Notes |
|---|---|---|---|---|---|
| 53 | NoerSewer / `event=NoerSewer`, `isUnderGround=true` | 100 x 70 | 19 Mack-Sewer: macks417_sewer_A1 / macks417_Sewer_A2 / macks_A3 / macks417_Tomb_A4 / macks417_Tomb_A5; B-E TileC_exterior417Ver, 417Mixupedd-slum, TileD_exterior2, macks417_badland_E | world-map point `-point-NoerSewer` (32,96), inside Noer's walls; the new game starts here | this report's subject |
| 60 | NoerCatacombB1Grind / `event=NoerCatacombB1Grind`, underground | 70 x 90 | 20 Mack-Tomb (same A1, A3, A4, A5 as 19; A2 macks417_Tomb_A2) | from the catacomb | catacomb cellar, same look |
| 66 | NoerCatacombB1 / `event=NoerCatacombB1`, underground | 70 x 90 | 20 Mack-Tomb | from the catacomb | same |
| 20 | NoerCatacomb / `event=NoerCatacomb` | 100 x 100 | 24 RMDLC CatacombOuta (outdoor graveyard) | world map | not sewer-like |
| 129 | NoerDockC1 (dock cellar) | 100 x 100 | 26 RMDLC INSA BSS (interior) | dock | an interior, not sewer-like |
### 1.2 Entry, exit, state (Map053)
| Point | Evidence |
|---|---|
| World-map point (32,96): "enter?" then `change_map_enter_tag("NoerSewer")`. Always open; `QuProgSewerKickMobs == 1` only shows a quest balloon | Map002 event 3 |
| A tag map: `$data_tag_maps["NoerSewer"].sample`, only Map053; not a region map | `E/34_Functions_ChangeMap.rb:200-215`; Map053 note |
| New game, game over and the credits start here | `F/5_DataManager.rb:601`, `:625`; `F/118_Scene_Gameover.rb:154`; `E/121_Scene_MapCredits.rb:920` |
| Reloaded fresh on every entry (`Game_Map#setup` loads the file); the BIOS rolls again (`ReRollHalfEvents` = 1) | `F/31_Game_Map.rb:172`; `E/34_Functions_ChangeMap.rb:214` (`change_map_story_stats_fix`) |
| `isUnderGround`: underground light | `F/31_Game_Map.rb:288`; `E/70_Game_Map_DayNightAndOvermap.rb:41` |
| Exits: the ladder (33,21) back to Noer, with the tutorial skip prompt on the first visit; the east tunnel to OrkindCave1 once the goblins were seen | `HCG/event/NoerSewerToNoer.rb:2-27`; `HCG/event/NoerSewerToOrkindCave1.rb:2-34` |
| Leaving the first time arms the hobo clock: `RecQuestSewerHoboAmt` = date + 15 days | `NoerSewerToNoer.rb:14`, `:24` |
| Quest "kick the hobos out" offered at the guild board after that date; done -> clock + 15 days again | `HCG/event/NoerTavernQuestBoard.rb:19`; `HCG/event/NoerTavernGuildEmpolyee.rb:171-178` |
| Nap (event 43): once the hobos have settled and one is alive, the nap is the hobo capture scene (rape loop, gear dropped, `HumanCave_NapGangRape.rb`); otherwise a plain `handleNap` | `HCG/event/NoerSewer_Nap.rb:2-14`, `:17-60`, `:63-71` |
| Storage chests: boxes `map_id` and `map_id + 1000` (a rake and a short sword at first) | Map053 event 1 |
### 1.3 What lives there (Map053 event 1, BIOS, every entry)
| Spawn | Count | Where | Condition |
|---|---|---|---|
| WildGiantMice (race Abomination, health 20) or the first-quest version | 8 / 10 | `region_map[1].sample` | always (first visit: quest version) |
| AnimalRoach + AnimalRattus (vermin) | 5 + 5 | `region_map[1]` | always |
| MobHumanCommoner / MobMootCommoner (hobos, health 130) | 1, or 2 + 2 while the quest runs | `region_map[1]` | after the hobo date |
| GoblinCommoner x 3 (static, the goblin room) | 3 | events 18-22 | story |
| SewerMootMother / SewerMootKid, Sandbag, traps x 4 | | events 36, 44, 71-75 | story / tutorial |
Group race for naps after the hobo date: `OnRegionMapSpawnRace = "BanditMobs"` (Map053 event 1).
NPC stats: `Data/NPCdata/WildGiantMice.json`, `WildAnimalRattus.json`, `MobHumanCommoner.json`,
`GoblinCommoner.json`.
### 1.4 Layout (Map053; `r3/sewer_map053_play.png`, regions `r3/sewer_map053_regions.png`)
| Measure | Value |
|---|---|
| Walkway tiles reachable from StartPoint (walkable, not A4 ceiling) | 335 |
| Walkways | 2 tiles wide along sewage channels (A1 kind 14, impassable), bridges and stairs between |
| Largest open square / rectangle | 4 x 4 (goblin room, (70,49)) / 14 x 2 (start corridor) |
| Regions | 1 = walkway spawn list (183, all spawns), 2 = channels (310), 3 = goblin room (41), 50 = start area (26) |
| Exit ring | none: region 1 is the SPAWN list here, not an exit ring; exits are events |
Consequence for `LC/110_Bases.rb`: its edge zone treats region 1 as the exit ring
(`LC/110_Bases.rb:885`, `:1110`), which on Map053 would refuse every walkway. Any sewer support
needs the edge rule per map kind.
## 2. Tilesets
### 2.1 Tileset 19 Mack-Sewer (`r3/sewer_a1_a2_a5.png`, `r3/sewer_a4.png`, A3 = `r3/a3_rings_1.png` macks_A3)
| Part | Content | Passable / tag |
|---|---|---|
| A1 macks417_sewer_A1 | 16 water kinds: sewage (14, olive sludge, the map's channels), dark water, blood, lava; animated like all A1 | all X, tag 0 |
| A2 macks417_Sewer_A2 | dirt, gravel, cobble, rubble, moss, blood floors, rails | O except 34 and 41 |
| A3 macks_A3 | 32 kinds: log palisade 70 (today's Palisade), grey stone blocks 77, beige brick 75, plank walls 73 | all X, tag 4 |
| A4 macks417_Tomb_A4 | stone sewer walls: tops 80-87 / 96-103 / 112-119, faces 88-95 (mossy stone, 92 used by the map), 104-111, 120-127 (123 used); top 115 = the map's black ceiling | tops O, faces X; tag 4 (top 96-103 partly 0) |
| A5 macks417_Tomb_A5 | same layout as macks_A5: planks 1568-1570 (1570 crosswise), flagstone 1584-1586, sewer floor 1554 (used 294 times) | all O but 1536 |
| B-E | TileC_exterior417Ver, 417Mixupedd-slum, TileD_exterior2, macks417_badland_E: crates, barrels, bones, grates, pipes as the map uses | |
Tileset 20 Mack-Tomb uses the same A1, A3, A4 and A5 sheets (only A2 differs), so the same table rows work there.
### 2.2 Pieces in a sewer
| Piece | Today | PROPOSED |
|---|---|---|
| Palisade Wall | draws: `macks_A3` is in the wall table (`LC/110_Bases.rb:881`, kind 70); looks like a log fence underground | keep (it is the cheap wall) |
| Stone Wall (new) | none | A3 grey stone blocks: macks_A3 77 (rendered); for the other sheets e.g. TileA3 57, Outside_POOR_A3 61, TileA3Abom 57, to be picked from `r3/a3_rings_*.png` (a second table, same 16-shape code); recipe 3 Stone Block + 1 Rope (Stone Block = 2 Rough Stone at the pot, `LC/30_Process.rb:35`); bench only |
| Plank Floor | refused: `macks417_Tomb_A5` is not in the floor table (`LC/110_Bases.rb:883-884`) | add `"macks417_Tomb_A5" => 1570` |
| Wooden Door | works (event, no tile) | keep |
Mock-up: `r3/sewer_chamber_mock.png` (left Stone Wall + planks, right today's Palisade + planks,
a sideways door in the west wall).
## 3. Making a sewer buildable
### 3.1 Options
| | A. The game's sewer (Map053) | B. The mod's own sewer map (PROPOSED) | C. Sewer field maps behind world-map tiles |
|---|---|---|---|
| How | allow bases on the tag map `NoerSewer`; record keyed by map name | a generated map "Deep Sewer" (tileset 19) with tunnels, sewage channels and 2 chambers (about 12 x 9 and 10 x 8); a ladder event added to Map053 leads down, its own ladder back | new region-style sewer field maps (`region=` note) behind new region tiles on the world map |
| Room to build | 4 x 4 at most; walls would cut the quest paths (goblin room, cave tunnel) | designed chambers | as designed |
| Game state | new-game start, quest maps, hobo capture nap (`NoerSewer_Nap.rb:2-60`): building on it mixes with story events; a death or new game drops Lona here | untouched; Map053 only gets one ladder event (injected like the home doors, `LC/100_Homes.rb:1262-1304`) | untouched |
| Base system | needs map-name keying; region 1 is a spawn list, so the edge rule breaks (1.4) | needs map-name keying (as A) and the map's own spawn and edge regions, painted by us | works unchanged (pin, revert, marker, raids) |
| Where | inside Noer's walls (the world-map point at (32,96)) | under Noer, through the game's sewer: no world-map change | world-map tiles inside Noer are refused by the allowed rule (`LC/110_Bases.rb:181`, walled boxes); outside the walls a "sewer" is odd; new region tiles on Map002 mean editing the world map at runtime |
| Danger | the game's: rats every visit, hobos after day 15, capture nap | ours: tunnel spawns + sewer raid scenario | the raid scenarios |
| Effort | small code, big conflicts | 1 map + about 700 lines | several maps + world-map edits |
Recommendation: **B**.
### 3.2 The Deep Sewer map (PROPOSED)
| Part | Spec |
|---|---|
| File | `Maps/DeepSewer.rvdata2`, generated by a script like the Stone House builder (tiles from Map053: sewage A1 14, walls A4 92 / ceiling 115, floor A5 1554, B-E clutter) |
| Size | about 60 x 45; 2 chambers (12 x 9, 10 x 8) of plain floor, 2-tile walkways along sewage channels, 3 tunnel mouths |
| Regions | 1 = tunnel-mouth spawn tiles (the edge zone keeps 2 tiles clear of them), 2 = walkways (vermin spawns), 0 = chambers (no spawns), so the whole chamber is buildable |
| Events | BIOS (underground light, `NoerSewer_begin.rb` look: music, shadows), StartPoint at the ladder, the exit ladder (back to Map053, next to the ladder down), NapEvent with the field-map command `region_map_wildness_nap` (so `LC/120_Raids.rb` hooks it) |
| Entry | a ladder event injected into Map053 on a dead-end walkway (south branch near (50,52), off the quest paths); "Climb down into the deep sewer? Leave / Climb down" |
| Map number | fixed, as the homes (`LC/100_Homes.rb:90`, 546-576): e.g. 9101 |
### 3.3 Danger (PROPOSED numbers)
| Point | Value | Evidence / note |
|---|---|---|
| Every entry | vermin as Map053: 6 WildGiantMice + 4 AnimalRoach + 4 AnimalRattus on region 2; at night +2 hobos (MobHumanCommoner / MobMootCommoner) on region 1 | Map053 event 1 |
| Nap danger | raid chance per nap 35 % by day, 60 % at night (the field maps roll `WildDangerous` against rand(100) + Survival, `E/34_Functions_RegionMap.rb:237-246`); base value bonus as `LC/120_Raids.rb` | |
| Raid scenario "sewer" (new row in `LC/120_Raids.rb` scenarios, chosen by the record's `kind`) | CommonMobs 50 (hobos), AbomBreedlingRaid 30 (breedlings), rats 30 (a mod group: 6-10 WildGiantMice), UndeadWalking 10 | groups from `E/34_Functions_RegionMap.rb:361-1115`; group scripts `HCG/encounter/CommonMobs.rb`, `AbomBreedlingRaid.rb` |
| Spawn | from the tunnel mouths (region 1), never inside the chambers' walls (the R8 enclosure rule) | `LC/110_Bases.rb:1078`, `:1159` |
| Grace | 5 s (tunnels are close) | |
| Disease / filth | the game has no sewer status effect (grep of `Data/Scripts` for sewer finds only the new-game code); none PROPOSED for now | |
### 3.4 Living there with no money
| Need | In the Deep Sewer |
|---|---|
| Entry, rent | free, no owner, no purchase |
| Sleep | the map's NapEvent (sleep anywhere, plain `handleNap`, raids possible); a Bedroll is craftable by hand and at the bench (`Recipes/Furniture_PottedPlant.json`, 2 Hide + 1 Rope) |
| Food, cooking | none there: bring food; the Cooking Fire is craftable by hand (`Recipes/Furniture_Campfire_Hand.json`); giant rats drop Raw Meat (`Data/NPCdata/WildGiantMice.json` drop_list `ItemRawMeat` 100) |
| Water | none (the sewage is impassable A1, no drink event): bring water. Option for later: a "dirty water" spot (drink, chance of sickness) |
| Storage | placed chests (per piece, `LC/90_Furniture.rb` records) |
| Materials | Planks from Wooden Clubs (by hand), Rope from plants; Stone Wall needs Stone Block (Rough Stone from boulders, `LC/45_Nodes.rb:62`) |
## 4. Persistence (tag-map bases)
| Point | PROPOSED |
|---|---|
| Record | same `lonacraft_data["bases"]` list; `"kind" => "sewer"`, `"key"` = the map file key, `"map_no"` = the fixed number, `"om" => nil`, `"region"` = a scenario id (e.g. 90) |
| Lookup | `record_for_map` already matches by key (`LC/110_Bases.rb:135`); `can_build_here?` (`:208`) gains "a fixed base map" (the Deep Sewer) beside the region-entry rule; no pin needed (the map is always the same) |
| Furniture | per map number, as now (`LC/90_Furniture.rb` records) |
| Edge zone | per map: on the Deep Sewer the zone is region 1 (tunnel mouths) + the map border, as now; Map053 itself is never a base map |
| Marker | none on the world map (the sewer is not a world-map tile); optional: a small sign event beside the Map053 ladder when a Deep Sewer base exists |
| Revert | the last piece and furniture gone -> the record goes; the map stays as it is (still dangerous) |
| Destroy-all | as now (pieces not refunded, furniture back with chest contents) |
| Save | the map number is fixed, so pieces and furniture keep their map across saves |
## 5. Build plan (PROPOSED)
| Item | What | Files | Lines (rough) |
|---|---|---|---|
| S1 | Deep Sewer map (generator script, tileset 19, regions, BIOS, NapEvent, ladders) + registration with a fixed number | `Maps/DeepSewer.rvdata2`, `LC/130_Sewer.rb` (new) | 150 + map |
| S2 | Ladder injected into Map053, entry and exit, texts | `LC/130_Sewer.rb`, `Text/<lang>/Sewer.txt` | 120 |
| S3 | Fixed-map bases: `kind` field, `can_build_here?` for the Deep Sewer, per-map edge rule, floor row `macks417_Tomb_A5`, Stone Wall table | `LC/110_Bases.rb` | 120 |
| S4 | Stone Wall piece (item, recipe, icon, build-mode list) | `LC/0_Core.rb`, `Item/`, `Recipes/`, `LC/110_Bases.rb` | 80 + data |
| S5 | Sewer scenario and vermin group in raids; nap trigger on a tag map (`region_map_wildness_nap_stats` only runs when `OnRegionMap >= 1`, `E/34_Functions_RegionMap.rb:1832`, so the sewer NapEvent sets it or calls the raid roll directly) | `LC/120_Raids.rb`, `Config/Bases.json` defaults | 200 |
Reused unchanged: tile paint and autotile, build mode, doors, enclosure spawn rule, siege driver,
furniture in bases, Destroy-all.
## 6. Choices for the owner
| # | Choice | PROPOSED |
|---|---|---|
| 1 | Where: A the game's sewer / B the mod's Deep Sewer / C sewer tiles on the world map | B |
| 2 | Entry to the Deep Sewer: a ladder inside the game's sewer / a new world-map point near the slums | the ladder |
| 3 | A Stone Wall piece (3 Stone Block + 1 Rope, bench) | yes |
| 4 | Danger: nap raid 35 % day / 60 % night, scenario CommonMobs 50 / Breedlings 30 / rats 30 / Undead 10, vermin every entry | as listed |
| 5 | Water: bring it / a dirty-water spot later | bring it for now |
| 6 | More than one Deep Sewer map later (variety) | one now |
@@ -0,0 +1,203 @@
# R1: LonaCraft beside RolePlayS (RPS 0.7.8.8, LonaRPG B.0.10.8.26)
Research only. No mod file was changed. Paths: `RPS/` = `ModScripts/_Mods/RolePlayS/`,
`LC/` = `ModScripts/_Mods/LonaCraft/`, `Game/` = `Data/Scripts/` unless a path says otherwise.
## Summary
| # | Finding | Severity |
|---|---|---|
| 1 | The current order (LonaCraft 1, RolePlayS 2) drops LonaCraft Hide/Bone on boars and rabbits. The RPS quest skin still drops. | breaks owner rule |
| 2 | The current order crashes RPS's Assessment skill: LonaCraft's `show_npc_info` wrapper passes 4 args to the game's 3-arg method. | crash |
| 3 | With RPS first, both drops happen on the same kill and nothing in this report breaks. | fix |
| 4 | Item ids, tier variants and RPS map ids all depend on load order. The current LonaCraft-only saves would shift LonaCraft item ids by +39 once RPS loads first. | save migration |
| 5 | No same item_name, no same display name, and no same redirected script between the two mods. | none |
**Recommended order: RolePlayS before LonaCraft** (lower LoadOrder number). This is what LonaCraft
already expects (`LC/Scripts/0_Core.rb:95-96`, `LC/README.md:430-441`, `LC/loader.rb:3-4`).
## How load order works (`Game/Frames/RVscript/730_Mod_InGameUI_mod_manager.rb`)
| Fact | Evidence |
|---|---|
| `GameMods.ini` LoadOrder is sorted ascending: the lower number loads first. Ties go by mod id, and "LonaCraft" < "RolePlayS". | 730:208-215 |
| Each enabled mod's entry script runs in that order. | 730:70-74, 710_Mod_InGameUI_ClassMod.rb:97-108 |
| Every mod script is evaluated before the database loads. `DataManager.load_mod_database` runs at the end of `load_normal_database`. | 5_DataManager.rb:127, 182, 224-226 |
| A mod that loads later wraps `load_mod_database` around the earlier ones. The later mod calls the earlier one's version first and then runs its own body, so the later mod's data writes win. | RPS 0_CORE.rb:84-86; LC 0_Core.rb:261-268 |
| `$mod_load_script` is a plain hash, so the last writer wins. `load_script` redirects through it once per call. | 5_GLOBAL_SETTING.rb:19; 102_ScriptImport.rb:63 |
| `extra_map_register` assigns id = highest current id + 1. | 5_DataManager.rb:390-399 |
| New items get `id = $data_items.length`, and saves store party items as `{id => n}`. | RPS 0_CORE.rb:337-345; LC 0_Core.rb:175-178; 29_Game_Party.rb:351-358 |
| `"before": [X]` in mod M means "M loads before X". It is auto-sorted. | 730:141-152, 94-107; 710:33 |
| `"requires"` disables the mod when the required mod is missing or off, through `error=`, which sets `enabled=false`. | 730:166-182; 710:65-68 |
| On every start the INI LoadOrder is rewritten to 0..n. | 730:232-238 |
## Q1. RPS quest skins and LonaCraft Hide/Bone
### How RPS drops the quest item
| Step | Evidence |
|---|---|
| Quests "WildBoarSkin" (4 x Wild Boar Skin) and "RabbitSkins" (10 x Rabbit Skin) are taken at the guild board. | RPS/HCGframes/event/NoerTavernQuestBoard.rb:15-16, 65-74 |
| Accepting sets `$story_stats["QuProg<name>"] = 1`. | RPS/HCGframes/event/NoerTavernGuildEmpolyee.rb:334-335 |
| The items `AnimalSkinWildBoar` and `AnimalSkinRabbit` are Key items, used only for the turn-in. | RPS/Item/AnimalSkinWildBoar.json:2-8, AnimalSkinRabbit.json:2-8 |
| RPS overrides the NPCs and sets their `death_event`. **The drop_list is not used.** WildBoar and WildBoarF get `EffectWildBoarDed`; WildRabbit gets `EffectWildRabbitDed`. | RPS/NPC/WildBoar.json:17, WildBoarF.json:17, WildRabbit.json:17 |
| The death events, in the RPS EventLib `RPS/MapObject.rvdata2` (events 22 and 23), run `if $story_stats["QuProgWildBoarSkin"] == 1` and then `reserve_summon_event("AnimalSkinWildBoar")`; the rabbit event does the same. | decoded with rubymarshal |
| The pickup events, in `RPS/QuestObject.rvdata2` (events 1 and 2), delete themselves once Lona holds 4 boar skins or 10 rabbit skins, then call `optain_item`. | decoded |
| The turn-in takes every skin. | RPS/HCGframes/event/NoerTavernGuildEmpolyee.rb:257-265, 280-288 |
| The NPC objects are replaced wholesale: `$data_npcs[name] = <new object>`. | RPS/Scripts/0_CORE.rb:160-163 |
### How a kill drops
| Step | Evidence |
|---|---|
| `setup_dead_npc` calls `setup_drop_item` (the drop_list rolls) and **then** `summon_death_event`. The two calls are independent. | Game/Frames/39_Game_Event.rb:843, 847 |
| Each kill rolls `rand(max+1)+min` times from the bag. | 281_Game_NonPlayerCharacter.rb:974-981, 1089-1101 |
| The death event is summoned when `npc.death_event` is set. | 281_Game_NonPlayerCharacter.rb:843-846 |
| LonaCraft adds Hide/Bone copies to `$data_npcs[n].drop_list` for 10 animals. | LC/Scripts/0_Core.rb:67-78, 225-243 (called at :127 from the wrapper at :261-268) |
### Result per load order
| NPC (in HUNTING_DROPS) | RPS overrides | LC -> RPS (today's ini) | RPS -> LC |
|---|---|---|---|
| WildBoar | yes | LC Hide/Bone **lost**; quest skin drops | both drop |
| WildBoarF | yes | LC Hide/Bone **lost**; quest skin drops | both drop |
| WildRabbit | yes (also drop_amt 2-4 becomes 1-2, RPS/NPC/WildRabbit.json:77-78) | LC Hide/Bone **lost**; quest skin drops | both drop; about half the rabbit Hide (about 0.3 instead of 0.6 per kill) |
| WildAlphaPig, WildDog, WildDireWolf, WildHorse, WildApeM, WildApeF, WildApeF_Sneak | no | LC drops | LC drops |
Why: in LC -> RPS, RPS's wrapper runs LonaCraft's merge first and then replaces 3 NPC objects
(0_CORE.rb:160-163), which drops the merged lists. In RPS -> LC, LonaCraft merges into RPS's objects,
which keep `death_event`. The quest item and Hide never share a code path, an item name or an EventLib
event, so they cannot block each other. A boar kill with the quest active (fewer than 4 held) gives
1 skin plus about 9 rolls at 12% Hide and 6% Bone.
### Options
| Option | Change | Covers | Cost |
|---|---|---|---|
| **A (PROPOSED, recommended)** | In `UserData/GameMods.ini`, set RolePlayS below LonaCraft (e.g. RolePlayS 1, LonaCraft 2) and RolePlayS `Banned = 0`. Do not use equal numbers. | Q1, plus #2 and #4 below | no code; see the save note under Q3 |
| B (PROPOSED, hardening) | Also call `LonaCraft.merge_hunting_drops` from a `DataManager.load_normal_database` wrapper, after the original. That runs after every mod's `load_mod_database` in either order (5_DataManager.rb:127, 182). The merge is already idempotent (0_Core.rb:237). About 10 lines in LC/Scripts/0_Core.rb. | Q1 in both orders | fixes only the drop, not #2 or #4 |
| C (PROPOSED) | Alias `Game_Event#setup_drop_item` to roll Hide/Bone by NPC name at the kill. | Q1 in both orders | more code; the drop math moves out of drop_list |
| D | Add Hide/Bone to RPS/NPC/*.json. | Q1 | edits RPS; rejected |
Recommendation: **A**. B is optional insurance, worth it only if players might ignore the load-order warning.
## Q2. Every other collision
### (a) Items
| Check | Count | Evidence |
|---|---|---|
| Same `item_name` (LC 66 items vs RPS 360 Item/Weapon/Armor/Skill jsons) | 0 | all LC names start `ItemLonaCraft` (LC/Scripts/0_Core.rb:35-49) |
| Same English display name (LC 66 vs RPS 181) | 0 | LC/Text/ENG/Items.txt, Furniture.txt vs RPS/Text/ENG/DataItem.txt, DataEquip.txt |
| Overlapping meaning | 2 | "Hide" (LC/Text/ENG/Items.txt:11-12) vs "Wild Boar Skin" and "Rabbit Skin" (RPS/Text/ENG/DataItem.txt:236-244). Separate items, which is what the owner wants. |
| Shared id space (both append to `$data_items`, `$data_weapons`, `$data_armors`) | 1 | RPS appends 39 Items, 37 Weapons and 15 Armors (0_CORE.rb:316-349); LC appends 66 Items plus tier variants (0_Core.rb:163-182, 50_Tiers.rb:21-23) |
| Shared shop (both append to `NoerBlackSmithShopTrader`) | 1, harmless | RPS 0_CORE.rb:529-537, LC 0_Core.rb:86-93, 246-258 |
Item ids per session (game Items.rvdata2 has 306 entries):
| Session | LC items | RPS new items |
|---|---|---|
| LC only (current saves) | 306-371 | none |
| LC -> RPS | 306-371 | 372-410 |
| RPS -> LC | 345-410 | 306-344 |
### (b) Script redirects (`$mod_load_script`)
| Mod | Redirects | Evidence |
|---|---|---|
| LC | 3: NoerBankMaani.rb, NoerTavernWaifu.rb, NoerTavern_Nap.rb (the Command_DarkPot.rb -> Command_PotStation.rb redirect was removed in R2, 2026-10-06: pots are vanilla again) | 100_Homes.rb:100-107, 183, 954-972, 1033 |
| RPS | 39: 28 replaced game event scripts, 6 new event scripts, 2 replaced HCGframes (Command_AreaNap.rb, OverEvent_RebirthCheck.rb), 3 replaced Batch scripts | RPS/Scripts/0_CORE.rb:1707-1721; folders RPS/HCGframes, RPS/HCGframes/event, RPS/Batch |
| Same key in both | **0** | |
| Indirect, harmless | 2 | (1) LC beds run `Data/HCGframes/Command_AreaNap.rb` (LC/Scripts/90_Furniture.rb:163, 1063), which RPS redirects. The RPS copy differs from the game's only by a commented-out Save choice and a `save_tavern` flag. (2) The RPS mining node `StaticCrystalOre` (RPS/MapObject.rvdata2 event 98) loads `RPS/HCGframes/event/Mining_Mineral.rb`, and LC's check for `"/Mining_"` matches it (LC/Scripts/40_Mining.rb:57-65), so mining by-products still drop. |
The full RPS event list: CommonCatchMovingFish, CommonRockCrab, CommonSandBoxSetup, CommonTree,
CommonTreeApple, CommonTreeArecaNut, CommonTreeBanana, CommonTreeNoble, CommonTreeNuts,
CommonWildAnimalRattus, CompCommon, CompCommonBack*, CompElfArcher, CompFireMage*, CompMusketeer,
CompNinjaKiller, CompOrkindSlayer*, CompWarSister, DoomFortressInnCompHumanScout, Mining_Mineral*,
Mining_Phosphorus, Mining_Saltpeter, NoerMarketLisa, NoerTavernCompFireMage, NoerTavernCompHumanBow,
NoerTavernCompHumanExplorer, NoerTavernCompHumanWarrior, NoerTavernGuildEmpolyee, NoerTavernQuestBoard,
NorthFL_INN_CompMusketeer, PirateBaneInnCompHumanSpear, PlayerDryadGuard*, SewerSkipTutorial*,
SouthFL_INNCompWarSister. A `*` marks a script that is new rather than a replacement. RPS also maps
`CompDireWolf.rb` to CompCommon (0_CORE.rb:1721).
### (c) Maps
| Map | RPS | LC | Collision |
|---|---|---|---|
| OvermapMain (Map002) | Summons GroveIdlenessPath at (43,68) on every overmap (0_CORE.rb:1155-1159). Adds lines to `-point-NoerTavern` (33,100) (0_CORE.rb:1184-1201). | Doors at (23,100) and (31,100) (100_Homes.rb:146, 192) | none: different tiles and events |
| NoerTavern (Map059) | Adds lines to `-point-GuildEmpolyee` at (31,44) (0_CORE.rb:1166-1183). Overrides NPC UniqueGrayRat (`-point-UniqueGrayRat` at 29,40). | Room cleared inside (30..35, 27..33) plus (31,28) (100_Homes.rb:163-188, 1206-1258); no station any more (the tavern Carpentry Bench was removed 2026-10-06) | none: (31,44) and (29,40) are outside both areas |
| NoerBlackSmithShop (Map043), NoerMarket (Map062) | not touched (only NPC scripts and barter adds) | stations (90_Furniture.rb:147-149) | none |
| MinerPrison | Tag replaced by RPS/MinerPrison.rvdata2 (0_CORE.rb:138-139) | LC mining also catches the vanilla Map050 call (40_Mining.rb:13-17, 41) | none: the RPS mine uses Mining_Mineral.rb, which LC catches |
| New RPS maps: GrId_Path, GrId_Top, TitleHalloween, r1_PlainField4, r4_RainFroest4, r11_RoadPlain4, MinerPrison (7) | `extra_map_register` = highest id + 1 (0_CORE.rb:99-155) | LC houses at fixed ids 9001 and 9003 (100_Homes.rb:90, 546-573) | **1 (id allocation)**: in LC -> RPS, RPS maps get ids 9004-9010; in RPS -> LC they get 213-219, the same as RPS alone. Saves store the current map id. |
| Tilesets | 2 new names, ACJ_GroveI and GroveIdleness (RPS/Tilesets.rvdata2, keyed by name, 5_DataManager.rb:487-504) | uses the game tilesets | none |
| RPS/temp/NoerTavern.rvdata2 | not loaded (registration commented out, 0_CORE.rb:141-145) | | none |
### (d) Methods both mods hook or redefine
| Method | RPS | LC | Result |
|---|---|---|---|
| `GIM_ADDON#show_npc_info` | Redefined with a 4th parameter `access` (RPS/Scripts/29_Skill_Assessment.rb:120); called with 4 args at :106 | Aliased at **class** Game_Interpreter (100_Homes.rb:1497-1510) | **LC -> RPS: crash.** LC's class method captures the game's 3-parameter version (Game/Editables/29_Functions_417_Interpreter.rb:455) and hides RPS's module method, so the 4-arg call raises ArgumentError and every other call loses the RPS look. **RPS -> LC: works.** |
| `DataManager.load_mod_database` | alias, 0_CORE.rb:84 | alias, 0_Core.rb:263; 100_Homes.rb:1040 | Both chains work. The data order causes Q1 and (a)/(c). |
| `DataManager.make_save_contents` / `extract_save_contents` | alias, 10_Class_and_History.rb:76, 86 (`:hero_class_lona`) | alias, 70_Save.rb:164, 177 (`:lonacraft`) | harmless in both orders |
| `Game_Map#setup` | alias, 0_CORE.rb:1154 | alias, 90_Furniture.rb:899; 100_Homes.rb:1306 | harmless |
| `Game_Map#setup_event_hack` | alias, 0_CORE.rb:1163 | alias, 90_Furniture.rb:887; 100_Homes.rb:1286 | harmless (see (c)) |
| `Scene_Map#update` | alias, 102_00_Scene_Map.rb:8 (F5/F6 quick save) | alias, 100_Homes.rb:1107; 95_Debug.rb:101 | harmless |
| `Game_Interpreter#darkPot_translate_recipe` | redefined, 0_CORE.rb:930-1138 | called by salvage, 20_Station.rb:70 | Harmless in both orders. The only change runs postProcess keys that start with "_" as code, and LC/Salvage has none. |
| `Menu_Items#process_item_use` | redefined, Frames/191_menu_07items.rb:210-246 | furniture use relies on `check_common_event` (90_Furniture.rb:24-31) | harmless: the same calls, only the sound changes |
| `Window_Base#initialize`, `System_Settings::FONT_*` | redefined, Frames/53_Window_Base.rb:8-17; 0_CORE.rb:796-861 (RPS skin and pixel fonts) | LC windows inherit them (80_CraftScene.rb:344-720) | cosmetic: the craft screen fonts and skin change; needs a screenshot run |
| `Window_ItemList#draw_item` | redefined, Frames/63_Window_ItemList.rb:8-23 | salvage and chest boxes use Scene_ItemStorage | cosmetic |
| `Window_ChoiceList` | `create_contents`, Frames/80_Window_ChoiceList.rb:8 | `draw_selected_item` alias, 100_Homes.rb:1127 | different methods, harmless |
| `ItemConfigs#load_lona_effect_from_hash` | alias, 0_CORE.rb:874-880 | Tiers rebuild through it, 50_Tiers.rb:275-277 | already handled by LC |
RPS does not touch these LonaCraft hooks: `Game_Party#has_item?` and `lose_item`, `Game_Date#shift`,
`addDays` and `oneDayForward`, `Game_Map#reserve_summon_event`, `Cache.system`, `Text#[]`, and
`Game_Interpreter#call_msg` and `load_script`. That was checked against every script RPS/loader.rb
loads (its 2_LonaBitmapChanger, 2_PersistentCache and 999_tmp_CORE are not loaded).
### (e) Save data
| Key | RPS | LC | Collision |
|---|---|---|---|
| Save contents hash | `:hero_class_lona` | `:lonacraft` | 0 |
| `$game_system` | none | `@lonacraft` (60_Skill.rb:20-25) | 0 |
| `$story_stats` | many custom keys (`QuProg*`, `Guild*`, `TitleHalloweenON`) | game keys only: `HiddenOPT0` (temporary), `LastOverMapX/Y` | 0 |
| Box ids | the game's 65533/65535 and `STORAGE_*` (25_Skills.rb:598-603) | 65901-65903 and 66000+ (20_Station.rb:30) | 0 |
| Item and map ids inside the save | not remapped | only tier variants are remapped (70_Save.rb:1-27, 34-45) | see (a) and (c) |
### (f) RPS crafting next to LonaCraft
| Overlap | Evidence | Effect |
|---|---|---|
| RPS adds 4 alchemy files at index 0 of `$data_AlchemyRecipes` in a `load_normal_database` wrapper, so the effect does not depend on order. | RPS/Scripts/0_CORE.rb:596-609; RPS/Alchemy/*.json | "Cook" at the pot (LC passes it through, 20_Station.rb:160) also runs RPS recipes. |
| LC materials carry pot tags that RPS recipes use: Plank = Wood, Stone Block and Rough Stone = Rock, Cloth Bolt and Rope = Cloth. | LC/Item/*.json `pot_data`; RPS/Alchemy/400_darkPot_Arrows.json (Wood+Rock, Wood+Rock+Oil), 500_darkPot_Weapon.json (Wood+Cloth), 8000_darkPot_Bombs.json (Cloth) | Cooking LC materials can turn them into arrows, a club or bombs. Vanilla recipes already use Wood (Data/Effects/Alchemy/3000_*, 6000_*). Low impact. |
| Tier variants are chosen from the gear loaded before LC. | LC/Scripts/50_Tiers.rb:8-12, 168-209 | LC -> RPS: RPS's 52 new weapons and armor never get tiers, and the 76 game items RPS changes (36 weapons, 40 armors) are cloned before RPS changes them, so the tiers keep vanilla stats. RPS -> LC: consistent. |
| 29_ChestLoot.rb, 600_Items_for_Containers.rb, reward_item_roster | RPS/Scripts/29_ChestLoot.rb, 600_Items_for_Containers.rb; 0_CORE.rb:1283-1349 | Loot tables with RPS and game items only. No LC materials, no overlap. |
## Q3. Load order and `_ModInfo.json`
| Option | What | Verdict |
|---|---|---|
| **A (PROPOSED, recommended)** | RPS before LC in GameMods.ini. LC already warns when the order is wrong (0_Core.rb:144-160, text in LC/Text/ENG/Info.txt:8-9). | Fixes Q1, the (d) crash, the (c) map ids and the (f) tiers. |
| B (PROPOSED, owner's call) | Add `"before": ["LonaCraft"]` to **RolePlayS**/_ModInfo.json. It is auto-enforced (730:141-152) and harmless when LC is absent or off. | It edits the other mod, so it needs owner consent. |
| C | LC `_ModInfo.json` `"before"` | cannot say "after RPS". LC/_ModInfo.json:11 stays `[]`. |
| D | LC `"requires": {"RolePlayS": ...}` | Rejected: it disables LonaCraft when RPS is off (730:178-182, 710:65-68). |
RPS/_ModInfo.json (`requires LonaRPG >= 1.07518`, with a trailing comma) passes. The game version
reads as about 1.106 (150_check_OSVER.rb:14-31), and the JSON decoder accepts trailing commas
(101_jsonEnDecoder.rb:232-253). Both files use LF line endings, which the decoder needs (it does not
skip `\r`, 101_jsonEnDecoder.rb:178).
### Save note for option A (PROPOSED)
| Option | Change | Note |
|---|---|---|
| **E1 (recommended)** | Extend `LC/Scripts/70_Save.rb` so the save registry also covers the 12 materials and 54 furniture items (name to id) and `@items` in the party and boxes is remapped, as tier variants already are. | From then on, any order change is safe for LC items. |
| E2 | Start a new test save after switching the order. | The existing LonaCraft-only saves hold LC items at 306-371; with RPS first those ids belong to RPS items 306-344 and shifted LC items. Without E1, those saves come out wrong. |
Recommendation: **E1 and a fresh save**. Old saves have no item registry to remap from.
## Side note (not a LonaCraft collision)
RPS's `EffectWildBoarDed` and `EffectWildRabbitDed` copy the game's `EffectCharDed` without the line
`check_cannibalDrop(user.actor.race)` (game `-lib-MapObject` Map001, EffectCharDed). For these
"Others"-race animals the effect was not verified.
@@ -0,0 +1,65 @@
# Repeatable quests in the Deep Sewer
The Deep Sewer (`Maps/LonaCraftDeepSewer.rvdata2`, `Scripts/130_Sewer.rb`) is set up for repeatable
quests without touching the map file. No quest is built yet; this page says where one plugs in.
## What the map reserves
| Point (`-point-...`) | n | Kind (`Sewer.quest_point(kind)`) | Where |
|---|---|---|---|
| `LonaCraftSewerQuest_1` | 1 | `:goblin_den` | inside the goblin den (region 4) |
| `LonaCraftSewerQuest_2` | 2 | `:homeless_camp` | inside the homeless camp (region 3) |
| `LonaCraftSewerQuest_3` | 3 | `:flooded_basin` | in the flooded basin room |
| `LonaCraftSewerQuest_4` | 4 | `:dead_end` | at the end of a dead-end stub |
| `LonaCraftSewerQuest_5` | 5 | `:tunnel_mouth` | just inside a tunnel mouth |
| `LonaCraftSewerQuest_6` | 6 | `:bridge` | on a bridge in the middle of the tunnels |
- **Region 5** (`Sewer::QUEST_REGION`): walkway tiles around points 3 and 4, kept for quest spawns.
The population roller never uses it. It counts as walkway for the base rules (no wall may cut it).
- The points are ordinary story points, so `get_storypoint("LonaCraftSewerQuest_3")` works as on
any game map.
## The API (`LonaCraft::Sewer`)
| Call | Returns / does |
|---|---|
| `quest_points` | `{n => [x, y, event id]}` on the live map (empty when Lona is not in the Deep Sewer) |
| `quest_point(kind)` | `[x, y]` of one point by kind (table above), or nil |
| `quest_tiles` | the region-5 tiles `[[x, y], ...]` on the live map |
| `map?` | true while Lona is in the Deep Sewer |
| `on_enter {\|interp, map\| ... }` | runs when Lona comes down a grate, after the vermin, hobos and goblins are placed |
| `on_setup {\|interp, map\| ... }` | runs after every setup of the map: entry and after each nap |
| `on_nap {\|interp, map\| ... }` | runs when Lona sleeps there, before the sewer's own danger roll; return `:skip_roll` to skip that roll (no tunnel group this nap) |
The callbacks run inside the map's BIOS / NapEvent interpreter, so `interp` can use
`call_msg`, `$game_map.reserve_summon_event(name, x, y)` (or `EvLib.sum`), `optain_item` and so on.
An error in a callback is caught and written to the console ("LonaCraft Sewer enter hook error ...").
## How a modder adds a repeatable quest
1. Put a script in your own mod that loads **after** LonaCraft (`Scripts/130_Sewer.rb` must exist:
check `defined?(LonaCraft::Sewer)`).
2. Keep the quest state in `$story_stats` under your own keys (the game saves them).
3. Register `on_enter` (or `on_setup` if the quest should survive a nap) and place the quest's
events there, at `quest_point(...)` or on `quest_tiles`.
4. Give the quest out where the game gives repeatable work: the tavern quest board script
`HCGframes/event/NoerTavernQuestBoard.rb` builds `tmpQuestList` from rows gated by
`$story_stats["GuildQuestCurrent"] == 0`, `GuildQuestBeforeAccept` and a cool-down on
`$game_date.dateAmt`. RolePlayS adds its own repeatable guild quests the same way (its copy of that file,
rows such as `ChoppingFirewood` with `QuProg...AMT + 2` days). A sewer quest adds one row there
(or in its own copy of the file) and a `when` branch that sets the accepted quest.
5. On success, set your progress key so the board row shows again after the cool-down. That is what
makes it repeatable.
## Worked example (prose only)
"Clear the goblin den": the board row shows when `GuildQuestCurrent == 0`, the player has never
taken it or its cool-down of three days has passed. Accepting it sets
`$story_stats["MyModSewerDen"] = 1`. The mod registers
`LonaCraft::Sewer.on_enter { |i, m| ... }`. When the quest is active, the block reserves two
extra `GoblinCommoner` at `quest_point(:goblin_den)` with the summon data
`{:MyModSewerDen => true}`, so they can be counted. An `on_setup` block checks after each setup
whether any event with that tag is still alive. When none is, it sets `MyModSewerDen = 2` and shows a
line. Back at the board, the `when` branch pays the reward, sets the key back to 0 and stores
`dateAmt` for the cool-down. The map file is never changed. The six points and region 5 stay where
they are in every later version of the map.
@@ -0,0 +1,285 @@
# SPEC R2: crafting from the main menu, pot back to vanilla, arrows, recipe config
Status: research done 2026-10-06, every choice PROPOSED, the owner decides. Nothing is built.
Path prefixes: `LC/` = `_Mods/LonaCraft/`, `RPS/` = `_Mods/RolePlayS/`, `G/` = `LonaRPG/Data/Scripts/`.
Load order assumed: RolePlayS before LonaCraft (decided, BOARD R1).
## 0. Facts this spec rests on
| Fact | Where |
|---|---|
| The craft scene already takes a station: `LonaCraft.open_craft_scene(station)`, falls back to `:pot` if the station is not in `Stations::LIST` | LC/Scripts/80_CraftScene.rb:34-43 |
| It lists `Recipes.for_station(station)` plus the PROCESS rows of that station | 80_CraftScene.rb:116-150; 55_Recipes.rb:320-327 |
| Stations: `LIST = [:pot, :carpentry, :furnace, :anvil, :tailor]`; pot recipes = `PROCESS` "Plank" and "RopeFibre" + Furniture_CarpentryBench.json `"station": ["pot","carpentry"]` | 55_Recipes.rb:49-61; LC/Recipes/Furniture_CarpentryBench.json:5 |
| Leaving the scene always goes to the map | 80_CraftScene.rb:786-789 |
| Tier roll is one line: `tier = recipe.fixed_tier ? ... : Skill.roll_tier(req)`; the station is not known there | 55_Recipes.rb:423 |
| Displayed chances: `CraftUI.tier_chances(entry)` | 80_CraftScene.rb:242-257 |
| Tiers has no per-station notion; `Tiers.variant(base, tier)` just maps a tier to an item | 50_Tiers.rb:138-145 |
| Override files: one output each, `amount` always 1, non-craftable outputs forced to `fixed_tier` 1, missing output/input = skipped + console line | 55_Recipes.rb:245-273 (249-251, 257-259, 265, 272) |
| A recipe with no `station` and no Wood/Metal/Cloth/Leather tag goes to the Carpentry Bench | 55_Recipes.rb:66, 103-106, 276-285 |
| Pot Craft is blocked only by `$game_map.threat` (buzzer + "incombat" popup) and for non-Lona actors | 20_Station.rb:133-138 |
| Furniture is blocked on the overmap and in combat | 90_Furniture.rb:322-323, 1007-1018 |
| Skill above Lona's level BLOCKS the craft in the scene (buzzer, skill line blinks), while README:187 says it only rolls low | 80_CraftScene.rb:795-799 vs LC/README.md:187 (open discrepancy, not part of R2) |
| Display bug: a Recipes-list process row is shown as x1 (Wooden Club -> "Plank", gives 2) because the entry is built with qty 1 | 80_CraftScene.rb:134 (Recipes.craft gives `recipe.amount`, 55_Recipes.rb:428) |
| `lonacraft_process_menu` (old pot Process list) has no caller any more | LC/Scripts/30_Process.rb:117-132 |
## 1. A "Craft" entry in the main menu
### 1.1 How the menu is built
| Piece | Where | Note |
|---|---|---|
| Page list `init_contents`: `[label, PageClass]`, 9 pages; Equips/Items/Skills only if `!$game_player.cannot_control`; System only if `!menuSystem_disabled` | G/Frames/170_menu_base.rb:66-78 | the one list builder |
| Page objects are built once with the actor | 170_menu_base.rb:61 | `PageClass.new(@actor)` |
| Row position `y = 28 + index*18`, 120x28 bitmap | 170_menu_base.rb:263-291 (y at 284) | 10 rows -> last at y 190 |
| OK on a row: `Menu_Contents#process_ok` -> `@menu.deactivate; page.enter_page` (only if the page responds to it) | 170_menu_base.rb:220-222, 412-417 | |
| Every page's `update` runs every frame, shown or not | 170_menu_base.rb:428-430 | |
| Page base `Menu_ContentBase` (viewport, show/hide) | 170_menu_base.rb:457-526 | |
| Template of a one-action page: `Menu_Exit#enter_page` (goes to the map), unused in the list | G/Frames/194_menu_08_0_System.rb:8-14 | exactly the pattern needed |
| Precedent for going back to the menu from another scene: `SceneManager.goto(Scene_Menu)` | G/Frames/111_Scene_Save.rb:37-45 | |
| `SceneManager.call/return` pop a debug msgbox; use `goto` | G/Frames/6_SceneManager.rb:91-102 | |
| Menu opens unless an event runs / action state / message; only Hardcore>=2 blocks it near enemies | G/Frames/102_00_Scene_Map.rb:203-216 | so the menu CAN be open in combat |
| Gauge text starts at y 209 (vanilla) | 170_menu_base.rb:857 | screen 640x360, G/60_FullScreenPlus.rb:269 |
| Cocona's menu has its own `init_contents` (5 pages), no `super` | G/Editables/5000_Npc_UniqueCocona.rb:76-93 | an alias on Scene_Menu does not reach it |
RolePlayS (loaded files only: RPS/loader.rb:33-43 load `Scripts/Frames/`; `Scripts/Frames2/` with its own `init_contents` is NOT loaded):
| RolePlayS hook | Where | Effect on a new entry |
|---|---|---|
| `Menu_Command#initialize` redefined (font LARGE = 17, same y = 28 + i*18) | RPS/Scripts/Frames/170_menu_base.rb:7-40; RPS/Scripts/0_CORE.rb:817 | none, row picks up the font |
| `Scene_Menu#start` alias: clamps the saved index with `init_contents.length` | RPS/.../170_menu_base.rb:83-92 | counts the new entry automatically |
| `create_cursor`, `create_background` (adds bg_hud_menu 640x360) | RPS/.../170_menu_base.rb:97-130 | none |
| `process_exit_menu` keeps the page index | RPS/.../170_menu_base.rb:135-141 | menu reopens on Craft |
| `Menu_Gauge` top 215 | RPS/.../170_menu_base.rb:176 | 10th row at y 190 overlaps the panel (from y 207) by ~5 px: 85_MenuCraft.rb re-spaces rows to 17 px when a menu has more than 9 rows (verified 2026-10-06) |
| `Scene_Menu#start` alias (cache preload) | RPS/Scripts/2_PersistentCache.rb:257-277 | none (the file is commented out in RolePlayS's loader.rb, so it never loads) |
Other mods: none adds a menu entry. Lona Big Booba redefines one page class (`Menu_SexStats`, Lona_Booba_Graphics/BoobaMod.rb:188); CustomDifficulty, EasyTravel, Campsites only alias save/load/nap/overmap code (CustomDifficulty/Scripts/10_CustomDifficulty.rb:12-13, 58-59, 119-120; EasyTravel/Scripts/20_OverMap.rb:8-10, 30_InMap.rb:5-6; Campsites/Scripts/10_Campsites.rb:240-331). Nothing hard-codes menu indices (grep `prevOptChooseSet(<number>)` / `menu_index == <n>`: 0 hits).
### 1.2 Where the entry sits (PROPOSED)
| Option | Order | For | Against |
|---|---|---|---|
| **A (recommended)** | ... Equip, Items, **Craft**, Skills, Traits, Letters, System | next to the inventory it works on; hidden with Items when `cannot_control` | Skills/Traits/Letters/System move down one row |
| B | ... Letters, **Craft**, System | only System moves | far from Items |
| C | a button inside the Items page | no new row | RolePlayS rewrites the Items page (RPS/Scripts/Frames/191_menu_07items.rb); two layouts to patch |
How: alias `Scene_Menu#init_contents`, find the row whose class is `Menu_Items`, insert `[$game_text["LonaCraft:Craft:Menu/entry"], Menu_LonaCraft]` after it; no `Menu_Items` row (cannot_control) = no Craft row. Same code with and without RolePlayS (neither changes the list builder). Cocona's menu is untouched (own `init_contents`).
### 1.3 How it is drawn and what it opens (PROPOSED, recommended)
- `Menu_LonaCraft < Menu_ContentBase` in a new `LC/Scripts/85_MenuCraft.rb` (loaded after 80_CraftScene.rb in LC/loader.rb:17).
- The page shows one sprite on its viewport: title "Crafting by hand", one hint line ("Press OK to work with what you carry"), crafting level, and, when blocked, the reason in red.
- `enter_page` (OK key; mouse: left click on the page area outside `SceneManager.scene.menu_rect`, checked in the page's `update` only while its viewport is visible) runs `LonaCraft.open_craft_scene(:hand, :menu)`.
- `open_craft_scene(station, back = :map)` stores `back`; `Scene_LonaCraft#exit_scene` (80_CraftScene.rb:786-789) goes to `Scene_Menu` when `back == :menu`, else the map. The menu reopens on the Craft page (saved index, 170_menu_base.rb:170; RPS 170:138).
- New station symbol `:hand` in `Stations::LIST`, text `LonaCraft:Craft:Station/hand` = "By Hand" (6 x Text/<lang>/Craft.txt, next to `Station/pot` at line 85).
### 1.4 When it is blocked (PROPOSED, recommended: all four)
| Case | Test | Today at the pot | Proposed at the menu |
|---|---|---|---|
| Combat | `$game_map.threat` | blocked (20_Station.rb:133-137) | buzzer, red line on the page, `@menu.activate` (process_ok deactivated it) |
| World map | `$game_map.isOverMap` | n/a (no pot there) | blocked, same as furniture (90_Furniture.rb:322); "find a place to sit down" |
| Not Lona (NPC channel) | `LonaCraft.vanilla_only_actor?` | vanilla pot (20_Station.rb:138) | blocked |
| No control | `$game_player.cannot_control` | n/a | row not shown (like Items) |
| No stamina | `actor.sta <= 0` | per craft | per craft, unchanged (55_Recipes.rb:385) |
No map popup from the menu (popups need the map spriteset), hence the red line.
## 2. The hand-crafting list
### 2.1 What "limited" means technically (PROPOSED, recommended: both)
| Lever | How | Hook |
|---|---|---|
| Limited SET | only recipes that name `"hand"` (config / recipe file) or a PROCESS row with `:hand`; `default_stations` never returns `:hand` | 55_Recipes.rb:51-61, 276-285 (no change needed beyond the data) |
| Limited QUALITY = Common only | per-station cap `Stations::MAX_TIER = {:hand => 1}`, applied at the roll and in the shown chances | below |
Exact hook (station cap):
```ruby
# 55_Recipes.rb, module Stations
LIST = [:hand, :carpentry, :furnace, :anvil, :tailor]
ALIASES = {:pot => :hand} # old "station": "pot" in recipe files
MAX_TIER = {:hand => 1} # nil = no cap
def self.max_tier(station); MAX_TIER[station]; end
# parse (line 78): sym = ALIASES[sym] || sym
# 55_Recipes.rb:405, 423
def self.craft(recipe, interpreter = nil, station = nil)
tier = recipe.fixed_tier ? recipe.fixed_tier.to_i : LonaCraft::Skill.roll_tier(recipe.skill_req)
cap = LonaCraft::Stations.max_tier(station)
tier = cap if cap && tier > cap
# 80_CraftScene.rb:299 LonaCraft::Recipes.craft(entry.source, nil, LonaCraft.craft_station)
# 80_CraftScene.rb:242-257 tier_chances: fold every chance above the cap into the cap tier
```
The cap is a safety net: every default hand recipe below is fixed tier 1 already; it keeps a gear recipe that a user moves to "hand" Common-only, while the same recipe still rolls at its bench. "Common only, no roll" for the whole station is the recommendation; a cap of 2 (Uncommon) is one number in the config (section 6).
### 2.2 PROPOSED default hand list (recommended)
| # | Item | Materials | Skill | STA | Why it fits "by hand" | Source of the recipe today |
|---|---|---|---|---|---|---|
| 1 | 2 Plank | 1 Wooden Club | 0 | 1 | split a club with what she carries; first material of everything | PROCESS "Plank" (30_Process.rb:24; 55_Recipes.rb:52) |
| 2 | 1 Rope | 4 plants/herbs (any) | 0 | 1 | twisting fibre needs no tools | PROCESS "RopeFibre" (30_Process.rb:28; 55_Recipes.rb:58) |
| 3 | Carpentry Bench | 6 Plank, 2 Rope | 1 | 8 | the owner's starting place; a lashed frame, no nails | Recipes/Furniture_CarpentryBench.json |
| 4 | Light Arrows (x10) (RolePlayS only) | 1 Plank, 1 Bone | 0 | 2 | RolePlayS: "simple... stone tip, easy to make" (RPS/Text/ENG/DataItem.txt:42-47) | new (section 4) |
4 recipes (3 without RolePlayS). All Common, all skill <= 1.
### 2.3 "Maybe" items
| Item | Materials (proposed) | For | Against | Call |
|---|---|---|---|---|
| 1 Rope from 3 Cloth Bolt | as Tailor (30_Process.rb:27) | harmless, cloth already bought | duplicate path, tailor exists for it | no |
| 1 Cloth Bolt from 4 plants | as Tailor (30_Process.rb:29) | early cloth without a town | weaving needs a loom; makes the Tailor's Table trivial | no |
| 1 Stone Block from 2 Rough Stone | as Bench (30_Process.rb:32) | early Furnace | masonry needs tools; the bench is the next step anyway | no |
| Bedroll (key `PottedPlant`, FURNITURE_LIST.md:41) | today 2 Stone Block, 1 Plank; by hand e.g. 2 Hide, 1 Rope | the only sleep piece without a bench | placeable only in an owned home (README:298-301); the field nap works without it | no (maybe later) |
| Cooking Fire (key `Campfire`, 90_Furniture.rb:93) | 2 Plank, 4 Stone Block | camp feel | decoration only, no Cook action; needs Stone Block | no |
| Wooden Club from 2 Plank | Recipes/WoodenClub.json | — | circular with recipe 1; gear belongs at the bench | no |
| Fire Arrows (x10) | section 4 | arrows in one place | oil + flame + cloth wrap: bench work | no (bench) |
### 2.4 Never by hand (rule, PROPOSED)
1. Anything whose recipe today needs heat or metal: every Furnace and Anvil recipe (Iron Ingot, Glass, Nails), every recipe with Iron Ingot or Nails as input.
2. All weapons and armour (they roll tiers at their bench).
3. All furniture and decoration except the Carpentry Bench.
4. Leather (tanning) and Cloth Bolt (weaving).
5. Anything with skill > 1, and nothing above Common (cap 1).
The config validator (section 6) does NOT enforce this; it is the default data. A user may break the rule on purpose.
## 3. Removing Craft from the dark pot / stove
| File:line | Change (PROPOSED, recommended) |
|---|---|
| 20_Station.rb:129 `LonaCraft.install_pot_redirect` | delete: every pot runs `Data/HCGframes/Command_DarkPot.rb` (or another mod's redirect) directly |
| 20_Station.rb:44-57 (`station_script`, `pot_previous`, `install_pot_redirect`) and :132-151 (`lonacraft_pot_station`) | delete |
| 20_Station.rb:155-164 `lonacraft_run_original_pot` | keep the name (the Stove calls it, 90_Furniture.rb:1068-1070), body becomes `load_script(LonaCraft::POT_SCRIPT)`; `load_script` applies other mods' redirects itself (G/102_ScriptImport.rb:63) |
| LC/HCGframes/Command_PotStation.rb | delete (only 20_Station.rb:45 points to it) |
| 30_Process.rb:117-161 (`lonacraft_process_menu`, `lonacraft_process_run`) | delete (no caller); keep PROCESS_RECIPES and the fibre helpers |
| 55_Recipes.rb:49, 52, 58 | `:pot` -> `:hand` (LIST, "Plank", "RopeFibre"); `ALIASES = {:pot => :hand}` so third-party `"station": "pot"` still lands on the hand list |
| 80_CraftScene.rb:34-43 | default and fallback `:pot` -> `:hand` |
| 90_Furniture.rb:1074 | `kind[:station] || :pot` -> `|| :carpentry` (every station kind sets `:station`, 90_Furniture.rb:77-80) |
| Recipes/Furniture_CarpentryBench.json:5 | `["hand", "carpentry"]` |
| Text/<lang>/Station.txt:7-9 `Pot/begin` (6 languages) | delete |
| Text/<lang>/Craft.txt:85-86 `Station/pot` | replace with `Station/hand`; add `Menu/entry`, `Menu/title`, `Menu/hint`, `Menu/blocked_threat`, `Menu/blocked_overmap` |
| README.md:9-14, 36, 43, 62, 71, 73-76, 192-193, 309, 480-481 | rewrite: pot = vanilla Cook; "By hand" station; bootstrap starts from the menu |
| docs/RPS_INTEGRATION.md:108 | note the pot redirect is gone |
Stove furniture: already Cook only (`:actions => [:cook, :pickup, :cancel]`, 90_Furniture.rb:81) through `lonacraft_run_original_pot`; unchanged for the player. Inn pots, stoves, "Set Dark Pot": vanilla Craft-less menu; RolePlayS's pot recipes (incl. its arrows, section 4) still work through Cook.
Dead `:pot` id: nothing in the save stores a station (`grep station|pot` in 70_Save.rb: 0 hits; salvage boxes are keyed :carpentry/:anvil/:tailor, 20_Station.rb:30). `$mod_load_script` is set at boot, not saved. So `:pot` can go; keep it only as the parse alias above.
## 4. Arrows (RolePlayS)
### 4.1 What exists
3 families x 5 bundles = 15 items, all `RPG::Item`, type/tag "Arrows", consumable, no `pot_data` (RPS/Item/Projectiles_Arrows*.json:2-21).
| Family | Item names | Quiver stat | Price x5/x10/x15/x20/x25 | Per arrow | Weight x5..x25 | Bows (RPS/Scripts/102_map_hud_new.rb:134-146) |
|---|---|---|---|---|---|---|
| Light | ItemArrowsShortX5..X25 | arrows_short | 50/100/150/200/250 | 10 | 1..5 | Item2MhShortBow, Item2MhHunterBow |
| Medium | ItemArrowsMediumX5..X25 | arrows_medium | 200/400/600/800/1000 | 40 | 1..5 | Item2MhAssBow, Item2MhLongBow, Item2MhSniperBow, Item2MhElvenBow |
| Fire | ItemArrowsFireX5..X25 | arrows_fire | 150/300/450/600/750 | 30 | 1..5 | Item2MhBowJaeger |
- Using a bundle adds N to the actor stat (`use_item_effect` "+N", e.g. RPS/Item/Projectiles_ArrowsMedium_x10.json:16-21). Stat rows `[25, 0, 99, 99, ...]` light, `[0, 0, 99, 99, ...]` medium/fire: light starts at 25, cap 99 (RPS/Scripts/25_Skills.rb:394-396, accessors 400-407).
- Per shot: 1 arrow for every bow skill that names one (`adjustment` 1: BowJaegerNormal/Control.json:43/53, ElvenBowNormal/Control:43/53, HunterBowControl:56, LongBowControl:60, MediumBowNormal:43, ShortBowNormal:43, SniperBowControl:60); ShortBowControl lists 0 (RPS/Skill/ShortBowControl.json:53) and its multishot takes 1 light arrow per projectile (RPS/Scripts/480_EventCharacterBatch.rb:226-233).
- Sources today: bow enemies drop bundles at 50% (e.g. RPS/NPC/GoblinBow.json:68-71 x10 light, UndeadEliteBow.json:67-70 x5 medium); RolePlayS dark-pot (Cook) recipes, 5 arrows per set: Light = Wood + Rock, Medium = Wood + CrystalOre, Fire = Wood + Rock + Oil (RPS/Alchemy/400_darkPot_Arrows.json:7-24, 100-115, 183-198). LonaCraft's Plank (Wood 1) and Rough Stone / Stone Block (Rock 1) already count there (LC/Item/Plank.json:16-18, RoughStone.json:16-18, StoneBlock.json:16-18).
- LonaCraft derivation does NOT reach them: CRAFTABLE needs Weapon/Armor with a craft tag (50_Tiers.rb:78-94). They need explicit recipes; an override for a non-craftable output is fixed tier 1 (55_Recipes.rb:265), so they never roll.
### 4.2 PROPOSED recipes (recommended; one x10 bundle per craft, no code change for the amount)
| Output | Materials | Value in / out | Skill | STA | Station | Note |
|---|---|---|---|---|---|---|
| Light Arrows (x10) `ItemArrowsShortX10` | 1 Plank, 1 Bone | 90 / 100 | 0 | 2 | hand, carpentry | bone tip; alt: 1 Plank + 2 ItemRock (vanilla rock, price 0) |
| Medium Arrows (x10) `ItemArrowsMediumX10` | 2 Plank, 4 Nails | 220 / 400 | 3 | 6 | anvil | steel tip = metal work; RolePlayS pot equivalent costs 2 Crystal Ore (400) + 2 Wood |
| Fire Arrows (x10) `ItemArrowsFireX10` | 1 Light Arrows (x10), 1 Cloth Bolt, 2 Oil (`ItemOil`, price 1) | 162 / 300 | 2 | 4 | carpentry | upgrade of the light bundle; oil-soaked cloth |
Value in = materials at their own price (Plank 60, Bone 30, Nails 25, Cloth Bolt 60; README:34-47). Every recipe is >= 54% of the output price, so buying materials and selling arrows is not a money pump. Skill = the default rule round(sqrt(price/50)) except Light (0 instead of 1, so it is in the hand list from the start).
- Tiers: no (fixed tier 1, automatic).
- Group in the scene: today an `RPG::Item` from an override lands in "Processing" (80_CraftScene.rb:106-110, 128-133) and gives gear exp 5 + skill (60_Skill.rb:131). PROPOSED (recommended): category `"ammo"` -> group "Ammunition" (new `Group/Ammo` text key, GROUPS 80_CraftScene.rb:72-79, OVERRIDE_CATEGORIES 55_Recipes.rb:135) and 1 exp like processing (60_Skill.rb:131), since bundles are cheap and repeatable.
- Without RolePlayS: the outputs do not exist -> the recipes are skipped with one console line each (55_Recipes.rb:249-251); the player sees nothing. With the config's `"requires": ["RolePlayS"]` (section 6) they are skipped without the console line. If RolePlayS loads after LonaCraft the same skip happens (items not yet defined at `Recipes.build`, 0_Core.rb:143).
## 5. Save / compatibility
| Area | Impact |
|---|---|
| Save data | none: recipes, stations, the menu page and the config are rebuilt at boot; `$game_system` crafting data (60_Skill.rb:20-27) unchanged |
| Item ids | no new items; arrows are RolePlayS's (not in LonaCraft's remap, 70_Save.rb) |
| Old saves | load unchanged; pots simply stop asking Craft/Cook |
| Other mods replacing Command_DarkPot.rb | now win in any order (LonaCraft no longer redirects it) |
| RolePlayS absent | menu entry works; arrow recipes vanish |
| Cocona menu | untouched |
| Screen | 10 menu rows: last at y 190, gauge text at 209 (vanilla) / 215 (RolePlayS); needs a screenshot both ways |
## 6. Recipe config file (owner addition, 2026-10-06)
Today: three layers, highest first: `Recipes/*.json` overrides (full replacement per output, 55_Recipes.rb:148, 228-273) > derived from pot tags (55_Recipes.rb:205-226) ; plus PROCESS_RECIPES and the station maps in code (30_Process.rb:23-33; 55_Recipes.rb:51-67). 56 recipe files ship (54 furniture, WoodenClub, ShortSword).
Parsing available: the game's `JSON.decode` (G/101_jsonEnDecoder.rb:69-74), which skips `//` line comments (:181-188) but treats only space, `\n`, `\t` as whitespace (:175-176), so strip `\r` first (Notepad CRLF). `JSON.encode` writes one line and does not escape quotes (:76-121): a written file needs a small pretty-printer. Ini style is parsed by hand in other mods (Campsites/Scripts/0_Config.rb:7-14, `key = value` per line).
### 6.1 Options
| | A: one file with everything | B: per-item files + small configs | C: ini `LonaCraft.cfg` | **D: user file + generated defaults (recommended)** |
|---|---|---|---|---|
| Files | `Config/Recipes.json`, derived recipes written into it on first run | keep `Recipes/*.json`, add `Config/Hand.json`, `Config/Overrides.json` | `Config/LonaCraft.cfg`, one line per recipe `out = stations \| skill \| in:n,in:n` | `Config/Recipes.json` (user, partial entries) + `Config/Recipes_defaults.json` (written at every boot, read-only reference) |
| Non-coder finds it | one file, but hundreds of entries | three places | one file, cryptic lines | user file is short; defaults list every recipe with its display name as a `//` comment |
| Derived / other mods' gear | frozen at first run; new mod gear appears only if merged in | as today | needs writing out too | defaults file is rewritten each boot from what is loaded (RolePlayS gear, arrows) |
| Mod update changes a default | user's file shadows it forever | fine | as A | fine: user entries only hold what the user changed |
| Missing item / material | skip + console line | same | same | skip + console line; `requires` skips silently |
| Precedence | file = everything | config > files > derived | cfg > files > derived | user config (field merge) > Recipes/*.json > derived/PROCESS |
| Reload | restart, or debug key | same | same | restart; DEBUG build: a free numpad key (Numpad * if the game's Input maps it; 2/4/6/8 are taken, 95_Debug.rb:5) re-runs `Recipes.build` (recipes are not saved, safe) |
| Format | JSON (game loader) | JSON | hand parser | JSON (game loader) |
| Save impact | none | none | none | none |
Recommendation: D. It keeps the shipped `Recipes/*.json` as the mod's default layer (unchanged format, nothing replaced), wraps the derived recipes, PROCESS rows and station rules, and adds one short user file where an entry only names what it changes.
### 6.2 Schema (D)
`Config/Recipes.json`:
| Key | Type | Default | Meaning |
|---|---|---|---|
| `stations.<id>.max_tier` | 1..5 | hand 1, others none | best tier a station can give (section 2.1) |
| `stations.<id>.cost` | 1..10 | hand 1.25, others 1.0 | input multiplier at that station, `ceil(count x cost)` per input (owner 2026-10-06; `Recipes.inputs_at`, 55_Recipes.rb) |
| `recipes[].id` | string, required | — | output `item_name`, or `process:<Key>` for a PROCESS row (30_Process.rb:24-32) |
| `enabled` | bool | true | false removes the recipe everywhere |
| `station` | string or list | from lower layer | `hand`, `carpentry`, `furnace`, `anvil`, `tailor` (`pot` = `hand`) |
| `skill` | 0..20 | from lower layer | crafting level needed |
| `inputs` | {item_name: count} | from lower layer | `*plant` = any plant; replaces the whole input list |
| `amount` | int >= 1 | 1 | how many outputs per craft (also fixes the x1 display, 80_CraftScene.rb:134) |
| `max_tier` | 1..5 | none | per-recipe cap (1 = always Common) |
| `category` | gear/furniture/decoration/ammo | from lower layer | list group |
| `requires` | [mod id] | [] | skip silently unless these mods are loaded (`$mod_manager.mods`, 0_Core.rb:101) |
Unknown keys: console line, ignored. An entry with an unknown `id`, input or station: entry skipped, console line, never a message box. Partial entries merge field by field onto the lower layer; an `id` with no lower layer needs `station` and `inputs` (a new recipe).
Example (5 entries):
```json
{"stations": {"hand": {"max_tier": 1}},
"recipes": [
{"id": "ItemLonaCraftFurnitureCarpentryBench", "station": ["hand", "carpentry"], "skill": 1, "inputs": {"ItemLonaCraftPlank": 6, "ItemLonaCraftRope": 2}},
{"id": "ItemArrowsShortX10", "requires": ["RolePlayS"], "category": "ammo", "station": ["hand", "carpentry"], "skill": 0, "inputs": {"ItemLonaCraftPlank": 1, "ItemLonaCraftBone": 1}},
{"id": "process:RopeFibre", "station": ["hand", "tailor"]},
{"id": "ItemMhShortSword", "skill": 6}
]}
```
Shipped state: the user file ships with only `stations` and comments (defaults stay in `Recipes/*.json`, "we keep the defaults for now"); the three arrow recipes ship as `Recipes/Arrows_Light.json`, `Arrows_Medium.json`, `Arrows_Fire.json` with `requires`. `Config/Recipes_defaults.json` is written only when its content changed.
## 7. Work breakdown (PROPOSED)
| Item | What | Files |
|---|---|---|
| B1 Hand station, pot back to vanilla | `:hand` + alias + MAX_TIER cap; pot redirect and old pot/process menus removed; scene defaults; x1 display fix; return-to-menu argument | LC/Scripts/55_Recipes.rb, 80_CraftScene.rb, 20_Station.rb, 30_Process.rb, 90_Furniture.rb:1074; delete LC/HCGframes/Command_PotStation.rb; LC/Recipes/Furniture_CarpentryBench.json; Text/<6 langs>/Station.txt, Craft.txt |
| B2 Main menu page | `Menu_LonaCraft` + `init_contents` alias, blocks (threat, overmap, actor), mouse click | new LC/Scripts/85_MenuCraft.rb; LC/loader.rb; Text/<6 langs>/Craft.txt (Menu/*) |
| B3 Arrows | 3 recipe files, `ammo` category + group + 1 exp, `requires` | LC/Recipes/Arrows_*.json; 55_Recipes.rb:135; 80_CraftScene.rb:72-79, 128-133; 60_Skill.rb:131; Text/<6 langs>/Craft.txt (Group/Ammo) |
| B4 Recipe config | Config/Recipes.json reader (field merge, requires, validation, `\r` strip), defaults writer, debug reload key | 55_Recipes.rb (build/load_overrides), new LC/Config/Recipes.json, 95_Debug.rb |
| B5 Docs | README (pot, stations, bootstrap, recipes, config), BOARD, RPS_INTEGRATION note | LC/README.md, docs/BOARD.md, docs/RPS_INTEGRATION.md |
Gate after B2: screenshots of the menu with and without RolePlayS (row 10 vs gauge), the hand screen, a blocked line in combat. Order: B1 -> B2 -> B3 -> B4 -> B5 (B3 and B4 both touch 55_Recipes.rb; one at a time).
Open for the owner (not decided here): the skill block vs README (80_CraftScene.rb:795-799 vs README:187).
@@ -0,0 +1,392 @@
# SPEC R5: stone nodes (boulders) and the axe for wood
Status: BUILT 2026-10-06, pending the owner's run. The owner's build decisions (below) override the draft's **Rec.** where they
differ; the rows marked **Decided** are what the code does.
Paths: `G/` = game root `LonaRPG/`, `RPS/` = `ModScripts/_Mods/RolePlayS/`, `LC/` = `ModScripts/_Mods/LonaCraft/`.
Map ids: `G/Data/MapNNN.rvdata2`. EV = event id in that map.
Owner decisions this spec builds on (2026-10-06): (1) Rough Stone comes from its own boulder nodes on some
wilderness maps, easy early-game, mined with a pickaxe like the game's ore nodes; (2) in this mod, wood from
trees requires an axe.
Build decisions (owner, 2026-10-06): boulders as 2.1-2.3 (option A, 9 hits, 4 Rough Stone, 15% Iron Ore, deleted
when spent, `$_boulder` placeholder, `LonaCraft_Boulder.png` when present); **pickaxe REQUIRED** (over the draft's
recommendation); Hatchet both bought and crafted; the tree rule through `$mod_load_script` wrappers (section 4).
**Change 2026-10-07 (owner):** "The hatchet is not a weapon, instead, it's an item. The pickaxe is a weapon. You require
the pickaxe equipped in your hand to mine. But for the hatchet, all you need is the item in your inventory. Change that so
the hatchet is actually an equippable item/weapon. Just use whatever default axe sprite for it being held in your hand, but
it should be weaker than any axes in the game. It should require the hatchet in your hand to farm trees." Built:
| Point | Now | Where |
|---|---|---|
| Hatchet | an `RPG::Weapon` in `$data_weapons` (was an `RPG::Item`): wtype `NormalEQ`, etype `MH`, skill `WoodenClubNormal` (seals `BasicNormal`), price 150, weight 5, pot Wood 1, mod icon cell 12 | `Item/Hatchet.json` (game weapon format), `Scripts/0_Core.rb` WEAPONS / load_weapons |
| Stats | atk_plus +1, weak -4, sexy -5 (max); RPG params [0, 0, 10, 0, 0, -5, 0, -15]. Wooden Club +1 / -5 / -15, params 0; pickaxe +3 / -8 / -15 (RolePlayS +1.3), params ATK 20; RolePlayS Lumberjack Axe +1.1 / -10 / -20 | same |
| Held picture | `MainArm` = `MhWoodenClub`: the base game has no axe part in `G/Data/CHSConfig/CHSconfigs_Actors/Lona/Layer/200_MH.json` (the axe parts are RolePlayS's, not used) | `Item/Hatchet.json` lonaStat_json_hash |
| Tiers | the Hatchet gets no quality tiers (always the plain weak tool) | `Scripts/50_Tiers.rb` craftable_base_item? |
| Tool rule | trees need an `AXES` entry and boulders a pickaxe **in the main hand** (`TOOLS_IN_HAND = true`; `false` = the 2026-10-06 "carried or equipped" rule). A quality-tier copy (`_LC2`-`_LC5`) of a listed tool counts. Popups: "Need an axe in hand to cut wood." / "Need a pickaxe in hand to break this." | `Scripts/45_Nodes.rb` tool_ok? / held_tool |
| STA | boulder: always 1 per swing now (9 per boulder; the "2 when carried" branch is only reached with `TOOLS_IN_HAND = false`); RolePlayS gets the item in hand as its tool name. Tree: unchanged, the game's 5 per swing (RolePlayS: 1 with its Lumberjack Axe in hand, else 5) | `45_Nodes.rb` lonacraft_mine_boulder |
| Saves | save data version 3 lists the mod's weapons as "W". A version 2 save's Hatchet (kind "I") moves from the party's items to its weapons (console line); a Hatchet item in a storage box becomes the weapon (by name, any version). A version 1 save: a Hatchet in the bag is left as it is | `Scripts/70_Save.rb` |
The rows below that say "carried or equipped" (2.2, 3.3) describe the 2026-10-06 build; this note overrides them.
---
## 1. Ore nodes today
### 1.1 Mechanics
| Node (EventLib name) | Defined | HP | Hits per drop | Drops per node | STA per swing, vanilla | STA per swing, RPS | Script |
|---|---|---|---|---|---|---|---|
| StaticSaltpeter | Map001 EV807 (`@summon_data = {:HP => 6}`) | 6 | 3 | 2 Saltpeter | 1 with pickaxe equipped, 2 without | 1 / 2 (+STR/CON exp) | `G/Data/HCGframes/event/Mining_Saltpeter.rb` |
| StaticPhosphorus | Map001 EV808 (HP 6) | 6 | 3 | 2 Phosphorus | 1 / 2 | 1 / 2 | `Mining_Phosphorus.rb` (identical but line 16) |
| StaticCrystalOre (RPS only) | `RPS/MapObject.rvdata2` EV98 (HP 9) | 9 | 3 | 3 Crystal Ore | - | 1 / 2 | `RPS/HCGframes/event/Mining_Mineral.rb` |
| Prison wall (ItemMineral) | Map050 EV011-EV033, inline, no script file | - | - | per quest | - | - | `reserve_summon_event("ItemMineral",x,y,player id)` |
Evidence, `Mining_Saltpeter.rb`:
| Line | What |
|---|---|
| 1-3 | STA <= 0: buzzer + "sta_too_low", nothing else |
| 5 | swing animation `animation_atk_mh` |
| 7 | `equips_0_id = $game_player.actor.equips[0].id` (main hand) |
| 11-12 | `sta -= 1`; `sta -= 1 if equips_0_id != 11` (comment: no pickaxe equipped) |
| 13 | `summon_data[:HP] -= 1` |
| 15-16 | every 3rd hit (`HP % 3 == 0`): `EvLib.sum("ItemSaltpeter", player x, y)` (drop on Lona's tile) |
| 17 | `get_character(0).delete if HP <= 0` |
RPS replaces lines 6-12 with `calc_harvest_sta_cost(1, "ItemMhPickAxe")` (`RPS/HCGframes/event/Mining_Saltpeter.rb:14`,
`Mining_Phosphorus.rb:14`, `Mining_Mineral.rb:7`). That helper (`RPS/Scripts/0_CORE.rb:1418-1440`): tool looked up by
name (`$data_ItemName[tool].id`, :1419), counts only when **equipped in main hand** (`actor.equips[0]`, :1422);
cost 1 with tool, `1 + base_cost` without (:1425); adds STR/CON exp (WIS/SUR for the sickle), half without the tool (:1430-1436).
LonaCraft on top (`LC/Scripts/40_Mining.rb`): every ore yielded while a `*/Mining_*` script runs rolls 60% Rough Stone
and 35% Iron Ore (:23-26, :56-66 depth counter, :68-87 `reserve_summon_event` alias); the prison wall is recognised by
its player-id argument (:41).
### 1.2 What "pickaxe" means
| Question | Answer | Evidence |
|---|---|---|
| Item | `ItemMhPickAxe`, price 200, main-hand weapon, icon 406 | `G/Data/Effects/Weapons/MhPickAxe.json`; RPS overrides stats only (`RPS/Weapon/MhPickAxe.json`) |
| Equipped or carried | equipped (main hand) only; carried does nothing | `Mining_Saltpeter.rb:7,12`; `RPS/Scripts/0_CORE.rb:1422` |
| Required? | never; it only halves STA (1 vs 2 per swing) | `Mining_Saltpeter.rb:11-12` |
| Vanilla id check | hard-coded id 11 | `Mining_Saltpeter.rb:12` |
| Where sold | Noer blacksmith (amount 1), common weapon traders | `G/Data/Barters/NoerBlackSmithShopTrader.json:25`, `CommonWeaponTrader.json:25` |
### 1.3 States and refill
| Question | Answer | Evidence |
|---|---|---|
| Used / empty frame | **none**. The node is deleted when HP reaches 0. `@pattern = rand(3)` is a random look, not a used state. | `Mining_Saltpeter.rb:17`; Map001 EV807 init |
| Nap | not re-initialised (`@nap_initialize=3`) | Map001 EV807; meaning in `G/Data/Scripts/Frames/39_Game_Event.rb:54-59` |
| Refill | **every visit**. Each entry from the overmap sets `ReRollHalfEvents = 1` (`34_Functions_ChangeMap.rb:138`), the map's BIOS event re-rolls its resources (nodes, plants, fruit trees) on random tiles of an in-map region (`$game_map.region_map[N]`, built in `31_Game_Map.rb:270-280`), then `enter_static_region_map` sets it back to 0 (`34_Functions_ChangeMap.rb:104-114`). No daily timer. | r7 BIOS (Map037 EV1): 4 x `EvLib.sum("StaticPhosphorus", region 39 tile)`, 1st always, others `if asd >= rand(25/50/75)`, `asd = 1 + WIS + 2*SUR` |
| Where nodes spawn | Saltpeter: Orkind caves Map018/023/024/046, Fishkind caves Map072/095, prison Map050 (BIOS, 2-4 per visit). Phosphorus: r7 mountain Map037/184 (region 39), Map050. Crystal: RPS MinerPrison map. | BIOS events of those maps |
ASSET_PROMPTS.md (line 15) says the game's ore nodes have an unlit/used frame: they do not (see above). Fix in B5.
---
## 2. Stone nodes (boulders)
### 2.1 Event model
| Option | What | For | Against |
|---|---|---|---|
| **A (Rec.)** | EventLib event `LonaCraftBoulder`, cloned at boot from `StaticSaltpeter` (as `register_drop_events` clones `ItemRawMeat`, `0_Core.rb:195-223`), graphic and script swapped; summoned with `EvLib.sum` when a region map is entered | the game's own node lifecycle (overlap guard, nap rule, delete at HP 0, gone when the map is left); 1 table + 1 hook | none found |
| B | runtime `RPG::Event` from `Furniture.build_event` (`90_Furniture.rb:542-602`) injected in `setup_event_hack` (`:886-896`), like TOWN_STATIONS | reuses furniture code | `setup_event_hack` runs before the BIOS and before `ReRollHalfEvents` is known to be a fresh visit; own lifecycle and HP state to write; TOWN_STATIONS are fixed tiles, the r-maps are not |
Boulder event (option A), page 0 of Map001 EV807 with these changes:
| Field | StaticSaltpeter | LonaCraftBoulder |
|---|---|---|
| graphic | `grimdark32_02` idx 6 (white specks, ground decal) | `LonaCraft_Boulder` (owner PNG, one cell, `@manual_cw = @manual_ch = 1` as `90_Furniture.rb:580`) if present, else placeholder `$_boulder` idx 0 dir 2 pattern 0 |
| priority / through | 1 / false (blocks) | same |
| `@forced_z = -10`, `@blend_type = 1`, `@opacity = 200+rand(50)`, `@pattern = rand(3)` | glitter decal | drop all four (an upright opaque rock) |
| `@forced_y = 4 - rand(8)`, `@mirror` | jitter | keep |
| `@summon_data` | `{:HP => 6}` | `{:HP => 9}` |
| overlap guard, `@nap_initialize=3` | yes | keep |
| script | `load_script("Data/HCGframes/event/Mining_Saltpeter.rb")` | `load_script("<LC path>/HCGframes/Mining_Boulder.rb")` (one line: `lonacraft_mine_boulder`); the name keeps `/Mining_` so 40_Mining's depth counter stays consistent; Rough Stone is not in `MINING_ORES` (`40_Mining.rb:21`), so no double by-product roll |
Placeholder `$_boulder.png` (`G/Graphics/Characters/`, 96 x 128, 3 x 4 cells of 32 x 32, a rolling-boulder sheet used on
Map003 NpcLab and Map061 ScoutCampOrkind). Render: scratchpad `r5/boulder_sheet.png`, with the ore decals for comparison in
`r5/r5_placeholder_rocks.png`. The other rock sheets do not fit (`!$_DedOneRock0` is a sign, `!$_WinterRock0` an ice pillar).
### 2.2 Mining a boulder
| Item | Value (**Decided**) | Option | Why |
|---|---|---|---|
| Hits | 9 (HP 9), a yield every 3 hits | HP 6 like the ore | 3 yields |
| Per yield | 1 Rough Stone, 100% | - | main drop |
| Last yield (HP 0) | +1 Rough Stone | - | 4 Rough Stone per boulder |
| Iron Ore | **15% per yield** (about 0.45 per boulder) | 35% as `MINING_BYPRODUCTS` | boulders are on many open maps and come back every visit; 35% x 3 gives about 1 Iron Ore per boulder, which floods the Furnace chain that ore nodes gate today |
| Saltpeter / Phosphorus | none | - | owner |
| Pickaxe required? | **Yes** (owner): `ItemMhPickAxe` (the game's weapon id 11; RolePlayS updates the same item, `RPS/Scripts/0_CORE.rb:321-328`) carried or equipped (`has_item?(item, true)`, `29_Game_Party.rb:303`). Without it the swing does nothing but show `LonaCraft:Nodes:Boulder/need_pickaxe` (buzzer, no STA, no hit) | not required, halves STA (draft) | owner's call |
| STA per swing | the game's ore-node rule kept: **1 with the pickaxe equipped in main hand, 2 when only carried** (`Mining_Saltpeter.rb:11-12`); under RPS its `calc_harvest_sta_cost(1, "ItemMhPickAxe")` (same 1/2 plus attribute exp) | - | game rule |
| STA per boulder | 9 equipped / 18 carried | - | - |
| STA <= 0 | game's "sta_too_low" popup, nothing else | - | `Mining_Saltpeter.rb:1-3` |
| Drop tile | Lona's tile (`EvLib.sum(..., player x, y)`) | - | as the ore |
| Depleted | deleted (game rule, `Mining_Saltpeter.rb:17`); no rubble, no used sprite (the BoulderBroken prompt was dropped) | rubble event like a tree stump | nodes have no used state |
| Refill | every visit (2.3) | daily timer | the game's own rule, no save data |
Furnace (6 Stone Block + 8 Rough Stone = 20 Rough Stone, README Stations) = 5 boulders = 45-90 STA.
### 2.3 Where
How a field map is reached: overmap tile region id -> `change_map_enter_region` picks
`$data_region_maps[region].sample` (`34_Functions_ChangeMap.rb:257-269`, :263). The list is built from each map's note
`region=N` (`5_DataManager.rb:351-369`); RPS appends `r1_PlainField4`, `r4_RainFroest4`, `r11_RoadPlain4`
(`RPS/Scripts/0_CORE.rb:147-156`). So **the same overmap tile does not always give the same map**, and every map is
reloaded fresh on entry. "Known spots" per world tile cannot exist without changing map selection.
Campsites does not touch r-maps: it keeps camps in `$game_system` (`Campsites/Scripts/10_Campsites.rb:272-284`), shows an
overmap icon (:165-174) and sends the player to its own camp map through `$data_tag_maps` (:247-252, :221-225).
Placement rule:
| Option | What | Verdict |
|---|---|---|
| Fixed hand-picked tiles (TOWN_STATIONS style, `90_Furniture.rb:146-151`) | a table of (map, x, y) | 60 maps by hand; the map a tile opens is random anyway |
| Chosen once per overmap tile, persisted (Campsites style) | save data per tile | meaningless: the r-map is re-sampled on every entry |
| **Random per visit on the map's own region (Rec.)** | on a fresh entry, sample N tiles from `region_map[R]` of that map, as the BIOS does for phosphorus and plants | follows the game; no save data; one table |
Tile filter (Rec.): region R tile, the tile and its 4 neighbours passable, no map event within 1 tile, not within 6 tiles
of `-point-StartPoint`. For r7 only: region 39 (rock faces where the game puts phosphorus), the tile itself impassable and
at least 1 of its 4 neighbours passable (mined from the path). Counted with the scratchpad tool `r5/cand.py` / `r5/wall39.py`
(layer passability only).
Hook (Rec.): `Game_Interpreter#enter_static_region_map` (module `GIM_ADDON`, `34_Functions_ChangeMap.rb:5,104`, included
in `Game_Interpreter`, `40_Game_Interpreter.rb:19`): every r-map BIOS calls it exactly once on entry (checked on 28 maps: all 20 boulder maps plus
8 controls Map019/027/029/034/080/093/163 and RPS r4_RainFroest4; scratchpad `r5/esr.py`), with `ReRollHalfEvents` still 1. Override
with `super`: spawn first if `ReRollHalfEvents == 1`, then `super` (which resets it at :114). No other mod overrides it (grep
of all `_Mods/*/Scripts`).
Every r-map family (`region=` note; rock-like events = what its BIOS or map events already place):
| Family | Map ids | Rock-like content today | Boulders max (Rec.) | Region R | Free tiles (min over maps) |
|---|---|---|---|---|---|
| r1 PlainField | 28, 26, 16, RPS r1_PlainField4 | 3 StaticRockInsect0 on region 11 | **2** (early game, Noer area) | 11 | 138 |
| r2_r27 Beach | 27, 147, 149 | 2 StaticRockCrab (region 10) | 0 | - | - |
| r3 BadlandMountain | 39 | 3 StaticRockInsect1-3 (region 9) | **4** | 9 | 32 |
| r4 RainForest | 29, 80, 93, RPS r4_RainFroest4 | none | 0 | - | - |
| r5 PineForest | 30, 13, 124 | 3 StaticRockInsect0 (region 9) | **2** | 9 | 45 |
| r6 BadlandForest | 21, 127 | none (18 Humpshroom) | **3** | 9 | 8 |
| r7 PineForestMountain | 37, 184 | 4 StaticPhosphorus (region 39) | **4** | 39 (face rule) | 88 |
| r8_25 Swamp | 19, 163 | none | 0 | - | - |
| r9 AbandonedHouse | 45, 47 | none | 0 | - | - |
| r10 Slum | 17, 170 | none | 0 | - | - |
| r11 RoadPlain | 34, 32, 33, RPS r11_RoadPlain4 | none | 0 | - | - |
| r12 RoadNoerNob | 83 | none | 0 | - | - |
| r13_24 SwampRoad | 101, 102 | none | 0 | - | - |
| r14 AbomDesert | 107, 112 | 3 StaticRockInsect1-3 (region 9) | **2** | 9 | 286 |
| r15_26 Marsh | 108, 125 | none | 0 | - | - |
| r16 PlainBadland | 131, 134 | 3 StaticRockInsect1-3 (region 9) | **3** | 9 | 83 |
| r17 RoadSyb | 145, 146 | 3 StaticRockInsect1-3 (region 12) | 0 | - | - |
| r18 TownSyb | 150 | 3 StaticRockInsect1-3 | 0 | - | - |
| r19 OrkDesert | 111, 159 | 3 StaticRockInsect1-3 (region 9) | **2** | 9 | 268 |
| r20 RefugeeCamp | 35, 73 | none | 0 | - | - |
| r21 NoerTown | 5, 4, 7 | none | 0 | - | - |
| r22 RoadNoer | 48, 56, 57 | none | 0 | - | - |
| r23 Boulevard | 51, 54, 55 | none | 0 | - | - |
| r28 OrkBadland | 160, 161 | 3 StaticRockInsect1-3 (region 9) | **3** | 9 | 73 |
| r29 SYB_KeepAbom | 191 | none | 0 | - | - |
| r30 SYB_KeepOrk | 192 | none | 0 | - | - |
| r31 SYB_RoadOrk | 200 | none | 0 | - | - |
| r32 SYB_AlleyOrk | 201 | none | 0 | - | - |
Totals: 28 families, 60 maps (57 game + 3 RPS); 9 families with boulders (20 maps). Count per visit (Rec., the game's
own roll): boulder 1 always, boulder k (k >= 2) `if asd >= rand(25 * (k - 1))`, `asd = 1 + WIS + 2*SUR` (Map037 EV1 phosphorus
formula). Table key: map name prefix `r<N>_` (the family), so RPS's extra maps are covered without ids.
Why not plains/roads beyond r1: roads and towns are paths and buildings; swamps, marsh, beach and rainforest have no rock.
r1 is in because the owner wants early-game stone and the plains already "hide" rock insects on region 11.
Renders (scratchpad, region R shaded yellow, filtered tiles green, 4 sample boulders red, start point blue):
| File | Map | Reading |
|---|---|---|
| `r5_r16_PlainBadland1_boulders.png` | Map131, region 9 | open badland, boulders sit off the paths: good |
| `r5_r7_PineFroestMountain1_boulders.png` | Map037, region 4 | region 4 is the 1-tile mountain path: a boulder there blocks the route. This is why r7 uses region 39 (rock faces) instead |
Caves (Orkind/Fishkind): **no boulders (Rec.)**. They already spawn 2-4 ore nodes per visit (Map018/023/024/046/072/095
BIOS) and each ore already rolls 60% Rough Stone (`40_Mining.rb:23-26`); caves are mid-game and dangerous, the opposite
of "easy early stone".
### 2.4 Loose stones (owner addition 2026-10-06, **Decided**, built)
"Loose stones that we can pick up, separate from the rock nodes."
| Item | Value | Evidence |
|---|---|---|
| Event | `LonaCraftLooseStone`, a static node cloned from the game's `StaticSaltpeter` (Map001 EV807) like the boulder, **not** a ground drop: owner, 2026-10-06, "as a dropped item, they despawn after a while". Same init (overlap guard, `@nap_initialize=3`), stays for the whole visit, rebuilt fresh each visit, no save data | `45_Nodes.rb` clone_node |
| Trigger / priority / through | action key while facing it (priority 1, "same as characters", as the boulder), but **through** so a stone never blocks a narrow path (r7's path); the action key still starts it | `45_Nodes.rb` clone_node `through = true` |
| Action | `HCGframes/Mining_LooseStone.rb` -> `lonacraft_pick_loose_stone`: `common_pickup_item("ItemLonaCraftRoughStone", true)` (the game's pickup: pick-up pose, `optain_item` sound and "+1" icon popup, the same feedback as picking up a dropped material), then the event is deleted. No tool, no stamina, no hit count | `29_Functions_417_Interpreter.rb:861-867, 410-418` |
| Picture | the game's own small-rock drop: `item_icon01` index 5, dir 2, pattern 1 (the `ItemRock` drop, Map001 EV93); or `LC/Graphics/Characters/LonaCraft_LooseStone.png` (one 32 x 32 cell, `@manual_cw/ch = 1`) when present. Render: scratchpad `r5/r5_loose_stone_placeholder.png`, whole sheet `r5/item_icon01_dir2.png` | `G/Graphics/Characters/item_icon01.png` (288 x 192, 24 x 24 cells) |
| Gives | 1 Rough Stone, one pick, no tool, no STA | - |
| Count | 1-3 per fresh visit (`LOOSE_MIN + rand(3)`), after the boulders (their pending summons count as taken) | `45_Nodes.rb` spawn_loose_stones |
| Tile rule | the boulders' `:open` rule (tile + 4 neighbours passable, nothing within 1 tile) but only **not within 2 tiles** of the start point (`LOOSE_START_CLEAR = 3`) | - |
| Maps (`LOOSE_MAPS`) | the 9 boulder families on their boulder region, except r7 on its walkable path (region 4; boulders use the rock faces, 39); **plus r11 RoadPlain** on region 11 (all 4 maps have it, 45-201 tiles; their BIOS places nothing there) | dry run below |
Dry run (layer passability; candidate tiles with the looser filter):
| Maps | Region | Candidates (min-max) |
|---|---|---|
| r11 RoadPlain 34 / 32 / 33 / RPS r11_RoadPlain4 | 11 | 39 / 189 / 177 / 113 |
| r1 PlainField x4 | 11 | 231-286 |
| r3 BadlandMountain 39 | 9 | 32 |
| r5 PineForest x3 | 9 | 45-87 |
| r6 BadlandForest 21 / 127 | 9 | 53 / 8 |
| r7 PineForestMountain 37 / 184 | 4 | 65 / 53 |
| r14, r19 x2 each | 9 | 336-390 |
| r16 131 / 134 | 9 | 206 / 100 |
| r28 160 / 161 | 9 | 133 / 84 |
All 24 maps call `enter_static_region_map` once; every map has at least 3 candidates (fewest: r6_BadlandForest2, 8).
---
## 3. Trees and the axe
### 3.1 Trees today
All tree scripts: `G/Data/HCGframes/event/CommonTree*.rb` (6). Common to all: in combat -> "incombat" popup, STA <= 0 ->
"sta_too_low"; per swing: animation, chop sound, `switch2_id -= 1`; a yield every 3 swings (`switch2_id`, reset to 3);
`switch1_id` yields per tree (`rand(3)+1` default, line 9; the map's "high tree" events set `@switch1_id = 3` on a fresh
visit, Map037 EV3 init); at 0 the tree falls and leaves a stump (`ChopedTreeBig/Small`). No cooldown: trees are re-rolled
on every visit like nodes (high tree init moves to a random region-10 tile when `ReRollHalfEvents == 1`).
| Script | Placed by | Yield | STA vanilla | Tool, vanilla | STA under RPS | RPS tool |
|---|---|---|---|---|---|---|
| CommonTree.rb | r-map "high tree" events (most r-maps) | Wooden Club (:19) | 5 per swing (:12), 45 per tree | none | 1 equipped / 5 (`calc_harvest_sta_cost(4,"ItemMhLumbAx")`, `RPS/.../CommonTree.rb:24`) | Lumberjack Axe |
| CommonTreeNoble.rb | r12 RoadNoerNob (4 trees) | Wooden Club (:21) + MoralityDown30 (:19) | 5 per swing (:12) | none | same as vanilla (RPS copy unchanged) | - |
| CommonTreeApple.rb | StaticAppleTree (Map001 EV223), r7 | Apple (:23) | 1 sickle / 3 per yield (:16-20) | Sickle id 10, equipped | 1 / 4 (`calc_harvest_sta_cost(3,"ItemMhSickle")`) | Sickle |
| CommonTreeArecaNut.rb | StaticArecaNut, r2 | 2 Areca Nut (:23-24) | 1 / 3 per yield | Sickle | 1 / 4 | Sickle |
| CommonTreeBanana.rb | StaticBananaTree, r4 | Banana (:24) | 1 / 3 per yield | Sickle | 1 / 4 | Sickle |
| CommonTreeNuts.rb | StaticNutsTree, r5 | Nuts (:23) | 1 / 3 per swing (:14-18) | Sickle | 1 / 4 | Sickle |
Wooden Club is also bought: 20 barters list it (e.g. `NoerBlackSmithShopTrader.json:9`, `CommonWeaponTrader.json:9`), price
100 (`G/Data/Effects/Weapons/MhWoodenClub.json:4`); RPS start kits include one (`RPS/Scripts/0_CORE.rb:299-312`). Clubs are
also fuel: placing the player's dark pot takes 1 (`480_EventCharacterBatch.rb:1384,1399`), Glass and Smelt take 1
(`LC/Scripts/30_Process.rb:30-31`).
### 3.2 Axe-like items
| Item | Source | Kind | Price | Sold | Notes |
|---|---|---|---|---|---|
| (none) | game | - | - | - | vanilla `Effects/Weapons` has no axe; PickAxe and Sickle only |
| ItemMhLumbAx "Lumberjack Axe" | RPS `Weapon/MhLumbAx.json` | main-hand weapon, STR 2 | 500 | CommonWeaponTrader x1.2, FishKindWeaponry (`0_CORE.rb:561,574`); chest loot (:1293) | RPS's tree tool (STA 1/swing equipped) |
| ItemMhPoleaxe | RPS `Weapon/MhPoleaxe.json` | main-hand war axe | 12000 | Noer blacksmith x2 (`0_CORE.rb:534`); chest loot (:1290) | an axe, not a tool |
No hatchet exists anywhere. Axe items found: 2 (both RPS).
### 3.3 The Hatchet (**Decided**)
| Field | Value | Option |
|---|---|---|
| Name / id | Hatchet, `ItemLonaCraftHatchet`, `LC/Item/Hatchet.json` | - |
| Kind | tool item, `"type": "Other"` (not equippable) | main-hand weapon: needs Lona arm sprites (`CHSConfig` MainArm layer, as RPS does for LumbAx) |
| Price / weight | 150 / 5 | - |
| Registration | 13th row of `LonaCraft::ITEMS` (`0_Core.rb:36-50`), icon cell 12 (free: cells 12-15, 70-79 of `Iconset_LonaCraft.png`) | separate TOOLS list (needs a 70_Save edit) |
| Save | covered: `ITEM_NAMES` is already remapped (`70_Save.rb:52-55`) | - |
| Icon placeholder | a drawn 24 x 24 hatchet in cell 12 (cell 12 was empty; the game has no axe icon, 3.2) until the owner icon exists | - |
| Icon prompt (for ASSET_PROMPTS, 24 x 24 icon) | "A small hatchet icon: short pale wooden handle angled up-left, a grey iron wedge head with a bright edge facing right, a strip of leather wrapped at the grip." | - |
Rule (**Decided**): with LonaCraft on (`LonaCraft::Nodes::AXE_REQUIRED = true`), `CommonTree.rb` and `CommonTreeNoble.rb` need an axe
**carried or equipped** (`$game_party.has_item?(item, true)`, `29_Game_Party.rb:303`). Accepted, when registered:
`ItemLonaCraftHatchet`, `ItemMhLumbAx`, `ItemMhPoleaxe`. Without one: buzzer + popup `LonaCraft:Nodes:Tree/need_axe` ("Need an
axe to cut wood."), no swing, no STA, the tree's counters untouched. STA stays the scripts' own (vanilla 5/swing; RPS 1
with the Lumberjack Axe equipped): the Hatchet unlocks, the Lumberjack Axe speeds up.
Fruit trees (Apple, ArecaNut, Banana, Nuts): **unchanged, fruit by hand (Rec.)**; they give no wood.
### 3.4 Bootstrap (**Decided**: pickaxe required)
| Way | Chain |
|---|---|
| Buy | Hatchet in `NoerBlackSmithShopTrader` and `CommonWeaponTrader`, amount 1, `itemPrice*(shopNerf+1)` (`0_Core.rb` BARTER_ADDS) |
| Craft | `LC/Recipes/Hatchet.json`: 1 Wooden Club + 2 Rough Stone + 1 Rope, `station ["hand", "carpentry"]`, `fixed_tier 1`, skill 0 |
**Gold-free start (back with the loose stones, 2.4).** Stone without a tool comes from loose stones; the Wooden Club is
in Lona's start kit (`G/Data/Effects/_Sys_Actor/Lona.json:14`; RPS kits too, `RPS/Scripts/0_CORE.rb:299-312`), so the
hand Hatchet needs no gold. A pickaxe is still needed for boulders (Furnace onwards).
First pickaxe (price 200, `G/Data/Effects/Weapons/MhPickAxe.json`):
| Seller | Barter | Price |
|---|---|---|
| Noer blacksmith | `G/Data/Barters/NoerBlackSmithShopTrader.json:25` | 200 x (shopNerf+1) |
| Common weapon traders (Noer market, forts) | `CommonWeaponTrader.json:25` | 200 x (shopNerf+1) |
| Fishkind weaponry, North FL dock | `FishKindWeaponry.json:29`, `NorthFL_Dock_WeaponTrader.json:31` | markup |
| Arena slave-fight supply | `NoerArenaB1_SlaveFight.json:37` | 200 flat (arena route only) |
| Prison mine quartermaster | `HumanPrisonMineQuartermaster.json:17` | captured route only |
Gold-free path to the Carpentry Bench:
| Step | Get | How | Needs | Evidence |
|---|---|---|---|---|
| 1 | 2 Rough Stone | pick up loose stones on a plains / road / badland visit (1-3 per visit, no tool) | - | 2.4 |
| 2 | 12 plants | forage by hand | - | plants on every r-map BIOS |
| 3 | 3 Rope | by hand, 4 plants -> 1 | step 2 | README Stations |
| 4 | Hatchet | by hand: 1 Wooden Club (start kit) + 2 Rough Stone + 1 Rope | 1, 3 | `LC/Recipes/Hatchet.json` |
| 5 | 3 Wooden Clubs | chop 1 high tree (9 swings, 45 STA vanilla) | Hatchet carried | `CommonTree.rb:12,19`; Map037 EV3 `@switch1_id = 3` |
| 6 | 6 Planks | by hand, 1 club -> 2 | step 5 | `30_Process.rb:24` |
| 7 | Carpentry Bench | by hand: 6 Plank + 2 Rope | 3, 6 | `LC/Recipes/Furniture_CarpentryBench.json` |
With gold the Hatchet can simply be bought (150 x markup, step 4); the bench needs no stone.
Stone path (Furnace onwards): loose stones (1-3 per visit), or buy a pickaxe (200 x markup) -> boulders on r1/r3/r5/r6/r7/r14/r16/r19/r28 (2.3), 4 Rough
Stone each; 20 Rough Stone for the Furnace = 5 boulders. With stone in hand a second Hatchet can be crafted (1 club + 2
Rough Stone + 1 Rope).
---
## 4. Hook points and RolePlayS collision
`load_script(path)` (`G/Data/Scripts/102_ScriptImport.rb:61-76`): `path = $mod_load_script.fetch(path, path)` (:63), then
`instance_eval` for `Data/HCGframes/` paths, `eval` with binding otherwise (:68-72). `Game_Interpreter#load_script` overrides
run before the redirect and see the event's own path.
RPS redirects every file in its `HCGframes/event/` (34 files) through `$mod_load_script` at script load
(`RPS/Scripts/0_CORE.rb:1707-1717`), including all 6 `CommonTree*.rb` and `Mining_Saltpeter.rb`, `Mining_Phosphorus.rb`
(plus its own `Mining_Mineral.rb`, called by path from StaticCrystalOre). No other mod touches these scripts or
`enter_static_region_map` (grep of `_Mods/*/Scripts`).
| Way | What | Collision with RPS | Verdict |
|---|---|---|---|
| **`$mod_load_script` wrappers (Decided, built)** (Homes pattern, `100_Homes.rb:945-972`, `:1393-1403`) | `LC/HCGframes/CommonTree.rb` + `CommonTreeNoble.rb`, each `lonacraft_tree_chop("<game path>")`: check the axe, then run the previous script (RPS copy or vanilla) with the redirect lifted | `45_Nodes.rb` loads after RPS and stores RPS's entry as "previous", so RPS's copy runs unchanged; if RPS were loaded after LonaCraft it would overwrite the redirect and the axe rule would not apply (the load-order warning, `0_Core.rb` LOAD_AFTER, covers this) | built |
| `Game_Interpreter#load_script` gate (draft Rec.) | in new `45_Nodes.rb`, `alias_method` on the override 40_Mining defines (`40_Mining.rb:56-66`; a second `def` would replace it): if `File.basename(path) =~ /\ACommonTree(Noble)?\.rb\z/` and no axe -> popup, return; else call the chain | none: runs before the redirect, RPS's copy still runs unchanged | no files, order-proof |
Scripts wrapped: `CommonTree.rb`, `CommonTreeNoble.rb`. Not touched: the 4 fruit-tree scripts, all
`Mining_*.rb` (ore nodes stay as the game and RPS have them; their 60/35 by-products stay). New: `LC/HCGframes/Mining_Boulder.rb`
(called by the boulder event, not a redirect). Spawn hook: `Game_Interpreter#enter_static_region_map` override (2.3).
---
## 5. Save impact and build items
Save: nothing new. Boulders are summoned per visit and vanish with the map; the axe rule is stateless; the Hatchet id is
remapped with the other `ITEM_NAMES` (`70_Save.rb:52-55`). Old saves: no change needed.
Built (2026-10-06):
| Item | Files | State |
|---|---|---|
| Hatchet | `Item/Hatchet.json` (new), `Scripts/0_Core.rb` (ITEMS row 13 cell 12, BARTER_ADDS: Noer blacksmith + new CommonWeaponTrader row), `Recipes/Hatchet.json` (new), `Text/<CHT ENG KOR RUS UKR>/Items.txt`, `Graphics/System/Iconset_LonaCraft.png` cell 12 | built |
| Axe rule | `Scripts/45_Nodes.rb` (redirects, `lonacraft_tree_chop`), `HCGframes/CommonTree.rb`, `HCGframes/CommonTreeNoble.rb` (new), `Text/*/Nodes.txt` (new) | built |
| Loose stones | `Scripts/45_Nodes.rb` (`LonaCraftLooseStone` node cloned from StaticSaltpeter, LOOSE_MAPS, spawn after the boulders), `HCGframes/Mining_LooseStone.rb` (new) | built, game `item_icon01` stone; `LonaCraft_LooseStone.png` override |
| Boulders | `Scripts/45_Nodes.rb` (EventLib clone, BOULDER_MAPS, filter, `enter_static_region_map` override, `lonacraft_mine_boulder`, own `load_mod_database` alias), `HCGframes/Mining_Boulder.rb` (new), `loader.rb` (line after 40_Mining.rb) | built, `$_boulder` placeholder |
| Owner sprite | `Graphics/Characters/LonaCraft_Boulder.png` picked up when present (`@manual_cw/ch = 1`) | code built, **needs the generated 48 x 48 sprite** |
| Docs | `README.md`, `docs/ASSET_PROMPTS.md`, `docs/BOARD.md` | built; debug keys not added (95_Debug.rb belongs to another build) |
Draft plan (kept for reference):
| Item | What | Files | Lines (approx.) | Sprite? | Order note |
|---|---|---|---|---|---|
| B1 Hatchet | item, icon cell 12 (placeholder from icon 406), 2 barter rows, recipe, texts | `Item/Hatchet.json` (new), `Scripts/0_Core.rb` (ITEMS row, BARTER_ADDS rows), `Recipes/Hatchet.json` (new), `Text/*/Items.txt`, `Graphics/System/Iconset_LonaCraft.png` | 45 | icon: placeholder ships | after the recipe-layer merge (it edits `Recipes/`) |
| B2 Axe gate | `AXE_REQUIRED`, `AXES`, load_script alias, popup text | `Scripts/45_Nodes.rb` (new), `Text/*/Info.txt` | 50 | no | after B1 |
| B3 Boulders | EventLib clone `LonaCraftBoulder`, `BOULDER_MAPS` table (family prefix -> max, region, rule), tile filter, spawn in `enter_static_region_map`, `lonacraft_mine_boulder` (STA, yields, 15% Iron Ore, last-yield bonus, delete) | `Scripts/45_Nodes.rb`, `HCGframes/Mining_Boulder.rb` (new, 1 line), call from `0_Core.rb load_database` | 140 | ships with `$_boulder` placeholder | after B2 |
| B4 Owner sprites | `LonaCraft_Boulder.png` picked up when present (`@manual_cw/ch = 1`) (the rubble / BoulderBroken idea was dropped) | `Scripts/45_Nodes.rb`, `Graphics/Characters/` | 30 | **yes: needs the generated sprites** (prompts already in ASSET_PROMPTS.md lines 12-13) | any time after B3 |
| B5 Docs and debug | README (materials table: Rough Stone from boulders; Mining; Hatchet; tree rule), ASSET_PROMPTS (remove the "used frame" claim, add the Hatchet icon line), debug key to summon a boulder in front of Lona and give a Hatchet | `README.md`, `docs/ASSET_PROMPTS.md`, `Scripts/95_Debug.rb` | 40 | no | after the recipe layer (it edits `95_Debug.rb`) |
Total about 305 lines, 4 new files. Gates for the builder: boot log clean; on r16/r3/r7 summon count and tiles; 9 hits ->
4 Rough Stone, STA 9/18; tree with/without Hatchet, with RPS Lumberjack Axe equipped; fruit tree by hand; RPS on and off.
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,35 @@
<!doctype html><html lang=en><head><meta charset=utf-8><meta name=viewport content='width=device-width,initial-scale=1'><title>LonaCraft furniture catalogue</title><style>
:root{color-scheme:dark}
body{background:#17171a;color:#ddd;font:15px/1.4 system-ui,Segoe UI,Arial,sans-serif;margin:0;padding:12px 16px}
h1{font-size:16px;margin:0 0 12px;font-weight:600}
h2{font-size:18px;margin:24px 0 8px;border-bottom:1px solid #444;padding-bottom:4px}
h3{font-size:15px;margin:16px 0 6px;color:#aab}
table{border-collapse:collapse;width:100%}
th,td{border:1px solid #333;padding:6px 8px;text-align:left;vertical-align:top}
th{background:#24242a}
td.img{width:1%}
.imgs{display:flex;flex-wrap:wrap;gap:6px}
figure{margin:0;display:inline-block}
figure img{display:block;image-rendering:pixelated;max-width:100%;height:auto}
figcaption{font-size:11px;color:#999;max-width:200px;word-break:break-all}
tr.bad td{background:#3a1416;border-color:#7a2a2e}
.why{color:#ff7b7b;font-weight:600}
code{font-family:Consolas,monospace;font-size:13px}
@media (max-width:640px){
thead{display:none}
table,tbody,tr,td{display:block;width:auto}
tr{border:1px solid #444;margin-bottom:10px}
td{border:0;border-bottom:1px solid #2a2a2a}
td::before{content:attr(data-l);display:block;font-size:11px;color:#889;text-transform:uppercase}
td.img{width:auto}
}
</style></head><body>
<h1>LonaCraft furniture catalogue, 2026-10-06: Added 54, Candidates 79, Building pieces 3 (+1 drop sheet); 325 images embedded, 0 rows with missing sprites.</h1>
<h2>1. Added (54 kinds)</h2><table><thead><tr><th>image</th><th>kind key / suggested name</th><th>display name</th><th>sprite</th><th>footprint</th><th>notes / description</th></tr></thead><tbody><tr><td class="img" data-l="image"><div class="imgs"><figure><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAIAAADdvvtQAAAWs0lEQVR42u1dS48k6VWNR0bkqzLr1d3VbvcIsKBhYCxZyDMMyCOMPOKxsFhYFjJCCJCQvGNjIeAXsLCQeMgbFiywQEggxAqJAWSNMY1sIaGewaOhx+qHp6fb9cysyoyM5xcs4p4T1V9UVfd43NOR1fds+ut45+s7de49373utWs/6ZyEtbWNE7dPJvtP9Pgvf+mVahB4bjWICyOndOWYt2/frwZ/8jffedLP8yEc/we/9bz8xw2qf0NPBpfwmr9x491q8Lev3W3V83uOQvEBoF8gxQdCp20PFPj4TpdCYbnJqkG2SKvBg53t8/QZ9DuhfBiBENawK1s8v6wGg6GvM5BCKUyhaDmFea7HkQxiUWG+W1SDu3f2qsFXfu8FOdaTF1J0fBCfnJ3leTWYxTIosaVIcZAnTLG2OhISCeQ63UCu7HVkYHBw35En/A5UYV7kjvMRx3F2pxO5zrAnb3QvABHLTRdR9RhrBtcp3RIPLwMfA5PlOgMpzuMM1LZ4ieJstO3zah2FlQgbJqkQVgrGiRzZ4pYiUu4ezOS0XFjAL0rrOvM0B5dBzeUliE94qvQN3qapvC8F3iBQqtuRgSnBL6AePCCez3EKPE8ayZZoUeAsuRe5en+yqAZhPxHeBCOPh/JKb995gGuPlMIUqsIUinZS2M23b1aDe7siZI5imdhHnnDQrbs71WBlxbV/CVBhjstdwjggN8fjlszgCNkShojggadcXqeWh/JviF3beFRj5IL396Y4iWeBAUGgJSTg5c2xvNIoxgAvuSdnXb9xT0jt8sd1BlIohSkU7aSwes4vOdWDe0rZhSCf897BXEYGKqx0rNMZlHMgfxyoJ9+XC7k4zQWXuSQ8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JqS2iltcCERPGfgYac5PunJ3+CKdeSq/zDluOh7jUecSmRwEKJi/EFKDFqwt/ToDKZTCFIqlpjDW4J0vEvBUgH0y1V+5KF0jp3OhgcO5XWGeUcdDOCs6IBE68GkU2TmUzNcYHkVKrfWRcNnKQC44KEMwoJx+D4HEnQO5ztFsAcEoN53Lsc6FcQ/EJ4+6vTfXGUjxbMxA6gdqM9rvB1oCCmPJC9bZiLASuTB2BeCtDeEXOt65KzdwJCIOeWlVDn5vZybHYK10lAjNTWYwEI7l4HmC6yCZFXZlMOqJ1OrDxfHRDYmCsvri9qTRKppWydDDWQOlMIWqMIXiHKgwBtV6YQCCkAE9gRNoHNrjh30Y/yCsumAug9Dij2ytWXw3jeR0rhTzMWBSLMlyPAaqc8zlESe+PIYPSzw9G1uw4gdcK70/B6nJWSGyY2FHZyCFUphCcR4obNBjzSj5uudgnC6ST1y/fIBVV/QokviSlBkrOWsX0cKXX7haDa5/W5ZRRwuUK8R1XLxXbN2V46ZFKgOc5LjI1pHmuNS6iwVrF4dCsgU4cYI02WxRLs0XaBnqA60+s79v9QLine truncated
<h2>2. Candidates, not added (79 entries)</h2>
<h3>Lights (14)</h3><table><thead><tr><th>image</th><th>kind key / suggested name</th><th>display name</th><th>sprite</th><th>footprint</th><th>notes / description</th></tr></thead><tbody><tr><td class="img" data-l="image"><div class="imgs"><figure><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAADACAIAAAB05vGBAAAOAElEQVR42u1dS4wc1RV9r6r6O5+u7hnPjMc/HBzIFxIRTEhMIiIFiUXAREEKChAiJVI2UYQiRVkEJQukZMEim4hFFsmCRIkJhAQ7xvwNxsjBhI8NBpuPP9jMuKd7+jdV1d3VVVm8c1/3VE83Nsx4hsmtzVy9ul316tY9755733s18pJLPiMWOmw7t2B7qVT8v9I3BB99DzYQG4gNxAZiA7GBPr6HxXynvz57EEOMDcQGYgOxgdhAq5cHMd/pr88exBBjA7GB2EBsIDbQ6uVBzHf667MHMcTYQ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N9Nv+5rtMZI1KpVHeC3gqlUuv2i/GxyQXzicX8/2Jhn8auc/pL1yNr1s2zRUeHOjonpT/PNsLine truncated
<h3>Furniture (29)</h3><table><thead><tr><th>image</th><th>kind key / suggested name</th><th>display name</th><th>sprite</th><th>footprint</th><th>notes / description</th></tr></thead><tbody><tr><td class="img" data-l="image"><div class="imgs"><figure><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAIAAADdvvtQAAAWfUlEQVR42u1dSY9cWVa+900xZEYOzvRQ5VKVG3C1GgSoSzQgpg17GokV/6CXvWWFhEDiHyBBr9mwRuwACbW6BXQL3KhRtZsu21Xpsp2ZzsghpjddFnG+74bvc5o0fuF0Zp6zyZsRb7jvxYvzxXfOd8+xH3/8i+ZltrFx7aWvD4fPX/r6X//ZH8wH1tXzwbio5oNBIq/cf/R0PviL7/xwfX3TGGOtlb0wODw8aGU+V3D7b/3hTfnHpvO/WSSDGxud+eC7976YD/7h305amU9k1NTewPQBUnsjS9o6UCeNZeTkmDM3mw9SU4p7PBZ4iqIojmO9++1aL8nkQ00FsFY68koUu/mgv9LybVcPpKYPkNolgLDIRhwJFaiFfCVW6NjnD/fng7/9098ElskEqkRcayk7maIU4DuZysDhlSrHRpEz5kNjzMb6QJw2kLSTypGjRAZ1JG68Z2SG//PgSzlpJUcuChmMZzPcoXV5ZToRRLZyipWVrmzSFbJTTGpjto0xk3GJI8tUa+B4jdsSR/M71o9xxwq85TDIMjlXrytXsZpcl5PGcsML3PjhWI7jrMPNlEGMQY0LVA+k9m54oLbiE2oXy9qKP7UGYQ6+epYLYOVAnLGRV6wTUvDoAFGsUrxuXLngOKMcsFIWGDgAnzh2F9e4vEO5ngoXBki1iQxqB38OCMMEMT9jbC3DElHQMeKihZPjrKayez6WvcaTCkeWjYnnruKcZa+0I3g3mtZAAQdUIpYB0E/kLTPDxgN5pTsA/8Vn+PyxgGzWE/zt4BfC2orc+QcPnyiEqSkLU1MWFtj9T+/PBzt7w/ngeCq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R/FyFuKUHEaZlGUYA+gE6zvgq/YBLQnwP0cZ/vjd6tUcxxrDLSk9/RKspC1NTCHsdOzkRd/q7v/U18cNsm5JASw8+de3GdoAU1q/ronYdgUQUppiwdAZCZ0UxDQjIb/zaHcAlgoTMOZkGicNJ0zCuufjlI08MhSukmXdubWJi8soIMnuuOGNEsYZQc2WwGmA9pYlMDP704RP1QGoKYWpXE8La0gOdZftuT9Bkb38U+HyboMEl1wLD1ado8WzYFMyHH7FxHNbptVhAZdGoqyzCmvO+DrxlNoqwwkVtULPX09O+fhEzTT7RFHZbdiWrl8jfnHHRRlMwLzvk/YnqALmYyOvg2l8q8TlLvOe07c+iB1IPpKYQpnZFWBg9Mwt5sDFWihBc1ePKaHbDhOyB5MtLPlJwk7DhCDtuzaC1KPL6Bcq0OCEGC4lcrtHeK87C62koJIlYtcuC3Wvmvlg4q2BfGMCur4fMdFtYEYpikkku2+wfjtUDqSmEqSmELdvW10XOsTVA33swiBqoxhW7DuuXp24GfCkDBsLgXoeqRVbwQNGnHmpn1J0cpyheYEqLJThYhhHgxgGFf2kSBwgWeV0HkcYFl1OgLSbx9ziSaRyOp6CHUKcLine truncated
<h3>Decorations (36)</h3><table><thead><tr><th>image</th><th>kind key / suggested name</th><th>display name</th><th>sprite</th><th>footprint</th><th>notes / description</th></tr></thead><tbody><tr><td class="img" data-l="image"><div class="imgs"><figure><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAADACAIAAADdvvtQAAAb2UlEQVR42u1daW8cV3at7up9b64iRUmUJctjObZijwcTOBNMgjFmvoy/JEiCwAlgI0gCI0CQP5UESJAf4QAJZuw4ie3RWLYWihT33veltnyoe05Rj7K1kLJE6t4vfOiurnr1unhPn3vPvS925cpV60FWqcw88PV2u6nH6/G0uKWmdgTTB0hNHyA1fYDU9AFS0wdITU0fILXv0xIaz9Djj3K8eiA1hTA1fYDU9AFS0wdITU0fIDV9gNROjCU0nqHHH+V49UBqCmFq+gCp6QOkpg+Qmpo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oJ965MfqYqF40652OqfeSwCBOZHDTwIIPbXYHdm7fu4L4CgEgPGERUsvFWB+BoijnZMZJK/jRKrfNoMrxVGz36F0c6FLine truncated
<h2>3. Building pieces (3)</h2><table><thead><tr><th>image</th><th>kind key / suggested name</th><th>display name</th><th>sprite</th><th>footprint</th><th>notes / description</th></tr></thead><tbody><tr><td class="img" data-l="image"><div class="imgs"><figure><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMAAAAEgCAIAAABtjetmAAApBklEQVR42u1dy5Ic13GtW89+DgYEQBIiIJGixJDpsB1+e2d/gMM7f4T3/iEvvPcPeOm9F5btUCikMEVRJAYDzKNf9bxezD3nNvOiG1NDDKsUkbmq6K6ux+3qPJ2ZJ0+af/6nf4iiKIoiE5mbjSxNbzbyIr7ZKPjKJHf7ZFO3McluNpLEvWXch3C4KIrxStFsbjY6vNVFLXZ2p2hae7NhO7dhOnektnM717ZxH7f1zUZVuo31tsQrbuemdhtf/ubFzcYHz5/ebJyePsAp3Lkurq/d2a175YNHpzcbV5stDuguv2ncZXz51dc3G9cvz7AI7poNVuHpo6U76clELFDH5YDt8BauIopa7NQF62uDz9/JFo8+uNn4PyzUsx98eLOR4gFIU3f2Gb73OFJT+w6mD5Dad7LUwMkmwUYEVKrhwSJTwEW7V4rI7TNNEwdqSSwezq50zn9LPxzRw8c4qdsoqwreO/ZAJx93dxmxcWePkw2Q1AFWkQMKmxo7twKsee/+jrEFII1OH5wCOgrgpruernVHXm02AP1EIA4h6MOPHt1sLOcz9xbO0XZE7UacIsa9xxmOXAA7+F/Bg9l3sm/OroDsJ27j4QMsrzzpo5NcPZCaQpja4BB2ulwKf56mzjs9mDmcmkzcc5bHCSAsIQY695skwBsrcapwIdsym4nn9nrnUKCuroEdMQBiAywjhCXAhVwEMGUFOKjdx+vaXXyJy9kAfxlTeM+M60mTFDdo8ZaD1Dli0vW2k3EiwKhuWvm7xMU3MaJC427ZprgyRHMW+/C+GKB1AOKo2YmvMIkR/+IriO3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low7spgtAoP/eVvnGZUbRwutRDBmFlMS7Fu5/eeoOvq3uaVjG19/JHZ/RdE3WT4qAdSUwhTGxDCehWGWrREPX/+MVwrghSIexR8ZeIAIsumQEkXCySJe4tsBXrfOVJulHii4i67sAkdbSc9KtkprN/VXrXJAfGf/pm7Ht57hdRig4wiyeyddTuvQLVsarR+Q8bky6++vtl4PLfC+fvcHo5YMqA6zJf3I54lqHj8PGaEnkkwNaB0/HiGXJDU8kOoX2/c1/TsBx8iduNgaPex+SRTD6SmEKY2giisR2GIrbt7U4nJxHaoVLNT10BvEFIVBbJxU995FIsnud5U344tPHmdaiEELEKqtb7LKvhtMCrMEW1sgKTuToscx0ECsAXQvHdyIm6ns50ITldoLv7sJ++5j9eyYbjIYgFGYczVBK+E1tYS+UzoDDx9MZEhHwpeWfBx5ob/69evbjZOHz7AYQBY+M/xaJmoB1JTCFMbHMIYd9ymMHS6WNxsnCyX+H/ucOHBzOHUZEJ6APSX6EhRrLEo1nSRVDfKZwsAD2AFo6mofEX9kBYaTexl2+sIQBzEKhZim7ICAtYxUNtdPNJsUQXPPp0Line truncated
<h2>Appendix: the mod's drop sheet (1)</h2><table><thead><tr><th>image</th><th>kind key / suggested name</th><th>display name</th><th>sprite</th><th>footprint</th><th>notes / description</th></tr></thead><tbody><tr><td class="img" data-l="image"><div class="imgs"><figure><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABIAAAAMACAIAAADT3YtbAAEAAElEQVR42uz9Z4Bkx3ndD1fnODM9OW3Ou9gFFotMAAQJJpES+ackm5QlWsmiZcm2LFu2ZNkKtl9ZwZJlyZIp2VagKVESg8QgBpAECIDIeQM2z87Mzuzk1NM59/vhnlOz6MECWGCnp3v2/D5gC93VfW/VrXrq3qnT53Ht2XPAvBqxWMervh6PL6q+6qu+6qu+6qu+6qu+6qu+6qv+m6jvNkIIIYQQQggh6oIewIQQQgghhBBCD2BCCCGEEEIIoQcwIYQQQgghhBB6ABNCCCGEEEIIPYAJIYQQQggh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KGeWcCQGD6FO+onT4/jVBcxxvpiiKs+Ln9Line truncated
</body></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB