plan: opening intro (#29-#34)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-07 21:33:54 -04:00
parent 655f8e804d
commit 5dbad4c915
5 changed files with 337 additions and 341 deletions

View file

@ -1,9 +1,17 @@
# Harvest Season — thirty nights (2026-10-06)
# Harvest Season — opening intro (2026-10-07)
Status: planned, not started. The user asked to expand the vacation from 5 nights to 30 and
"scale things accordingly". They also asked to drop the pop-up status lines. Tasks continue the
numbering at **#23–#28** (#1–#22 are merged; the last was dcfc854). Line numbers point at
dcfc854, so re-check them before editing.
Status: planned, not started. The user asked for a cutscene at the start of every new vacation:
the farmers leave for the Bon Jovi concert, and that night a bickering UFO crew drops a part that
brings the scarecrow to life. Then a loading screen, then the first morning's instructions. Tasks
continue the numbering at **#29–#34** (#1–#28 are merged; the thirty-nights plan this file
replaced is in git at 6a9575d). Line numbers point at bbd8012 plus the uncommitted dialogue work,
so re-check them before editing.
**Before any worker starts:** the talking-head dialogue system is still uncommitted in the user's
tree. That covers `conversation.gd`, `dialogue_*.gd`, `game/resources/dialogue/`,
`test_dialogue.gd`, and the edits to `campaign_controller.gd`, `farm_sim.gd`, `main.gd`,
`tutorial.gd`, `campaign_debug.gd`, `run_tests.gd`, and `farm.tscn`. Worktrees branch from HEAD,
so it must be committed first, or the workers won't have it.
## Ground rules for workers
@ -18,363 +26,292 @@ dcfc854, so re-check them before editing.
- **`farm.tscn` and `.tres` files:** edit them as text. A headless `ResourceSaver.save()` drops
the `uid=` lines; if you must save from a script, restore them the way
`game/tools/build_prop_collision.gd` does.
- **Co-op:** changing the shape of `state.to_dict()` or the snapshot/event wire format means
bumping `CoopSession.PROTOCOL` (`coop_session.gd:54`, currently 5). Changing the save format
means bumping `FarmState.VERSION` (`farm_state.gd:12`, currently 7) and adding a `migrate` step
in `save_game.gd`. For the two-process check, run `game/tools/coop_smoke.gd` (see
`game/COOP.md`).
- **User tuning:** `game_config.tres` overrides only `costs` and `upgrades`. Its values are the
user's (e.g. Rapid fire's 3.0x), so keep them unless the task says otherwise.
- **No new HUD text:** don't add toast or banner lines for anything (task #23 removes them).
Feedback goes through the menus' own reason text, sound, or world visuals.
- **Co-op is untouched:** the intro is local, solo-only, and runs before any partner can join.
Nothing here changes the save format, `state.to_dict()`, or the wire format.
- **No new HUD text:** gameplay feedback still goes through menus, sound, and world visuals. The
intro's own captions ("Later that night....", the skip hint) are cutscene chrome the user asked
for, like the ending's caption, and appear only while it plays.
- **Look:** the user named the luggage, the UFO's flight, the part, the blue flash, the chest
glow, and the loading screen, so those are in scope. The farmers stay the tinted mannequins
from the ending. Talking heads are sketch placeholders (real portraits go in the speaker
`.tres` later). New lit `StandardMaterial3D`s get the toon look from `ToonLook` automatically;
a custom `ShaderMaterial` must `#include "res://game/resources/toon_light.gdshaderinc"`.
- **Graph:** after modifying code, run `graphify update .`.
## Decisions (the user's, 2026-10-06)
## Decisions (the user's, 2026-10-07)
1. **30 nights.** `GameConfig.campaign_nights` goes from 5 to 30.
2. **Phase lengths stay as they are:** 180 s day, 30 s dusk, 150 s night, 20 s dawn. A full
vacation is about 3¼ hours. The user turned down shorter days.
3. **Losses stay permanent** (RULES "Losses carry over"). Stolen crops don't regrow and lost
animals don't come back. The user turned down crop regrowth and animal replacement.
4. **Progression stretches with upgrade tiers and timed stock.**
- Workbench upgrades get levels with rising costs and stacking effects.
- Shed items arrive on set days.
5. **No pop-up status lines.** Remove the zone-name banner (`ZoneBanner`) and the whole message
feed (`ToastFeed`), including replies to the player's own actions. The menus already show
their own reasons, such as the upgrade rows' "Need 2 more scrap".
1. **Dialogue in the talking-head box** (`DialogueBox`, the morning sign's paper with portraits).
Lines go on by themselves in time with the action; a tap hurries them.
2. **The part is absorbed into the scarecrow.** A faint blue glow stays in its chest all game.
It sets up the day-2 alien's "You have something of ours" (`morning_day_2.tres`).
3. **Loading screen:** `assets/pictures/screens/splash-screen.png` with a slow pan, the title in
the handwritten font, and a sketch UFO wobbling along a hand-drawn progress bar, about 3 s.
4. **It plays on every New vacation, and can be skipped.** Continue never plays it. Hosting co-op
skips it.
## Defaults (assumed; flip any of these on request)
**The arc.**
- Nights 1–5 stay the introduction: crows, aliens, robots, both sides, then UFOs.
- Today's night 5 ("The last night") moves to **night 30**. It keeps the user's title, hint, and
180 s length, and its groups grow to the finale's size.
- A new night 5, "Lights in the sky", introduces UFOs.
- Nights 6–29 escalate. Every fifth one (10, 15, 20, 25) is a **siege night**: about 30% heavier,
at the normal 150 s length.
**Controls.**
- A tap (Space / Enter / E / A / click) is the box's own input and goes to the next line.
- Holding Space / Enter / A for 1 s skips the whole intro. The hint is "Hold [Space / Enter / A]
to skip", bottom right, with a ring that fills while held.
- The intro polls `Input` for the hold, because the box takes the press.
**The nights are generated as editable files.**
- `game/tools/make_nights.gd` writes nights 6–29 as ordinary `NightPlan` .tres files, so each
night stays editable in the inspector.
- It never overwrites a file unless given `--force`.
- Their titles and dusk hints are placeholder drafts for the user to rewrite.
**Skipping, pausing, and quitting.**
- A skip fades straight to the first morning sign, without the loading screen.
- Escape opens the pause menu as usual: the tree pauses, so the intro freezes, and the box waits
(`blocked`).
- "Restart the night" during the intro acts as a skip.
- "Save & quit to menu" clears the intro. The save is night 1's morning (`new_campaign` autosaves),
so Continue from there plays no intro.
**Pressure.**
- The global `wave_count_scale` of 7 and `wave_spacing_scale` of 0.3 stay.
- The ramp lives in each plan's group counts. Base totals grow from 24 on night 5 to about 61 on
night 29, about 427 arrivals as played. Night 30 is about 72 base, about 500 arrivals.
**Names and lines.**
- Speakers: **Farmer**, **Farmer's Wife**, **Little Green Alien** (the existing speaker, who comes
back on day 2), and **Big Green Alien**. They're editable in `speakers/*.tres`.
- The user wrote "etc." for the bickering. The extra lines below marked *(draft)* are
placeholders to rewrite freely in the `.tres`.
**Faster, tougher enemies.**
- Each plan gets `enemy_speed_scale` and `enemy_hp_scale` (default 1).
- The generated values start after night 5. Speed rises 1% a night, to 1.25 at night 30. HP rises
2.5% a night, to 1.625 at night 30.
- HP is floored, so a crow stays one hit. Thieves go 3→4, breakers 6→9, and UFOs 2→3.
**Staging.**
- The car waits parked nose-out (facing north) for the departure, so it drives straight off.
- The same luggage rides on the ending's car (one shared kit), so the farmers come home loaded.
- If the house model's front door is a separate node, it swings open. Otherwise the farmers appear
on the porch with a door creak.
- The scarecrow stands on a wooden post at its start spot (3, −13) in its rest pose, arms out
(check that the mannequin's rest pose is a T-pose; if it isn't, ask).
- Its lantern stays dark until the flash. Only player 1's scarecrow exists during the intro.
- The chest glow is on every scarecrow (the co-op partner's too) from then on. It's a fixed part
of the look, so nothing is saved for it.
**Arrivals wait instead of vanishing.** Today a ground arrival is silently skipped when its
type's character pool is full. Now it waits for a free character. Pool sizes move into
`GameConfig`, and #28 decides whether to raise them.
## The storyboard
**Tiers.**
- Workbench stat upgrades get 3 levels. Level 1 keeps today's effect and cost.
- Each further level costs `upgrade_cost_growth` (1.8) times the previous one.
- Levels 2 and 3 open on days 8 and 16 (`upgrade_level_days`).
- One-off unlocks stay single: Sprint, the weapons, and Radar.
About 75 s if nothing is skipped or hurried. Stage names are `OpeningIntro.stage` values.
**Shed stock days.** Corn shooter 1, Shurikens 2, Pumpkin bombs 3, Potato cannon 6, Radar 8,
Propane torch 10, Alien ray 14. Hidden items still need their goop reveal as well.
| # | Stage | Light | Camera | What happens | Sound |
|---|---|---|---|---|---|
| 1 | `leave` | morning (forced) | Wide from the yard's north-east, looking south-west at the porch and the parked car | The farmers come out of the door (19.6, −29.8) and walk to the car's doors. The **departure** conversation starts as they step off the porch, and they wait at the doors until it ends. ~18 s | door creak, day ambience |
| 2 | `board` | | same | The farmer gets in on the left and the wife on the right; each disappears with a door slam. The engine starts and the luggage jiggles. ~2 s | car door ×2, engine |
| 3 | `drive` | | Follows behind the car (the ending's follow camera), then stops at GapDriveway and watches it shrink down the road | The car drives the ending's route backwards: north along the yard road, east out GapDriveway (a horn toot), then south down the road at x 52 and away. The luggage sways on the turns. ~12 s | engine, horn |
| 4 | `card` | night (forced, snapped while black) | — | Fade to black. "Later that night...." is written letter by letter in the handwritten font, centered. ~3.5 s | night ambience fades in |
| 5 | `flight` | night | Low on the farm, looking up at the night sky; it pans to track the UFO | A big UFO (`EnemySystem.build_ufo_mesh` at scale ~8, `ufo.gdshader`, lights pulsing) crosses from the far north-east toward the farm. Its path jerks and banks with each line of the **flight** conversation (a tug-of-war on the controls). ~18 s | UFO hum (loop) |
| 6 | `wobble` | | Holds on the UFO above the farm | It stops over the scarecrow at about (3, 20, −13). It sways side to side (±3 m, ±20° tilt) faster and faster, then spins up hard. ~4 s | rising whine |
| 7 | `drop` | | Cuts to the scarecrow on its post as the part comes into frame | A part flies off the rim and tumbles down with a blue trail. It lands about 0.8 m in front of the scarecrow with a thud and a puff of dust. ~2.5 s | falling whistle, thud |
| 8 | `flash` | | Close on the scarecrow | The part pulses three times, then a **blue flash**: a light spike, a full-screen blue-white flash fading out, and a ring across the ground. The part streaks into the scarecrow's chest and the chest glow comes on. The scarecrow drops off its post (`Hit_A`), lands, its lantern lights, and it looks around (`Idle_B`), then up. ~5 s | shimmer zap |
| 9 | `uh_oh` | | Low behind the scarecrow, looking up at the hovering UFO | The **uh-oh** conversation. The UFO shifts guiltily. ~7 s | hum |
| 10 | `escape` | | Holds on the scarecrow looking up | The UFO tilts and zooms off up and away, its lights streaking. ~2.5 s | whoosh |
| 11 | `loading` | morning (released, snapped) | — | Fade to black, then the loading screen, about 3 s. Under it the farm is put back: post and part gone, the scarecrow idle at its start, HUD and input back, the light snapped to the morning look. ~4.5 s | |
| 12 | `end` | | the game camera | Fade into the first morning sign ("The farmers are away", `review_panel.gd:164-170`). `finished` is emitted. | |
**Unchanged:**
- Crop fields still sprout after nights 2 and 4.
- The edge-arrow alerts stay (they're not pop-up lines), and so do the first-day tips.
## The lines
## Tasks
**`intro/departure.tres`**
- Farmer: "Well, I sure hope the farm will be okay."
- Farmer's Wife: "Well then, you should have paid someone to come watch it for you instead of
buying those front row tickets to the Bon Jovi concert."
- Farmer: "Ah, it'll be alright. What's the worst that could happen?"
### #23 [pop-ups] Remove the zone banner and the message feed
**`intro/flight.tres`**
- Little Green Alien: "I want to fly the ship!"
- Big Green Alien: "You flew it all the way from the Andromeda galaxy! It's my turn!"
- Little Green Alien: "Your tentacles don't even reach the pedals!" *(draft)*
- Big Green Alien: "Mother said we take turns! Give me the stick!" *(draft)*
- Little Green Alien: "Hands off! [shake]HANDS OFF![/shake]" *(draft; the wobble starts on this line)*
**What shows them now:**
- `ZoneBanner` (`zone_banner.gd`, node `ZoneBanner` at `farm.tscn:3677`) prints the zone's name at
the top whenever the local scarecrow walks into one.
- `ToastFeed` (`toast_feed.gd`, node `Hud/ToastFeed` at `farm.tscn:3694`, exported to `FarmSim` as
`toasts` at `farm.tscn:3794`) stacks up to 5 lines. They're fed by:
- `farm_sim.gd:328-342`: interactions, upgrade/shed panels, build mode, arrivals, breaches, open
pen, patch;
- `farm_sim.gd:772-777`: outside the fence, sunrise;
- loot events (`toast_feed.gd` `MESSAGES`, wired through `LootSystem.loot_event`);
- `main.gd:102`, `main.gd:370`, `campaign_debug.gd:88`;
- co-op, in `coop_session.gd`:
- `:187`, `:259`, `:509`, `:630`;
- the client's `"toast"` and `"arrived"` event handling at `:700-707`;
- the host's `"toast"` events at `:173`, `:179`, `:549-567`.
**`intro/uh_oh.tres`**
- Big Green Alien: "Uh oh.... we should go tell mother."
- Little Green Alien: "Are you crazy!!! Let's just get out of here, maybe no one will notice!"
**Change:**
- Delete both nodes from `farm.tscn` (as text) and their `ext_resource` lines.
- Delete `zone_banner.gd` and `toast_feed.gd` with their `.uid` files.
- Remove every `toasts.push` call and the `FarmSim.toasts` export.
- `FarmSim.arrival_message` goes if nothing else uses it.
- `main.gd:350` `_set_hud` lists `"ZoneBanner"`; drop it.
## How it fits together
**Co-op:** stop sending `"toast"` events, and drop the `"arrived"` client handler if it only
toasted. If either changes the event wire format, bump `CoopSession.PROTOCOL`.
**`OpeningIntro`** (`game/scripts/opening_intro.gd`)
- A `Node3D` under `FarmSim`, built and wired in `_ready` like `FarmersReturn` (`farm_sim.gd:312`).
- Everything is built in `start()` and freed in `clear()`, so nothing exists during play.
- `step(delta)` drives the stage machine, so tests can step it headless the way
`test_flow.gd:_ending` steps the ending.
- Its API is `start()`, `skip()`, `clear()`, `running`, `done`, `stage`, and `signal finished`.
**Signals stay:** keep the `message` signals on `Interactions`, `BuildMode`, and `UpgradePanel`
if tests listen to them; otherwise remove them too. `WaveDirector.arrived` stays (audio and
tests use it).
**`CutsceneKit`** (`game/scripts/cutscene_kit.gd`): static helpers shared with `FarmersReturn`.
- The car with its roof luggage.
- The tinted farmer mannequins with straw hats, and their `AnimationPlayer`s.
- Camera easing (`_move_camera`) and the follow-behind camera.
- The letterbox overlay with its caption label and the skip hint.
**Docs:** update the RULES.md sentences that mention the banner or messages (Tutorial / alerts /
co-op sections). Also update `README.md` and `game/COOP.md` where they describe the feed.
**Its own `DialogueBox`** sits in the intro's overlay `CanvasLayer`, because the HUD layer is
hidden.
- Its conversations live in `game/resources/dialogue/intro/`. `DialogueDirector.load_all` skips
subfolders, so they never play by themselves.
- They use `pause_game = true` (the box takes input) with `auto_advance` ≈ 1.6 s, so lines go on
by themselves and a tap hurries them. The intro plays them with `box.play()`, never through
`DialogueDirector.play()`, so the tree isn't paused.
- Main sets the box's `blocked` the same way as `sim.dialogue.box.blocked` (`main.gd:66`).
- **Framing:** the paper is 1360×350, 118 px above the bottom, and the heads stand above it. Keep
the action in the upper half of the frame while a line is up. If that isn't enough, give
`DialogueBox` a size scale at the timing review (#34).
**Verify:**
- The full suite shows no new FAIL lines. `test_farm_layout.gd` references the banner or feed, so
update it.
- `rg -n "toasts|ToastFeed|ZoneBanner" game` finds nothing but history notes.
- `coop_smoke.gd` passes.
**Hooks it needs:**
- **`DayNight.forced`** (empty = normal): `target()` returns the named look ("morning" = the
MORNING mix, "night" = `NIGHT`). A way to keep a lantern dark.
- **The morning sign:**
- `ReviewPanel.refresh()` keeps the sign hidden while `sim.intro` is running.
- `DialogueDirector` doesn't start morning conversations or call `_sign(true)` while the intro
runs.
- When the intro ends, it hands over: night 1's morning conversations (none today), then the
sign.
- **`Tutorial`** hides while the intro runs.
- **Freezing and focus:** `sim.freeze_local(true)` stops the scarecrow's input (morning input
isn't otherwise gated). Audio focus goes to the cutscene's subject (`sim.audio.focus`), and the
HUD layer is hidden (`FarmersReturn._set_hud`).
- **`Main.new_vacation()`** (`main.gd:162`): after `new_campaign()`, call `sim.intro.start()`
unless hosting. `_host_coop` must not start it. `to_menu()` clears it.
### #24 [30] Nights by count, per-night enemy speed and HP
Code only. `campaign_nights` stays 5 here; #27 flips it to 30 together with the plans.
**Plans by count.**
- `FarmSim.NIGHT_PLANS` (`farm_sim.gd:32-36`, loaded at `:244-246`) becomes
`night_plan_path(n)` → `"res://game/resources/nights/night_%d.tres"`, for n in
1..`config.campaign_nights`.
- A missing file is a `push_error`, and the last loaded plan is used, as
`WaveDirector.plan_for` already clamps.
- Update `game/PLAYTEST.md:308`, which names `NIGHT_PLANS`.
**Enemy scales.**
- `NightPlan` gets `@export var enemy_speed_scale: float = 1.0` and
`@export var enemy_hp_scale: float = 1.0`. Fix the header comment's "night_1..5".
- At nightfall, `WaveDirector._on_phase_changed` sets tonight's scales on `EnemySystem` (e.g.
`night_speed_scale`, `night_hp_scale`). Debug plans (F2) carry their own (default 1).
- `EnemySystem.spawn` (`enemy_system.gd:261`): `health = maxi(t_hp[t], floori(t_hp[t] * hp_scale))`.
- Steering reads `t_speed[t] * speed_scale` (`:384`, and anywhere else `t_speed` drives
movement). Fleeing and carrying speeds derive from it as now.
- **Check the HP bar.** It must use each enemy's own full HP rather than `t_hp`, on the host and on
a co-op replica. If the replica can't know, store each enemy's max HP or send tonight's scale,
and bump `PROTOCOL` if the wire format changes.
**Debug night jump** (`campaign_debug.gd`, debug builds, morning review only):
- **F3** moves to the next day's morning and **Shift+F3** to the previous one.
- The farm stays as it is; `nights_survived` follows as `night − 1`.
- Reuse the real "new morning" path, so the following all happen as on a real morning: dormant
crop fields sprout by `nights_survived`, the Workbench grant runs at ≥1, the retry snapshot is
retaken, and the review panel refreshes.
- Don't autosave on a jump.
- Add the keys to the header list. If this needs more than a small change to the morning path,
stop and report rather than restructure it.
**Tests:**
- Speed and HP scaling on spawn: a crow stays at 1 HP at scale 1.6, a thief goes 3→4, a breaker
6→9.
- A plan with default scales behaves exactly as before.
- Plan paths for n in 1..campaign_nights all load.
- F3 moves the morning and keeps the farm.
**Docs:** RULES.md, The enemies: add a line about the per-night scales.
### #25 [30] Arrivals wait for a free character
**Root cause:** `EnemySystem.spawn` (`enemy_system.gd:229-240`) returns -1, counted in
`spawn_skipped`, when a ground type has no free character (`EnemyCharacters.POOL`: 48 thieves,
20 breakers). The plan's enemy is lost for good. Late nights would quietly play far fewer enemies
than planned.
**Change:**
- Add `EnemySystem.can_spawn(type)`: capacity and a free character, without side effects.
- In `WaveDirector.step`, a due arrival whose type can't spawn now waits. It stays queued without
holding back the other types behind it, and comes in as soon as a character frees.
- At sunrise, arrivals still waiting are dropped and counted: add `waited` and `dropped` counters
next to `spawned` for the soak report.
- Move `EnemyCharacters.POOL` into `GameConfig` as `character_pool := {"thief": 48, "breaker": 20}`,
same sizes for now (#28 decides). `EnemyCharacters` builds its pools from it at setup.
- RULES.md, Night plans: replace the "Up to 160 enemies…" paragraph with the real limits
(`enemy_capacity` 800 in all; on foot, the character pools) and the waiting rule.
**Tests** (test_roster or test_nights):
- With the thief pool full, a due thief waits rather than vanishing, and arrives once one leaves.
- Crows behind it still arrive on time.
- Waiting arrivals are dropped at sunrise and counted.
### #26 [30] Upgrade tiers and timed shed stock
**Today:**
- `Upgrades` (`upgrades.gd`) treats every upgrade as bought once. `FarmState.upgrades` already
stores `id -> level` (`farm_state.gd:107-108`), so saves don't change shape.
- Definitions are in `GameConfig.upgrades`, and the live ones in `game_config.tres:102+`. Costs
are in `costs`.
- The rows are drawn by `UpgradePanel` (`upgrade_panel.gd`, two instances: workbench and shed).
- Turret and tar-patch per-instance levels (#10, `StructureSystem.MAX_LEVEL`) are a separate
system; leave them alone.
**Definitions** (document every key in the `upgrades` comment, `game_config.gd:143-150`):
- `"levels": int` (default 1).
- `"mult"` and `"add"` may be a number (the same every level) or an Array with one entry per
level.
- `"texts": Array` (optional), one description per level.
- Shed items: `"from_day": int` (default 1).
- New `GameConfig` fields:
- `upgrade_cost_growth := 1.8`: level L costs `costs[id]` × growth^(L−1), each material
rounded up;
- `upgrade_level_days: Array[int] = [1, 8, 16]`: level L can be bought from day
`upgrade_level_days[L−1]`, overridable per upgrade with `"level_days"`.
- "Day N" is `campaign.state.night`, the day before night N.
**`game_config.tres` values.** Level 1 keeps the user's current numbers.
| Upgrade | Per level |
|---|---|
| rapid_fire | mult [3.0, 1.25, 1.25] |
| heavy_seeds | add [1, 1, 1] (kernels 2/3/4) |
| wide_fear | mult [1.3, 1.15, 1.15] |
| quick_fear | mult [0.8, 0.9, 0.9] |
| straw_stuffing | add [2, 2, 2] |
| pouch_upgrade | add [8, 4, 4] |
| reinforced_fences | mult [1.5, 1.25, 1.25] |
| long_range | mult [1.3, 1.15, 1.15] |
| sticky_tar | mult [1.5, 1.25, 1.25] |
- All of these get `"levels": 3` and a `"texts"` list.
- Sprint, every shed weapon, and Radar stay at 1 level.
- `from_day`: corn_shooter 1, shurikens 2, pumpkin_bomb 3, potato_cannon 6, radar 8,
propane_torch 10, alien_ray 14.
**Upgrades API:**
- `level(state, id)`. `owned()` stays "level ≥ 1", so `requires` and the weapon unlocks don't
change.
- `max_level(cfg, id)`.
- `cost(cfg, id, level)`: the cost of buying that level; the default is the next one.
- `value()` applies each owned level's entry.
- `blocker()` adds these reasons:
- "Done" at max level;
- "Arrives on day N" before `from_day`;
- "Level N opens on day D".
- `buy()` raises the level by 1 and applies that level's side effect. The side effects are
`scarecrow_max_hp` and `pouch_capacity` with that level's `add`, and `barrier_hp`, whose ratio
logic already handles any step.
- `upgrades_bought` counts every level.
**UpgradePanel:**
- Show the level with roman numerals (e.g. "Rapid fire II"), the next level's text and cost,
"Max" when done, and the blockers above.
- A shed item before its day shows its name greyed with "Arrives on day N".
- A hidden item that hasn't arrived still shows "?" plus the arrival day.
**Co-op:** a client's purchase request carries the id, and the host buys the next level. Check
`coop_session.gd`'s buy path from #22. The state dict already carries levels.
**`soak_night.gd`:** the scripted buyer's `UPGRADE_ORDER` keeps buying affordable next levels.
**Tests** (wherever upgrades are tested now: `test_economy.gd` / `test_scarecrow.gd`):
- level costs grow;
- day gates hold (L2 not before day 8);
- effects stack (heavy seeds L3 = 4 damage; rapid fire L2 = 3.0 × 1.25);
- `from_day` hides stock;
- levels survive save, retry, and co-op;
- an old save with `{"rapid_fire": 1}` loads as level 1.
**Docs:** RULES.md, Upgrades. Replace the table with levels and per-level costs, add the stock
schedule, and fix "Bought once each".
### #27 [30] The thirty nights
Depends on #24.
**Move the finale.**
- `git mv game/resources/nights/night_5.tres night_30.tres`, which keeps its uid.
- Keep the user's title, dusk hint, and `night_length = 180`.
- Grow its groups to about 72 base, keeping the three-wave shape and adding UFO groups.
- Set `enemy_speed_scale = 1.25` and `enemy_hp_scale = 1.625`.
**New night 5, hand-authored:** "Lights in the sky".
- Night 4's shape plus the first UFOs: two single-UFO groups, 14 as played.
- About 24 base in total, scales 1.
- Its hint introduces the UFOs.
**`game/tools/make_nights.gd`** (new, `extends SceneTree`):
- Writes nights `--from=6 --to=29` with a fixed `--seed` (default 30), skipping existing files
unless `--force`.
- Writes the .tres text directly, in the existing files' layout, with a fresh uid from
`ResourceUID.create_id()`.
- Checks every plan with `NightPlan.problems()` at the played scales (7, 0.3, its length) and
exits non-zero on any problem.
**Recipe for night n:**
| What | Rule |
|---|---|
| Base total | `round(24 × (1 + 0.065 × (n − 5)))`; siege nights (n % 5 == 0) × 1.3 |
| Mix | Interpolated linearly from n=6 to n=29: crows 0.45→0.30, thieves 0.35→0.35, breakers 0.12→0.20, UFOs 0.08→0.15. At least one group of each type. |
| Targets | Crows go for crops; breakers and UFOs for any; thieves rotate animals → supplies → any |
| Waves | 3 for n < 12, 4 for 12–21, 5 for 22+, evenly spaced from about 5 s to `length − 30` s |
| Groups per wave | 2–4 from different types, arriving within 0–6 s of each other (the "from both sides" moments) |
| Group size | count 1–5 base, every 1.5–3.0 s base |
| Scales | `enemy_speed_scale = 1 + 0.01 × (n − 5)`, `enemy_hp_scale = 1 + 0.025 × (n − 5)`, written into each file |
| Title and hint | Short drafts from small lists. Sieges are titled "Siege: …". Don't invent lore beyond what nights 1–5 say. |
**Flip to 30.** Set `campaign_nights = 30` in `game_config.gd` and fix its comment.
**Tests:**
- `test_nights.gd`:
- 30 plans;
- every plan passes `problems()` at the played scales;
- no breaker before night 3 and no UFO before night 5;
- played totals never drop by more than 15% from one non-siege night to the next;
- night 30 is the longest.
- `_five_nights` (`test_nights.gd:202-251`) plays every night back to back. At 30 nights that's
too slow, so make it play nights 1–5, a siege night, and 30 with arrivals as planned. Skip the
rest with the same morning path as #24's F3, and keep the check that the farmers return after
the last.
- `test_campaign.gd:48-58` "exactly five nights" reads `campaign_nights`.
- `test_flow.gd` and `test_outcome.gd` already read `campaign_nights`; check that their runtime
stays sane.
**Docs:**
- RULES.md: The vacation ("thirty nights"), the Night row (180 s is now night 30), and the nights
table. Keep rows 1–5, add a summary row per week with the generated ranges, plus row 30.
- `README.md` (lines ~104, 174, 312, 496, 536-540).
- `game/PLAYTEST.md`: add a dated section rather than rewriting history.
### #28 [30] Thirty-night soak, pool sizes, and a balance report
Depends on #23–#27. A report, not a retune: change numbers only to fix outright breakage.
**Soak.**
- Run `soak_night.gd --mode=cycle --cycles=30` for 3 seeds.
- Per night, record:
- arrivals planned, arrived, waited, and dropped;
- the peak alive per type;
- losses per category;
- the scarecrow's HP;
- levels bought;
- materials banked;
- the sim tick's average and max.
**Pools.**
- Measure the headless sim tick with `character_pool` at 48/20 vs 64/28 on nights 20 and 30.
- Recommend sizes, but leave the render cost to a visible-window check by the user (headless
can't measure it).
**Output.**
- Write `docs/thirty-night-soak.md` with the table and three things to tune next.
- Fix anything outright broken: plan problems, a stuck queue, a crash, or a night that can't end.
Report everything else.
**`LoadingScreen`** (`game/scripts/loading_screen.gd`) is a self-contained `Control` with
`play(seconds)` and `signal finished`, so it can be reused later.
## File overlap and order
| File | Tasks |
|---|---|
| `farm_sim.gd` | #23 (toasts, ~328-342, 756-777), #24 (plan paths, ~32-36, 244-246) |
| `coop_session.gd` | #23 (toast events), #24 (HP bar on the replica, if needed), #26 (buy path, if needed) |
| `wave_director.gd` | #24 (nightfall scales), #25 (queue in `step`) |
| `enemy_system.gd` | #24 (spawn HP, steering speed), #25 (`can_spawn`) |
| `game_config.gd` | #24 (comment), #25 (`character_pool`), #26 (upgrades group), #27 (`campaign_nights`) |
| `game_config.tres` | #26 only |
| `campaign_debug.gd` | #23 (one toast), #24 (F3) |
| `test_nights.gd` | #24, #27 |
| `soak_night.gd` | #26 (`UPGRADE_ORDER`), #28 |
| `RULES.md` | #23–#27, separate sections |
| `farmers_return.gd` | #29 (moves pieces into the kit) |
| `cutscene_kit.gd` (new) | #29, used by #33 |
| `day_night.gd` | #30 |
| `farm_audio.gd`, `game/tools/synth_audio.gd`, `assets/audio/synth/` | #30 |
| `player_character.gd` (or wherever the scarecrow's model is built) | #30 (chest glow) |
| `sketch.gd` | #31 (two icons) |
| `game/resources/dialogue/` | #31 |
| `loading_screen.gd` (new) | #32 |
| `opening_intro.gd` (new), `farm_sim.gd`, `main.gd`, `review_panel.gd`, `dialogue_director.gd`, `tutorial.gd` | #33 |
| `test_flow.gd` | #29 (ending still passes), #33 (new-vacation flow) |
| `README.md`, `game/LAYOUT.md`, `game/PLAYTEST.md`, `RULES.md` | #33 |
- **Wave 1 (parallel):** #23, #24, #26. They touch separate regions of shared files; merge
carefully.
- **Wave 2 (parallel):** #25 and #27, after #24.
- **Wave 3:** #28.
- **Wave 1 (parallel):** #29, #30, #31, #32. They touch different files.
- **Wave 2:** #33, after all of wave 1.
- **Wave 3:** #34, the timing review with the user.
## Tasks
### #29 [intro] Cutscene kit and the loaded-up car
- **Extract from `FarmersReturn`:** the car instancing (collision layers off, engine player), the
farmer building (tinted mannequins, straw hats, `AnimationPlayer` with
`player_animations.res`), `_move_camera` / `_follow_camera` / `_face`, and `_build_overlay`. Put
them in `CutsceneKit` as static functions or small helper classes. `FarmersReturn` keeps its
behavior exactly.
- **Roof luggage** (`CutsceneKit.load_roof(car)`), National Lampoon's style:
- A tall, slightly crooked stack on `car_002`'s roof rack, as children of the car so it rides
along.
- Use the farm pack's `bag_001..003` and `box_004/005` props, scaled, plus 3–4 primitive
suitcases in different colors. Add 2–3 thin dark straps over the top, tied down, and one item
hanging off the side (a rolled mattress or a bike, primitives are fine).
- Find the roof height from the car mesh's AABB, not a hard-coded number.
- A small sway, driven by the car's turning and braking (`CutsceneKit.sway_luggage(delta, turn,
accel)`).
- The ending's car gets the luggage too.
- **Verify:** `test_flow.gd`'s `_ending` passes unchanged. A new check confirms the car has its
luggage and the luggage sits above the roof's AABB top. No new FAIL lines. Take a screenshot of
the parked car (headless can't render, so use the editor binary with a window, as in
`render_overview.gd`) and show it to the user.
### #30 [intro] Hooks: forced lighting, sounds, the chest glow
- **`DayNight.forced: String`** (`""`, `"morning"`, `"night"`): `target()` returns that look while
it's set, and `snap()` still works. Add a lantern override (`lanterns_dark := false`) so the
intro can keep the scarecrow's lantern off until the flash.
- **Sounds** (`synth_audio.gd`, written to `assets/audio/synth/`, registered in `FarmAudio`):
- `ufo_hum`: a loop, a low wobbling drone.
- `ufo_whine`: a rising spin-up, ~2 s.
- `part_fall`: a falling whistle, ~1.5 s.
- `life_flash`: a bright shimmer-zap.
- `ufo_zoom`: a doppler whoosh away.
- `car_door`: a dull metal thunk.
- `door_creak`: try `kenney/rpg/creak*` first (already used for `thief_arrive`).
- Reuse `fall`, `horn`, `truck_engine`, and the ambiences.
- **Chest glow:**
- A small emissive blue core on each scarecrow's model at chest height, with a faint pulse and a
weak `OmniLight3D`. Keep it subtle in daylight and visible at night.
- It's on by default, and `set_core_glow(on)` lets the intro hide it until the flash.
- It must not break the hit-flash material swap or the toon look.
- **Verify:** unit checks that `forced` overrides `target()` and clears back, and that the new
sound names resolve to streams. No new FAIL lines. Take a screenshot of the scarecrow at night
showing the glow.
### #31 [intro] Speakers and the three conversations
- **Speakers** in `game/resources/dialogue/speakers/`:
- `farmer.tres` (left side, low voice pitch).
- `farmers_wife.tres` (right side, higher pitch).
- `big_green_alien.tres` (icon `"thief"`, right side, `portrait_height` ~380 so it's literally
bigger than the Little Green Alien's 300, lower pitch).
- The existing `little_green_alien.tres` stays as it is, on the left.
- **Two new `Sketch.ICONS`:** `"farmer"` (a round face, a straw hat, a moustache) and
`"farmers_wife"` (a straw hat with a flower, curls), drawn the way the existing icons are.
- **Conversations** in `game/resources/dialogue/intro/` (`departure.tres`, `flight.tres`,
`uh_oh.tres`), with the lines from "The lines" above:
- `pause_game = true`, `auto_advance` 1.6, `enabled = false`.
- Being in a subfolder already keeps them from playing by themselves; `enabled = false` is a
second guard.
- Write them as text, with uids.
- **Verify:** `test_dialogue.gd` loads each one and checks the speakers and line counts.
`DialogueDirector.load_all(DIR)` still returns only `morning_day_2`. No new FAIL lines. Take a
screenshot of the box with each new speaker up.
### #32 [intro] The loading screen
- **`LoadingScreen extends Control`:** full-rect, on its own `CanvasLayer` (the caller adds it).
- **Splash art:** `splash-screen.png`, scaled to cover (crop, never letterbox), with a slow
Ken-Burns pan and zoom over the screen's time.
- **Title:** "Harvest Season" in `Sketch.font()` with the outline style (there's no logo image
yet; `assets/pictures/logo/` is empty).
- **Progress:** a hand-drawn progress bar (`Sketch.box` / `Sketch.line`) fills over `seconds`. The
sketch `"ufo"` icon bobs and wobbles along its leading edge. "Loading..." is written under it,
with the dots cycling.
- **API:** `play(seconds := 3.0)` fades in from black, runs, and emits `finished` at full
progress. The caller fades it out.
- It works while the tree is paused (`PROCESS_MODE_ALWAYS`).
- **Verify:** a unit check that `finished` fires once after `seconds` of steps. Take a screenshot
mid-way.
### #33 [intro] The opening intro
Blocked by #29–#32.
- Build `OpeningIntro` per "How it fits together" and the storyboard. That means stages 1–12, the
hold-to-skip, its own `DialogueBox`, and the hooks into `ReviewPanel`, `DialogueDirector`,
`Tutorial`, `freeze_local`, the HUD layer, audio focus, and `DayNight.forced`.
- **The part:** a primitive-built gizmo, about 0.5 m: a dark metal cylinder and a torus, a glowing
blue core (emission plus an `OmniLight3D`), and a blue trail while it falls (a `GPUParticles3D`
or a few fading quads).
- **The flash:** an `OmniLight3D` energy spike, a full-screen `ColorRect` in the overlay going
blue-white and fading, and a ground ring (reuse `fear_burst.gdshader` if it fits).
- **The UFO:** a `MeshInstance3D` with `build_ufo_mesh(8.0)` and a `ufo.gdshader` material, set up
as `FarmSim` does for the enemy UFOs (`farm_sim.gd:201`) but its own instance. Spin it with the
shader's spin plus node rotation for the fast spin. Give it night glow.
- **Wiring:**
- `FarmSim` builds `intro` next to `ending`.
- `Main.new_vacation()` starts it, except from `_host_coop`. `to_menu()` clears it.
- "Restart the night" skips it.
- Main sets the intro box's `blocked`.
- **Ends cleanly:** after `finished` (or a skip), the farm must be exactly what `new_campaign()`
leaves:
- the scarecrow at its start, input back, HUD back, the lighting un-forced and snapped;
- the post, the part, the UFO, the car, and the farmers freed;
- the morning sign up with focus on its Start button.
- **Docs:** README (what happens on New vacation; the skip), `game/LAYOUT.md` (the intro's staging
points, next to "The car's route"), `game/PLAYTEST.md` (a line to watch it once and try a skip),
and RULES.md if it describes starting a vacation.
- **Verify:**
- A new `test_intro.gd` (registered in `run_tests.gd`) covers these:
- New vacation starts it, and Continue doesn't.
- Hosting doesn't start it.
- Stepping to the end visits every stage in order, ends with `done`, and the sign is visible.
- During the intro the sign is hidden, the HUD layer is hidden, and the scarecrow can't move.
- A skip at each stage ends clean.
- `to_menu` mid-intro leaves no intro nodes. Restart mid-intro ends clean.
- The lighting is back to the MORNING target, and the chest glow is on after.
- No new FAIL lines.
- A windowed run with frames captured at every stage, to show the user.
### #34 [intro] Timing review with the user
Run the intro in a window and capture each shot. Then go through the user's notes: line timing
(`auto_advance`, letters/s), shot framing against the dialogue box (add a box size scale if
needed), UFO sway and spin feel, flash strength, the luggage's look, the loading screen's length,
and rewrites of the *(draft)* lines. No acceptance beyond the user's sign-off.

View file

@ -303,3 +303,62 @@ timed shed stock, and no pop-up status lines.
`soak_night.gd --mode=cycle --cycles=30` × 3 seeds; headless tick cost at pools 48/20 vs 64/28;
`docs/thirty-night-soak.md`.
*Acceptance:* the report exists with per-night numbers; no crash, stuck queue, or invalid plan.
# Opening intro — task list (2026-10-07)
Narrative, storyboard, lines, decisions, defaults, and file pointers are in `docs/plan.md`
("Harvest Season — opening intro"). The user's calls: dialogue in the talking-head box, the part
absorbed into the scarecrow (chest glow), an animated splash-art loading screen, and the intro on
every New vacation (skippable; not on Continue or when hosting co-op). Commit the uncommitted
dialogue system before starting: worktrees branch from HEAD.
## Wave 1
- [ ] **#29 Cutscene kit and the loaded-up car.** Blocks #33.
Move the car, farmer, camera, and letterbox pieces out of `FarmersReturn` into `CutsceneKit`
(the ending behaves the same). Add National Lampoon's roof luggage on `car_002`: farm-pack bags
and boxes, primitive suitcases, and straps, placed from the car's AABB and swaying on turns. The
ending's car carries it too.
*Acceptance:* `_ending` passes unchanged; a luggage check; a screenshot of the car; no new FAIL
lines.
- [ ] **#30 Hooks: forced lighting, sounds, the chest glow.** Blocks #33.
`DayNight.forced` ("morning" / "night") and a dark-lantern override. Synth sounds `ufo_hum`,
`ufo_whine`, `part_fall`, `life_flash`, `ufo_zoom`, and `car_door`, plus a door creak, all
registered in `FarmAudio`. A subtle blue chest glow on every scarecrow (`set_core_glow`).
*Acceptance:* override and sound-name checks; a night screenshot of the glow; no new FAIL
lines.
- [ ] **#31 Speakers and the three conversations.** Blocks #33.
Speakers `farmer`, `farmers_wife`, and `big_green_alien`; Sketch icons `"farmer"` and
`"farmers_wife"`. `dialogue/intro/departure.tres`, `flight.tres`, and `uh_oh.tres` with the
plan's lines (the extra bickering lines are drafts). They're set `pause_game`, `auto_advance`
1.6, and `enabled = false`.
*Acceptance:* `test_dialogue` loads them; `load_all(DIR)` is still only `morning_day_2`; box
screenshots; no new FAIL lines.
- [ ] **#32 The loading screen.** Blocks #33.
`LoadingScreen`: `splash-screen.png` cover-scaled with a slow pan and zoom, "Harvest Season" in
the handwritten font, a sketch progress bar with the `"ufo"` icon wobbling along it, and
"Loading..." under it. It provides `play(seconds)` and `finished`, and runs while the tree is
paused.
*Acceptance:* `finished` fires once; a screenshot; no new FAIL lines.
## Wave 2
- [ ] **#33 The opening intro.** Blocked by #29–#32.
`OpeningIntro` (stages `leave` → `board` → `drive` → `card` → `flight` → `wobble` → `drop` →
`flash` → `uh_oh` → `escape` → `loading` → `end`): the part, the blue flash, and the UFO at
scale 8. Hold to skip. It plays only on New vacation (not Continue or hosting). It holds the
morning sign, the dialogue director, the tutorial, the HUD, and the scarecrow's input until it
ends, then leaves the farm exactly as `new_campaign()` does. Docs: README, LAYOUT, and
PLAYTEST.
*Acceptance:* `test_intro.gd` (order, skip at every stage, to_menu, restart, no leftovers,
lighting, glow, sign focus); per-stage frames for the user; no new FAIL lines.
## Wave 3
- [ ] **#34 Timing review with the user.** Blocked by #33.
Captured shots, then the user's notes on timing, framing against the box, the UFO's feel, the
flash, the luggage, the loading length, and the draft lines.
*Acceptance:* the user signs off.

View file

@ -1 +1 @@
1791398176.6069093
1791422454.3396769

File diff suppressed because one or more lines are too long

View file

@ -110,8 +110,8 @@
"semantic_hash": "6a47d64fcc136324ca395065a707ef76"
},
"README.md": {
"mtime": 1791398708.9809115,
"ast_hash": "c435c638ada5c61ef9feda41c1db6e52",
"mtime": 1791420601.009332,
"ast_hash": "78074ee49b0384a8f3ddf88227cbb876",
"semantic_hash": ""
},
"assets/audio/CREDITS.md": {