Files
LonaRPG-Online-Games/ModScripts/_Mods/LonaCraft/docs/RESEARCH_DIFFICULTY.md
T
2026-10-29 21:59:06 +04:00

27 KiB

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)