Seven playtest issues traced to root causes: per-player co-op pouch, Propane Torch band of fire, Alien Ray beam, primitive UFO model, crop fields on the south soil with their own plant models, free-roaming animals, and the joining player's store. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 KiB
Harvest Season — post-overhaul fix batch (2026-10-06)
Status: planned, not started. Seven issues the user found playtesting the alien overhaul
(docs/tasks.md #1–#15, all merged by 3e85104). Tasks are numbered #16–#22 to continue that
list; the user's original item number is in brackets. Root causes were traced in code on
2026-10-06. Line numbers point at decf96b, so re-check them before editing.
Ground rules for workers
- Godot binary:
godotis not on PATH here. Use~/Downloads/Godot_v4.7.2-stable_linux.x86_64everywhere these docs saygodot. Exit code 127 means the binary wasn't found, not a pass. - Tests:
godot --headless --path . --script res://game/tests/run_tests.gd. The exit code is the failure count and is never 0 here: about 25 checks fail because of tuning, and the test_roster "All three" check is flaky. Run the suite before editing, diff the FAIL lines afterwards, and judge your task by new FAIL lines only. One suite:-- --suite=test_x. - Parallel worktrees: give each headless run its own
XDG_DATA_HOMEsouser://saves don't collide. farm.tscn: edit it as text. A headlessResourceSaver.save()drops theuid=lines; if you must re-save from a script, restore them the waygame/tools/build_prop_collision.gddoes.- Co-op: changing the shape of
state.to_dict()or the snapshot/event wire format means bumpingCoopSession.PROTOCOL(coop_session.gd:48, currently 3). Changing the save format means bumpingFarmState.VERSION(farm_state.gd:11, currently 6) and adding amigratestep insave_game.gd. For the two-process check, rungame/tools/coop_smoke.gd(seegame/COOP.md). - Graph: after modifying code, run
graphify update ..
Decisions (resolved 2026-10-06)
- Crop fields move onto the south brown soil. The user chose this over laying soil under the current spot. The playable map extends south to include them (#20).
- Animals roam the whole farm and are never lost on their own. An animal that leaves an open pen becomes loose again. An animal is lost only when an Alien carries it off the map. A closed pen still protects the animals inside it (#21).
Defaults (assumed; flip any of these on request)
- Pouch:
pouch_capacitystays shared, so onepouch_upgradepurchase grows both pouches.- Goop from a kill goes to the killer's pouch. Bomb and turret kills credit the nearest avatar.
- When the partner leaves, their pouch is deposited in the shed.
- Torch band: about 4.5 m long (measured from the muzzle) and 1.6 m wide. Config-tunable.
- Alien Ray beam: about 20 m long. It stops at walls and pierces enemies, hitting each one along it (capped by config). Damage is applied per tick while fire is held.
- UFO model: a flattened saucer built in code from a disc, a dome, a rim ring and small lights. No imported asset.
- Crop models: existing ithappy prefabs from
assets/farm/ithappy/farm/prefabs/assets/plant/.- Lettuce/cabbage:
plant_004/plant_005(≈0.45 m heads). - Corn:
plant_001(≈2.66 m stalk). - These were picked by size and palette only. Confirm them in the editor and fall back to primitives if they don't read right.
- Lettuce/cabbage:
Tasks
#16 [1] Per-player pouch in co-op
Root cause: this is by design, not a sync bug: there is exactly one pouch.
ResourceStorekeeps a singlepouchandpouch_capacity(resource_store.gd:13-15) in the sharedFarmState.resources(farm_state.gd:102).- That state is replicated whole to the client (
coop_session.gd:321-328, applied at621-638). game/COOP.mdsays "Everything is shared: the shed, the pouch…", andtest_coop.gd:181-182asserts the shared pouch.
Every pouch path goes through campaign.state.resources:
- Gathering:
interactions.gd:296(room check) and:339(add_to_pouch). - Deposit:
interactions.gd:182-185. A partner idling in the shed instantly banks whatever the other player gathers. - Pouch-first paying:
resource_store.gd:85-93, viaFarmState.pay(farm_state.gd:222). Callers:- repair,
interactions.gd:226 - patch,
scarecrow.gd:148 - structures,
structure_system.gd:243,371,428 - upgrades,
upgrades.gd:91,105
- repair,
- Goop drop:
farm_sim.gd:636. pouch_upgrade:upgrades.gd:120-121.
Approach:
- Storage: the shed stays shared. The pouch becomes one per slot (
pouches[slot], where slot 0 is the host or solo player), with one sharedpouch_capacity. - Slot parameter:
add_to_pouch,deposit,available,missing,can_affordandpaytake aslotthat defaults to 0, so solo callers don't change. - Callers pass the acting avatar's slot:
Interactionsuseskit.slot.- The Scarecrow patch uses its own slot.
- The host's
_do_requestuses the requester's slot for "place" and "buy". Upgrades.buyandStructureSystem.placetake a slot.
- Goop: credit the killer's slot (see Defaults).
- HUD:
resource_hud.gd:36-37shows the local avatar's pouch. Retarget it inFarmSim.set_local(farm_sim.gd:522). Also updatereview_panel.gd:131andtutorial.gd:122. - Partner leaves:
remove_partner(farm_sim.gd:500) deposits the partner's pouch into the shed. - Versions: bump
FarmState.VERSION6→7, with asave_game.gdmigratestep that adds an empty partner pouch. BumpCoopSession.PROTOCOL3→4. - Docs:
game/COOP.md,game/RULES.md.
Files:
- Code:
resource_store.gd,farm_state.gd,save_game.gd,interactions.gd,scarecrow.gd,structure_system.gd,upgrades.gd,farm_sim.gd,coop_session.gd,resource_hud.gd,review_panel.gd,tutorial.gd - Docs:
COOP.md,RULES.md - Tests:
test_coop.gd,test_save.gd,test_economy.gd,test_cycle.gd,test_flow.gd,game/tools/soak_night.gd
Acceptance:
- In
test_coop:- P2's gathering fills only P2's pouch.
- P1 standing in the shed doesn't bank P2's pouch.
- Each player pays from their own pouch plus the shed.
- One
pouch_upgraderaises both capacities.
- In
test_save, a v6 save migrates. - Solo behaviour is unchanged, and there are no new FAIL lines.
#17 [2] Propane Torch sprays a band of fire
Root cause: damage works, but there's nothing to see and the hit area is small.
- Path:
step()→_held(&"fire")→attack()→_use()→_torch_tick()(scarecrow_combat.gd:267,288,383-385,474-479). - Hit test:
_cone_hit(:484-511) measurestorch_range3.5 from the scarecrow's centre. That reaches only about 2.45 m past the 1.05 m muzzle. It uses a 55° arc, hits at most 5 targets, and deals 1 damage every 0.2 s. - Feedback the player gets:
- A 0.09 s kick on an orange-tinted corn-shooter mesh, replayed on every tick
(
weapon_models.gd:28-29,68,143-150). - The pitchfork "stab" sound (
farm_audio.gd:300). - The enemy's hurt flash.
- A 0.09 s kick on an orange-tinted corn-shooter mesh, replayed on every tick
(
- Test gap:
test_weapons.gd:357-369callsattack_toward()once. It checks no held fire and no visual.
Approach:
- Band hit test: add
_band_hitbeside_cone_hit.- It projects each enemy onto the aim direction from the muzzle.
- A hit requires
0 ≤ along ≤ torch_rangeand|across| ≤ torch_width/2 + hit radius. - Keep the
_clear_linecheck.
- Config: drop
torch_arc, addtorch_width, and lengthentorch_range(see Defaults). - Flame visual: a
CPUParticles3Don the torch pivot, sized to the band (pattern:structure_system.gd:809-830)._use/_show_attacklight it, and a short timeout (about 1.5 ×torch_tick_interval) keeps it lit. It stays lit while fire is held and goes out on release.- Stop replaying the kick on every tick.
- Co-op: the existing
["attack", slot, w]events (coop_session.gd:163, applied at687-693) light the flame on the partner's screen. No protocol change is needed. For a remote avatar, take the direction from the model's yaw. - Sound: give the torch its own
burnedsignal and sound infarm_audio.gd, instead ofstabbed.
Files: scarecrow_combat.gd, weapon_models.gd (or a new torch_flame.gd),
game_config.gd / game_config.tres, farm_audio.gd, test_weapons.gd.
Acceptance (test_weapons):
- An enemy in the band ahead is hit.
- An enemy beside it, outside the width, is not hit.
- An enemy behind is not hit.
- Holding fire over N steps ticks repeatedly and stops on release (use
Input.action_pressastest_theft.gd:191-201does). - The flame is visible while fire is held and hidden after release.
#18 [3] Alien Ray fires a beam
Root cause: _shoot_alien_ray (scarecrow_combat.gd:448-456) is a copy of _shoot_potato.
It fires one non-piercing projectile through _shots.fire, using the shared kernel mesh
(farm_projectiles.gd:58-62), every 0.9 s.
- Its description text (
game_config.gd:156) already says "beam". - The root
plan.md"no hitscan" rule was for the original prototype; no code or test enforces it.
Approach:
- Held weapon: like the torch, it ticks every
alien_ray_tick_intervalwhile fire is held. - Each tick:
- Cast a world ray (WORLD_LAYER) from the origin through the muzzle, out to
alien_ray_range. This gives the beam segment, clipped at the first wall. - Damage every enemy within
alien_ray_width/2 + hit radiusof that segment, up toalien_ray_pierceenemies. - This needs a new EnemySystem query that returns all hits;
sweep_hit(enemy_system.gd:501) returns only the nearest.
- Cast a world ray (WORLD_LAYER) from the origin through the muzzle, out to
- Visual: a top-level
MeshInstance3D: an unshaded, emissive green cylinder or box, oriented and scaled from the muzzle to the hit point each frame while firing. - Co-op: the visual uses the same hold-timeout and attack-event path as the torch. The partner recomputes the wall clip locally, which is deterministic because the world geometry is static.
- Config:
- Remove
alien_ray_speedandalien_ray_lifetime. - Add
alien_ray_range(≈20),alien_ray_tick_interval,alien_ray_widthandalien_ray_pierce. alien_ray_damagebecomes damage per tick.
- Remove
- Counters: add a
beam_tickscounter toattacks()(scarecrow_combat.gd:316-317) and stop incrementingshots_fired. - Comments: update the headers at
scarecrow_combat.gd:38-42andweapon_models.gd:14-17.
Files: scarecrow_combat.gd, enemy_system.gd, weapon_models.gd, game_config.gd /
game_config.tres, test_weapons.gd.
Acceptance (test_weapons): replace _buy_equip_hit(... alien_ray ...) at :356 and keep
the buy/equip checks. Then check:
- A far target is hit on the same step.
- A target behind a wall is not hit.
- Two enemies in line are both hit.
- The beam mesh is visible while fire is held and hidden after release.
Order: #17 and #18 share files. Run #18 after #17, which sets the held-visual pattern.
#19 [4] UFO model built from primitives
Root cause: all flyers are drawn by one MultiMesh (HordeRenderer) using one mesh.
farm_sim.gd:177-179passesEnemySystem.build_bird_mesh(0.0055)as the only flyer mesh.commit_render(enemy_system.gd:565-582) writes every flyer into that one buffer.horde_renderer.gd:21-41overrides the material withgame/resources/thief.gdshader. That shader flaps vertices byabs(VERTEX.x)and has a singlebase_coloruniform.
Approach:
- Mesh: add
static func build_ufo_mesh()toenemy_system.gd.- It merges the
get_mesh_arrays()of a CylinderMesh disc, a SphereMesh dome, a TorusMesh rim and small sphere lights into oneArrayMesh, transformed into place, with anARRAY_COLORper part.build_bird_mesh(:608-625) is the template. - Centre it on its origin, with nothing more than about 1.5 m below. UFOs dive to
land_altitude1.55 (thief_behavior.gd:197-209). - Forward is −Z, with yaw only.
- It merges the
- Renderer: create a second
HordeRendererfor UFOs inEnemySystem.setup(:145-149). - Shader: a new
game/resources/ufo.gdshader. It takes albedo fromCOLOR, has no flap and an optional slow spin fromTIME, and keeps the hit flash (INSTANCE_CUSTOM.g) andnight_glow. - Buffers:
commit_renderfills one buffer per type. Mirrorwrite_new(:257),move_slot(:599) andclear(:206-208) on both renderers. - DayNight: register the new material with DayNight (
day_night.gd:38-42,111-112;farm_sim.gd:254). - Sound (optional): give UFOs their own arrival sound; today they reuse the crow's.
Files: enemy_system.gd, horde_renderer.gd, new game/resources/ufo.gdshader,
farm_sim.gd, day_night.gd, test_roster.gd.
Acceptance:
- In
test_roster, a spawned UFO is in the UFO renderer's visible instances and not in the bird renderer's. Crows are unchanged. - Eyeball the saucer in a screenshot of night 5 or of the
ufos.tresscenario.
#20 [5] New crop fields on the south brown soil, with their own plant models
Root cause (placement):
- LettuceField (
farm.tscn:2244-2249) sits at (−6, 0, 7) and CornField (:2635-2640) at (7, 0, 7), each 10×10, on the green grass plane (farm.tscn:127-132). - The brown soil is the ithappy
ground_008/ground_011tiles (farm.tscn:166-173):ground_011_004lies under the sunflower Crop Field.ground_008_004(SW, x ≈ −25…7.5, z ≈ 14.6…45) andground_011_003(SE, x ≈ 13.4…46, z ≈ 14.2…45) are bare. Both are outside the playable map (z ≤ 15,farm_zones.gd:11) and inside the "South Fields (outside the fence)" straw zone (farm.tscn:3453).
- The plant y offsets (0.288 / 0.535) were copied from CropField, which sits at y −0.36
(
farm.tscn:1005). So the new plants float about 0.36 m up.
Root cause (models):
crop_unit.gd:11-13: thecropfield is cosmetic only, and nothing reads it.- Every lettuce and corn unit's children are the sunflower prefabs
plant_007/plant_008(farm.tscn:30-31; e.g.:2261-2264,:2652-2655). - The carried/dropped crop token is always
plant_007(loot_system.gd:60,159-161).
Approach:
- Placement: defaults below; confirm them with
game/tools/render_overview.gd --zones.- Lettuce/cabbage field: x −6…4, z 20…30, on the SW soil.
- Corn field: x 24…34, z 20…30, on the SE soil.
- Match the zone y to the soil surface; CropField uses −0.36.
- Map bounds: extend
FarmZones.playablesouth to cover the fields with margin:Rect2(-13, -45, 60, 80), i.e. z −45…35.- The south side has no perimeter fence, so no fence work is needed.
roamalready reaches z ≈ 47.
- Knock-on effects:
- The nav grid (
farm_sim.gd:132, built overplayable.grow(5)) grows about 33%. Measure the flow-field rebuild time before and after. - The spawn edge (
zones.edge(spawn_margin)) moves south. The enemy and projectile bounds (farm_sim.gd:179,195) follow automatically. - The SouthFields zone's hay points at (−10, 25) and (24, 27) fall inside the new map; (24, 27) is inside the corn field. Move the zone and those points south of z ≈ 37. Outside zones must stay outside the playable map.
- The nav grid (
- Thief targeting:
ThiefBehavior.field_rectis the bounding box of all three crop fields (seedocs/followups.md). With the fields this far apart it would cover most of the south map, so switch to per-field rects. - Models:
- Replace the new units' plant children: lettuce/cabbage get
plant_004/plant_005, corn getsplant_001(see Defaults). - Pick the crop token per crop in
loot_system.gd, from_units[id].crop.
- Replace the new units' plant children: lettuce/cabbage get
- Docs: update
game/LAYOUT.md(map size, zone table, crop units, SouthFields).
Files:
- Code and scenes:
farm.tscn,farm_zones.gd,crop_unit.gd(only if model choice moves into code),loot_system.gd,thief_behavior.gd - Docs:
game/LAYOUT.md - Tests:
test_farm_layout.gd: 60×60 check (:29), inside-playable and overlap checks (:56-59), side names (:112-113), open south (:139), andMAX_TRAVEL(:13), which will have to rise.test_theft.gd: its edge-cell list (:35) includes (20, 18), which is now inside the map.
Acceptance:
- In
test_farm_layout:- Both new fields lie on the soil tiles' footprints and inside the playable map.
- No zones overlap, and outside zones are outside the map.
- Lettuce and corn units don't use the sunflower prefabs.
- The staged-field cases in
test_theft(:300-366) still pass.
Risk: the new fields are about 35–40 m from the scarecrow's start at (3, −13), so night defence spreads out further. Playtest the balance.
#21 [6] Animals roam the whole farm and are never lost on their own
Root causes:
- An open pen leaks at night. During NIGHT and DAWN, while
pen_openis true,_wander_out()(animal_system.gd:406-425) turns one calm HOME animal into DROPPED everyanimal_wander_interval(10 s; the first after about 3 s). Since #11 removed the scene fence and the starting gate,pen_openstays true until the whole ring is built. - DROPPED animals always run for the edge and are deleted.
_stray()(:322-336) followsescape_field, thenloot.animal_escaped()→_lose(loot_system.gd:693-703) marks the animal LOST and hides it (animal_system.gd:457).- The escape goal is the outline of
zones.edge(3)(farm_sim.gd:151). The pen's west wall is at x = −10, only about 5 m from the west exit band, which is the user's "a few steps". - This runs in any phase.
- Animals also become DROPPED when
FOLLOW_LEASHbreaks (more than 20 m from their scarecrow;animal_system.gd:33,346-351) or when a carrier is killed (loot_system.gd:394-403).
- The escape goal is the outline of
- Loose animals are tethered.
LOOSE_WANDER_RADIUSis 0.8 (animal_system.gd:35), and_wander_goal(:397-403) stays around_loose_spot. The spots (game_config.gd:92-95) hug the pen; the x = −12 spots are about 3 m from the exit band.
Approach (Decision 2):
- No self-escape: remove
_stray's edge path andanimal_escaped.- A DROPPED animal (an Alien dropped it, its carrier was killed, or its leash broke) becomes LOOSE where it stands.
- Keep the two real loss paths: a thief carrying an animal off the map (
thief_behavior.gd:508-512→loot.escape), andon_enemy_removedwith reason LEFT (loot_system.gd:493-498).
- Open pen:
_wander_outturns HOME into LOOSE (no escape) and callsFarmState.unpen_animal(farm_state.gd:192). Keeppen_openand its messaging. - Roaming, day and night:
_wander_goalpicks a goal 4–8 m from the animal's current position. The goal must be:- inside the playable rect shrunk by a margin (pass the rect in
setup, wired atfarm_sim.gd:185;behavior.farm_rectalready exists), - walkable (
nav.is_walkable), - reachable in a clear line (
nav.line_clear,farm_navigation.gd:187).
- inside the playable rect shrunk by a margin (pass the rect in
- Mornings:
sync_from_state(animal_system.gd:153) puts loose animals back at their loose spots, so no new save fields are needed. Move the x = −12 spots inward. - Dawn:
return_dropped(loot_system.gd:479-490) auto-pens DROPPED animals at dawn. Remove it, since no DROPPED animals remain by then. - Text: fix every place that promises animals "wander out" or "run for the edge":
- header comments in
animal_system.gd:3-22andloot_system.gd:15-26 RULES.md:179-195- the toast at
farm_sim.gd:335-337 review_panel.gd:128-129
- header comments in
animals_strayedevent: keep it (it now counts animals that left the pen). This avoids churn in save data and tests (test_save.gd:125,test_farm_state.gd:30,test_cycle.gd:155,soak_night.gd:234,review_panel.gd:155).- Leave as is: followers become HOME as soon as they cross the unfenced pen rect
(
animal_system.gd:340).
Files: animal_system.gd, loot_system.gd, farm_sim.gd, game_config.gd /
game_config.tres, review_panel.gd, game/RULES.md, test_targets.gd.
Acceptance (test_targets):
- Over a long day and night, loose animals roam more than 4 m but stay inside the playable map.
This replaces the "none wandered off" check in
_loose_start(:85-95). - An Alien-dropped animal becomes LOOSE, not LOST (
:105-107,:221-226). - At night an open pen lets animals out as LOOSE, and none become LOST (rework
_breach,:286-340). - Carrying an animal off the map still loses it.
_make_loose(:507) and_leading(:279-281) are updated to the new route into HOME.- The
pen_openchecks intest_structuresstill pass.
#22 [7] The joining player can open the store
Status: the cause is not confirmed; reading the code didn't show a blocker. The open path is wired:
- The host handles P2's press through
RemoteControls.take(interactions.gd:160). - The partner's
Interactionsfinds the ShedCounter insetup(:93-101) and focuses it in_nearest(:361-365). - Having no panel, it emits
shed_requested(:271-277), which becomes a["shed"]event (coop_session.gd:167). - The client opens
sim.shed_panelif it's daytime (:701-703).
Purchases are already routed to the host: buy_request → ["buy", id] (:212-213) →
_do_request (:549-555).
Co-op defects found on the way:
- No shop prompt on the client.
_gather_node(coop_session.gd:804-813) resolves only the workbench and the gather nodes. So the client's replicated focus is null at the counter, and its label never shows "[E / X] Shop" (interactions.gd:399-401,shed_counter.gd:41). - Presses can be silently dropped. The host consumes P2's press on every tick
(
interactions.gd:160), even when its lagging copy of P2 isn't within reach yet. - Pressing interact again doesn't close the shop on the client.
_close_menu(coop_session.gd:929-935) ignores presses. - A partner's purchase doesn't equip the new weapon.
boughtfires only on the local path (upgrade_panel.gd:136-138,farm_sim.gd:272-275).
Approach:
-
Test first. Add a failing test to
test_coop.gd:- Put
client.playeratcounter.global_position + (0, 0, 1.2)and pump about 20 ticks. - Press and release
interact, then pump again. - Assert
client.shed_panel.is_open,not host.shed_panel.is_open, andremote.ui_open. - Repeat for the Workbench after
host.structures.grant_workbench().
Also try a two-process
coop_smoke.gdrun, since the loopback pair may not reproduce a timing cause. Fix whatever the test pins down. - Put
-
Fix all four defects above:
- Add the ShedCounter to
_gather_node. - On the host, keep a partner's press pending for a short window (about 0.3 s) until its focus is valid, instead of dropping it.
- On the client, treat interact while a menu is open as "close".
- When the host handles a partner's "buy", emit an equip event for the buyer's slot.
- With #16 in place, "buy" pays from the requester's pouch.
- Add the ShedCounter to
Files: coop_session.gd, interactions.gd, upgrade_panel.gd, farm_sim.gd,
test_coop.gd (and possibly shed_counter.gd).
Depends on #16: they share files and the PROTOCOL bump, and "buy" needs per-player paying.
Acceptance:
- The new
test_coopcases pass for both shops. - The client can buy a weapon: it pays from P2's pouch plus the shed, and the weapon lands in P2's hand.
- In a two-process smoke run, the client opens the shed.
File overlap and order
| File | Tasks |
|---|---|
coop_session.gd, interactions.gd |
#16, #22 |
scarecrow_combat.gd, weapon_models.gd, test_weapons.gd |
#17, #18 |
enemy_system.gd |
#18 (beam query), #19 (renderer) |
loot_system.gd |
#20 (crop token), #21 (escape/drop) |
farm_sim.gd |
#16, #19, #21, #22 (separate regions) |
game_config.gd / game_config.tres |
#17, #18, #21 |
farm.tscn |
#20 only |
- Wave 1 (parallel): #16, #17, #19, #20, #21. Their overlaps in
farm_sim.gd,loot_system.gdandgame_config.gdare in separate regions; merge carefully. - Wave 2: #18 after #17, and #22 after #16.
This batch supersedes these entries in docs/followups.md:
- UFOs use the crow mesh (#19).
- The torch's kick placeholder (#17).
ThiefBehavior.field_rectspans all crop fields (#20).LAYOUT.mddoesn't list the new fields (#20).