Commit graph

10 commits

Author SHA1 Message Date
Forrest
e26e343436 Task #28: thirty-night soak, pool sizes, and a balance report
docs/thirty-night-soak.md: the whole vacation for 3 seeds with the scripted
scarecrow (per-night arrivals planned / arrived / waited / dropped, peak alive
per type, losses, HP at dawn, levels, materials banked, sim tick), character
pools measured on nights 20 and 30 (48/20, 64/28, 48/40), density experiments,
and three things to tune next. Nothing in the game broke; no numbers changed.

soak_night.gd (cycle mode): per-night report as a table and ROW json lines;
the carry-over check counts the Workbench granted after night 1; a lost night
is retried, then (--shield=after) carried on with the scarecrow shielded; the
scripted player buys the corn shooter first, repairs, rebuilds broken
build-plan pieces, and patches at half its real max health; measuring options
--start, --load, --save-at/--save-dir, --stock, --gather=0, --pool, --frame,
--count-scale, --plan-scale.

test_nights _back_to_back: planned-vs-arrived becomes an accounting check
(arrived, or dropped at sunrise with every character of the type in use;
drops match WaveDirector.dropped; spawn_skipped unchanged), still reporting
the planned / arrived / dropped numbers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 17:55:58 -04:00
Forrest
ddb3cb0568 Merge task #27: the thirty nights
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:38:48 -04:00
Forrest
ab1443325a 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>
2026-10-06 16:38:07 -04:00
Forrest
787b36a1c2 Merge task #26: upgrade tiers and timed shed stock
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	game/scripts/coop_session.gd
2026-10-06 16:20:52 -04:00
Forrest
91b9e52e96 Task #26: upgrade tiers and timed shed stock
Workbench stat upgrades get 3 levels: level L costs costs[id] x
upgrade_cost_growth (1.8) ^ (L - 1), each material rounded up, and opens on
day upgrade_level_days[L - 1] ([1, 8, 16]). Each owned level's "mult"/"add"
entry stacks. Level 1 keeps the user's values and costs (rapid fire 3.0x).
Shed items arrive on set days ("from_day"): corn shooter 1, shurikens 2,
pumpkin bombs 3, potato cannon 6, radar 8, propane torch 10, alien ray 14.

- Upgrades: level(), max_level(), maxed(), cost(cfg, id, level),
  next_cost(), per_level(), text_at(), name_at() (roman numerals),
  from_day(), level_day(), arrived(). owned() stays "level >= 1". blocker()
  adds "Arrives on day N" and "Level N opens on day D"; buy() takes the next
  level and applies that level's side effect; upgrades_bought counts every
  level. FarmState.upgrades keeps id -> level, so saves don't change shape.
- UpgradePanel: "Rapid fire II" with the next level's text and cost, the
  blocker reason, "Max" at the last level; a shed item before its day shows
  its name greyed with "Arrives on day N" ("?" plus the day if hidden). The
  title counts items at their last level. Every level bought jingles.
- Co-op: the host sends "bought" for any level (no wire change; PROTOCOL
  stays 5).
- soak_night.gd buys the lowest next level first across UPGRADE_ORDER.
- Tests: level costs, day gates, stacking, from_day, save/morning/retry/co-op,
  an old {"rapid_fire": 1} save as level 1. Existing tests set the day where
  they buy stock that now arrives later.
- RULES.md Upgrades: per-level effects and costs, stock schedule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:20:05 -04:00
Forrest
192a89770a Task #24: nights by count, per-night enemy speed and HP
- Plans load by count: FarmSim.night_plan_path(n) ("res://game/resources/nights/night_%d.tres")
  for n in 1..campaign_nights (FarmSim.load_night_plans). A missing file is a push_error and
  that night plays the last plan that loaded. FarmSim.NIGHT_PLANS is gone. campaign_nights
  stays 5.
- NightPlan.enemy_speed_scale / enemy_hp_scale (default 1; problems() flags non-positive ones).
  At nightfall WaveDirector._on_phase_changed hands tonight's plan (or the F2 debug plan) to
  EnemySystem.night_speed_scale / night_hp_scale, and the morning puts them back to 1.
  EnemySystem.full_hp(type) = maxi(t_hp, floori(t_hp * night_hp_scale)) at spawn; steering
  and max_speed() use t_speed * night_speed_scale (fleeing and carrying are shares of it).
  Enemies have no HP bar (only structures do), and the co-op replica never simulates enemy HP,
  so the wire format and CoopSession.PROTOCOL (5) are unchanged.
- Debug F3 / Shift+F3 (CampaignDebug.jump_morning; debug builds, morning review only, not on
  a co-op partner's machine): next / previous day's morning with the farm as it is and
  nights_survived = night - 1. It grants the Workbench and grows crops_total as a night's end
  does, then re-enters the morning through CampaignController.load_state with save_path
  blanked, so there's no autosave.
- test_nights: plan paths load in order (and a missing one repeats the last), spawn HP and
  speed at default and 1.6 scales, and the F3 / Shift+F3 jump.
- RULES.md (The enemies: per-night scales), PLAYTEST.md (NIGHT_PLANS note), GameConfig
  campaign_nights comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 16:05:12 -04:00
Forrest
df10a1967c Task #9: Workbench auto-grants after Night 1, destructible/repairable
Gate the Workbench to appear once Night 1 is survived instead of being
buildable: StructureSystem.grant_workbench() (an unvalidated, unpurchased
place() variant, grant()) adds a "workbench" structure record at the scene
node's position, reusing the existing damage/repair/targeting/save pipeline
end to end. The grant happens on CampaignController.night_ending (so it
lands in state before the morning snapshot, like #13's crop growth) and is
re-derived from FarmState.nights_survived on load/retry (sync_from_state).

The Workbench's view is the scene's own node (hidden until granted, shown
by StructureSystem._add_view) instead of a second built mesh, so it gets
the standard HP bar, damage tint, and wobble for free. It's repair-only:
damage() never removes its record at 0 HP ("broken" instead of destroyed),
and it can't be dismantled. Interactions refuses to open its shop before
it exists or while broken (and no longer treats it as focusable), and
coop_session.gd's "buy" request handler refuses a workbench-shop item
(Upgrades.shop_of) the same way for a co-op partner. review_panel.gd's
pre-grant summary line no longer promises the work area from night one.

No FarmState.VERSION bump: a "workbench" record is a new type string, not
a new field, and from_dict() already validates types generically.

Tests: a new test_structures.gd check covers absent/no-prompt/shop-refused
before Night 1 (including a co-op "buy" request), granted after, damaged
by an enemy (thief_behavior.gd's generic BREAK state), broken-not-destroyed
at 0 HP with its shop refused, repaired at the normal proportional cost,
and persistence through a save/retry round trip. test_cycle.gd and
test_nights.gd pre-grant the workbench in setup (grant_workbench()) so
their per-night structure-count invariants aren't thrown off by the
night-1 grant itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 16:27:55 -04:00
Forrest
b9dcd24b5d Task #7: four new shed weapons (Potato Cannon, Shurikens, Propane Torch, Alien Ray)
All four go in the main hand alongside the pitchfork and corn shooter, cooldown-based
with no ammo, every stat GameConfig-tunable: Potato Cannon is a slow heavy shot,
Shurikens a fast cheap throw, Propane Torch a sustained cone DoT while held (shares
the pitchfork's cone-hit test), and Alien Ray a fast powerful shot that stays hidden
in the shop until enough Alien Goop is collected. FarmProjectiles.fire() gained
optional speed/lifetime overrides (backward compatible) so each ranged weapon can fly
at its own pace. WeaponModels gained tinted placeholder pivots for the new weapons
(no new art), and the number-key switch loop and HUD panel layout were fixed to not
go out of bounds now that there are more main weapons than number keys.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 15:39:56 -04:00
Forrest
34358d0641 Task #15: UFO enemy, a fast flying fighter
Adds a 4th enemy type (TYPE_UFO=3) that reuses the generic flying-nav
infrastructure (ignores fences, gates, and traps) and gets a new
FIGHT-capable behavior in ThiefBehavior: it skips SEEK/loot entirely and
goes straight to FIGHT, strafing the scarecrow in dive-and-pull-up passes
(diving to land_altitude while its attack is off cooldown, climbing to
cruise_altitude right after landing a hit) until it's hit for every pass.
All stats (speed 7.0, hp 2, damage 1, hit_interval 1.5s, aggro_range 10.0,
etc.) live in GameConfig.enemy_types["ufo"]. It renders through the same
shared flyer MultiMesh crows use (no new art) and is wired into
NightPlan/WaveDirector composition, the HUD/assessment roster lines, kill
log keys, and the arrival sound/toast, with a generic audio fallback since
it has no cue of its own.

Per a scope addition mid-task, night 5 now also sends in a wave of 4 UFOs
late in the night (game/resources/nights/night_5.tres), which shifts
test_nights' known-flaky "arrived" baseline line by one new {3: N} entry
(the UFO counts agree between plan and arrival) and required updating its
hardcoded "all three types" check to four. A debug-only "UFOs only"
scenario is added (game/resources/scenarios/ufos.tres) but deliberately
left out of CampaignDebug.SCENARIOS, since wiring it in would change
test_roster's hardcoded scenario count and that file's existing checks
were required to stay untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-05 14:43:46 -04:00
Forrest
4298caf5cb updates 2026-10-04 12:07:36 -04:00