Task #27: the thirty nights

- campaign_nights 5 -> 30. The old night 5 ("The last night") is now night 30, keeping its
  uid, title, hint, and 180 s. It grew to 73 base / 511 played in its three waves, with UFO
  groups added, at speed x1.25 and HP x1.625.
- New hand-authored night 5, "Lights in the sky": night 4's shape plus the first UFOs (two
  single-UFO groups, 14 as played), 24 base.
- New game/tools/make_nights.gd writes nights 6-29 by the plan's recipe (seed 30, sieges on
  10/15/20/25, mix, waves, scales, draft titles and hints) as .tres text with fresh uids. It
  skips existing files unless --force (which keeps their uids), refuses ranges outside 6..29,
  and checks every plan with NightPlan.problems() at the played scales (non-zero exit on any
  problem). Generated nights 6-29 are committed.
- test_nights: the arc (30 plans, breakers from night 3 and UFOs from night 5, no non-siege drop
  over 15% from night 3 on, sieges, last night longest), the per-night scales, the new night 5
  and night 30 designs. The back-to-back run plays nights 1-5, 10, and 30, skipping the rest
  with CampaignDebug.jump_morning.
- test_campaign, test_cycle, test_flow read campaign_nights instead of a hard-coded 5.
- RULES (the vacation, the Night row, the thirty nights and their table, the vacation's end),
  README, and a dated PLAYTEST section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 16:38:07 -04:00
parent 3bb835f7c3
commit ab1443325a
36 changed files with 2956 additions and 136 deletions

View file

@ -102,9 +102,9 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
the bombs sit in the off-hand, thrown with right mouse / LT. The models are the user's (`assets/weapons/`, posed on
the scarecrow by `WeaponModels`); the HUD's weapon panel (bottom right) shows them. Shots, the
corn shooter, and enemy hit proxies sit at 1.8 m, above the sunflowers and the pen fence.
* **Campaign** — `CampaignController` (`game/scripts/campaign_controller.gd`) runs the five-night
vacation: Morning → Day → Dusk → Night → Dawn per night, then the farmers' return, with Game
Over from any phase. `FarmState` (`farm_state.gd`) is the single source of truth for what
* **Campaign** — `CampaignController` (`game/scripts/campaign_controller.gd`) runs the thirty-night
vacation (`GameConfig.campaign_nights`): Morning → Day → Dusk → Night → Dawn per night, then
the farmers' return, with Game Over from any phase. `FarmState` (`farm_state.gd`) is the single source of truth for what
persists; settings are in `game/resources/game_config.tres` (`GameConfig`). The rules are in
[`game/RULES.md`](game/RULES.md) and the development plan in
[`first-game-plan.md`](first-game-plan.md). `CampaignDebug` is a debug readout of the phase and
@ -112,8 +112,10 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
speed, F9 sets the scarecrow to 0 HP, F10 strips the farm (every category), R retries after a
Game Over, and T / G / H send in a thief / a crow / a fence breaker. F2 cycles tonight's plan
through the debug scenarios (`game/resources/scenarios/`). They introduce the enemies one type at
a time (crows, thieves, fence breakers), then pairs, then all three. N starts the night early
(only when `allow_early_night` is on).
a time (crows, thieves, fence breakers), then pairs, then all three. In the morning review,
F3 / Shift+F3 jump to the next / previous day's morning with the farm as it is (no autosave;
`CampaignDebug.jump_morning`), to try a late night without playing up to it. N starts the night
early (only when `allow_early_night` is on).
On the farm the scarecrow moves with WASD / left stick, aims with the mouse / right stick, and
fires with the left mouse button / right trigger.
* **Scarecrow kit** — `Scarecrow` (`game/scripts/scarecrow.gd`): health in `FarmState` with 1 s
@ -128,7 +130,7 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
`--mode=cycle --cycles=N` plays whole days and nights (gather, rebuild the pen's gate, build a
fixed defense plan, buy upgrades with what's left, guard all three targets and lead loose
animals home; `--build=0` / `--guard=0` / `--upgrades=0` turn parts off), reports each night's
losses per target, and checks what carries over. `--cycles=5` plays the whole vacation.
losses per target, and checks what carries over. `--cycles=30` plays the whole vacation.
* **Economy** — wood, scrap, and straw (`ResourceStore` in `FarmState`): shed stock plus the
scarecrow's 15-unit pouch, which empties into the shed when it walks into the Supply Shed zone.
@ -167,13 +169,19 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
and hotbar; `Interactions` repairs. Rules and numbers: `game/RULES.md`.
* **Day and night** — `WaveDirector` (`game/scripts/wave_director.gd`) plays each night's
`NightPlan` (`game/resources/nights/night_1..5.tres`).
`NightPlan` (`game/resources/nights/night_1..30.tres`, by count: `FarmSim.night_plan_path`).
- A plan has a title, a dusk hint, an optional night length and scales, and groups of enemies by type,
time, count, spacing, and target. Where isn't planned: each enemy arrives at its own random
point along the farm's edge (on foot `GameConfig.spawn_margin` out, wherever there's a route
in; crows `flyer_spawn_margin` out).
- The five nights each test something new: crows only; a second target; breakers; groups at
once; three waves. From night 2, every group is played at seven times its size, about three
- Thirty nights. The first five each bring something new: crows only; a second target;
breakers; groups at once; UFOs. Nights 6–29 are generated by `game/tools/make_nights.gd`
(seed 30; it never overwrites a night without `--force`, and checks each plan as played):
they grow from 182 to 427 enemies as played, in 3 to 5 waves. Every fifth night
(10, 15, 20, 25) is a 30% heavier siege, and each night's enemies are a little faster and
tougher (`NightPlan.enemy_speed_scale` / `enemy_hp_scale`, up to ×1.25 / ×1.625). Their titles
and dusk hints are drafts. Night 30, "The last night", is the finale: 511 enemies in three
waves over 180 s. From night 2, every group is played at seven times its size, about three
times as often (`GameConfig.wave_count_scale` 7, `wave_spacing_scale` 0.3). Night 1 sets its
own scales to 1 (`NightPlan.count_scale` / `spacing_scale`), so it plays as designed: 11 crows.
- `NightPlan.problems()` checks a plan against the farm.
@ -181,7 +189,7 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
farm itself). `DayNight` (`day_night.gd`) eases the sun, sky,
ambient light, and a whole-picture brightness / saturation between day, sunset, night (moonlight),
and sunrise; the scarecrow carries a lantern that lights up as it gets dark, and thieves glow
faintly at night. `PhaseHud` (top left) is the sun / moon dial with "Night N of 5", the phase and
faintly at night. `PhaseHud` (top left) is the sun / moon dial with "Night N of 30", the phase and
its time left, a hint line (what tonight brings, enemies on the farm), and a banner at each phase
change ("Night 3: Breakers at the fences"), with the dusk hint under it from dusk into the
night. `ReviewPanel` is the morning review: last night's losses per category, what's left, what
@ -310,10 +318,11 @@ game/
nights/ (night plans), scenarios/ (debug plans), thief (crow) / enemy overlay /
steal ring / loot icon / fear burst / HP bar shaders
tests/ headless test runner and suites (campaign rules, farm layout, theft, scarecrow,
economy, structures, all three targets, the enemy roster, the five nights, full
economy, structures, all three targets, the enemy roster, the thirty nights, full
cycle, saving and settings, the whole game through its menus, co-op)
tools/ build_player_animations.gd, build_prop_collision.gd, render_overview.gd,
configure_input.gd, soak_night.gd, synth_audio.gd, build_ui_theme.gd, coop_smoke.gd
configure_input.gd, soak_night.gd, synth_audio.gd, build_ui_theme.gd, coop_smoke.gd,
make_nights.gd
prototype/
scenes/ main.tscn (round), player.tscn, hud.tscn
scripts/ gameplay systems (one class per file, see Architecture)
@ -494,7 +503,7 @@ godot --headless --path . --fixed-fps 60 --script res://prototype/tests/run_test
Game: 908 checks, about 80 s. Covers `FarmState` round trips (also through JSON) and rejection
of invalid data, every outcome rule including the loss-before-completion tie on the final dawn
and a stripped farm across all three categories (spent supplies don't count),
failure in every phase, the untimed morning, phase order and lengths, exactly five nights,
failure in every phase, the untimed morning, phase order and lengths, exactly `campaign_nights` (30) nights,
starting the night early (off by default), per-night loss records, and retrying a failed night
from its morning. The farm layout suite checks one non-overlapping zone per kind inside the
60 × 60 m map, zone lookup, the 30 crop units, the farm's edge and its side names, the remaining
@ -534,11 +543,16 @@ the scarecrow, turning on it when shot, six hits to stop), the character pool (o
enemy, spawns skipped past it, corpses taken over), the alert manager (grouping, escape priority
and escalation, breaches before thefts, the cap), and the debug scenarios. The nights suite checks
every night plan and debug scenario against the farm (and that broken plans are caught), what
each of the five nights tests, every upgrade's effect on the real systems (fire rate, damage,
fear, max health, fence health, defense range, trap time), that upgrades can't be bought twice or
at night and persist (next morning, JSON, retry, not into a new vacation), and all five nights
played back to back to the farmers' return. Each night brings its own plan's enemies under its
own banner, each morning is its night's snapshot, and the last night is longer.
each of the first five nights and the last tests, and the thirty nights' arc: breakers from
night 3 and UFOs from night 5, no night more than 15% lighter than the non-siege night before it,
sieges on every fifth night, each night's enemy speed and HP scales, and the last night the
longest. It also checks every upgrade's effect on the real systems (fire rate, damage, fear, max
health, fence health, defense range, trap time), that upgrades can't be bought twice or at night
and persist (next morning, JSON, retry, not into a new vacation), the F3 night jump, and a sample
of the vacation played back to back to the farmers' return: nights 1–5, the night-10 siege, and
night 30, with the nights between skipped by F3's morning path. Each played night brings its own
plan's enemies under its own banner, each morning is its night's snapshot, and the last night is
longer.
The cycle suite plays one whole day and night on the real farm: the morning review, the phase
HUD, a day's gathering and building, no thieves by day, the dusk warnings, the lighting of each
phase, the night plan's arrival times and targets at random points all along the edge, the dawn retreat, everything carrying