Compare commits

...

11 commits

Author SHA1 Message Date
Forrest
f0059f2e80 init 2026-10-14 12:54:33 -04:00
Forrest
2e68223b5c tasks: check off #33 (opening intro); graph update
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:55:41 -04:00
Forrest
c9898a97c8 Merge #33: opening intro cutscene
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:55:18 -04:00
Forrest
c6daf3d217 #33: opening intro cutscene
OpeningIntro (game/scripts/opening_intro.gd) plays on every New vacation
(not Continue, not when hosting co-op): the farmers leave in their loaded
station wagon, "Later that night....", a bickering UFO crew drops a part
whose blue flash brings the scarecrow (hung on a post in its T-pose) to life,
the UFO zooms off, then the loading screen and the first morning's sign.
Hold Space / Enter / A (or E, or the mouse button) 1 s to skip from any
stage; Escape pauses it; Restart the night skips it; Save & quit clears it.
It ends with the farm exactly as new_campaign() leaves it.

Hooks: ReviewPanel keeps the sign down while the intro has the farm (and
only focuses Start when the sign is up); DialogueDirector holds its
conversations and the sign, then intro_over() plays night 1's morning
conversations before the sign; Tutorial hides; FarmAudio gets set_scene /
end_scene (ambience and music held by a cutscene) and stop_cue (the morning
stinger plays with the sign instead); Main wires new_vacation(intro),
blocked, resume's freeze, restart and to_menu.

Tests: test_intro (45 checks); test_flow skips the new intro. Tool:
game/tools/capture_intro.gd saves a frame per stage for the timing review.
Docs: README, RULES, LAYOUT (staging points), PLAYTEST.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:54:24 -04:00
Forrest
d96ef8b5be tasks: check off #29-#32 (opening intro wave 1); graph update
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:00:15 -04:00
Forrest
78ff549407 Merge #29: cutscene kit and roof luggage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 22:00:01 -04:00
Forrest
c009260d4a #29: cutscene kit and roof luggage
CutsceneKit (static, shared by FarmersReturn and the coming opening intro):
make_car / add_engine, the tinted farmer mannequins (make_farmer, anim_of),
route_curve / reversed / place_on_curve for any point list, make_camera /
move_camera / follow_camera / face, set_hud, and the Letterbox overlay with a
caller-set skip hint. FarmersReturn now uses it and behaves as before.

load_roof piles National Lampoon style luggage on car_002's rack: farm-pack
bags and crates, four primitive suitcases, and a hatbox, stacked from the
roof found in the car mesh's AABB and vertices, three straps pulled taut over
the pile's real outline, and a rolled mattress lashed off the right side. No
collision. Luggage.sway(delta, turn_rate, accel) leans it out on turns and
forward when braking; the ending's drive uses it.

test_flow: the ending's car is loaded, the pile sits on the car mesh's AABB
top, and it sways the right way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:58:50 -04:00
Forrest
f0146c8aa5 Merge #30: forced lighting, intro sounds, scarecrow chest glow
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:51:40 -04:00
Forrest
4b86f655c4 #30: forced lighting, intro sounds, scarecrow chest glow
- DayNight.forced ("" / "morning" / "night") overrides target(); snap()
  still works. DayNight.morning() is the MORNING phase's look.
  lanterns_dark keeps every lantern at 0.
- synth_audio.gd: ufo_hum (4 s loop), ufo_whine, part_fall, life_flash,
  ufo_zoom, car_door, each on its own seed (existing wavs unchanged).
  FarmAudio cues for those plus door_creak (kenney creak1/2), all in
  LOCAL_CUES.
- PlayerCharacter: a blue core glow on the chest bone (BoneAttachment3D):
  an unshaded gem, an additive halo pulled toward the camera, and a weak
  pulsing OmniLight3D. On for every scarecrow; set_core_glow(on) hides
  it. set_tint skips it; the hit flash overlay and ToonLook leave it alone.
- test_look: forced/lanterns_dark, the intro cues, the glow on both
  scarecrows, hit flash intact, set_core_glow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:51:14 -04:00
Forrest
fe08f6602c Merge #31: intro speakers and conversations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:48:56 -04:00
Forrest
9224b65c7a #31: intro speakers and conversations
Speakers farmer, farmers_wife, and big_green_alien (the thief head at
380 px, bigger than the little alien's 300, with a lower voice). Two new
Sketch icons, "farmer" (round face, pinched straw hat, moustache) and
"farmers_wife" (curls, straw sun hat with a ribbon and a flower).
dialogue/intro/departure, flight, and uh_oh with the plan's lines, off
(enabled = false), pause_game, auto_advance 1.6. test_dialogue checks
their lines and speakers, that the director still plays only
morning_day_2, and that the new heads draw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 21:48:31 -04:00
62 changed files with 6088 additions and 2420 deletions

View file

@ -221,6 +221,21 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
(`example_morning_day_2.tres`, the Scarecrow and a Little Green Alien) uses the HUD's painted
icons as placeholder portraits (`DialogueSpeaker.icon`) until real pictures are set.
* **The opening intro** — every New vacation opens with a cutscene, about 70 s (`OpeningIntro`,
`game/scripts/opening_intro.gd`): on a summer morning the farmers load up their station wagon
and drive off to the Bon Jovi concert; that night a bickering UFO crew loses control over the
farm, a glowing part falls off, and its blue flash brings the scarecrow to life (the faint blue
glow in its chest from then on); then a loading screen (`LoadingScreen`) and the first
morning's sign. Hold Space / Enter / A (or E, or the mouse button) for a second to skip it
(straight to the sign); Escape pauses it, and Restart the night skips it. Continue never plays
it, and hosting co-op skips it. Its lines are talking-head conversations in
`game/resources/dialogue/intro/` (`departure.tres`, `flight.tres`, `uh_oh.tres`; edit the lines
and speakers there: that folder never plays by itself), shown in the intro's own box, where
they go on by themselves and a tap hurries them. It shares the car, the farmers, and the camera
moves with the ending (`CutsceneKit`). Its staging points are in
[`game/LAYOUT.md`](game/LAYOUT.md). To review it shot by shot, `game/tools/capture_intro.gd`
saves a frame at every stage (its header has the command).
* **Menus and saving** — `Main` (`game/scripts/main.gd`, `game/scenes/main.tscn`) hosts the farm
under the menus. `MainMenu` is the title screen (Continue, New vacation, Settings, Quit) over
the paused farm, with a camera circling it. `PauseMenu` (Escape / Start) pauses the whole tree
@ -316,6 +331,7 @@ pack (`assets/farm/ithappy/farm/prefabs/assets/`).
| Pause / resume | Escape | Start |
| Hide the tips | Backspace | Back |
| Mute / unmute your microphone (co-op) | M | - |
| Skip the opening intro (hold 1 s) | Space, Enter, E, or left mouse | A, X, or right trigger |
| Skip the farmers' return | Space, Enter, E, or click | A or X |
| Menus and end screens | Click, arrows + Enter, Escape to go back | D-pad + A, B to go back |
@ -610,8 +626,8 @@ damaged, rule-breaking, non-morning, newer, and too-old saves refused with a rea
save upgraded, the autosave every morning, retry restoring the saved morning, the save deleted
when the vacation is finished, settings saved, loaded, clamped, and applied (bus volumes, dead
zones), and the final assessment's score, tiers, and renormalized weights. The flow suite plays
the game through `main.tscn`: the title screen over the paused farm, New vacation and Continue
(and their questions), pausing freezing the simulation tick, settings applying and saving from
the game through `main.tscn`: the title screen over the paused farm, New vacation (its intro
skipped) and Continue (and their questions), pausing freezing the simulation tick, settings applying and saving from
the pause menu, Restart the night and Save & quit leaving the save untouched, a damaged save
refused, the failure screens and Retry, the farmers' return to the final assessment (and
skipping it), the first day's and night's tips, and the sounds hooked to the game. The co-op suite
@ -619,6 +635,12 @@ runs a host and a partner in one process (the partner's farm in its own world, o
link): the join, the partner's requests, moves, gathering, and shots, enemies, loot, and shots
arriving, the fall rule and Retry, a crowd with dropped packets and message sizes, and either side
leaving. `game/tools/coop_smoke.gd` plays the same over real GD-Sync between two processes.
The intro suite plays the opening intro through `main.tscn`: New vacation starts it, and Continue
and hosting don't; stepped through, it visits every stage in order with the farm held (no sign,
no HUD, the scarecrow frozen on its post) and ends on the focused morning sign; and a skip from
every stage, holding to skip, Restart the night, and Save & quit during it each leave the farm
exactly as a new vacation's first morning (the scarecrow at its start with input and glow, the
light and sounds given back, the game camera, nothing of the intro left).
Prototype: 107 checks, ~1.5 s. Covers pool acquire/release/exhaustion and swap identities, slot reuse
hygiene and stale handles, U-shape routing, corner cutting, unreachable spawns, octile costs,

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://brmcshcd5qkeb"
path="res://.godot/imported/car_door.wav-11e45d985ca5a18d886d502f22a587a2.sample"
[deps]
source_file="res://assets/audio/synth/car_door.wav"
dest_files=["res://.godot/imported/car_door.wav-11e45d985ca5a18d886d502f22a587a2.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://n1vpsrggju13"
path="res://.godot/imported/life_flash.wav-6f1a94e43d64179d5cba5b86790f94a4.sample"
[deps]
source_file="res://assets/audio/synth/life_flash.wav"
dest_files=["res://.godot/imported/life_flash.wav-6f1a94e43d64179d5cba5b86790f94a4.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://cdukl6jlxtdrg"
path="res://.godot/imported/part_fall.wav-35c3cf6a15deda03d53d6fa66b9bfe26.sample"
[deps]
source_file="res://assets/audio/synth/part_fall.wav"
dest_files=["res://.godot/imported/part_fall.wav-35c3cf6a15deda03d53d6fa66b9bfe26.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://iolkmlfkxyfp"
path="res://.godot/imported/ufo_hum.wav-33f85e7caf73f265b88f263892795662.sample"
[deps]
source_file="res://assets/audio/synth/ufo_hum.wav"
dest_files=["res://.godot/imported/ufo_hum.wav-33f85e7caf73f265b88f263892795662.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://20kiejrcnb7i"
path="res://.godot/imported/ufo_whine.wav-a29ece9af7cc4232cb4457e845f42484.sample"
[deps]
source_file="res://assets/audio/synth/ufo_whine.wav"
dest_files=["res://.godot/imported/ufo_whine.wav-a29ece9af7cc4232cb4457e845f42484.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b1qyikj5ni8km"
path="res://.godot/imported/ufo_zoom.wav-518690e3115d4839dfb1e6eddd0ab827.sample"
[deps]
source_file="res://assets/audio/synth/ufo_zoom.wav"
dest_files=["res://.godot/imported/ufo_zoom.wav-518690e3115d4839dfb1e6eddd0ab827.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2

View file

@ -314,7 +314,7 @@ dialogue system before starting: worktrees branch from HEAD.
## Wave 1
- [ ] **#29 Cutscene kit and the loaded-up car.** Blocks #33.
- [x] **#29 Cutscene kit and the loaded-up car.** Blocks #33. *(merged c009260 — `CutsceneKit` (all static): `make_car`/`add_engine`, `load_roof`/`sway_luggage`/`Luggage.nudge`/`settle`, `make_farmer`/`anim_of`/`face`, `route_curve`/`reversed`/`place_on_curve`, `make_camera`/`move_camera`/`follow_camera`/`set_hud`, `make_letterbox`; 4 suitcases, hatbox, farm-pack bags and crates, 3 straps, a mattress off the right side; ending unchanged at 21.2 s)*
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
@ -322,14 +322,14 @@ dialogue system before starting: worktrees branch from HEAD.
*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.
- [x] **#30 Hooks: forced lighting, sounds, the chest glow.** Blocks #33. *(merged 4b86f65 — `DayNight.forced` ("morning"/"night"), static `DayNight.morning()`, `lanterns_dark`; cues `door_creak` (kenney creak1/2), `car_door`, `ufo_hum` (4 s loop, play via `stream_of`), `ufo_whine`, `part_fall`, `life_flash`, `ufo_zoom`, all local-only; `PlayerCharacter.set_core_glow`/`core_glow` on the chest bone — subtle from the game camera, the head hides most of it)*
`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.
- [x] **#31 Speakers and the three conversations.** Blocks #33. *(merged 9224b65 — speakers farmer / farmers_wife / big_green_alien; Sketch icons "farmer" and "farmers_wife" (+ `Sketch._closed`); `dialogue/intro/` departure 3, flight 5, uh_oh 2 lines; the "thief" head is purple, so both "green" aliens are purple)*
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`
@ -337,7 +337,7 @@ dialogue system before starting: worktrees branch from HEAD.
*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.
- [x] **#32 The loading screen.** Blocks #33. *(merged a4d6021 — `LoadingScreen`: `play(seconds)`, `finished`, `fade_out(time)` then `hidden`, `stop()`, `step()`; uses splash-screen.png (1687×761, a little soft at 1080p; `ART` switches it))*
`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
@ -346,7 +346,7 @@ dialogue system before starting: worktrees branch from HEAD.
## Wave 2
- [ ] **#33 The opening intro.** Blocked by #29–#32.
- [x] **#33 The opening intro.** Blocked by #29–#32. *(merged c6daf3d — `OpeningIntro` (`sim.intro`): `start`/`skip`/`clear`/`step`, `running` (has the farm) vs `busy()` (until the end); 69.1 s unskipped (leave 12.2, board 2.2, drive 12.0, card 3.6, flight 13.0, wobble 4.0, drop 2.6, flash 5.4, uh_oh 7.1, escape 2.6, loading 4.1); `Main.new_vacation(intro := true)`, hosting passes false; `FarmAudio.set_scene`/`end_scene`/`stop_cue`; the kit's `alive` is false during it; T-pose held; house_009 has no door node; the scarecrow hops off and the post tips; the UFO backs off to (26, 15, −16) for uh_oh, which is the weakest shot (scarecrow cropped at the left edge behind the box); capture: `godot --path . --windowed --disable-vsync --fixed-fps 30 --script res://game/tools/capture_intro.gd -- --out=/tmp/hs-intro --every=2`)*
`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

View file

@ -264,6 +264,34 @@ Its largest slice stays about 3 ms.
- **What to avoid:** the tractor parked east of the house (about (30, −25)) hides anything at the
house's east side from the south-east.
## The opening intro (#33)
`OpeningIntro` (`game/scripts/opening_intro.gd`) stages its shots on the same map:
- **The car** waits at the end of the ending's route, (32.8, −29.5), facing north (nose-out), and
drives the route backwards: north along the yard road, east out of GapDriveway (the horn), then
south down the road at x 52 to z 80, well past the map's south edge.
- **The farmers** come out of the front door, (19.6, −29.8). The farmer walks along z ≈ −31 to the
car's left door, (31.45, −29.95). The wife goes round the car's nose (z −33.7) to its right
door, (34.15, −29.95).
- **The departure shot** looks south over the yard from the north, (26.2, 13.5, −59), at
(26.2, 1, −30.5). The porch and the car stand side by side in the middle of the frame, clear of
the talking heads at its sides. The scrap heap's props between the camera and the yard are low
enough to look over.
- **The drive** follows behind the car until 6 m before the gap. Then the camera stops by
GapDriveway, at (46.8, 3, −43.6), and watches the car go south down the road.
- **The scarecrow's post** stands at the scarecrow's start, (3, −13). The scarecrow hangs 0.6 m up
on it, facing east over the crop field. It drops off 0.6 m in front of the post, which tips over
to its left. At the end it stands at its start again, facing north.
- **The UFO** comes from (125, 62, −150), bends over (70, 40, −40), and stops over the scarecrow at
(5, 19, −13). The part lands 0.8 m in front of the scarecrow. After the flash the UFO backs off to
(26, 15, −16), then leaves up and away to the east-north-east.
- **The night shots:** the flight and the wobble look up from the south-west, low, at
(−9, 1.5, 19), far enough off to see the saucer from the side. The drop and the flash look at
the scarecrow from the east (the barn behind it). The uh-oh and the escape look over the
scarecrow's right shoulder from behind it.
- **What to avoid:** the woodlot's trees block any view of the yard from the east, and the pen
(x −10…4, z −11…−1) is right under low cameras south-west of the scarecrow.
## Outside the fence
The scarecrow can leave through the fence's gaps or across the open south and west sides. The invisible walls (`Zones/Perimeter/PlayerBounds`)

View file

@ -396,3 +396,23 @@ so a whole vacation is about 3¼ hours, and losses still carry over. The nights,
biggest step.
- Rewrite the draft titles and hints of nights 6–29 (in the files, or in `make_nights.gd`'s lists
followed by `--force`).
## The opening intro (2026-10-07)
New vacation now opens with a cutscene (#33, `OpeningIntro`); README has the story and LAYOUT.md
the staging. When nothing is skipped and no line is hurried, it lasts 69 s. The stages, in
seconds: leave 12.2, board 2.2, drive 12, card 3.6, flight 13, wobble 4, drop 2.6, flash 5.4,
uh-oh 7.1, escape 2.6, loading 4.1. `test_intro` checks that every stage plays in order, and
that a skip from any of them, Restart the night, or Save & quit leaves the farm exactly as a new
vacation's first morning. `game/tools/capture_intro.gd` saves a frame at each stage for the
timing review (#34).
**For the playtest:**
- Watch it once from New vacation, all the way to the first morning's sign.
- Start another and hold Space / Enter / A partway through. Does it skip cleanly to the sign? Is
the hint ("Hold ... to skip", with its ring) easy to find?
- Tap through a few lines: do they hurry as expected, and do the shots still keep up?
- Press Escape mid-intro. Does the pause menu work over it, and does Restart the night take you
to the sign?
- Is anything important hidden behind the dialogue box? Is the UFO easy to read against the night
sky?

View file

@ -545,6 +545,12 @@ shed counts as raided when a thief takes the last of its stock, and storing anyt
## Menus, pause, and settings
- **Title screen:** Continue, New vacation, Settings, Quit, over the farm standing still.
- **The opening intro.** New vacation plays a cutscene (about 70 s) before the first morning's
sign: the farmers leave, and that night a UFO's lost part brings the scarecrow to life. Holding
Space / Enter / A (or E, or the mouse button) for a second skips it, straight to the sign.
Continue never plays it, and hosting co-op skips it. It changes nothing in the farm: the new
vacation is saved before it starts, so quitting during it continues at that morning without
it, and Restart the night during it skips it. Escape pauses it like the game.
- **Pause** (Escape / Start, any phase) freezes the whole simulation: timers, enemies, shots,
and game sounds. The menus and the ambience keep running. Its options are Resume, Restart the
night, Settings, Save & quit to menu, and Quit the game. Restarting and quitting ask first, with

View file

@ -0,0 +1,28 @@
[gd_resource type="Resource" script_class="Conversation" format=3 uid="uid://c08yse6j7xhvk"]
[ext_resource type="Script" uid="uid://b8csl51l2cwpg" path="res://game/scripts/conversation.gd" id="1_conversation"]
[ext_resource type="Script" uid="uid://oluompq3r367" path="res://game/scripts/dialogue_line.gd" id="2_line"]
[ext_resource type="Resource" path="res://game/resources/dialogue/speakers/farmer.tres" id="3_farmer"]
[ext_resource type="Resource" path="res://game/resources/dialogue/speakers/farmers_wife.tres" id="4_wife"]
[sub_resource type="Resource" id="Resource_line1"]
script = ExtResource("2_line")
speaker = ExtResource("3_farmer")
text = "Well, I sure hope the farm will be okay."
[sub_resource type="Resource" id="Resource_line2"]
script = ExtResource("2_line")
speaker = ExtResource("4_wife")
text = "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."
[sub_resource type="Resource" id="Resource_line3"]
script = ExtResource("2_line")
speaker = ExtResource("3_farmer")
text = "Ah, it'll be alright. What's the worst that could happen?"
[resource]
script = ExtResource("1_conversation")
enabled = false
pause_game = true
auto_advance = 1.6
lines = Array[ExtResource("2_line")]([SubResource("Resource_line1"), SubResource("Resource_line2"), SubResource("Resource_line3")])

View file

@ -0,0 +1,38 @@
[gd_resource type="Resource" script_class="Conversation" format=3 uid="uid://yna1lvpdeqe4"]
[ext_resource type="Script" uid="uid://b8csl51l2cwpg" path="res://game/scripts/conversation.gd" id="1_conversation"]
[ext_resource type="Script" uid="uid://oluompq3r367" path="res://game/scripts/dialogue_line.gd" id="2_line"]
[ext_resource type="Resource" path="res://game/resources/dialogue/speakers/little_green_alien.tres" id="3_little"]
[ext_resource type="Resource" path="res://game/resources/dialogue/speakers/big_green_alien.tres" id="4_big"]
[sub_resource type="Resource" id="Resource_line1"]
script = ExtResource("2_line")
speaker = ExtResource("3_little")
text = "I want to fly the ship!"
[sub_resource type="Resource" id="Resource_line2"]
script = ExtResource("2_line")
speaker = ExtResource("4_big")
text = "You flew it all the way from the Andromeda galaxy! It's my turn!"
[sub_resource type="Resource" id="Resource_line3"]
script = ExtResource("2_line")
speaker = ExtResource("3_little")
text = "Your tentacles don't even reach the pedals!"
[sub_resource type="Resource" id="Resource_line4"]
script = ExtResource("2_line")
speaker = ExtResource("4_big")
text = "Mother said we take turns! Give me the stick!"
[sub_resource type="Resource" id="Resource_line5"]
script = ExtResource("2_line")
speaker = ExtResource("3_little")
text = "Hands off! [shake]HANDS OFF![/shake]"
[resource]
script = ExtResource("1_conversation")
enabled = false
pause_game = true
auto_advance = 1.6
lines = Array[ExtResource("2_line")]([SubResource("Resource_line1"), SubResource("Resource_line2"), SubResource("Resource_line3"), SubResource("Resource_line4"), SubResource("Resource_line5")])

View file

@ -0,0 +1,23 @@
[gd_resource type="Resource" script_class="Conversation" format=3 uid="uid://dvu0br3epblpb"]
[ext_resource type="Script" uid="uid://b8csl51l2cwpg" path="res://game/scripts/conversation.gd" id="1_conversation"]
[ext_resource type="Script" uid="uid://oluompq3r367" path="res://game/scripts/dialogue_line.gd" id="2_line"]
[ext_resource type="Resource" path="res://game/resources/dialogue/speakers/big_green_alien.tres" id="3_big"]
[ext_resource type="Resource" path="res://game/resources/dialogue/speakers/little_green_alien.tres" id="4_little"]
[sub_resource type="Resource" id="Resource_line1"]
script = ExtResource("2_line")
speaker = ExtResource("3_big")
text = "Uh oh.... we should go tell mother."
[sub_resource type="Resource" id="Resource_line2"]
script = ExtResource("2_line")
speaker = ExtResource("4_little")
text = "Are you crazy!!! Let's just get out of here, maybe no one will notice!"
[resource]
script = ExtResource("1_conversation")
enabled = false
pause_game = true
auto_advance = 1.6
lines = Array[ExtResource("2_line")]([SubResource("Resource_line1"), SubResource("Resource_line2")])

View file

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="DialogueSpeaker" format=3 uid="uid://chciiyc5efsqv"]
[ext_resource type="Script" path="res://game/scripts/dialogue_speaker.gd" id="1_speaker"]
[ext_resource type="AudioStream" path="res://assets/audio/kenney/interface/pluck_001.ogg" id="2_voice"]
[resource]
script = ExtResource("1_speaker")
display_name = "Big Green Alien"
icon = "thief"
side = 1
portrait_height = 380.0
voice = ExtResource("2_voice")
voice_pitch = 1.05
voice_every = 3

View file

@ -0,0 +1,13 @@
[gd_resource type="Resource" script_class="DialogueSpeaker" format=3 uid="uid://dtxc1nfa3plr0"]
[ext_resource type="Script" uid="uid://c1dai0qffqkmi" path="res://game/scripts/dialogue_speaker.gd" id="1_speaker"]
[ext_resource type="AudioStream" uid="uid://duf3ktuoslfbx" path="res://assets/audio/kenney/interface/pluck_002.ogg" id="2_voice"]
[resource]
script = ExtResource("1_speaker")
display_name = "Farmer"
icon = "farmer"
portrait_height = 320.0
voice = ExtResource("2_voice")
voice_pitch = 0.65
voice_every = 3

View file

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="DialogueSpeaker" format=3 uid="uid://c5onilw721jwg"]
[ext_resource type="Script" path="res://game/scripts/dialogue_speaker.gd" id="1_speaker"]
[ext_resource type="AudioStream" path="res://assets/audio/kenney/interface/pluck_001.ogg" id="2_voice"]
[resource]
script = ExtResource("1_speaker")
display_name = "Farmer's Wife"
icon = "farmers_wife"
side = 1
portrait_height = 320.0
voice = ExtResource("2_voice")
voice_pitch = 1.2
voice_every = 3

View file

@ -6,7 +6,6 @@
[ext_resource type="PackedScene" uid="uid://wbiymevvh11y" path="res://assets/farm/ithappy/farm/prefabs/assets/ground/ground_008.tscn" id="4_wbrnf"]
[ext_resource type="PackedScene" uid="uid://bf3e5b3p5iko5" path="res://assets/farm/ithappy/farm/prefabs/assets/ground/ground_011.tscn" id="5_rhwtn"]
[ext_resource type="PackedScene" uid="uid://rg2gblm7uljg" path="res://assets/farm/ithappy/farm/prefabs/assets/ground/ground_017.tscn" id="6_3bdhk"]
[ext_resource type="PackedScene" uid="uid://bsu2o2bc8eic3" path="res://assets/farm/ithappy/farm/prefabs/assets/road/road_003.tscn" id="7_km4uj"]
[ext_resource type="PackedScene" uid="uid://1igwiyo0o8en" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/tree_006.tscn" id="11_nblca"]
[ext_resource type="PackedScene" uid="uid://c4vjhqtwt34g" path="res://assets/farm/ithappy/farm/prefabs/assets/prop/fence_001.tscn" id="12_fence"]
[ext_resource type="PackedScene" uid="uid://bfm0nv45v407u" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/tree_003.tscn" id="12_v2ii5"]
@ -14,11 +13,8 @@
[ext_resource type="PackedScene" uid="uid://qw3mpra243ku" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/tree_007.tscn" id="16_xyaw0"]
[ext_resource type="PackedScene" uid="uid://c1e53qopqbgw6" path="res://assets/farm/ithappy/farm/prefabs/assets/prop/cart_001.tscn" id="18_cart"]
[ext_resource type="PackedScene" uid="uid://cnsl83bhjsw1g" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/bush_004.tscn" id="19_eirbx"]
[ext_resource type="PackedScene" uid="uid://dpf557y6k4s42" path="res://assets/farm/ithappy/farm/prefabs/assets/road/road_001.tscn" id="19_fmk7d"]
[ext_resource type="PackedScene" uid="uid://bf67eg36lwasy" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/tree_001.tscn" id="19_tree"]
[ext_resource type="PackedScene" uid="uid://brhyleh5gmgce" path="res://assets/farm/ithappy/farm/prefabs/assets/road/road_007.tscn" id="20_jcd8b"]
[ext_resource type="PackedScene" uid="uid://eqggvm2yodv3" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/tree_002.tscn" id="20_tree_big"]
[ext_resource type="PackedScene" uid="uid://dvaegcxbuan1v" path="res://assets/farm/ithappy/farm/prefabs/assets/road/road_002.tscn" id="21_erhlk"]
[ext_resource type="PackedScene" uid="uid://dy6wpv14a1bg3" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/fir_tree_001.tscn" id="21_fir"]
[ext_resource type="PackedScene" uid="uid://bdh6n2xpwgsdc" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/fir_tree_010.tscn" id="21_ykj4j"]
[ext_resource type="PackedScene" uid="uid://craodujsd0wu0" path="res://assets/farm/ithappy/farm/prefabs/assets/tree/fir_tree_003.tscn" id="22_fir_small"]
@ -132,6 +128,11 @@ size = Vector2(120, 120)
[sub_resource type="BoxShape3D" id="Box_ground"]
size = Vector3(120, 1, 120)
[sub_resource type="PlaneMesh" id="PlaneMesh_cog68"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_d4oey"]
albedo_color = Color(0.5409905, 0.5409905, 0.5409905, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_bounds_ns"]
size = Vector3(82.4, 3, 0.2)
@ -165,6 +166,26 @@ mesh = SubResource("PlaneMesh_ground")
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
shape = SubResource("Box_ground")
[node name="MeshInstance3D" type="MeshInstance3D" parent="Ground" unique_id=1582438448]
transform = Transform3D(3.1002333, 0, 0, 0, 1, 0, 0, 0, 75.078064, 52.22323, 0.14366436, -0.38418353)
mesh = SubResource("PlaneMesh_cog68")
surface_material_override/0 = SubResource("StandardMaterial3D_d4oey")
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Ground" unique_id=1289898431]
transform = Transform3D(-1.3551549e-07, 0, 46.04058, 0, 0.99999994, 0, -3.100233, 0, -2.0124978e-06, 7.6088333, 0.14366436, 50.2471)
mesh = SubResource("PlaneMesh_cog68")
surface_material_override/0 = SubResource("StandardMaterial3D_d4oey")
[node name="MeshInstance3D3" type="MeshInstance3D" parent="Ground" unique_id=1872031465]
transform = Transform3D(-3.1002333, 0, -9.904602e-07, 0, 0.9999999, 0, 2.7103098e-07, 0, -11.329543, -12.8214035, 0.14366436, 59.9148)
mesh = SubResource("PlaneMesh_cog68")
surface_material_override/0 = SubResource("StandardMaterial3D_d4oey")
[node name="MeshInstance3D4" type="MeshInstance3D" parent="Ground" unique_id=1100224087]
transform = Transform3D(1.8486813e-07, 0, -11.329541, 0, 0.99999976, 0, 1.4097635, 0, 1.48569e-06, 43.288177, 0.14366436, -39.372124)
mesh = SubResource("PlaneMesh_cog68")
surface_material_override/0 = SubResource("StandardMaterial3D_d4oey")
[node name="Level" type="Node3D" parent="." unique_id=809922080]
[node name="ground_008_004" parent="Level" unique_id=975238962 instance=ExtResource("4_wbrnf")]
@ -185,48 +206,6 @@ transform = Transform3D(1.2036887, 0, 0.24747285, 0, 1, 0, -0.24747285, 0, 1.203
[node name="ground_017_029" parent="Level" unique_id=215248066 instance=ExtResource("6_3bdhk")]
transform = Transform3D(-0.30402178, 0, -1.1906639, 0, 1, 0, 1.1906639, 0, -0.30402178, -2.795761, -1.1757813, 22.774946)
[node name="road_003_002" parent="Level" unique_id=938560234 instance=ExtResource("7_km4uj")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, -13.445679, -0.15, 52.697506)
[node name="road_001_003" parent="Level" unique_id=392124351 instance=ExtResource("19_fmk7d")]
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -22.445679, -0.15, 50.797504)
[node name="road_007_023" parent="Level" unique_id=2095068098 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 0.5543213, -0.15, 50.597504)
[node name="road_007_024" parent="Level" unique_id=809962896 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 13.554321, -0.15, 50.597504)
[node name="road_007_025" parent="Level" unique_id=200149534 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 26.554321, -0.15, 50.597504)
[node name="road_007_026" parent="Level" unique_id=862145411 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-4.371139e-08, 0, -1, 0, 1, 0, 1, 0, -4.371139e-08, 39.55432, -0.15, 50.597504)
[node name="road_007_029" parent="Level" unique_id=1738931402 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-1.0199817, 0, 3.9719555e-07, 0, 1.1107799, 0, -3.9719555e-07, 0, -1.0199817, 52.55432, -0.3476622, 21.52183)
[node name="road_007_031" parent="Level" unique_id=1109146227 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-1, 0, 6.711724e-07, 0, 1, 0, -3.8941437e-07, 0, -1.723543, 52.55432, -0.15, 3.1548197)
[node name="road_007_033" parent="Level" unique_id=1057996629 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-1, 0, 7.1140477e-07, 0, 1, 0, -3.8941437e-07, 0, -1.826858, 52.55432, -0.15, -21.12042)
[node name="road_002_002" parent="Level" unique_id=785047163 instance=ExtResource("21_erhlk")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 52.55432, -0.15, -39.402496)
[node name="road_007_034" parent="Level" unique_id=2125972378 instance=ExtResource("20_jcd8b")]
transform = Transform3D(-1, 0, 3.8941437e-07, 0, 1, 0, -3.8941437e-07, 0, -1, 52.55432, -0.15, -52.402496)
[node name="road_007_214" parent="Level" unique_id=133188723 instance=ExtResource("20_jcd8b")]
transform = Transform3D(1.7444279e-06, 0, 0.99999994, 0, 1, 0, -0.99999994, 0, 1.7444279e-06, 44.45688, -0.15, -39.402496)
[node name="road_003_003" parent="Level" unique_id=1458630441 instance=ExtResource("7_km4uj")]
transform = Transform3D(-1, 0, -1.509958e-07, 0, 1, 0, 1.509958e-07, 0, -1, 50.55432, -0.15, 50.597504)
[node name="road_003_009" parent="Level" unique_id=1658351541 instance=ExtResource("7_km4uj")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 54.354317, -0.15, 35.597504)
[node name="tree_006_001" parent="Level" unique_id=581566848 instance=ExtResource("11_nblca")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 25.234314, 0.05543518, 58.766026)
@ -4818,7 +4797,7 @@ reach = 3
clip = &"Hammering"
[node name="car_003_001" parent="Zones/EastRoad/RoadsideCar" unique_id=1328810145 instance=ExtResource("41_fwpte")]
transform = Transform3D(-1, 0, -3.8941437e-07, 0, 1, 0, 3.8941437e-07, 0, -1, -0.0017, 0.48251343, -0.001)
transform = Transform3D(-1, 0, -3.874302e-07, 0, 1, 0, 3.874302e-07, 0, -1, -0.0016937256, 0.08827877, -0.000998497)
[node name="RoadsideBarrels" type="Node3D" parent="Zones/EastRoad" unique_id=1131456836]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.0526924, 0, -10.6225815)

View file

@ -0,0 +1,698 @@
class_name CutsceneKit
extends RefCounted
## The pieces the cutscenes share (FarmersReturn's ending, the opening intro), all static:
## * The farmers' station wagon (car_002, no collision) with its engine sound and, National
## Lampoon style, a tall, crooked pile of luggage strapped to the roof rack (Luggage, which
## sways when the car turns or brakes).
## * The farmers: tinted mannequins in straw sun hats, with the player's animations.
## * Routes: a corner-rounded Curve3D through any list of points, and placing a node on it
## facing the way it runs (drive a route backwards by reversing its points).
## * The cutscene camera: easing toward a shot, and following behind a car.
## * The letterbox overlay (Letterbox): black bars, a caption, and a skip hint.
## The caller owns everything built here and frees it.
const CAR_SCENE := "res://assets/farm/ithappy/farm/prefabs/assets/transport/car_002.tscn"
const FARMER_SCENE := "res://assets/kaykit_characters/characters/Mannequin_Medium.glb"
const ANIMATIONS := "res://game/resources/player_animations.res"
## The farmers' tints: the farmer (blue) and the farmer's wife (red).
const FARMER_TINTS: Array[Color] = [Color(0.35, 0.5, 0.85), Color(0.85, 0.45, 0.4)]
const STRAW := Color(0.92, 0.8, 0.45)
const BAGS: Array[String] = [
"res://assets/farm/ithappy/farm/prefabs/assets/prop/bag_001.tscn",
"res://assets/farm/ithappy/farm/prefabs/assets/prop/bag_002.tscn",
"res://assets/farm/ithappy/farm/prefabs/assets/prop/bag_003.tscn",
]
const CRATES: Array[String] = [
"res://assets/farm/ithappy/farm/prefabs/assets/box/box_004.tscn",
"res://assets/farm/ithappy/farm/prefabs/assets/box/box_005.tscn",
]
## The roof is the top part of the car this deep (a share of its height): the roof skin and the
## rack on it. Its footprint is where the luggage goes.
const ROOF_BAND := 0.15
## The pile, bottom up. Each piece: "bag" / "crate" (an index into BAGS / CRATES, and a scale),
## "case" (a primitive suitcase: its size in meters and color), or "hatbox" (its radius and
## color); "at" is where its middle goes, as a share of the roof's half width (x, + to the car's
## left) and half length (z, + forward); "yaw" and "tilt" (pitch, roll) are degrees. Each piece
## rests on whatever is under its middle already, so the pile builds itself on any roof.
const PILE: Array[Dictionary] = [
{"case": Vector3(0.56, 0.22, 0.9), "color": Color(0.45, 0.27, 0.14), "at": Vector2(-0.47, 0.41), "yaw": 3.0},
{"case": Vector3(0.52, 0.26, 0.84), "color": Color(0.2, 0.5, 0.47), "at": Vector2(0.51, 0.45), "yaw": -4.0},
{"bag": 0, "scale": 0.72, "at": Vector2(-0.45, -0.5), "yaw": 30.0},
{"bag": 1, "scale": 0.68, "at": Vector2(0.47, -0.47), "yaw": -20.0},
{"case": Vector3(0.84, 0.2, 0.56), "color": Color(0.74, 0.2, 0.17), "at": Vector2(0.05, 0.33), "yaw": 7.0, "tilt": Vector2(0.0, 2.0)},
{"crate": 1, "scale": 0.5, "at": Vector2(-0.38, -0.5), "yaw": 10.0, "tilt": Vector2(0.0, -3.0)},
{"crate": 0, "scale": 0.44, "at": Vector2(0.44, -0.46), "yaw": -6.0, "tilt": Vector2(2.0, 3.0)},
{"case": Vector3(0.5, 0.36, 0.17), "color": Color(0.86, 0.66, 0.22), "at": Vector2(0.14, 0.29), "yaw": -8.0, "tilt": Vector2(0.0, 4.0)},
{"bag": 2, "scale": 0.5, "at": Vector2(-0.45, 0.42), "yaw": 25.0},
{"crate": 1, "scale": 0.32, "at": Vector2(-0.42, 0.4), "yaw": 25.0, "tilt": Vector2(3.0, -2.0)},
{"hatbox": 0.18, "color": Color(0.9, 0.55, 0.65), "at": Vector2(-0.3, -0.5), "tilt": Vector2(-4.0, 6.0)},
]
## Where the straps cross the pile (a share of the roof's half length), and their look.
const STRAPS: Array[float] = [0.36, 0.06, -0.5]
const STRAP_WIDTH := 0.06
const STRAP_THICK := 0.018
const STRAP_COLOR := Color(0.13, 0.11, 0.09)
const MATTRESS_RADIUS := 0.17
const MATTRESS_LENGTH := 1.1
# --- The car ---------------------------------------------------------------------------------
## The farmers' station wagon under parent, its collision off; loaded with the roof luggage
## (load_roof) unless loaded is false.
static func make_car(parent: Node, loaded := true) -> Node3D:
var car := (load(CAR_SCENE) as PackedScene).instantiate() as Node3D
parent.add_child(car)
for body in car.find_children("*", "CollisionObject3D", true, false):
(body as CollisionObject3D).collision_layer = 0
if loaded:
load_roof(car)
return car
## The car's engine: a 3D player on the car with the truck_engine loop, already playing (if audio
## has the sound; there's no audio in some tests).
static func add_engine(car: Node3D, audio: FarmAudio) -> AudioStreamPlayer3D:
var engine := AudioStreamPlayer3D.new()
engine.name = "Engine"
engine.bus = &"SFX"
engine.unit_size = 10.0
engine.volume_db = -6.0
if audio != null:
engine.stream = audio.stream_of("truck_engine")
car.add_child(engine)
if engine.stream != null:
engine.play()
return engine
## The roof in the car's space, from its meshes (not the luggage): the top is the top of the
## car's AABB (the roof rack), and the footprint and the bottom are those of its vertices in the
## top ROOF_BAND of its height (the roof skin and the rack).
static func roof_of(car: Node3D) -> AABB:
var skip := luggage_of(car)
var whole := mesh_bounds(car, car, skip)
var band := whole.end.y - whole.size.y * ROOF_BAND
var lo := Vector3(INF, INF, INF)
var hi := -lo
for node in car.find_children("*", "MeshInstance3D", true, false):
var mi := node as MeshInstance3D
if mi.mesh == null or (skip != null and skip.is_ancestor_of(mi)):
continue
var xf := _to_space(mi, car)
for s in mi.mesh.get_surface_count():
for v: Vector3 in mi.mesh.surface_get_arrays(s)[Mesh.ARRAY_VERTEX]:
var p := xf * v
if p.y >= band:
lo = lo.min(p)
hi = hi.max(p)
if lo.x == INF:
return AABB(Vector3(whole.position.x, band, whole.position.z), Vector3(whole.size.x, whole.end.y - band, whole.size.z))
return AABB(Vector3(lo.x, lo.y, lo.z), Vector3(hi.x - lo.x, whole.end.y - lo.y, hi.z - lo.z))
## The bounds of every mesh under node (and node itself, if it's one), in space's coordinates
## (space is node or one of its ancestors), leaving out the meshes under skip. Works out of the
## tree too. Empty if there are none.
static func mesh_bounds(node: Node, space: Node, skip: Node = null) -> AABB:
var meshes := node.find_children("*", "MeshInstance3D", true, false)
if node is MeshInstance3D:
meshes.append(node)
var out := AABB()
var first := true
for m in meshes:
var mi := m as MeshInstance3D
if mi.mesh == null or (skip != null and (skip == mi or skip.is_ancestor_of(mi))):
continue
var box := _to_space(mi, space) * mi.get_aabb()
out = box if first else out.merge(box)
first = false
return out
static func _to_space(node: Node, space: Node) -> Transform3D:
var xf := Transform3D.IDENTITY
var n := node
while n != null and n != space:
if n is Node3D:
xf = (n as Node3D).transform * xf
n = n.get_parent()
return xf
# --- The roof luggage --------------------------------------------------------------------------
## The roof load: the pile on the rack (pieces), the straps over it, and the rolled mattress
## hanging off the car's right side (hanging), all under this node. It sits on the middle of the
## rack's top, which is the pivot of its sway.
class Luggage extends Node3D:
## Sway: a stiff, under-damped spring (per second squared, per second), the lean per m/s² of
## braking and per rad/s of turning, and the most it leans (radians).
const STIFFNESS := 80.0
const DAMPING := 4.5
const LEAN_PER_ACCEL := 0.0045
const LEAN_PER_TURN := 0.05
const MAX_ACCEL := 15.0
const MAX_TURN := 2.0
const MAX_LEAN := 0.12
var pieces: Array[Node3D] = []
var straps: Array[Node3D] = []
var hanging: Node3D
## The lean (x: forward, about the car's x; y: to the car's right, about its z, radians) and
## how fast it's changing.
var lean := Vector2.ZERO
var lean_speed := Vector2.ZERO
## One step of the sway. turn_rate: the car's heading change (rad/s, + turning left);
## accel: its change in speed along its way (m/s², - braking). Braking tips the pile forward,
## a turn throws it to the outside, and it wobbles back.
func sway(delta: float, turn_rate: float, accel: float) -> void:
if delta <= 0.0:
return
var want := Vector2(-clampf(accel, -MAX_ACCEL, MAX_ACCEL) * LEAN_PER_ACCEL,
clampf(turn_rate, -MAX_TURN, MAX_TURN) * LEAN_PER_TURN)
var left := minf(delta, 0.25) # a long step doesn't fling it
while left > 0.0:
var h := minf(left, 1.0 / 60.0)
lean_speed += ((want - lean) * STIFFNESS - lean_speed * DAMPING) * h
lean = (lean + lean_speed * h).clampf(-MAX_LEAN, MAX_LEAN)
left -= h
rotation = Vector3(lean.x, 0.0, lean.y)
## A jolt (rad/s: forward, to the right): a door slam, the engine catching. sway() plays it out.
func nudge(kick: Vector2) -> void:
lean_speed += kick
## Straight and still.
func settle() -> void:
lean = Vector2.ZERO
lean_speed = Vector2.ZERO
rotation = Vector3.ZERO
## The car's Luggage, or null.
static func luggage_of(car: Node3D) -> Luggage:
return car.get_node_or_null(^"Luggage") as Luggage if car != null else null
## sway() on the car's luggage, if it has any.
static func sway_luggage(car: Node3D, delta: float, turn_rate: float, accel: float) -> void:
var luggage := luggage_of(car)
if luggage != null:
luggage.sway(delta, turn_rate, accel)
## Straps the roof luggage onto car (once; a second call returns the first load): the PILE,
## stacked from the roof's footprint and height (roof_of), the STRAPS over it, and a rolled
## mattress hanging off the car's right side. No collision on any of it.
static func load_roof(car: Node3D) -> Luggage:
var old := luggage_of(car)
if old != null:
return old
var roof := roof_of(car)
var half := Vector2(roof.size.x, roof.size.z) * 0.5
var luggage := Luggage.new()
luggage.name = "Luggage"
luggage.position = Vector3(roof.get_center().x, roof.end.y, roof.get_center().z)
car.add_child(luggage)
var pile := Pile.new(half, 0.5)
for spec in PILE:
var piece := _piece(spec)
var tilt: Vector2 = spec.get("tilt", Vector2.ZERO)
piece.rotation = Vector3(deg_to_rad(tilt.x), deg_to_rad(float(spec.get("yaw", 0.0))), deg_to_rad(tilt.y))
luggage.add_child(piece)
var at: Vector2 = spec["at"]
_stack(luggage, pile, piece, at * half, 0.04 if spec.has("bag") else 0.0)
var strap_mat := _material(STRAP_COLOR)
var buckle_mat := _material(Color(0.62, 0.62, 0.58))
var faces := _faces(luggage)
for z in STRAPS:
var strap := _strap(faces, z * half.y, half.x, roof.size.y, strap_mat, buckle_mat)
luggage.add_child(strap)
luggage.straps.append(strap)
luggage.hanging = _mattress(pile, half, roof.size.y)
luggage.add_child(luggage.hanging)
return luggage
## Where the pile has got to: the height of its top (above the rack) on a grid over the roof,
## twice: what the next piece can rest on (under the middle of each piece, as their bounds are
## boxy) and the whole outline (what the straps go over).
class Pile extends RefCounted:
const CELL := 0.04
var origin: Vector2
var nx: int
var nz: int
var rests := PackedFloat32Array()
var outline := PackedFloat32Array()
func _init(half: Vector2, margin: float) -> void:
origin = -half - Vector2(margin, margin)
nx = ceili((half.x + margin) * 2.0 / CELL)
nz = ceili((half.y + margin) * 2.0 / CELL)
rests.resize(nx * nz)
rests.fill(0.0)
outline.resize(nx * nz)
outline.fill(0.0)
## The highest top under rect (x, z): of what a piece can rest on, or of the outline.
func top(rect: Rect2, of_outline := false) -> float:
var grid := outline if of_outline else rests
var out := 0.0
var c := _cells(rect)
for j in range(c.position.y, c.end.y):
for i in range(c.position.x, c.end.x):
out = maxf(out, grid[j * nx + i])
return out
## A piece over rect (x, z) with its top at `to`.
func raise(rect: Rect2, to: float) -> void:
var c := _cells(rect)
var middle := _cells(rect.grow_individual(-rect.size.x * 0.1, -rect.size.y * 0.1, -rect.size.x * 0.1, -rect.size.y * 0.1))
for j in range(c.position.y, c.end.y):
for i in range(c.position.x, c.end.x):
var k := j * nx + i
outline[k] = maxf(outline[k], to)
if middle.has_point(Vector2i(i, j)):
rests[k] = maxf(rests[k], to)
## The cells whose middles are in rect (at least one), as a Rect2i of indices (clipped to the
## grid).
func _cells(rect: Rect2) -> Rect2i:
var a := ((rect.position - origin) / CELL).round()
var b := ((rect.end - origin) / CELL).round()
var lo := Vector2i(clampi(int(a.x), 0, nx - 1), clampi(int(a.y), 0, nz - 1))
var hi := Vector2i(clampi(maxi(int(b.x), lo.x + 1), 0, nx), clampi(maxi(int(b.y), lo.y + 1), 0, nz))
return Rect2i(lo, hi - lo)
## The x where the pile starts (its outline's leftmost cell, - x) between z0 and z1.
func min_x(z0: float, z1: float) -> float:
var c := _cells(Rect2(origin.x, z0, nx * CELL, z1 - z0))
for i in nx:
for j in range(c.position.y, c.end.y):
if outline[j * nx + i] > 0.0:
return origin.x + i * CELL
return 0.0
## Puts piece (already turned and scaled) on top of what's under its middle at `at` (x, z) and
## raises the pile under it (its bounds are boxy, so neighbours that only touch at the corners
## stand side by side instead of on each other). Soft pieces sink in a little (not into the rack).
static func _stack(luggage: Luggage, pile: Pile, piece: Node3D, at: Vector2, sink: float) -> void:
var b := Transform3D(piece.basis, Vector3.ZERO) * mesh_bounds(piece, piece)
var rect := Rect2(at.x + b.position.x, at.y + b.position.z, b.size.x, b.size.z)
var base := pile.top(rect.grow_individual(-rect.size.x * 0.3, -rect.size.y * 0.3, -rect.size.x * 0.3, -rect.size.y * 0.3))
var y := maxf(base - sink, 0.0)
piece.position = Vector3(at.x, y - b.position.y, at.y)
pile.raise(rect, y + b.size.y)
luggage.pieces.append(piece)
static func _piece(spec: Dictionary) -> Node3D:
if spec.has("case"):
return _suitcase(spec["case"], spec["color"])
if spec.has("hatbox"):
return _hatbox(float(spec["hatbox"]), spec["color"])
var path: String = BAGS[int(spec["bag"])] if spec.has("bag") else CRATES[int(spec["crate"])]
var prop := (load(path) as PackedScene).instantiate() as Node3D
for body in prop.find_children("*", "CollisionObject3D", true, false):
body.get_parent().remove_child(body)
body.free()
var s := float(spec.get("scale", 1.0))
prop.scale = Vector3(s, s, s)
return prop
## A suitcase: a box with a darker seam around its middle, a handle on its long side, and two
## latches.
static func _suitcase(size: Vector3, color: Color) -> Node3D:
var root := Node3D.new()
var trim := _material(color.darkened(0.45))
_box(root, size, Vector3.ZERO, _material(color))
_box(root, Vector3(size.x + 0.012, 0.022, size.z + 0.012), Vector3.ZERO, trim)
# The handle sits on the +x face if the case lies wide, else on its top edge (standing up).
var standing := size.y > size.z
var face := Vector3(size.x * 0.5, 0.0, 0.0) if not standing else Vector3(0.0, size.y * 0.5, 0.0)
var out := Vector3.RIGHT if not standing else Vector3.UP
var along := Vector3(0.0, 0.0, 1.0) if not standing else Vector3(1.0, 0.0, 0.0)
var grip := Vector3(0.025, 0.025, 0.025) + along * 0.13
_box(root, grip, face + out * 0.04, trim)
for side: float in [-1.0, 1.0]:
_box(root, Vector3(0.022, 0.022, 0.022) + out * 0.02, face + out * 0.02 + along * 0.055 * side, trim)
_box(root, Vector3(0.03, 0.03, 0.03) + along * 0.01, face + along * size.dot(along) * 0.33 * side, _material(Color(0.75, 0.72, 0.6)))
return root
## Every triangle of the pieces' meshes, in the luggage's space (three points each).
static func _faces(luggage: Luggage) -> PackedVector3Array:
var out := PackedVector3Array()
for piece in luggage.pieces:
var meshes := piece.find_children("*", "MeshInstance3D", true, false)
if piece is MeshInstance3D:
meshes.append(piece)
for node in meshes:
var mi := node as MeshInstance3D
if mi.mesh == null:
continue
var xf := _to_space(mi, luggage)
for v in mi.mesh.get_faces():
out.append(xf * v)
return out
## The pile's outline where a strap crosses it at z: the highest of its triangles cut by the
## planes at z and at the strap's edges, in steps of 2 cm across x (bin -> height).
static func _profile(faces: PackedVector3Array, z: float) -> Dictionary:
const STEP := 0.02
var tops := {}
var w := STRAP_WIDTH * 0.5
for t in range(0, faces.size(), 3):
var tri := [faces[t], faces[t + 1], faces[t + 2]]
if minf(faces[t].z, minf(faces[t + 1].z, faces[t + 2].z)) > z + w \
or maxf(faces[t].z, maxf(faces[t + 1].z, faces[t + 2].z)) < z - w:
continue
for plane: float in [z - w, z, z + w]:
var hits: Array[Vector2] = []
for e in 3:
var p: Vector3 = tri[e]
var q: Vector3 = tri[(e + 1) % 3]
if p.z != q.z and (p.z - plane) * (q.z - plane) <= 0.0:
var f := (plane - p.z) / (q.z - p.z)
hits.append(Vector2(lerpf(p.x, q.x, f), lerpf(p.y, q.y, f)))
if hits.size() < 2:
continue
var a := hits[0] if hits[0].x <= hits[1].x else hits[1]
var b := hits[1] if hits[0].x <= hits[1].x else hits[0]
for i in range(floori(a.x / STEP), floori(b.x / STEP) + 1):
var x0 := maxf(a.x, i * STEP)
var x1 := minf(b.x, (i + 1) * STEP)
var ys := [a.y, b.y] if b.x - a.x < 1e-6 else \
[lerpf(a.y, b.y, (x0 - a.x) / (b.x - a.x)), lerpf(a.y, b.y, (x1 - a.x) / (b.x - a.x))]
tops[i] = maxf(float(tops.get(i, -INF)), maxf(ys[0], ys[1]))
var out := {} # x -> height, at both edges of each step
for i: int in tops:
for x: float in [i * STEP, (i + 1) * STEP]:
out[x] = maxf(float(out.get(x, -INF)), tops[i])
return out
## A round hatbox (radius r) with a lid and a ribbon round its middle.
static func _hatbox(r: float, color: Color) -> Node3D:
var root := Node3D.new()
var h := r * 1.1
# radius, height, middle (y), color: the box, its lid, the ribbon
for part in [[r, h, 0.0, color], [r + 0.012, 0.05, h * 0.5 - 0.02, color.lightened(0.3)],
[r + 0.006, 0.025, -0.04, Color(0.35, 0.2, 0.45)]]:
var mesh := CylinderMesh.new()
mesh.top_radius = part[0]
mesh.bottom_radius = part[0]
mesh.height = part[1]
var mi := MeshInstance3D.new()
mi.mesh = mesh
mi.position.y = part[2]
mi.material_override = _material(part[3])
root.add_child(mi)
return root
## A strap across the pile at z: taut over the top of the pile (the upper hull of its outline
## there) and down to the roof's edges on both sides (drop below the rack's top), with a buckle.
static func _strap(faces: PackedVector3Array, z: float, half_x: float, drop: float, mat: Material, buckle: Material) -> Node3D:
var profile := _profile(faces, z)
var xs := profile.keys()
xs.sort()
var points: Array[Vector2] = []
for x: float in xs:
points.append(Vector2(x, float(profile[x]) + STRAP_THICK * 0.5))
var ends := Vector2(-half_x, half_x)
if not points.is_empty():
ends = Vector2(minf(-half_x, points[0].x - 0.005), maxf(half_x, points[-1].x + 0.005))
points.push_front(Vector2(ends.x, -drop))
points.append(Vector2(ends.y, -drop))
var hull: Array[Vector2] = []
for p in points: # in x order: the upper hull is the strap pulled tight
while hull.size() >= 2 and (hull[-1] - hull[-2]).cross(p - hull[-2]) >= 0.0:
hull.pop_back()
hull.append(p)
var strap := Node3D.new()
strap.name = "Strap"
var highest: MeshInstance3D = null
for i in hull.size() - 1:
var a := hull[i]
var d := hull[i + 1] - a
var seg := _box(strap, Vector3(d.length() + STRAP_THICK, STRAP_THICK, STRAP_WIDTH), Vector3.ZERO, mat)
seg.position = Vector3(a.x + d.x * 0.5, a.y + d.y * 0.5, z)
seg.rotation.z = atan2(d.y, d.x)
if highest == null or seg.position.y > highest.position.y:
highest = seg
var b := _box(strap, Vector3(0.07, STRAP_THICK * 2.0, STRAP_WIDTH + 0.02), Vector3.ZERO, buckle)
b.transform = highest.transform
return strap
## A rolled-up mattress hanging off the car's right side (- x) beside the pile, tied with two
## cords that run up to the pile, its back end sagging.
static func _mattress(pile: Pile, half: Vector2, drop: float) -> Node3D:
var r := MATTRESS_RADIUS
var root := Node3D.new()
root.name = "Mattress"
var z0 := half.y * 0.05
var side := minf(pile.min_x(z0 - MATTRESS_LENGTH * 0.5, z0 + MATTRESS_LENGTH * 0.5), -half.x)
root.position = Vector3(side - r - 0.01, r - drop, z0)
root.rotation = Vector3(deg_to_rad(-7.0), 0.0, deg_to_rad(-12.0))
var roll := CylinderMesh.new()
roll.top_radius = r
roll.bottom_radius = r
roll.height = MATTRESS_LENGTH
var body := MeshInstance3D.new()
body.mesh = roll
body.rotation.x = PI / 2.0
body.material_override = _material(Color(0.78, 0.82, 0.9))
root.add_child(body)
var stripe := _material(Color(0.42, 0.52, 0.72))
for end: float in [-1.0, 1.0]: # the rolled-up ends
var cap := CylinderMesh.new()
cap.top_radius = r * 0.72
cap.bottom_radius = r * 0.72
cap.height = 0.012
var c := MeshInstance3D.new()
c.mesh = cap
c.rotation.x = PI / 2.0
c.position = Vector3(0.0, 0.0, end * MATTRESS_LENGTH * 0.5)
c.material_override = stripe
root.add_child(c)
var cord := _material(Color(0.5, 0.38, 0.22))
var to_root := root.transform.affine_inverse()
for along: float in [-0.3, 0.3]:
var ring := TorusMesh.new()
ring.inner_radius = r - 0.004
ring.outer_radius = r + 0.022
var t := MeshInstance3D.new()
t.mesh = ring
t.rotation.x = PI / 2.0
t.position = Vector3(0.0, 0.0, along * MATTRESS_LENGTH)
t.material_override = cord
root.add_child(t)
# The cord runs from the top of the ring in over the edge, tied off on top of the pile.
var from := root.transform * Vector3(0.0, r + 0.015, along * MATTRESS_LENGTH)
var tie := Vector2(side + 0.12, from.z)
var on := Vector3(tie.x, minf(pile.top(Rect2(tie - Vector2(0.03, 0.03), Vector2(0.06, 0.06)), true), r * 2.0) + 0.012, tie.y)
_rod(root, to_root * from, to_root * on, 0.012, cord)
return root
static func _box(parent: Node3D, size: Vector3, at: Vector3, mat: Material) -> MeshInstance3D:
var mesh := BoxMesh.new()
mesh.size = size
var mi := MeshInstance3D.new()
mi.mesh = mesh
mi.position = at
mi.material_override = mat
parent.add_child(mi)
return mi
## A thin cylinder from a to b (in parent's space).
static func _rod(parent: Node3D, a: Vector3, b: Vector3, radius: float, mat: Material) -> MeshInstance3D:
var mesh := CylinderMesh.new()
mesh.top_radius = radius
mesh.bottom_radius = radius
mesh.height = a.distance_to(b)
mesh.radial_segments = 6
var mi := MeshInstance3D.new()
mi.mesh = mesh
mi.material_override = mat
parent.add_child(mi)
var up := (b - a).normalized()
var side := up.cross(Vector3.FORWARD if absf(up.z) < 0.9 else Vector3.RIGHT).normalized()
mi.transform = Transform3D(Basis(side, up, side.cross(up)), (a + b) * 0.5)
return mi
static func _material(color: Color) -> StandardMaterial3D:
var m := StandardMaterial3D.new()
m.albedo_color = color
return m
# --- The farmers -----------------------------------------------------------------------------
## A farmer under parent: a Mannequin_Medium tinted all over with a straw sun hat, under its own
## root (returned); its AnimationPlayer (the player's animations) is anim_of(root).
static func make_farmer(parent: Node, tint: Color) -> Node3D:
var root := Node3D.new()
parent.add_child(root)
var model := (load(FARMER_SCENE) as PackedScene).instantiate() as Node3D
root.add_child(model)
for mi in model.find_children("*", "MeshInstance3D", true, false):
var m := mi as MeshInstance3D
var base := m.get_active_material(0)
if base is BaseMaterial3D:
var tinted := (base as BaseMaterial3D).duplicate() as BaseMaterial3D
tinted.albedo_color = tint
m.material_override = tinted
var straw := _material(STRAW) # a straw sun hat for the trip
for part in [[0.62, 0.05, 2.12], [0.34, 0.26, 2.26]]: # brim, crown: radius, height, y
var mesh := CylinderMesh.new()
mesh.top_radius = part[0]
mesh.bottom_radius = part[0]
mesh.height = part[1]
var hat := MeshInstance3D.new()
hat.mesh = mesh
hat.position = Vector3(0.0, part[2], 0.0)
hat.material_override = straw
model.add_child(hat)
var anim := AnimationPlayer.new()
anim.name = "AnimationPlayer"
root.add_child(anim)
anim.root_node = anim.get_path_to(model)
anim.add_animation_library(&"", load(ANIMATIONS) as AnimationLibrary)
return root
static func anim_of(farmer: Node3D) -> AnimationPlayer:
return farmer.get_node_or_null(^"AnimationPlayer") as AnimationPlayer
## Turns node (about y) to face the point at, if it isn't standing on it.
static func face(node: Node3D, at: Vector3) -> void:
var d := at - node.global_position
if Vector2(d.x, d.z).length_squared() > 1e-6:
node.rotation.y = atan2(d.x, d.z)
# --- Routes ----------------------------------------------------------------------------------
## A smooth route through points (two or more, any order): each inner corner is rounded, its
## handles a quarter of the way toward its neighbours.
static func route_curve(points: Array[Vector3], rounding := 0.25) -> Curve3D:
var curve := Curve3D.new()
for p in points:
curve.add_point(p)
for i in range(1, points.size() - 1):
var t := (points[i + 1] - points[i - 1]) * rounding
curve.set_point_in(i, -t)
curve.set_point_out(i, t)
return curve
## points in the other order (to drive a route backwards).
static func reversed(points: Array[Vector3]) -> Array[Vector3]:
var out := points.duplicate()
out.reverse()
return out
## Puts node distance along curve (clamped to it), level and facing the way the curve runs there
## (its + z ahead).
static func place_on_curve(node: Node3D, curve: Curve3D, distance: float) -> void:
var length := curve.get_baked_length()
var at := curve.sample_baked(distance, true)
var ahead := curve.sample_baked(minf(distance + 1.0, length), true)
var behind := curve.sample_baked(maxf(distance - 1.0, 0.0), true)
var dir := ahead - behind
dir.y = 0.0
if dir.length_squared() > 1e-6:
node.rotation = Vector3(0.0, atan2(dir.x, dir.z), 0.0)
node.global_position = at
# --- The camera and the overlay --------------------------------------------------------------
## A camera under parent, made current (the caller puts the old one back).
static func make_camera(parent: Node, fov := 45.0) -> Camera3D:
var camera := Camera3D.new()
camera.fov = fov
parent.add_child(camera)
camera.make_current()
return camera
## Eases camera toward want, turning it to look at look: 1 - e^(-rate * delta) of the way each
## step. A step of a second or more, or a camera that hasn't moved from the origin yet (just
## made), cuts straight to the shot.
static func move_camera(camera: Camera3D, want: Vector3, look: Vector3, delta: float, rate: float) -> void:
var k := 1.0 - exp(-rate * delta) if delta < 1.0 else 1.0
camera.global_position = camera.global_position.lerp(want, k) if camera.global_position != Vector3.ZERO else want
var target := camera.global_transform.looking_at(look, Vector3.UP)
camera.global_basis = camera.global_basis.slerp(target.basis, k).orthonormalized() if k < 1.0 else target.basis
## Behind and above target, off its left side (+ x), looking a little ahead of it.
static func follow_camera(camera: Camera3D, target: Node3D, delta: float, rate := 2.5) -> void:
var fwd := target.global_basis.z
var want := target.global_position - fwd * 11.0 + Vector3(0.0, 8.0, 0.0) + target.global_basis.x * 3.0
var look := target.global_position + fwd * 4.0 + Vector3(0.0, 1.0, 0.0)
move_camera(camera, want, look, delta, rate)
## Shows or hides the game's HUD layer (cutscenes hide it).
static func set_hud(sim: FarmSim, on: bool) -> void:
if sim.hud != null and sim.hud.get_parent() is CanvasLayer:
(sim.hud.get_parent() as CanvasLayer).visible = on
## The cutscene chrome over the 3D view: black bars at the top and bottom, a caption in the top
## one, and the skip hint at the bottom right.
class Letterbox extends CanvasLayer:
const BAR := 96.0
var bars: Array[ColorRect] = []
var caption: Label
var hint: Label
## A Letterbox under parent with caption and hint (the caller says how to skip).
static func make_letterbox(parent: Node, caption: String, hint: String, layer := 5) -> Letterbox:
var box := Letterbox.new()
box.layer = layer
parent.add_child(box)
for top in [true, false]:
var bar := ColorRect.new()
bar.color = Color.BLACK
bar.mouse_filter = Control.MOUSE_FILTER_IGNORE
box.add_child(bar)
bar.set_anchors_and_offsets_preset(Control.PRESET_TOP_WIDE if top else Control.PRESET_BOTTOM_WIDE)
if top:
bar.offset_bottom = Letterbox.BAR
else:
bar.offset_top = -Letterbox.BAR
box.bars.append(bar)
box.caption = Label.new()
box.caption.text = caption
box.caption.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
box.caption.add_theme_font_size_override("font_size", 38)
box.caption.add_theme_color_override("font_color", Color(0.95, 0.85, 0.55))
box.add_child(box.caption)
box.caption.set_anchors_and_offsets_preset(Control.PRESET_TOP_WIDE)
box.caption.offset_top = 22.0
box.hint = Label.new()
box.hint.text = hint
box.hint.add_theme_font_size_override("font_size", 22)
box.hint.add_theme_color_override("font_color", Color(0.8, 0.8, 0.75))
box.add_child(box.hint)
box.hint.set_anchors_and_offsets_preset(Control.PRESET_BOTTOM_RIGHT)
box.hint.offset_left = -360.0
box.hint.offset_top = -70.0
return box

View file

@ -0,0 +1 @@
uid://b003m7se63ke4

View file

@ -9,6 +9,8 @@ extends Node
## The scarecrow carries a lantern that lights up as it gets dark, and enemies glow faintly at
## night (night_glow in thief.gdshader and ufo.gdshader) so they stay readable. The current
## look eases toward the target, so phase changes never pop.
## A cutscene (the opening intro) can hold a look whatever the phase (forced: "morning" or
## "night") and keep the lanterns dark (lanterns_dark); both are cleared to give the phase back.
const NIGHTFALL := 8.0
const EASE := 2.5
@ -33,6 +35,11 @@ var lantern: OmniLight3D
## Co-op: player 2's lantern (add_lantern), lit the same.
var lanterns: Array[OmniLight3D] = []
var current := DAY.duplicate()
## "" follows the phase; "morning" holds the MORNING phase's look and "night" the NIGHT look
## (target() returns it; the current look eases toward it, or snap() jumps to it).
var forced := ""
## Every lantern stays off while set (the intro's scarecrow isn't alive yet).
var lanterns_dark := false
func setup(p_campaign: CampaignController, p_sun: DirectionalLight3D, p_env: Environment, player: Node3D,
@ -72,6 +79,11 @@ func snap() -> void:
func target() -> Dictionary:
match forced:
"morning":
return morning()
"night":
return NIGHT
var s := campaign.state
var cfg := campaign.config
var length := campaign.phase_length(s.phase)
@ -79,7 +91,7 @@ func target() -> Dictionary:
var p := clampf(elapsed / length, 0.0, 1.0) if is_finite(length) and length > 0.0 else 0.0
match s.phase:
CampaignController.Phase.MORNING:
return _mix(SUNRISE, DAY, 0.7)
return morning()
CampaignController.Phase.DUSK:
return _mix(DAY, SUNSET, p)
CampaignController.Phase.NIGHT:
@ -91,6 +103,11 @@ func target() -> Dictionary:
return DAY
## The MORNING phase's look: mostly day, a little sunrise.
static func morning() -> Dictionary:
return _mix(SUNRISE, DAY, 0.7)
func _process(delta: float) -> void:
if campaign == null:
return
@ -108,7 +125,7 @@ func _apply() -> void:
env.adjustment_saturation = current["sat"]
for l in lanterns:
if is_instance_valid(l):
l.light_energy = current["lantern"]
l.light_energy = 0.0 if lanterns_dark else float(current["lantern"])
for m in enemy_materials:
if m != null:
m.set_shader_parameter("night_glow", current["glow"])

View file

@ -10,6 +10,9 @@ extends Node
## starts while a menu is up (the shops, or Main's: DialogueBox.blocked) or the vacation is over,
## and a new morning (or a retry) takes down whatever was up. play() shows a conversation from
## code at any time; replay() (debug: F5) plays this phase's again.
## The opening intro (OpeningIntro) holds all of it: nothing starts while it's on screen (play()
## waits) and the sign stays down while it has the farm; at its end (intro_over()) night 1's
## morning conversations play, then the sign comes up.
const DIR := "res://game/resources/dialogue/"
@ -73,9 +76,9 @@ func due(n: int, phase: CampaignController.Phase) -> Array[Conversation]:
return out
## Shows conversation c now, or after the one that's up.
## Shows conversation c now, or after the one that's up (or the opening intro).
func play(c: Conversation) -> void:
if is_playing():
if is_playing() or _intro_busy():
_asked.append(c)
return
_played[c] = true
@ -98,6 +101,17 @@ func replay() -> void:
play(c)
## Whether a conversation would start now (the intro keeps the sign down for it).
func has_due() -> bool:
return not _asked.is_empty() or (not _queue.is_empty() and _elapsed() >= _queue[0].delay)
## The opening intro is over: this morning's conversations now, then the sign.
func intro_over() -> void:
if not is_playing():
_next()
## Takes down whatever is up and forgets what was due.
func stop() -> void:
_queue.clear()
@ -120,7 +134,7 @@ func _exit_tree() -> void:
func _process(_delta: float) -> void:
if _queue.is_empty() or is_playing() or box.is_blocked() or sim.campaign.is_over() or sim._menu_open():
if _queue.is_empty() or is_playing() or box.is_blocked() or sim.campaign.is_over() or sim._menu_open() or _intro_busy():
return
if _elapsed() >= _queue[0].delay:
play(_queue.pop_front())
@ -146,6 +160,11 @@ func _on_phase(phase: CampaignController.Phase, _previous: CampaignController.Ph
func _on_finished(_c: Conversation) -> void:
_release()
_next()
## The next conversation (asked for, or due), or the sign.
func _next() -> void:
if not _asked.is_empty():
play(_asked.pop_front())
elif not _queue.is_empty() and _elapsed() >= _queue[0].delay:
@ -155,10 +174,10 @@ func _on_finished(_c: Conversation) -> void:
## The morning sign steps aside while a conversation is up, and comes back (with the focus on
## Start the day) after it.
## Start the day) after it (not while the opening intro has the farm).
func _sign(show: bool) -> void:
var review := sim.review_panel if sim != null else null
if review == null:
if review == null or (show and sim.intro != null and sim.intro.running):
return
if show:
review.refresh()
@ -167,6 +186,10 @@ func _sign(show: bool) -> void:
review.mouse_filter = Control.MOUSE_FILTER_IGNORE
func _intro_busy() -> bool:
return sim != null and sim.intro != null and sim.intro.busy()
## Stops the farm for a conversation that pauses the game: the whole tree solo, this machine's
## scarecrow in co-op.
func _hold(pause: bool) -> void:

View file

@ -16,7 +16,8 @@ enum Align { SIDE, LEFT, CENTER, RIGHT }
## Optional mouth flaps: shown in turn with portrait while the words are being written.
@export var talk_frames: Array[Texture2D] = []
## Placeholder art while there's no portrait: one of Sketch.ICONS ("portrait" is the scarecrow,
## "thief" an alien, "breaker" a robot, "crow", "ufo").
## "thief" an alien, "breaker" a robot, "crow", "ufo", "farmer" the farmer in his straw hat,
## "farmers_wife" the farmer's wife).
@export var icon := ""
@export var side: HeadSide = HeadSide.LEFT

View file

@ -15,6 +15,11 @@ extends Node3D
## * phases: the dusk bell, stingers at dusk, nightfall, sunrise, and morning; game over;
## the day and night ambience (crossfading through dusk and dawn)
## * UI: hover, click, back, open, close, error (ui(), also from the menus)
## * the opening intro (OpeningIntro, solo only, so never sent): the farmhouse door's creak, the
## car doors, the big UFO's hum (a loop), spin-up whine, and zoom away, the part's falling
## whistle, and the flash that brings the scarecrow to life. While it plays it holds the
## ambience and the music (set_scene: its morning, then its night) whatever the phase, and it
## stops new_campaign()'s morning stinger (stop_cue) to play it with the sign instead
## * Music (the Music bus), by phase: "On the Farm" on the title screen (the farm's morning
## behind it), the morning, and by day, and when the farmers are back; "Purgatory" at night;
## none at dusk, at dawn, or after a Game Over (only the ambience). Tracks crossfade.
@ -101,11 +106,20 @@ const CUES := {
"truck_engine": {"files": ["synth/truck_engine.wav"], "db": -6.0},
"day_ambience": {"files": ["synth/day_ambience.wav"], "bus": "Ambience"},
"night_ambience": {"files": ["synth/night_ambience.wav"], "bus": "Ambience"},
# The opening intro ("ufo_hum" loops: play it on a player of its own, with stream_of)
"door_creak": {"files": ["kenney/rpg/creak1.ogg", "kenney/rpg/creak2.ogg"], "db": -2.0, "pitch": 0.05},
"car_door": {"files": ["synth/car_door.wav"], "db": -3.0, "pitch": 0.06},
"ufo_hum": {"files": ["synth/ufo_hum.wav"], "db": -6.0},
"ufo_whine": {"files": ["synth/ufo_whine.wav"], "db": -6.0},
"part_fall": {"files": ["synth/part_fall.wav"], "db": -6.0},
"life_flash": {"files": ["synth/life_flash.wav"], "db": -2.0},
"ufo_zoom": {"files": ["synth/ufo_zoom.wav"], "db": -4.0},
}
## Cues each machine plays for itself in co-op (never sent, never skipped).
const LOCAL_CUES: Array[String] = ["ui_hover", "ui_click", "ui_back", "ui_open", "ui_close", "error", "step", "chop",
"rustle", "clank", "hammer", "patching", "bell", "dusk", "night", "dawn", "morning", "game_over", "victory",
"assessment", "horn", "truck_engine", "day_ambience", "night_ambience", "upgrade", "fear_ready"]
"assessment", "horn", "truck_engine", "day_ambience", "night_ambience", "upgrade", "fear_ready", "door_creak",
"car_door", "ufo_hum", "ufo_whine", "part_fall", "life_flash", "ufo_zoom"]
const VOICES_3D := 20
const VOICES_UI := 10
## Seconds of channel between repeats of the gather / repair / patch sounds, and meters per
@ -156,6 +170,8 @@ var _bell_left: float = -1.0
var music_track := ""
var _music := {}
var _music_level := {}
## A cutscene holds the ambience and the music (set_scene); the phase gets them back at end_scene().
var scene := false
func _ready() -> void:
@ -357,6 +373,36 @@ func wire_buttons(node: Node) -> void:
button.pressed.connect(func() -> void: ui("ui_click"))
## A cutscene's ambience (day, night levels, 0..1; they crossfade to it) and music track ("" for
## none), whatever the phase, until end_scene().
func set_scene(ambience: Vector2, track: String) -> void:
scene = true
_ambience_target = ambience
music_track = track
## Gives the ambience (at once) and the music back to the phase.
func end_scene() -> void:
if not scene:
return
scene = false
var phase := sim.campaign.state.phase if sim != null else CampaignController.Phase.MORNING
_ambience_target = AMBIENCE.get(phase, Vector2(1.0, 0.0))
_ambience = _ambience_target
music_track = MUSIC_FOR.get(phase, "")
## Stops whatever a cue is playing now.
func stop_cue(cue: String) -> void:
for p in _voices_3d:
if p.playing and p.get_meta(&"cue", "") == cue:
p.stop()
for pool: Array[AudioStreamPlayer] in [_voices_ui, _voices_game]:
for p in pool:
if p.playing and p.get_meta(&"cue", "") == cue:
p.stop()
## The first stream of a cue (for looping players the cutscene owns).
func stream_of(cue: String) -> AudioStream:
var list: Array = streams.get(cue, [])
@ -420,6 +466,8 @@ func _process(delta: float) -> void:
func _on_phase(phase: CampaignController.Phase, _previous: CampaignController.Phase) -> void:
if scene:
return # the cutscene's (it gives them back at its end)
_ambience_target = AMBIENCE.get(phase, Vector2(1.0, 0.0))
music_track = MUSIC_FOR.get(phase, "")
match phase:

View file

@ -25,7 +25,8 @@ extends Node
## combat, and interactions are that machine's own scarecrow's (player 2's).
## FarmAudio plays every sound, Tutorial shows the first
## day's and night's tips, DialogueDirector the talking-head conversations (game/resources/
## dialogue/), and FarmersReturn plays the ending. Debug: T / G / H send in a
## dialogue/), OpeningIntro the cutscene before a new vacation's first morning (Main starts it),
## and FarmersReturn plays the ending. Debug: T / G / H send in a
## thief / a crow / a fence breaker at any time.
const SCARECROW_RADIUS := 0.4
@ -86,6 +87,7 @@ var audio: FarmAudio
var tutorial: Tutorial
var dialogue: DialogueDirector
var ending: FarmersReturn
var intro: OpeningIntro
## Flow-field rebuild after a structure change: running, and stats of the last one.
var rebuilding := false
var rebuilds: int = 0
@ -313,6 +315,12 @@ func _ready() -> void:
ending.name = "FarmersReturn"
add_child(ending)
ending.setup(self)
intro = OpeningIntro.new()
intro.name = "OpeningIntro"
add_child(intro)
intro.setup(self)
if review_panel != null:
review_panel.intro = intro
if end_panel != null:
end_panel.setup(campaign)
end_panel.ending = ending

View file

@ -7,13 +7,12 @@ extends Node3D
## camera follows the car, then frames the yard; the HUD hides behind letterbox bars. Fire,
## interact, or Space / Enter / A skips to the end. finished is emitted once it's
## over (or skipped), and EndPanel shows the final assessment over the scene.
## Built when it starts, after the game is over, so nothing is created during play.
## Built when it starts, after the game is over, so nothing is created during play. The car (with
## its roof luggage, which sways on the turns and tips forward as it stops), the farmers, the
## camera moves, and the letterbox come from CutsceneKit, which the opening intro shares.
signal finished
const CAR_SCENE := "res://assets/farm/ithappy/farm/prefabs/assets/transport/car_002.tscn"
const FARMER_SCENE := "res://assets/kaykit_characters/characters/Mannequin_Medium.glb"
const ANIMATIONS := "res://game/resources/player_animations.res"
## The road from the south along the east side, in at GapDriveway, through the farmyard to the
## parking spot east of the house (game/LAYOUT.md); the car faces the way it drives.
const ROUTE: Array[Vector3] = [
@ -30,7 +29,6 @@ const SCARECROW_SPOT := Vector3(24.6, 0.0, -34.0)
const YARD_CAMERA := Vector3(28.0, 10.0, -45.5)
const YARD_LOOK := Vector3(24.8, 0.8, -30.8)
const WALK_SPEED := 2.0
const TINTS: Array[Color] = [Color(0.35, 0.5, 0.85), Color(0.85, 0.45, 0.4)]
## Seconds: honk after parking, farmers out, then waving, cheering, and the end.
const OUT_AT := 0.9
const WAVE_TIME := 2.2
@ -47,13 +45,14 @@ var _car: Node3D
var _engine: AudioStreamPlayer3D
var _curve := Curve3D.new()
var _driven: float = 0.0
var _speed: float = 0.0 # the last step's, for the luggage's sway
var _parked_for: float = 0.0
var _farmers: Array[Node3D] = []
var _anims: Array[AnimationPlayer] = []
var _camera: Camera3D
var _previous_camera: Camera3D
var _stage_left: float = 0.0
var _overlay: CanvasLayer
var _overlay: CutsceneKit.Letterbox
var _caption: Label
@ -76,59 +75,17 @@ func start() -> void:
elapsed = 0.0
stage = "drive"
_driven = 0.0
_speed = DRIVE_SPEED
_parked_for = 0.0
for p in ROUTE:
_curve.add_point(p)
for i in range(1, ROUTE.size() - 1): # round the corners
var t := (ROUTE[i + 1] - ROUTE[i - 1]) * 0.25
_curve.set_point_in(i, -t)
_curve.set_point_out(i, t)
_car = (load(CAR_SCENE) as PackedScene).instantiate() as Node3D
add_child(_car)
for body in _car.find_children("*", "CollisionObject3D", true, false):
(body as CollisionObject3D).collision_layer = 0
_engine = AudioStreamPlayer3D.new()
_engine.bus = &"SFX"
_engine.unit_size = 10.0
_engine.volume_db = -6.0
if sim.audio != null:
_engine.stream = sim.audio.stream_of("truck_engine")
_car.add_child(_engine)
if _engine.stream != null:
_engine.play()
_curve = CutsceneKit.route_curve(ROUTE)
_car = CutsceneKit.make_car(self)
_engine = CutsceneKit.add_engine(_car, sim.audio)
_place_car(0.0)
var library := load(ANIMATIONS) as AnimationLibrary
for i in 2:
var root := Node3D.new()
root.visible = false
add_child(root)
var model := (load(FARMER_SCENE) as PackedScene).instantiate() as Node3D
root.add_child(model)
for mi in model.find_children("*", "MeshInstance3D", true, false):
var m := mi as MeshInstance3D
var base := m.get_active_material(0)
if base is BaseMaterial3D:
var tinted := (base as BaseMaterial3D).duplicate() as BaseMaterial3D
tinted.albedo_color = TINTS[i]
m.material_override = tinted
var straw := StandardMaterial3D.new() # a straw sun hat for the trip
straw.albedo_color = Color(0.92, 0.8, 0.45)
for part in [[0.62, 0.05, 2.12], [0.34, 0.26, 2.26]]: # brim, crown: radius, height, y
var mesh := CylinderMesh.new()
mesh.top_radius = part[0]
mesh.bottom_radius = part[0]
mesh.height = part[1]
var hat := MeshInstance3D.new()
hat.mesh = mesh
hat.position = Vector3(0.0, part[2], 0.0)
hat.material_override = straw
model.add_child(hat)
var anim := AnimationPlayer.new()
root.add_child(anim)
anim.root_node = anim.get_path_to(model)
anim.add_animation_library(&"", library)
_farmers.append(root)
_anims.append(anim)
var farmer := CutsceneKit.make_farmer(self, CutsceneKit.FARMER_TINTS[i])
farmer.visible = false
_farmers.append(farmer)
_anims.append(CutsceneKit.anim_of(farmer))
# The scarecrow waits by the yard (in co-op, both, side by side).
for a in sim.avatars:
var at := SCARECROW_SPOT + Vector3(1.6, 0.0, 0.6) * a.slot
@ -140,14 +97,12 @@ func start() -> void:
a.body.net_yaw = yaw
a.body.start_channel(&"Idle_A")
_previous_camera = get_viewport().get_camera_3d()
_camera = Camera3D.new()
_camera.fov = 45.0
add_child(_camera)
_camera.make_current()
_follow_camera(1.0)
_camera = CutsceneKit.make_camera(self)
CutsceneKit.follow_camera(_camera, _car, 1.0)
if sim.audio != null:
sim.audio.focus = _car
_build_overlay()
_overlay = CutsceneKit.make_letterbox(self, "The farmers are on their way home", "[Space / Enter / A] skip")
_caption = _overlay.caption
_set_hud(false)
@ -158,10 +113,13 @@ func skip() -> void:
_driven = _curve.get_baked_length()
_place_car(_driven)
_stop_engine()
var luggage := CutsceneKit.luggage_of(_car)
if luggage != null:
luggage.settle()
for i in 2:
_farmers[i].visible = true
_farmers[i].global_position = FARMER_SPOTS[i]
_face(_farmers[i], SCARECROW_SPOT)
CutsceneKit.face(_farmers[i], SCARECROW_SPOT)
_anims[i].play(&"Cheering")
_frame_yard(1.0)
_finish()
@ -179,6 +137,7 @@ func clear() -> void:
_engine = null
_camera = null
_overlay = null
_caption = null
_curve = Curve3D.new()
if sim != null:
_set_hud(true)
@ -202,9 +161,15 @@ func step(delta: float) -> void:
var length := _curve.get_baked_length()
var left := length - _driven
var speed := DRIVE_SPEED * clampf(left / 9.0, 0.18, 1.0) # ease into the spot
var was := _driven
var heading := _car.rotation.y
_driven = minf(_driven + speed * delta, length)
_place_car(_driven)
_follow_camera(delta)
if delta > 0.0: # the luggage leans out on the turns and tips forward as the car stops
var moved := (_driven - was) / delta
CutsceneKit.sway_luggage(_car, delta, angle_difference(heading, _car.rotation.y) / delta, (moved - _speed) / delta)
_speed = moved
CutsceneKit.follow_camera(_camera, _car, delta)
if _driven >= length:
_parked_for += delta
if _parked_for >= 0.15 and _engine != null and _engine.playing:
@ -220,6 +185,7 @@ func step(delta: float) -> void:
_anims[i].play(&"Walking_A", 0.1)
"walk":
_frame_yard(delta)
CutsceneKit.sway_luggage(_car, delta, 0.0, 0.0)
var arrived := 0
for i in 2:
var f := _farmers[i]
@ -229,12 +195,12 @@ func step(delta: float) -> void:
arrived += 1
continue
f.global_position += to.limit_length(WALK_SPEED * delta)
_face(f, f.global_position + to)
CutsceneKit.face(f, f.global_position + to)
if arrived == 2:
stage = "wave"
_stage_left = WAVE_TIME
for i in 2:
_face(_farmers[i], SCARECROW_SPOT)
CutsceneKit.face(_farmers[i], SCARECROW_SPOT)
_anims[i].play(&"Waving", 0.15)
if sim.audio != null:
sim.audio.play("victory")
@ -242,6 +208,7 @@ func step(delta: float) -> void:
_caption.text = "The farmers are home!"
"wave", "cheer":
_frame_yard(delta)
CutsceneKit.sway_luggage(_car, delta, 0.0, 0.0)
_stage_left -= delta
if _stage_left <= 0.0:
if stage == "wave":
@ -263,46 +230,16 @@ func _finish() -> void:
func _set_hud(on: bool) -> void:
if sim.hud != null and sim.hud.get_parent() is CanvasLayer:
(sim.hud.get_parent() as CanvasLayer).visible = on
CutsceneKit.set_hud(sim, on)
func _place_car(distance: float) -> void:
var length := _curve.get_baked_length()
var at := _curve.sample_baked(distance, true)
var ahead := _curve.sample_baked(minf(distance + 1.0, length), true)
var behind := _curve.sample_baked(maxf(distance - 1.0, 0.0), true)
var dir := ahead - behind
dir.y = 0.0
if dir.length_squared() > 1e-6:
_car.rotation = Vector3(0.0, atan2(dir.x, dir.z), 0.0)
_car.global_position = Vector3(at.x, 0.0, at.z)
## Behind and above the car, looking a little ahead of it.
func _follow_camera(delta: float) -> void:
var fwd := _car.global_basis.z
var want := _car.global_position - fwd * 11.0 + Vector3(0.0, 8.0, 0.0) + _car.global_basis.x * 3.0
var look := _car.global_position + fwd * 4.0 + Vector3(0.0, 1.0, 0.0)
_move_camera(want, look, delta, 2.5)
CutsceneKit.place_on_curve(_car, _curve, distance)
## A wide shot of the yard from the north-east: the car, the porch, and the scarecrow.
func _frame_yard(delta: float) -> void:
_move_camera(YARD_CAMERA, YARD_LOOK, delta, 1.2)
func _move_camera(want: Vector3, look: Vector3, delta: float, rate: float) -> void:
var k := 1.0 - exp(-rate * delta) if delta < 1.0 else 1.0
_camera.global_position = _camera.global_position.lerp(want, k) if _camera.global_position != Vector3.ZERO else want
var target := _camera.global_transform.looking_at(look, Vector3.UP)
_camera.global_basis = _camera.global_basis.slerp(target.basis, k).orthonormalized() if k < 1.0 else target.basis
func _face(node: Node3D, at: Vector3) -> void:
var d := at - node.global_position
if Vector2(d.x, d.z).length_squared() > 1e-6:
node.rotation.y = atan2(d.x, d.z)
CutsceneKit.move_camera(_camera, YARD_CAMERA, YARD_LOOK, delta, 1.2)
func _stop_engine() -> void:
@ -310,38 +247,6 @@ func _stop_engine() -> void:
_engine.stop()
func _build_overlay() -> void:
_overlay = CanvasLayer.new()
_overlay.layer = 5
add_child(_overlay)
for top in [true, false]:
var bar := ColorRect.new()
bar.color = Color.BLACK
bar.mouse_filter = Control.MOUSE_FILTER_IGNORE
_overlay.add_child(bar)
bar.set_anchors_and_offsets_preset(Control.PRESET_TOP_WIDE if top else Control.PRESET_BOTTOM_WIDE)
if top:
bar.offset_bottom = 96.0
else:
bar.offset_top = -96.0
_caption = Label.new()
_caption.text = "The farmers are on their way home"
_caption.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
_caption.add_theme_font_size_override("font_size", 38)
_caption.add_theme_color_override("font_color", Color(0.95, 0.85, 0.55))
_overlay.add_child(_caption)
_caption.set_anchors_and_offsets_preset(Control.PRESET_TOP_WIDE)
_caption.offset_top = 22.0
var hint := Label.new()
hint.text = "[Space / Enter / A] skip"
hint.add_theme_font_size_override("font_size", 22)
hint.add_theme_color_override("font_color", Color(0.8, 0.8, 0.75))
_overlay.add_child(hint)
hint.set_anchors_and_offsets_preset(Control.PRESET_BOTTOM_RIGHT)
hint.offset_left = -360.0
hint.offset_top = -70.0
func _unhandled_input(event: InputEvent) -> void:
if not running or done:
return

View file

@ -5,6 +5,9 @@ extends Node
## circles the farm behind the menu; the HUD is hidden.
## * New vacation (asks first when it would replace a save), Continue (the saved morning,
## SaveGame; refused with the reason when the save can't be used), Settings, Quit.
## * A new vacation opens with the intro (OpeningIntro; held down, it skips) before its first
## morning's sign. Continue never plays it, nor does hosting co-op. Restart the night during
## it skips it; Save & quit to menu takes it down (the save is that first morning already).
## * During play, Escape / Start pauses (PauseMenu): the tree pauses, so the simulation tick,
## timers, enemies, and game sounds all freeze. Resume, Restart the night (asks first),
## Settings, Save & quit to menu, Quit the game (asks first).
@ -65,6 +68,8 @@ func _ready() -> void:
sim.tutorial.enabled = settings.show_tips
if sim.dialogue != null:
sim.dialogue.box.blocked = func() -> bool: return screen != Screen.PLAYING
if sim.intro != null:
sim.intro.blocked = func() -> bool: return screen != Screen.PLAYING
main_menu.continue_requested.connect(continue_vacation)
main_menu.new_requested.connect(_ask_new_vacation)
main_menu.settings_requested.connect(_open_settings)
@ -158,10 +163,13 @@ func continue_vacation() -> bool:
return true
## New vacation: a fresh farm, the morning of night 1 (saved at once, replacing any save).
func new_vacation() -> void:
## New vacation: a fresh farm, the morning of night 1 (saved at once, replacing any save), and
## the opening intro before its sign (unless intro is false: hosting co-op).
func new_vacation(intro := true) -> void:
_play()
sim.campaign.new_campaign()
if intro and sim.intro != null:
sim.intro.start()
func pause() -> void:
@ -188,7 +196,7 @@ func resume() -> void:
pause_menu.close()
screen = Screen.PLAYING
get_tree().paused = false
if sim.local_frozen:
if sim.local_frozen and not (sim.intro != null and sim.intro.running): # (the intro's freeze is its own)
sim.freeze_local(false)
if sim.dialogue != null:
sim.dialogue.hold() # a conversation that was up stops the farm again
@ -196,6 +204,9 @@ func resume() -> void:
func restart_night() -> void:
resume()
if sim.intro != null and sim.intro.running:
sim.intro.skip() # its night is the first morning already: straight to it
return
sim.campaign.retry_night()
@ -204,6 +215,8 @@ func restart_night() -> void:
func to_menu() -> void:
confirm.close()
settings_menu.close()
if sim.intro != null:
sim.intro.clear()
if sim.coop.is_client():
_leave_as_partner("")
return
@ -262,7 +275,7 @@ func _host_coop(mode: CoopLobby.Mode, player: String, resume: bool) -> void:
if not continue_vacation():
return
else:
new_vacation()
new_vacation(false) # no intro: the friend can join any time
lobby.host(mode, player)
if not resume and SaveGame.read(save_path).status == SaveGame.Status.OK:
confirm.ask("Start a new vacation? It replaces your saved one.", "New vacation", go)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
uid://cppgmcqeukqgy

View file

@ -16,6 +16,11 @@ extends CharacterBody3D
## it was last sent (net_position, net_yaw) and animates by net_speed (like input strength: 1 at
## run speed, more while sprinting) instead of reading the input. Each scarecrow sprints on the
## machine that plays it. set_tint() and set_tag() tell the two scarecrows apart.
## The core glow: every scarecrow has a small blue core in its chest (the alien part it absorbed
## in the opening intro): a glowing gem on the chest bone (so it follows the animation), a soft
## halo, and a weak blue light, pulsing slowly. It's unshaded (the toon look and the hit flash
## leave it alone, and the tint doesn't touch it), so it reads faintly by day and clearly at
## night. set_core_glow(false) hides it (the intro, until the flash).
@export var run_speed := 5.0
@export var acceleration := 30.0
@ -37,6 +42,41 @@ extends CharacterBody3D
@onready var model: Node3D = $Model
@onready var animation_player: AnimationPlayer = $Model/AnimationPlayer
## Where the core sits in the mannequin skeleton's space (its front is +Z): on the front of the
## chest, a little more than half sunk in; the bone it rides; and the fallback spot in the
## model's space (it faces -Z) for a model without that bone.
const CORE_SPOT := Vector3(0.0, 0.93, 0.25)
const CORE_BONE := "chest"
const CORE_SPOT_MODEL := Vector3(0.0, 0.87, -0.25)
const CORE_COLOR := Color(0.3, 0.62, 1.0)
const CORE_GEM_COLOR := Color(0.5, 0.8, 1.0)
## Seconds per pulse, and the light's and the halo's strength from the pulse's low to its high.
const CORE_PULSE := 2.8
const CORE_LIGHT := Vector2(0.25, 0.45)
const CORE_HALO := Vector2(0.4, 0.75)
## The halo: an additive, camera-facing disc, drawn pulled toward the camera so the chest it
## sits in doesn't cut it in half (the body still hides it from behind).
const HALO_SHADER := """
shader_type spatial;
render_mode unshaded, blend_add, depth_draw_never, cull_disabled, shadows_disabled, fog_disabled;
uniform vec4 color : source_color = vec4(0.3, 0.62, 1.0, 1.0);
uniform float strength = 1.0;
uniform float pull = 0.2;
void vertex() {
vec3 center = (MODELVIEW_MATRIX * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
vec3 at = center + vec3(VERTEX.xy, 0.0) + normalize(-center) * pull;
POSITION = PROJECTION_MATRIX * vec4(at, 1.0);
}
void fragment() {
float d = length(UV - 0.5) * 2.0;
ALBEDO = color.rgb;
ALPHA = strength * pow(clamp(1.0 - d, 0.0, 1.0), 2.2);
}
"""
var alive := true
## Standing still for a channel: no movement input, the channel clip loops.
var rooted := false
@ -62,6 +102,13 @@ var _aim := Vector2.ZERO
var _aim_hold: float = 0.0
var _flash_mat: ShaderMaterial
var _tag: Label3D
## The core glow's root (hide it to hide all of it), its light and halo, and the pulse's clock.
var core_glow: Node3D
var _core_light: OmniLight3D
var _core_halo: ShaderMaterial
var _core_time: float = 0.0
## The halo's shader, compiled once for every scarecrow.
static var _halo_shader: Shader
func _ready() -> void:
@ -69,6 +116,13 @@ func _ready() -> void:
_flash_mat.shader = load("res://prototype/resources/hit_flash.gdshader") as Shader
for mi in model.find_children("*", "MeshInstance3D", true, false):
(mi as MeshInstance3D).material_overlay = _flash_mat
_build_core_glow()
func _process(delta: float) -> void:
if core_glow != null and core_glow.visible:
_core_time = fmod(_core_time + delta, CORE_PULSE)
_pulse_core()
func _physics_process(delta: float) -> void:
@ -157,10 +211,95 @@ func _end_sprint() -> void:
sprint_recharge = config.sprint_cooldown if config != null else 0.0
## Tints the model (co-op: player 2's scarecrow is blue).
## Shows or hides the core glow in the chest (on from the start).
func set_core_glow(on: bool) -> void:
if core_glow != null:
core_glow.visible = on
## The core glow: on the chest bone (through a BoneAttachment3D) when the model has one, else on
## the model at chest height.
func _build_core_glow() -> void:
var parent: Node3D = model
var spot := CORE_SPOT_MODEL
var front := Vector3.FORWARD
var down := Vector3.DOWN
var skeletons := model.find_children("*", "Skeleton3D", true, false)
if not skeletons.is_empty():
var skel := skeletons[0] as Skeleton3D
var bone := skel.find_bone(CORE_BONE)
if bone >= 0:
var attach := BoneAttachment3D.new()
attach.name = "CoreAttachment"
attach.bone_name = CORE_BONE
skel.add_child(attach)
parent = attach
var rest := skel.get_bone_global_rest(bone).affine_inverse() # skeleton -> the bone's space
spot = rest * CORE_SPOT
front = (rest.basis * Vector3.BACK).normalized()
down = (rest.basis * Vector3.DOWN).normalized()
core_glow = Node3D.new()
core_glow.name = "CoreGlow"
core_glow.position = spot
parent.add_child(core_glow)
var gem := MeshInstance3D.new()
gem.name = "Gem"
var sphere := SphereMesh.new()
sphere.radius = 0.06
sphere.height = 0.12
sphere.radial_segments = 12
sphere.rings = 6
var gem_mat := StandardMaterial3D.new()
gem_mat.shading_mode = BaseMaterial3D.SHADING_MODE_UNSHADED
gem_mat.albedo_color = CORE_GEM_COLOR
sphere.material = gem_mat
gem.mesh = sphere
gem.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
core_glow.add_child(gem)
var halo := MeshInstance3D.new()
halo.name = "Halo"
var quad := QuadMesh.new()
quad.size = Vector2(0.55, 0.55)
if _halo_shader == null:
_halo_shader = Shader.new()
_halo_shader.code = HALO_SHADER
_core_halo = ShaderMaterial.new()
_core_halo.shader = _halo_shader
_core_halo.set_shader_parameter("color", CORE_COLOR)
halo.mesh = quad
halo.material_override = _core_halo
halo.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
halo.extra_cull_margin = 0.5 # the shader moves it toward the camera
core_glow.add_child(halo)
_core_light = OmniLight3D.new()
_core_light.name = "CoreLight"
_core_light.light_color = CORE_COLOR
_core_light.omni_range = 2.2
_core_light.omni_attenuation = 1.0
_core_light.shadow_enabled = false
# Just in front of the chest and a little below the core, so it lights the arms and the ground
# more than the face.
_core_light.position = front * 0.25 + down * 0.08
core_glow.add_child(_core_light)
_pulse_core()
## The pulse: a slow sine between the light's and the halo's low and high.
func _pulse_core() -> void:
var k := 0.5 + 0.5 * sin(TAU * _core_time / CORE_PULSE)
_core_light.light_energy = lerpf(CORE_LIGHT.x, CORE_LIGHT.y, k)
_core_halo.set_shader_parameter("strength", lerpf(CORE_HALO.x, CORE_HALO.y, k))
## Tints the model (co-op: player 2's scarecrow is blue), all but the core glow.
func set_tint(color: Color) -> void:
for mi in model.find_children("*", "MeshInstance3D", true, false):
var m := mi as MeshInstance3D
if core_glow != null and core_glow.is_ancestor_of(m):
continue
var base := m.get_active_material(0)
if base is BaseMaterial3D:
var tinted := (base as BaseMaterial3D).duplicate() as BaseMaterial3D

View file

@ -7,7 +7,8 @@ extends CenterContainer
## * the enemies defeated, by type;
## * the materials gathered over the day and night.
## Each row has its icon; a type or material with none isn't listed. "Start the day" (focused,
## so Enter / A work) ends it. The first morning explains the vacation instead of results.
## so Enter / A work) ends it. The first morning explains the vacation instead of results. It
## stays down while the opening intro has the farm (intro.running).
const CATEGORIES := ["Crops", "Animals", "Supplies"]
const ENEMY_TYPES := [EnemySystem.TYPE_CROW, EnemySystem.TYPE_THIEF, EnemySystem.TYPE_BREAKER, EnemySystem.TYPE_UFO]
@ -19,8 +20,9 @@ const BOTTOM := 70.0
const WIDTH := 880.0
var campaign: CampaignController
## Set by FarmSim: the night plans (last night's title).
## Set by FarmSim: the night plans (last night's title), and the opening intro.
var waves: WaveDirector
var intro: OpeningIntro
var _board: PanelContainer
var _title: Label
@ -151,7 +153,7 @@ static func backing() -> StyleBoxFlat:
func refresh() -> void:
if campaign == null:
return
visible = campaign.state.phase == CampaignController.Phase.MORNING
visible = campaign.state.phase == CampaignController.Phase.MORNING and not (intro != null and intro.running)
mouse_filter = Control.MOUSE_FILTER_STOP if visible else Control.MOUSE_FILTER_IGNORE
if not visible:
return
@ -177,7 +179,14 @@ func refresh() -> void:
_fill_list(_enemies, _no_enemies, func(t: int) -> int: return int(e.get("killed_" + EnemySystem.TYPE_NAMES[t], 0)))
_fill_list(_materials, _no_materials, func(m: String) -> int: return int(e.get("gathered_" + m, 0)))
_board.queue_redraw()
_start.grab_focus.call_deferred()
_focus_start.call_deferred()
## Start the day takes the focus (unless the sign went down again meanwhile: a hidden button
## would still take Enter).
func _focus_start() -> void:
if is_visible_in_tree():
_start.grab_focus()
## The results table as text, one row per category ("Crops 4 3 1"), for tests.

View file

@ -6,8 +6,8 @@ extends RefCounted
## sketched outlines (each edge drawn twice, slightly off, overshooting its corners), painted
## fills (a flat color, a lighter dab, a darker rim), and painted icons for the weapons, the
## materials, the backpack, the sun and moon, the scarecrow's portrait, what thieves take (crops,
## animals, supplies), and the enemies; and the morning screen's wooden sign (planks, a nailed
## sheet of paper, leaves). Every wobble comes from a hash of a seed, so a shape is drawn the
## animals, supplies), the enemies, and the farmer and his wife (talking heads); and the morning
## screen's wooden sign (planks, a nailed sheet of paper, leaves). Every wobble comes from a hash of a seed, so a shape is drawn the
## same way each frame (no flicker).
## Icons are designed in a 100 x 100 box and scaled to the rect they're drawn in.
@ -39,7 +39,7 @@ const LEAF := Color(0.42, 0.64, 0.22)
## EnemySystem.TYPE_NAMES, and these.
const ICONS: Array[String] = ["pitchfork", "corn_shooter", "pumpkin_bomb", "potato_cannon", "shurikens",
"propane_torch", "alien_ray", "wood", "scrap", "straw", "alien_goop", "backpack", "sun", "moon", "portrait",
"crops", "animals", "supplies", "crow", "thief", "breaker", "ufo"]
"crops", "animals", "supplies", "crow", "thief", "breaker", "ufo", "farmer", "farmers_wife"]
static var _font: Font
@ -521,6 +521,85 @@ static func _icon(ci: CanvasItem, id: String) -> void:
for i in 5:
ci.draw_circle(Vector2(18.0 + i * 16.0, 57.0 + absf(i - 2.0) * -1.5), 3.6, Color(1.0, 0.86, 0.35))
ci.draw_circle(Vector2(43, 38), 3.5, Color(1.0, 1.0, 1.0, 0.85))
"farmer": # a round face under a straw hat, a big moustache
var skin := Color(0.95, 0.73, 0.56)
var straw := Color(0.93, 0.78, 0.4)
var brown := Color(0.48, 0.31, 0.17)
for k: float in [-1.0, 1.0]: # ears
paint(ci, blob(Vector2(50.0 + 29.0 * k, 61.0), 6.0, 9.0, 291.0 + k), skin.darkened(0.08), 293.0 + k, 2.0)
paint(ci, blob(Vector2(50, 60), 30.0, 30.0, 295.0, 0.03), skin, 296.0)
for k: float in [-1.0, 1.0]:
ci.draw_colored_polygon(blob(Vector2(50.0 + 17.0 * k, 68.0), 7.0, 5.0, 297.0 + k), Color(0.93, 0.4, 0.34, 0.35)) # sunburnt
line(ci, Vector2(50.0 + 6.0 * k, 48.0), Vector2(50.0 + 18.0 * k, 47.0), brown, 3.5, 299.0 + k, 0.6)
ci.draw_circle(Vector2(50.0 + 12.0 * k, 55.0), 3.4, INK)
ci.draw_circle(Vector2(51.2 + 12.0 * k, 53.8), 1.1, Color.WHITE)
paint(ci, blob(Vector2(50, 63), 6.5, 6.0, 301.0), skin.lerp(Color(0.88, 0.42, 0.36), 0.3), 302.0, 1.2) # nose
var tache := _bezier(Vector2(24, 78), Vector2(34, 62), Vector2(50, 69), 8)
tache.append_array(_bezier(Vector2(50, 69), Vector2(66, 62), Vector2(76, 78), 8).slice(1))
tache.append_array(_bezier(Vector2(76, 78), Vector2(64, 77), Vector2(50, 78), 6).slice(1))
tache.append_array(_bezier(Vector2(50, 78), Vector2(36, 77), Vector2(24, 78), 6).slice(1, -1))
paint(ci, tache, brown, 303.0, 2.0)
ci.draw_polyline(_bezier(Vector2(44, 81), Vector2(50, 85), Vector2(56, 81), 6), INK, 2.2, true) # a grin under it
var top := _bezier(Vector2(30, 16), Vector2(38, 2), Vector2(50, 12), 8) # the crown, pinched at the top
top.append_array(_bezier(Vector2(50, 12), Vector2(62, 2), Vector2(70, 16), 8).slice(1))
paint(ci, _closed(top, [Vector2(72, 34), Vector2(28, 34)]), straw.darkened(0.05), 304.0)
paint(ci, PackedVector2Array([Vector2(30, 20), Vector2(70, 19), Vector2(71, 28), Vector2(29, 29)]), Color(0.62, 0.2, 0.12), 305.0, 0.0) # the band
paint(ci, blob(Vector2(50, 36), 48.0, 8.5, 306.0, 0.03, 32, -0.03), straw, 307.0) # the brim
var weave := Color(straw.darkened(0.35), 0.7)
for i in 8:
var x := 10.0 + i * 11.5
line(ci, Vector2(x, 33.0), Vector2(x + 4.0, 40.0), weave, 1.5, 308.0 + i, 0.4)
for i in 3:
line(ci, Vector2(38.0 + i * 12.0, 15.0 - absf(i - 1.0) * 4.0), Vector2(37.0 + i * 13.0, 19.0), weave, 1.5, 316.0 + i, 0.4)
"farmers_wife": # curls under a straw sun hat with a flower in its ribbon
var skin := Color(0.97, 0.78, 0.63)
var hair := Color(0.7, 0.33, 0.15)
var straw := Color(0.95, 0.82, 0.47)
for i in 6: # curls down both sides, behind the face
for k: float in [-1.0, 1.0]:
var at := Vector2(50.0 + k * (28.0 + 2.5 * noise(331.0 + i + k * 7.0)), 42.0 + i * 8.0)
paint(ci, blob(at, 8.5, 7.0, 333.0 + i * 2.0 + k, 0.08), hair, 345.0 + i * 2.0 + k, 2.0)
paint(ci, blob(Vector2(50, 60), 24.0, 28.0, 357.0, 0.03), skin, 358.0)
for k: float in [-1.0, 1.0]: # curls at the temples, over the face's edge
paint(ci, blob(Vector2(50.0 + 22.0 * k, 47.0), 6.5, 5.5, 359.0 + k), hair.lightened(0.06), 361.0 + k, 1.5)
ci.draw_colored_polygon(blob(Vector2(50.0 + 14.0 * k, 68.0), 6.0, 4.5, 369.0 + k), Color(0.95, 0.42, 0.45, 0.4)) # rosy
var eye := Vector2(50.0 + 10.0 * k, 56.0)
ci.draw_circle(eye, 3.2, INK)
ci.draw_circle(eye + Vector2(1.0, -1.1), 1.0, Color.WHITE)
for j in 3: # lashes
var dir := Vector2.from_angle(-PI * 0.5 + k * (0.3 + 0.38 * j))
line(ci, eye + dir * 3.0, eye + dir * 7.0, INK, 1.6, 371.0 + j * 2.0 + k, 0.3)
ci.draw_polyline(_bezier(Vector2(51, 60), Vector2(46, 66), Vector2(52, 66), 6), skin.darkened(0.4), 2.0, true) # nose
var lips := _bezier(Vector2(43, 73), Vector2(50, 71), Vector2(57, 73), 6)
lips.append_array(_bezier(Vector2(57, 73), Vector2(50, 80), Vector2(43, 73), 6).slice(1, -1))
paint(ci, lips, Color(0.84, 0.24, 0.26), 378.0, 1.5)
var top := _bezier(Vector2(32, 20), Vector2(50, -2), Vector2(68, 20), 10) # the crown
paint(ci, _closed(top, [Vector2(69, 36), Vector2(31, 36)]), straw.darkened(0.05), 379.0)
paint(ci, PackedVector2Array([Vector2(33, 19), Vector2(67, 18), Vector2(68, 27), Vector2(32, 28)]), Color(0.38, 0.6, 0.86), 380.0, 0.0) # the ribbon
paint(ci, blob(Vector2(50, 37), 49.0, 9.5, 381.0, 0.05, 32, -0.05), straw, 382.0) # the brim, a little tipped
var weave := Color(straw.darkened(0.35), 0.7)
for i in 8:
var x := 9.0 + i * 11.5
line(ci, Vector2(x, 34.0), Vector2(x + 4.0, 41.0), weave, 1.5, 383.0 + i, 0.4)
var flower := Vector2(64, 23)
leaf(ci, flower + Vector2(2, 2), 15.0, 0.4, 391.0)
for j in 5:
paint(ci, blob(flower + Vector2.from_angle(TAU * j / 5.0 - 0.3) * 5.5, 4.6, 4.6, 392.0 + j), Color(0.96, 0.42, 0.56), 397.0 + j, 1.2)
ci.draw_circle(flower, 3.4, Color(1.0, 0.84, 0.3))
## An open outline (pts) closed with straight edges through corners, in steps about 5 long, so
## its points stay spread evenly (paint() places its lighter dab from their average).
static func _closed(pts: PackedVector2Array, corners: Array[Vector2]) -> PackedVector2Array:
var out := pts.duplicate()
var path: Array[Vector2] = [pts[pts.size() - 1]]
path.append_array(corners)
path.append(pts[0])
for i in path.size() - 1:
var n := maxi(int(path[i].distance_to(path[i + 1]) / 5.0), 1)
for j in range(1, n + 1 if i < path.size() - 2 else n): # (not pts[0] again)
out.append(path[i].lerp(path[i + 1], float(j) / n))
return out
## Points along a circle (center c, radius r) between where it crosses another circle (o, ro),

View file

@ -10,6 +10,7 @@ extends Control
## [Backspace / Back] hides them until the game is restarted; Settings turns them off.
## Finished tips stay finished for the session, so a retry or a second vacation doesn't repeat
## them.
## None show while a talking-head conversation or the opening intro is up.
const TEXT := {
"move": "Move with [W A S D] or the left stick. You're the scarecrow: keep the farm safe until the farmers are back.",
@ -93,7 +94,7 @@ func _process(delta: float) -> void:
return
var s := sim.campaign.state
if not enabled or dismissed or s.night != 1 or sim.campaign.is_over() or sim._menu_open() \
or (sim.dialogue != null and sim.dialogue.is_playing()):
or (sim.dialogue != null and sim.dialogue.is_playing()) or (sim.intro != null and sim.intro.busy()):
_show("")
return
_check_done()

View file

@ -26,6 +26,7 @@ const SUITES := [
"res://game/tests/test_look.gd",
"res://game/tests/test_dialogue.gd",
"res://game/tests/test_loading.gd",
"res://game/tests/test_intro.gd",
]
const TICK := 1.0 / 60.0
## Points on the farm's edge (FarmZones.edge) for tests that send an enemy in from a known side:

View file

@ -6,10 +6,20 @@ extends RefCounted
## night's phase and delay, pauses the farm for it and lets it go after, puts the morning sign
## aside meanwhile, doesn't replay it on a retry but does on a new vacation,
## takes it down on a new morning, plays several in order, waits under a menu, and lets one that
## doesn't pause the game go on by itself.
## doesn't pause the game go on by itself. The opening intro's conversations (dialogue/intro/)
## have their lines and speakers and never play by themselves; the farmer's and his wife's heads
## (Sketch icons) draw.
const P := CampaignController.Phase
const DT := 1.0 / 60.0
const INTRO := "res://game/resources/dialogue/intro/"
const SPEAKERS := "res://game/resources/dialogue/speakers/"
## The intro's conversations: who says each line, in order.
const INTRO_LINES := {
"departure": ["Farmer", "Farmer's Wife", "Farmer"],
"flight": ["Little Green Alien", "Big Green Alien", "Little Green Alien", "Big Green Alien", "Little Green Alien"],
"uh_oh": ["Big Green Alien", "Little Green Alien"],
}
var r: GameTestRunner
var sim: FarmSim
@ -23,6 +33,8 @@ var scarecrow: DialogueSpeaker
func run(p_r: GameTestRunner) -> void:
r = p_r
_saved()
_intro()
await _heads_draw()
var farm := (load("res://game/scenes/farm.tscn") as PackedScene).instantiate() as Node3D
r.root.add_child(farm)
await r.process_frame
@ -64,8 +76,67 @@ func _saved() -> void:
if line == null or line.text.strip_edges() == "":
bad.append(conv.resource_path)
r.check(bad.is_empty(), "every saved conversation has lines with words and plays within the vacation (bad: %s)" % [bad])
r.check(DialogueDirector.load_all("res://game/resources/dialogue/speakers/").is_empty(),
"a speaker's file isn't taken for a conversation")
r.check(DialogueDirector.load_all(SPEAKERS).is_empty(), "a speaker's file isn't taken for a conversation")
## The intro's conversations load with their lines and speakers, wait for the intro to play them
## (off, in a subfolder), and their speakers stand where they should.
func _intro() -> void:
for n: String in INTRO_LINES:
var conv := load(INTRO.path_join(n + ".tres")) as Conversation
if conv == null:
r.check(false, "intro/%s.tres loads as a Conversation" % n)
continue
var who: Array[String] = []
for line in conv.lines:
who.append(line.speaker.display_name if line != null and line.speaker != null and line.text.strip_edges() != "" else "?")
r.check(who == INTRO_LINES[n], "intro/%s: its lines by %s (got %s)" % [n, INTRO_LINES[n], who])
r.check(not conv.enabled and conv.pause_game and is_equal_approx(conv.auto_advance, 1.6),
"intro/%s is off (only the intro plays it), pauses (takes the taps), and goes on after 1.6 s" % n)
var paths: Array[String] = []
for conv in DialogueDirector.load_all(DialogueDirector.DIR):
paths.append(conv.resource_path.get_file())
r.check(paths == ["morning_day_2.tres"], "the director still plays only morning_day_2 by itself, not the intro's (got %s)" % [paths])
r.check(DialogueDirector.load_all(INTRO).is_empty(), "and even loaded from intro/ they're off")
var big := load(SPEAKERS + "big_green_alien.tres") as DialogueSpeaker
var little := load(SPEAKERS + "little_green_alien.tres") as DialogueSpeaker
var farmer := load(SPEAKERS + "farmer.tres") as DialogueSpeaker
var wife := load(SPEAKERS + "farmers_wife.tres") as DialogueSpeaker
r.check(big != null and little != null and farmer != null and wife != null, "the intro's speakers load")
if big == null or little == null or farmer == null or wife == null:
return
r.check(big.icon == little.icon and big.portrait_height > little.portrait_height and big.voice_pitch < little.voice_pitch,
"the Big Green Alien is the little one's head, bigger (%d px), with a lower voice" % big.portrait_height)
r.check(farmer.icon == "farmer" and wife.icon == "farmers_wife" and farmer.voice_pitch < wife.voice_pitch,
"the farmer and his wife have their own heads; his voice is the lower")
r.check(farmer.side == DialogueSpeaker.HeadSide.LEFT and wife.side == DialogueSpeaker.HeadSide.RIGHT
and big.side == DialogueSpeaker.HeadSide.RIGHT and little.side == DialogueSpeaker.HeadSide.LEFT,
"the farmer and the little alien on the left, his wife and the big alien on the right")
var no_head: Array[String] = []
for f in ResourceLoader.list_directory(SPEAKERS):
var sp := load(SPEAKERS + f) as DialogueSpeaker
if sp != null and sp.portrait == null and not Sketch.ICONS.has(sp.icon):
no_head.append(f)
r.check(no_head.is_empty(), "every speaker has a head: a portrait or a Sketch icon (none: %s)" % [no_head])
## The farmer's and his wife's heads are Sketch icons and draw (big, and HUD-small) without error.
func _heads_draw() -> void:
var ids: Array[String] = ["farmer", "farmers_wife"]
r.check(Sketch.ICONS.has("farmer") and Sketch.ICONS.has("farmers_wife"), "the farmer and his wife are Sketch icons")
var drawn: Array[String] = []
var canvas := Control.new()
canvas.size = Vector2(400.0, 400.0)
canvas.draw.connect(func() -> void:
for id in ids:
Sketch.icon(canvas, id, Rect2(Vector2.ZERO, Vector2(380.0, 380.0)))
Sketch.icon(canvas, id, Rect2(Vector2(10.0, 10.0), Vector2(40.0, 40.0)))
drawn.append(id))
r.root.add_child(canvas)
await r.process_frame
await r.process_frame
r.check(drawn == ids, "their heads draw without an error (drew %s)" % [drawn])
canvas.queue_free()
func _writing() -> void:

View file

@ -1,11 +1,13 @@
extends RefCounted
## The whole game through its entry scene (main.tscn, with test save and settings paths): the
## main menu over the paused farm; New vacation, Continue, and their questions; pausing freezes
## main menu over the paused farm; New vacation (its opening intro, skipped here: test_intro
## covers it), Continue, and their questions; pausing freezes
## the simulation tick; settings apply and persist from the pause menu; Restart the night and
## Save & quit to menu put the farm back at the saved morning without touching the save; a
## damaged save can't be continued; quitting a hosted co-op game from the pause menu leaves the
## scarecrow unfrozen; the failure screen and Retry; the farmers' return and the final
## assessment; the first day's and night's tips; and the sounds hooked to the game.
## scarecrow unfrozen; the failure screen and Retry; the farmers' return (their car loaded with
## roof luggage) and the final assessment; the first day's and night's tips; and the sounds hooked
## to the game.
const P := CampaignController.Phase
const SAVE := "user://test_flow_save.json"
@ -61,6 +63,15 @@ func _press(action: String) -> void:
await r.process_frame
## New vacation's opening intro, skipped to its end (the first morning's sign).
func _skip_intro() -> void:
sim.intro.skip()
var t := 0.0
while sim.intro.busy() and t < 10.0:
sim.intro.step(DT)
t += DT
func _hud_visible() -> bool:
return (main.farm.get_node("Hud") as CanvasLayer).visible
@ -84,9 +95,12 @@ func _title_screen() -> void:
"the UI theme is the project's default")
main.main_menu.new_button.pressed.emit()
var saved := SaveGame.read(SAVE)
r.check(main.screen == Main.Screen.PLAYING and not r.paused and sim.intro.running and c.state.phase == P.MORNING,
"New vacation (no save to replace) starts at once, with the opening intro")
_skip_intro()
r.check(main.screen == Main.Screen.PLAYING and not r.paused and _hud_visible() and c.state.phase == P.MORNING
and sim.review_panel.visible and main.get_viewport().get_camera_3d() == sim.camera,
"New vacation (no save to replace) starts at once: the morning screen, the HUD, the follow camera")
"after it, the morning screen, the HUD, the follow camera")
r.check(saved.status == SaveGame.Status.OK and saved.state.night == 1, "and saves the new vacation's first morning")
@ -196,6 +210,7 @@ func _continue_and_new() -> void:
main.main_menu.new_button.pressed.emit()
r.check(main.screen == Main.Screen.PLAYING and SaveGame.read(SAVE).status == SaveGame.Status.OK,
"New vacation doesn't ask about a damaged save and replaces it")
_skip_intro()
## Hosting co-op, the pause menu freezes only this scarecrow; quitting to the menu from it must
@ -325,6 +340,7 @@ func _ending() -> void:
r.check(c.state.phase == P.FARMERS_RETURN and not SaveGame.exists(SAVE), "the last dawn ends the vacation and deletes the save")
r.check(ending.running and ending.stage == "drive" and main.get_viewport().get_camera_3d() == ending._camera and not _hud_visible(),
"the farmers' return starts: the cutscene camera, no HUD")
_luggage(ending._car)
var horn := int(sim.audio.played.get("horn", 0))
var steps := 0
while ending.stage == "drive" and steps < 3000:
@ -367,6 +383,40 @@ func _ending() -> void:
and main.main_menu.continue_button.disabled, "Main menu after the ending: a fresh farm behind the menu, nothing to continue")
## The car comes home loaded (CutsceneKit.load_roof): a pile of luggage, straps, and a mattress
## hanging off the side, all riding on the car, with the pile on top of the car's mesh (its
## AABB) and no collision; and it sways with the driving.
func _luggage(car: Node3D) -> void:
var luggage := CutsceneKit.luggage_of(car)
var car_top := -INF
for m in car.get_children():
if m is MeshInstance3D:
car_top = maxf(car_top, ((m as MeshInstance3D).transform * (m as MeshInstance3D).get_aabb()).end.y)
var ok := luggage != null and luggage.get_parent() == car and luggage.pieces.size() >= 8 and luggage.straps.size() >= 2 \
and luggage.hanging != null and luggage.find_children("*", "CollisionObject3D", true, false).is_empty()
var low := INF
var high := -INF
if ok:
for piece in luggage.pieces:
var b := CutsceneKit.mesh_bounds(piece, car)
ok = ok and b.has_volume() and piece.get_parent() == luggage
low = minf(low, b.position.y)
high = maxf(high, b.end.y)
var hang := CutsceneKit.mesh_bounds(luggage.hanging, car)
ok = ok and hang.get_center().y > car_top - 0.1 and hang.get_center().x < CutsceneKit.roof_of(car).position.x
r.check(ok and absf(low - car_top) < 0.01 and high > car_top + 0.8,
"the car comes loaded: %d pieces on the roof from its top (%.2f m) up to %.2f m, strapped, a mattress hanging off the side"
% [luggage.pieces.size() if luggage != null else 0, car_top, high])
var swayed := false
if luggage != null:
for i in 30:
luggage.sway(DT, 1.5, -8.0) # a hard left turn, braking
swayed = luggage.lean.x > 0.02 and luggage.lean.y > 0.02 and luggage.rotation.z > 0.0
luggage.settle()
swayed = swayed and luggage.rotation == Vector3.ZERO
r.check(swayed, "it sways: forward when braking, out to the right on a left turn")
func _audio() -> void:
var audio := sim.audio
var missing: Array[String] = []
@ -378,6 +428,7 @@ func _audio() -> void:
r.check(audio._day.playing and audio._night.playing and (audio._day.stream as AudioStreamWAV).loop_mode == AudioStreamWAV.LOOP_FORWARD
and audio._day.bus == &"Ambience", "the day and night ambience loop on the Ambience bus")
main.new_vacation()
_skip_intro()
var before := audio.played.duplicate()
var count := func(cue: String) -> int: return int(audio.played.get(cue, 0)) - int(before.get(cue, 0))
sim.combat.fired.emit()

273
game/tests/test_intro.gd Normal file
View file

@ -0,0 +1,273 @@
extends RefCounted
## The opening intro (OpeningIntro) through the game's entry scene (main.tscn, with test save and
## settings paths): New vacation plays it, Continue and hosting co-op don't. Stepped through, it
## visits every stage in order while it holds the farm (no morning sign, no HUD, the scarecrow
## frozen on its post without its glow, the light forced), and it ends on the first morning's sign
## (focused) with the farm exactly as new_campaign() leaves it. Skipping it from any stage
## (pressing or holding), Restart the night, and Save & quit to menu leave it just as clean.
const SAVE := "user://test_intro_save.json"
const SETTINGS := "user://test_intro_settings.cfg"
const DT := 1.0 / 30.0
const LIMIT := 120.0 # seconds of stepping before a run counts as stuck
var r: GameTestRunner
var main: Main
var sim: FarmSim
var intro: OpeningIntro
func run(p_r: GameTestRunner) -> void:
r = p_r
_clean()
main = (load("res://game/scenes/main.tscn") as PackedScene).instantiate() as Main
main.save_path = SAVE
main.settings_path = SETTINGS
r.root.add_child(main)
await r.process_frame
await r.physics_frame
sim = main.sim
intro = sim.intro
intro.set_process(false) # stepped by hand
await _new_and_continue()
await _whole_intro()
await _skips()
await _hold_to_skip()
await _restart_and_quit()
await _hosting()
main.queue_free()
r.paused = false
await r.process_frame
_clean()
func _clean() -> void:
for p in [SAVE, SAVE + ".tmp", SETTINGS]:
if FileAccess.file_exists(p):
DirAccess.remove_absolute(ProjectSettings.globalize_path(p))
func _hud_visible() -> bool:
return (main.farm.get_node("Hud") as CanvasLayer).visible
## New vacation (from the menu; it asks over a save).
func _new_vacation() -> void:
main.main_menu.new_button.pressed.emit()
if main.confirm.is_open:
main.confirm.yes_button.pressed.emit()
## Steps until the stage is `until` (or it's over); returns false if it never got there.
func _step_to(until: String) -> bool:
var t := 0.0
while intro.stage != until and not intro.done and t < LIMIT:
intro.step(DT)
t += DT
return intro.stage == until
func _step_to_end() -> bool:
var t := 0.0
while intro.busy() and t < LIMIT:
intro.step(DT)
t += DT
return intro.done
## The farm held by the intro: no sign, no HUD, the intro's camera, the scarecrow frozen.
func _held() -> bool:
return intro.running and not sim.review_panel.visible and not _hud_visible() and sim.local_frozen \
and not sim.player.input_enabled and not sim.player.is_physics_processing() \
and main.get_viewport().get_camera_3d() != sim.camera
## The farm as new_campaign() leaves it, and the first morning's sign up (focused).
func _check_clean(what: String) -> void:
var p := sim.player
var dn := sim.day_night
var morning := DayNight.morning()
var light := dn.forced == "" and not dn.lanterns_dark and is_equal_approx(float(dn.current["elev"]), float(morning["elev"])) \
and is_equal_approx(float(dn.current["energy"]), float(morning["energy"])) \
and is_equal_approx(float(dn.target()["energy"]), float(morning["energy"]))
var body := p.global_position.distance_to(OpeningIntro.START) < 0.01 and is_zero_approx(p.model.rotation.y) \
and p.is_physics_processing() and p.input_enabled and not sim.local_frozen and p.core_glow.visible \
and p.find_children("*", "LookAtModifier3D", true, false).is_empty() and sim.scarecrow.alive and sim.combat.show_marker
var gone := intro.done and not intro.running and intro.stage == "end" and intro.get_child_count() == 0
var screen := _hud_visible() and main.get_viewport().get_camera_3d() == sim.camera and sim.review_panel.visible \
and sim.campaign.state.phase == CampaignController.Phase.MORNING and sim.campaign.state.night == 1
var sound := sim.audio.focus == p and not sim.audio.scene and sim.audio.music_track == "farm"
await r.process_frame
await r.process_frame
var focus := sim.review_panel._start.has_focus()
r.check(gone and body and light and screen and sound and focus,
"%s: the farm's as new_campaign() left it (intro gone %s, scarecrow at its start with input and glow %s, the morning light %s, HUD / game camera / sign %s, sounds %s, Start focused %s)"
% [what, gone, body, light, screen, sound, focus])
## New vacation plays it, holding the farm; Save & quit to menu takes it down; Continue doesn't
## play it.
func _new_and_continue() -> void:
_new_vacation()
r.check(main.screen == Main.Screen.PLAYING and intro.running and intro.stage == "leave" and _held(),
"New vacation starts the intro: no sign, no HUD, its own camera, the scarecrow frozen")
var p := sim.player
var on_post := absf(p.global_position.y - OpeningIntro.POST_LIFT) < 0.2 and not p.core_glow.visible \
and not p.animation_player.is_playing() and sim.day_night.forced == "morning" and sim.day_night.lanterns_dark \
and not sim.scarecrow.alive and not sim.combat.show_marker
r.check(on_post, "the scarecrow hangs on its post (raised, T-pose: no animation), not alive yet (no chest glow, fear ring, or aim marker), a forced morning, lantern dark")
var at := p.global_position
Input.action_press(&"move_forward")
for i in 6:
await r.physics_frame
Input.action_release(&"move_forward")
r.check(p.global_position == at and intro.running, "and the scarecrow can't move")
r.check(not sim.tutorial._box.visible, "no tips meanwhile")
main.to_menu()
r.check(main.screen == Main.Screen.MENU and not intro.busy() and intro.get_child_count() == 0 and not sim.local_frozen
and sim.player.is_physics_processing() and sim.day_night.forced == "" and sim.player.core_glow.visible,
"Save & quit to menu mid-intro: nothing of it left, the scarecrow given back")
main.main_menu.continue_button.pressed.emit()
r.check(main.screen == Main.Screen.PLAYING and not intro.busy() and sim.review_panel.visible and _hud_visible(),
"Continue plays no intro: straight to the saved morning's sign")
main.to_menu()
## The whole intro, stepped: every stage in order, the farm held until it's handed back.
func _whole_intro() -> void:
var audio := sim.audio
var before := audio.played.duplicate()
var count := func(cue: String) -> int: return int(audio.played.get(cue, 0)) - int(before.get(cue, 0))
var fired: Array[int] = [0]
var on_finished := func() -> void: fired[0] += 1
intro.finished.connect(on_finished)
_new_vacation()
var stinger := false
for v in audio._voices_ui:
stinger = stinger or (v.playing and v.get_meta(&"cue", "") == "morning")
r.check(count.call("morning") == 1 and not stinger, "new_campaign()'s morning stinger is stopped under the intro")
var seen: Array[String] = [intro.stage]
var length := {intro.stage: 0.0}
var held := true
var night_ok := false
var part_ok := false
var flash_ok := false
var t := 0.0
while intro.busy() and t < LIMIT:
intro.step(DT)
t += DT
if intro.stage != seen[-1]:
seen.append(intro.stage)
length[intro.stage] = 0.0
match intro.stage:
"flight":
night_ok = sim.day_night.forced == "night" and sim.day_night.lanterns_dark and intro._ufo.visible \
and audio.music_track == "" and audio._ambience_target == Vector2(0.0, 1.0)
"flash":
part_ok = intro._part.visible and intro._part.global_position.distance_to(OpeningIntro.START + OpeningIntro.FACING * 0.8) < 0.3
"uh_oh":
flash_ok = sim.player.core_glow.visible and not sim.day_night.lanterns_dark \
and absf(sim.player.global_position.y - intro._ground) < 0.01 and not intro._part.visible
else:
length[intro.stage] = float(length[intro.stage]) + DT
if intro.running and not _held():
held = false
r.check(seen == OpeningIntro.STAGES, "it visits every stage in order (%s)" % [seen])
r.check(held, "and holds the farm all along (no sign, no HUD, the scarecrow frozen) until it's handed back")
r.check(night_ok, "the night falls under the card: forced night, the lantern dark, the UFO up, night ambience, no music")
r.check(part_ok, "the part lands in front of the scarecrow")
r.check(flash_ok, "after the flash the scarecrow is down off its post, glowing, its lantern lit, the part gone into it")
r.check(fired[0] == 1 and t > 50.0 and t < 100.0, "finished once, %.1f s in all" % t)
var parts := PackedStringArray()
for s: String in seen:
parts.append("%s %.1f" % [s, float(length[s])])
r.info("intro stages (s): %s; %.1f s in all" % [", ".join(parts), t])
var cues := ["door_creak", "car_door", "horn", "ufo_whine", "part_fall", "life_flash", "ufo_zoom", "morning"]
var counts := []
for c: String in cues:
counts.append(count.call(c))
r.check(counts == [1, 2, 1, 1, 1, 1, 1, 2], "its sounds: %s = %s (the morning stinger with the sign)" % [cues, counts])
intro.finished.disconnect(on_finished)
await _check_clean("at the end")
main.to_menu()
## A skip from any stage fades straight to the sign, the farm just as clean.
func _skips() -> void:
for stage in OpeningIntro.STAGES:
if stage == "end":
continue
_new_vacation()
var got := _step_to(stage)
var t := 0.0
while got and intro.stage == stage and t < 0.6:
intro.step(DT)
t += DT
var at := intro.stage
intro.skip()
var ended := _step_to_end()
r.check(got and ended and intro._loading == null, "a skip in %s ends it" % at)
await _check_clean("skipped in " + at)
main.to_menu()
## Holding Space / Enter / A for a second skips it (a key already down at the start doesn't).
func _hold_to_skip() -> void:
Input.action_press(&"ui_accept")
_new_vacation()
for i in 45:
intro.step(DT)
var ignored := not intro._skipping
Input.action_release(&"ui_accept")
intro.step(DT)
Input.action_press(&"ui_accept")
for i in 20:
intro.step(DT)
var early := intro._skipping
for i in 12:
intro.step(DT)
var skipping := intro._skipping
Input.action_release(&"ui_accept")
_step_to_end()
r.check(ignored and not early and skipping, "holding [Space / Enter / A] a second skips (a key held from the menu doesn't count)")
await _check_clean("held to skip")
main.to_menu()
## The pause menu over it: Restart the night skips it; Save & quit to menu takes it down.
func _restart_and_quit() -> void:
_new_vacation()
var morning := SaveGame.read(SAVE).state.to_dict()
_step_to("flight")
main.pause()
r.check(main.screen == Main.Screen.PAUSED and r.paused and intro._box.is_blocked(), "Escape pauses it (its box waits)")
main.pause_menu.restart_button.pressed.emit()
main.confirm.yes_button.pressed.emit()
r.check(main.screen == Main.Screen.PLAYING and not r.paused and intro._skipping and sim.local_frozen,
"Restart the night during it skips it (still held while it fades)")
_step_to_end()
await _check_clean("restarted")
r.check(JSON.stringify(SaveGame.read(SAVE).state.to_dict()) == JSON.stringify(morning), "the save is still the first morning")
main.to_menu()
_new_vacation()
_step_to("uh_oh")
main.pause()
main.pause_menu.menu_button.pressed.emit()
var p := sim.player
r.check(main.screen == Main.Screen.MENU and not intro.busy() and intro.get_child_count() == 0 and not sim.local_frozen
and p.global_position.distance_to(OpeningIntro.START) < 0.01 and p.is_physics_processing() and p.core_glow.visible
and p.find_children("*", "LookAtModifier3D", true, false).is_empty() and sim.day_night.forced == ""
and not sim.day_night.lanterns_dark and not sim.audio.scene, "Save & quit to menu late in it leaves nothing behind")
## Hosting co-op starts the vacation without the intro.
func _hosting() -> void:
var gd := main.lobby.gdsync
main.lobby.gdsync = null # (no network in the test: the lobby just fails)
main._host_coop(CoopLobby.Mode.LAN, "Ana", false)
if main.confirm.is_open:
main.confirm.yes_button.pressed.emit()
r.check(main.screen == Main.Screen.PLAYING and not intro.busy() and sim.review_panel.visible and _hud_visible()
and not sim.local_frozen, "hosting co-op starts a new vacation without the intro")
main.lobby.gdsync = gd
main.to_menu()

View file

@ -0,0 +1 @@
uid://cn413pm2x21au

View file

@ -8,6 +8,10 @@ extends RefCounted
## stop rendering in 3D (they'd be pixelated) and ScreenLabels draws them as flat text where they
## project, at least MIN_SIZE tall, only while shown and in front of the camera, and nudged apart
## where they'd overlap.
## The opening intro's hooks into the look and sound: DayNight.forced holds the morning or the
## night look whatever the phase (and lets go again), lanterns_dark keeps the lanterns off, the
## intro's sound cues have their sounds, and every scarecrow has its blue core glow in its chest
## (on the chest bone, toon look, tint, and hit flash leaving it alone) until set_core_glow(false).
const TOON := "res://game/resources/toon.gdshader"
const TOON_DOUBLE_SIDED := "res://game/resources/toon_double_sided.gdshader"
@ -141,11 +145,68 @@ func _farm(r: GameTestRunner) -> void:
and outline.cast_shadow == GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
and outline_mat.render_priority == Material.RENDER_PRIORITY_MIN,
"the outline quad is in the world, casts no shadow, and draws under the transparent effects")
_intro_hooks(r, sim, a)
look.queue_free()
farm.queue_free()
await r.process_frame
func _intro_hooks(r: GameTestRunner, sim: FarmSim, partner: Avatar) -> void:
var dn := sim.day_night
var c := sim.campaign
c.begin_day()
dn.forced = "night"
dn.snap()
r.check(dn.target() == DayNight.NIGHT and is_equal_approx(sim.sun.light_energy, float(DayNight.NIGHT["energy"]))
and is_equal_approx(dn.lantern.light_energy, float(DayNight.NIGHT["lantern"])),
"DayNight.forced = \"night\" holds the night look by day, the lantern lit")
dn.lanterns_dark = true
dn.snap()
var lit := dn.lanterns.filter(func(l: OmniLight3D) -> bool: return l.light_energy != 0.0)
r.check(dn.lanterns.size() == 2 and lit.is_empty(), "lanterns_dark keeps the lanterns off at night")
dn.lanterns_dark = false
dn.forced = "morning"
dn.snap()
r.check(dn.target() == DayNight.morning() and dn.target() != DayNight.DAY
and is_equal_approx(sim.sun.light_energy, float(DayNight.morning()["energy"])),
"forced = \"morning\" holds the morning look by day")
dn.forced = ""
dn.snap()
r.check(dn.target() == DayNight.DAY and is_equal_approx(sim.sun.light_energy, float(DayNight.DAY["energy"]))
and is_equal_approx(dn.lantern.light_energy, 0.0), "cleared, the phase's look comes back")
var audio := sim.audio
var missing: Array[String] = []
for cue in ["door_creak", "car_door", "ufo_hum", "ufo_whine", "part_fall", "life_flash", "ufo_zoom"]:
if audio.stream_of(cue) == null or not FarmAudio.LOCAL_CUES.has(cue):
missing.append(cue)
var hum := audio.stream_of("ufo_hum") as AudioStreamWAV
r.check(missing.is_empty() and hum != null and hum.loop_mode == AudioStreamWAV.LOOP_FORWARD,
"the intro's sounds resolve and stay local, and the UFO's hum loops (missing: %s)" % [missing])
for body: PlayerCharacter in [sim.player, partner.body]:
var who := "player 1's" if body == sim.player else "the partner's"
var glow := body.core_glow
var attach := glow.get_parent() as BoneAttachment3D if glow != null else null
var gem := glow.get_node("Gem") as MeshInstance3D if glow != null else null
var gem_mat := gem.get_active_material(0) as StandardMaterial3D if gem != null else null
r.check(glow != null and glow.is_visible_in_tree() and attach != null and attach.bone_name == PlayerCharacter.CORE_BONE
and gem_mat != null and gem_mat.albedo_color == PlayerCharacter.CORE_GEM_COLOR and gem.material_overlay == null,
"%s scarecrow has its core glow on the chest bone, untinted, untouched by the toon look and the hit flash" % who)
var rel := glow.global_position - body.global_position if glow != null else Vector3.ZERO
var ahead := rel.dot(-body.model.global_basis.z)
r.check(rel.y > 0.7 and rel.y < 1.2 and ahead > 0.15, "at chest height on its front (%.2f m up, %.2f m ahead)" % [rel.y, ahead])
var mannequin := sim.player.model.find_children("Mannequin_Medium_*", "MeshInstance3D", true, false)
r.check(mannequin.size() == 6 and mannequin.all(func(m: Node) -> bool: return (m as MeshInstance3D).material_overlay != null),
"the hit flash still covers the scarecrow's body (%d parts)" % mannequin.size())
var light := sim.player.core_glow.get_node("CoreLight") as OmniLight3D
sim.player.set_core_glow(false)
r.check(not sim.player.core_glow.visible and not light.is_visible_in_tree() and partner.body.core_glow.visible,
"set_core_glow(false) hides it, light and all")
sim.player.set_core_glow(true)
r.check(light.is_visible_in_tree(), "and set_core_glow(true) shows it again")
## The nodes under root still showing a lit StandardMaterial3D, by name.
static func _lit_left(root: Node) -> Array[String]:
var out: Array[String] = []

View file

@ -0,0 +1,96 @@
extends SceneTree
## Captures the opening intro (OpeningIntro) for review: runs the real game (main.tscn, so the
## toon look and the pixel outlines are on, as ToonLook comes with Main) in a window, starts a New
## vacation, and saves a PNG at the start of every stage and every --every seconds of it, then one
## of the first morning's sign, and quits. It needs a window (not --headless) and must not run
## fullscreen (the project's default), so pass --windowed and a resolution; a hidden window with
## VSync on crawls on some desktops, so keep it visible and pass --disable-vsync. --fixed-fps
## makes every frame the same game time, so the shots don't depend on the machine's speed:
## godot --path . --windowed --resolution 1600x900 --disable-vsync --fixed-fps 30 \
## --script res://game/tools/capture_intro.gd -- --out=/tmp/hs-intro --every=2
## Options (after --): --out=dir (default /tmp/hs-intro/), --every=seconds (default 2; 0: stage
## starts only), --prefix=text (default "intro"), --skip-at=stage (skips half a second into that
## stage, to look at the skip). It saves to its own user://capture_intro_* files, so the player's
## save and settings are never touched.
const SAVE := "user://capture_intro_save.json"
const SETTINGS := "user://capture_intro_settings.cfg"
const LIMIT := 240.0 # seconds of intro before giving up
var _out := "/tmp/hs-intro/"
var _every := 2.0
var _prefix := "intro"
var _skip_at := ""
var _count: int = 0
func _initialize() -> void:
for a in OS.get_cmdline_user_args():
var arg := String(a)
if arg.begins_with("--out="):
_out = arg.trim_prefix("--out=")
elif arg.begins_with("--every="):
_every = float(arg.trim_prefix("--every="))
elif arg.begins_with("--prefix="):
_prefix = arg.trim_prefix("--prefix=")
elif arg.begins_with("--skip-at="):
_skip_at = arg.trim_prefix("--skip-at=")
if not _out.ends_with("/"):
_out += "/"
_run.call_deferred()
func _run() -> void:
DirAccess.make_dir_recursive_absolute(_out)
var main := (load("res://game/scenes/main.tscn") as PackedScene).instantiate() as Main
main.save_path = SAVE
main.settings_path = SETTINGS
root.add_child(main)
for i in 5:
await process_frame
main.new_vacation()
var intro := main.sim.intro if main.sim != null else null
if intro == null or not intro.busy():
printerr("capture_intro: the intro didn't start")
quit(1)
return
var last := ""
var next_shot := 0.0
var skipped := false
while intro.busy() and intro.elapsed < LIMIT:
await process_frame
if intro.stage != last:
last = intro.stage
await _shot(intro, "start")
elif _every > 0.0 and intro.elapsed >= next_shot:
next_shot = intro.elapsed + _every
await _shot(intro, "")
if _skip_at != "" and not skipped and intro.stage == _skip_at and intro.elapsed > 0.0:
skipped = true
for i in 15:
await process_frame
intro.skip()
for i in 30: # the sign settles
await process_frame
await _shot(intro, "sign")
print("capture_intro: %d shots in %s (%.1f s of intro)" % [_count, _out, intro.elapsed])
main.queue_free()
await process_frame
await create_timer(0.3).timeout
_clean()
quit()
func _shot(intro: OpeningIntro, tag: String) -> void:
await RenderingServer.frame_post_draw
var image := root.get_texture().get_image()
var stage := intro.stage if intro.stage != "" else "none"
var file := "%s%s_%03d_%05.1fs_%s%s.png" % [_out, _prefix, _count, intro.elapsed, stage, "_" + tag if tag != "" else ""]
image.save_png(file)
_count += 1
func _clean() -> void:
for p in [SAVE, SAVE + ".tmp", SETTINGS]:
if FileAccess.file_exists(p):
DirAccess.remove_absolute(ProjectSettings.globalize_path(p))

View file

@ -0,0 +1 @@
uid://tmmr78wn70ce

View file

@ -12,6 +12,14 @@ extends SceneTree
## torch tick; back-to-back plays blend into one roar)
## alien_beam.wav a buzzing, warbling ray hum over a high whine and a fizz (an alien ray
## tick; back-to-back plays blend into one hum)
## and the opening intro's (OpeningIntro):
## ufo_hum.wav 4 s loop: the big UFO's low, wobbling, beating drone and a faint warble
## ufo_whine.wav a 2 s spin-up: a whine rising faster and faster, pulsing as it spins
## part_fall.wav a 1.5 s falling whistle, louder as it comes down (the thud is "fall")
## life_flash.wav the blue flash: a crack, a rising zap, a low whomp, and a shimmer of
## sparkles dying away
## ufo_zoom.wav the UFO leaving: a whoosh and a hum whose pitch drops away (doppler)
## car_door.wav a car door slamming: a latch click and a dull metal thunk
## Loops carry a WAV 'smpl' loop point, so the importer's "Detect From WAV" loops them; every
## periodic part of a loop has a whole number of cycles in it and filtered noise is warmed up
## on the loop's own tail, so the seam is silent. Run with the editor closed, then let the
@ -44,6 +52,19 @@ func _initialize() -> void:
_write("torch_roar.wav", _roar(0.42), false)
_rng.seed = 19 # its own seed too
_write("alien_beam.wav", _beam(0.34), false)
# The opening intro's, each on its own seed as well.
_rng.seed = 23
_write("ufo_hum.wav", _hum(4.0), true)
_rng.seed = 29
_write("ufo_whine.wav", _whine(2.0), false)
_rng.seed = 31
_write("part_fall.wav", _whistle(1.5), false)
_rng.seed = 37
_write("life_flash.wav", _life_flash(1.4), false)
_rng.seed = 41
_write("ufo_zoom.wav", _zoom(2.2), false)
_rng.seed = 43
_write("car_door.wav", _door(0.5), false)
quit(0)
@ -162,6 +183,33 @@ func _night(seconds: float) -> PackedFloat32Array:
return _normalize(buf, 0.45)
## The big UFO hovering: two buzzy low tones a little apart (so they beat), both wobbling in
## pitch, under a faint high warble, throbbing, over a low rumble. Every cycle and wobble is a
## whole number of times in the loop (the wobbles' phase is integrated exactly), so it's seamless.
func _hum(seconds: float) -> PackedFloat32Array:
var n := int(seconds * RATE)
var rumble := _noise_lowpass(n, 120.0)
var buf := PackedFloat32Array()
buf.resize(n)
# (Hz, wobble Hz, wobble depth, level): 220, 227, and 1320 cycles in 4 s; wobbles of 6 and 20.
var voices := [[55.0, 1.5, 0.03, 1.0], [56.75, 1.5, 0.03, 0.7], [330.0, 5.0, 0.015, 0.12]]
for i in n:
var t := float(i) / RATE
var s := 0.0
for v: Array in voices:
var f: float = v[0]
var rate: float = v[1]
var phase := f * t + f * float(v[2]) * (1.0 - cos(TAU * rate * t)) / (TAU * rate)
if f < 100.0:
for h in range(1, 7):
s += float(v[3]) * sin(TAU * phase * h) / pow(h, 1.2)
else:
s += float(v[3]) * (0.8 + 0.2 * sin(TAU * 0.5 * t)) * sin(TAU * phase)
var throb := 0.75 + 0.25 * sin(TAU * 3.0 * t) # 12 throbs in 4 s
buf[i] = throb * s + 0.35 * rumble[i]
return _normalize(buf, 0.6)
func _engine(seconds: float) -> PackedFloat32Array:
var n := int(seconds * RATE)
var rumble := _noise_lowpass(n, 180.0)
@ -302,6 +350,143 @@ func _beam(length: float) -> PackedFloat32Array:
return _normalize(buf, 0.7)
## The UFO spinning up: a whine (and a fifth above it) sweeping up faster and faster from a low
## hum, pulsing quicker as it spins, over a rising rush of air; it ends at its peak.
func _whine(length: float) -> PackedFloat32Array:
var n := int(length * RATE)
var air := _band_sweep(n, 300.0, 3000.0, 0.15)
var buf := PackedFloat32Array()
buf.resize(n)
var phase := 0.0
var spin := 0.0
for i in n:
var u := float(i) / n
var f := 140.0 * pow(1800.0 / 140.0, pow(u, 1.3))
phase += f / RATE
spin += lerpf(3.0, 28.0, u * u) / RATE
var pulse := 1.0 - 0.35 * (0.5 + 0.5 * sin(TAU * spin))
var tone := sin(TAU * phase) + 0.3 * sin(TAU * phase * 2.0) + 0.12 * sin(TAU * phase * 3.0) \
+ 0.4 * sin(TAU * phase * 1.5)
var env := minf(u / 0.08, 1.0) * (0.45 + 0.55 * u) * minf((1.0 - u) / 0.04, 1.0)
buf[i] = env * (pulse * tone + 0.6 * u * air[i])
return _normalize(buf, 0.7)
## A falling whistle: a near-pure tone gliding down (with a breath of air), swelling as it
## comes; it stops dead where the part lands.
func _whistle(length: float) -> PackedFloat32Array:
var n := int(length * RATE)
var air := _noise_lowpass(n, 5000.0)
var air_low := _noise_lowpass(n, 1500.0)
var buf := PackedFloat32Array()
buf.resize(n)
var phase := 0.0
for i in n:
var t := float(i) / RATE
var u := float(i) / n
phase += 1900.0 * pow(620.0 / 1900.0, u) * (1.0 + 0.008 * sin(TAU * 6.0 * t)) / RATE
var env := minf(u / 0.13, 1.0) * (0.4 + 0.6 * u) * minf((1.0 - u) / 0.025, 1.0)
buf[i] = env * (sin(TAU * phase) + 0.15 * sin(TAU * phase * 2.0) + 0.25 * (air[i] - air_low[i]))
return _normalize(buf, 0.6)
## The blue flash that brings the scarecrow to life: a sharp crack, a buzzy zap sweeping up, a
## low whomp under it, and a shimmer of high sparkles that flicker and die away.
func _life_flash(length: float) -> PackedFloat32Array:
var n := int(length * RATE)
var white := _noise_lowpass(n, 9000.0)
var white_low := _noise_lowpass(n, 2000.0)
var buf := PackedFloat32Array()
buf.resize(n)
var zap := 0.0
var whomp := 0.0
for i in n:
var t := float(i) / RATE
zap += (220.0 * pow(8.0, minf(t / 0.2, 1.0))) / RATE
whomp += lerpf(110.0, 55.0, minf(t / 0.4, 1.0)) / RATE
var buzz := 0.0
for h in [1, 3, 5]: # (the 7th would pass the Nyquist limit at the top of the sweep)
buzz += sin(TAU * zap * h) / h
var zap_env := minf(t / 0.01, 1.0) * (1.0 if t < 0.2 else exp(-(t - 0.2) * 8.0))
buf[i] = 0.7 * minf(t / 0.001, 1.0) * (white[i] - white_low[i]) * exp(-t * 30.0) + 0.5 * zap_env * buzz \
+ 0.5 * minf(t / 0.005, 1.0) * sin(TAU * whomp) * exp(-t * 6.0)
for k in 14: # the sparkles
var f := _rng.randf_range(2000.0, 6500.0)
var trem := _rng.randf_range(8.0, 20.0)
var at := _rng.randf_range(0.0, 0.25)
var amp := _rng.randf_range(0.04, 0.08)
for i in range(int(at * RATE), n):
var t := float(i) / RATE - at
var flicker := 0.5 + 0.5 * sin(TAU * trem * t)
buf[i] += amp * minf(t / 0.02, 1.0) * exp(-t * 2.6) * flicker * sin(TAU * f * t)
return _normalize(buf, 0.8)
## The UFO zooming off: a rush of air and a buzzy hum, both dropping in pitch as it goes (fast
## at first, then settling: a doppler fall) and fading away.
func _zoom(length: float) -> PackedFloat32Array:
var n := int(length * RATE)
var air := _band_sweep(n, 2600.0, 350.0, 0.15)
var buf := PackedFloat32Array()
buf.resize(n)
var phase := 0.0
for i in n:
var t := float(i) / RATE
var u := float(i) / n
phase += (260.0 + 690.0 * exp(-u * 4.0)) * (1.0 + 0.02 * sin(TAU * 7.0 * t)) / RATE
var tone := 0.0
for h in [1, 3, 5]:
tone += sin(TAU * phase * h) / h
var env := minf(u / 0.03, 1.0) * pow(1.0 - u, 1.6)
buf[i] = env * (0.5 * tone + 0.8 * air[i])
return _normalize(buf, 0.75)
## A car door slamming: the latch's click (and a second as it catches), then a dull thunk: a low
## thump, a few damped, out-of-tune panel tones, and a puff of low noise.
func _door(length: float) -> PackedFloat32Array:
var n := int(length * RATE)
var click := _noise_lowpass(n, 9000.0)
var click_low := _noise_lowpass(n, 3000.0)
var thud := _noise_lowpass(n, 400.0)
var buf := PackedFloat32Array()
buf.resize(n)
var hit := 0.006 # the thunk starts just after the first click
var panel := [[143.0, 14.0, 0.5], [231.0, 18.0, 0.35], [389.0, 24.0, 0.22], [612.0, 30.0, 0.14], [980.0, 40.0, 0.08]]
var phase := 0.0
for i in n:
var t := float(i) / RATE
var s := 0.35 * minf(t / 0.0005, 1.0) * (click[i] - click_low[i]) * exp(-t / 0.0015)
if t > 0.035:
s += 0.2 * (click[i] - click_low[i]) * exp(-(t - 0.035) / 0.0012)
if t >= hit:
var th := t - hit
phase += lerpf(85.0, 62.0, minf(th / 0.15, 1.0)) / RATE
var attack := minf(th / 0.002, 1.0)
s += attack * sin(TAU * phase) * exp(-th * 16.0)
for p: Array in panel:
s += attack * float(p[2]) * sin(TAU * float(p[0]) * th) * exp(-th * float(p[1]))
s += 0.6 * attack * thud[i] * exp(-th * 25.0)
buf[i] = s
return _normalize(buf, 0.85)
## White noise through a resonant band whose center glides from f0 to f1 (q: lower is narrower).
func _band_sweep(n: int, f0: float, f1: float, q: float) -> PackedFloat32Array:
var buf := PackedFloat32Array()
buf.resize(n)
var low := 0.0
var band := 0.0
for i in n:
var u := float(i) / n
var w := TAU * f0 * pow(f1 / f0, u) / RATE
var high := _rng.randf_range(-1.0, 1.0) - low - q * band
band += w * high
low += w * band
buf[i] = band
return _normalize(buf, 1.0)
func _horn() -> PackedFloat32Array:
var n := int(0.9 * RATE)
var buf := PackedFloat32Array()

View file

@ -86,5 +86,6 @@
"84": "equip",
"85": "stop",
"86": "MainMenu",
"87": "step"
"87": "step",
"88": "render_overview.gd"
}

View file

@ -34,17 +34,25 @@
"32": "FarmSim Tick & Camera",
"33": "Interactions & Gathering",
"34": "Shed Stock & Supply Targets",
"35": "ResourceStore",
"36": "Farm Projectiles",
"37": "Alert Manager",
"38": "Net Budget Tool",
"39": "Enemy Roster Tests",
"40": "Co-op Menu UI",
"41": "Harvest Season — co-op",
"42": "Snapshot Decoding",
"43": "Enemy Characters & Hits",
"44": "send",
"45": "Interactions",
"46": "Upgrades",
"47": "Prop Collision Builder",
"48": "Horde Performance Report",
"49": "test_weapons.gd",
"50": "GameConfig",
"51": "Co-op Send Path",
"52": "Pause Menu Signals",
"53": "Tutorial",
"54": "GD-Sync Sync Icons",
"55": "Pine & Foliage Textures",
"56": "Campaign Experience (Step 11)",
@ -72,6 +80,11 @@
"78": "Mushrooms Texture",
"79": "Project Icon",
"80": "Alien overhaul — task list",
"81": "test_theft.gd",
"82": "explorer.md",
"83": "impl-worker.md"
"83": "impl-worker.md",
"84": "equip",
"85": "stop",
"86": "MainMenu",
"87": "step"
}

View file

@ -1,16 +1,16 @@
# Graph Report - harvest-season (2026-10-06)
# Graph Report - harvest-season (2026-10-07)
## Corpus Check
- 39 files · ~1,607,953 words
- 39 files · ~1,634,481 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 1365 nodes · 4087 edges · 75 communities (61 shown, 14 thin omitted)
- 1361 nodes · 4076 edges · 88 communities (74 shown, 14 thin omitted)
- Extraction: 87% EXTRACTED · 13% INFERRED · 0% AMBIGUOUS · INFERRED: 542 edges (avg confidence: 0.91)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `eac2cb65`
- Built from commit: `87b5c11f`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@ -50,17 +50,25 @@
- FarmSim Tick & Camera
- Interactions & Gathering
- Shed Stock & Supply Targets
- ResourceStore
- Farm Projectiles
- Alert Manager
- Net Budget Tool
- Enemy Roster Tests
- Co-op Menu UI
- Harvest Season — co-op
- Snapshot Decoding
- Enemy Characters & Hits
- send
- Interactions
- Upgrades
- Prop Collision Builder
- Horde Performance Report
- test_weapons.gd
- GameConfig
- Co-op Send Path
- Pause Menu Signals
- Tutorial
- GD-Sync Sync Icons
- Pine & Foliage Textures
- Campaign Experience (Step 11)
@ -87,13 +95,18 @@
- Mushrooms Texture
- Project Icon
- Alien overhaul — task list
- test_theft.gd
- equip
- stop
- MainMenu
- step
## God Nodes (most connected - your core abstractions)
1. `CampaignController` - 120 edges
1. `CampaignController` - 119 edges
2. `EnemySystem` - 109 edges
3. `StructureSystem` - 98 edges
4. `FarmSim` - 96 edges
5. `LootSystem` - 89 edges
4. `FarmSim` - 95 edges
5. `LootSystem` - 88 edges
6. `ScarecrowCombat` - 81 edges
7. `FarmState` - 76 edges
8. `PlayerCharacter` - 73 edges
@ -103,14 +116,14 @@
## Surprising Connections (you probably didn't know these)
- `Scripted soak runs (soak_night.gd)` --semantically_similar_to--> `Stress presets (25/50 to 1,000/2,000 birds)` [INFERRED] [semantically similar]
first-game-plan.md → plan.md
- `PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb)` --references--> `WeaponModels` [INFERRED]
assets/weapons/PumpkinBomb_texture.png → game/scripts/weapon_models.gd
- `Ground-bound birds (no flying navigation)` --semantically_similar_to--> `Gameplay is 2-D on the XZ plane` [INFERRED] [semantically similar]
plan.md → first-game-plan.md
- `Prototype scope boundaries` --semantically_similar_to--> `Deferred from version 1 (farming sim, multiplayer, tech trees)` [INFERRED] [semantically similar]
plan.md → first-game.md
- `PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb)` --references--> `PumpkinBombs` [INFERRED]
assets/weapons/PumpkinBomb_texture.png → game/scripts/pumpkin_bombs.gd
- `PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb)` --references--> `WeaponModels` [INFERRED]
assets/weapons/PumpkinBomb_texture.png → game/scripts/weapon_models.gd
## Import Cycles
- 3-file cycle: `game/scripts/enemy_system.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd`
@ -158,131 +171,131 @@
- **Retry restores the failed night's morning snapshot (verified across suites)** — game_tests_test_campaign_retry, game_tests_test_economy_deposit_and_night, game_tests_test_coop_fall_rule, game_tests_test_flow_failure, game_tests_test_nights_upgrades [INFERRED 0.85]
- **Suites that instantiate farm.tscn and step FarmSim by hand at 60 Hz** — game_tests_test_coop, game_tests_test_economy, game_tests_test_farm_layout, game_tests_test_nights, game_tests_test_roster [EXTRACTED 1.00]
## Communities (75 total, 14 thin omitted)
## Communities (88 total, 14 thin omitted)
### Community 0 - "Campaign Controller & Farm State"
Cohesion: 0.05
Nodes (82): D2: Early campaign end (scarecrow death or farm stripped), Outcome evaluator check_outcome, Assessment, CampaignController, advance_phase(), begin_day(), campaign_ended (signal), can_start_night_early() (+74 more)
Cohesion: 0.13
Nodes (28): CampaignController, advance_phase(), begin_day(), can_start_night_early(), check_outcome(), _enter(), is_over(), is_timed() (+20 more)
### Community 1 - "Structures & Build Mode"
Cohesion: 0.13
Nodes (32): StructureSystem, _add_view(), _build_view(), built (signal), damage(), destroyed (signal), dismantle(), hurt (signal) (+24 more)
Cohesion: 0.15
Nodes (28): StructureSystem, _add_view(), _build_view(), damage(), destroyed (signal), _ground_y(), hurt (signal), make_ghost() (+20 more)
### Community 2 - "Audio & Farmers Return Ending"
Cohesion: 0.09
Nodes (45): _on_ended(), FarmAudio, _free_voice(), _on_loot(), _on_phase(), _on_removed(), _physics_process(), play() (+37 more)
Cohesion: 0.07
Nodes (45): Harvest Season — audio credits, Kenney Digital Audio pack, Kenney Impact Sounds pack, Kenney Interface Sounds pack, Kenney Music Jingles pack (pizzicato set), Kenney RPG Audio pack, Kenney UI Audio (UI SFX Set) pack, "On the Farm" (music track) (+37 more)
### Community 3 - "Scarecrow Weapons & Bombs"
Cohesion: 0.05
Nodes (73): Prototype Kit texture (8x8 RGB color palette swatch atlas for flat-shaded prototype pieces), PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb), ActionEdges, note(), BuildHud, _process(), BuildMode, dismantled (signal) (+65 more)
Cohesion: 0.15
Nodes (25): ScarecrowCombat, _aim_at(), attack(), attack_toward(), attacked (signal), _clear_line(), fired (signal), interval_ticks() (+17 more)
### Community 4 - "Waves, Night Plans & Review"
Cohesion: 0.14
Nodes (29): NightPlan, count_scale_in(), problems(), scaled_count(), scaled_every(), spacing_scale_in(), total(), type_counts() (+21 more)
Cohesion: 0.07
Nodes (59): Wave count and spacing scaling, User feedback: "extraordinarily easy" → 30-day scale pass, 5x enemies scale pass (up to 160 enemies; FarmSim.step 0.45 ms avg), Dusk warning (banner, hint, phase HUD list), Night plans (NightPlan groups: time, count, spacing, type, target), enemies_line(), materials_line(), show_failure() (+51 more)
### Community 5 - "First Game Plan & Milestones"
Cohesion: 0.09
Nodes (35): First complete version — five-night vacation build steps, Harvest Season — first game development plan, D1: Starting the night early (allow_early_night, off by default), D3: Phase lengths, D4: Sunrise retreat and dawn grace, D5: Killing or fearing a carrier drops its loot, D6: Recovery rules (touch to recover; animals follow, max 3), D7: Scarecrow HP carries over between nights (+27 more)
Nodes (34): Harvest Season — first game development plan, D10: Ground enemies before Step 9, D2: Early campaign end (scarecrow death or farm stripped), D3: Phase lengths, D4: Sunrise retreat and dawn grace, D5: Killing or fearing a carrier drops its loot, D6: Recovery rules (touch to recover; animals follow, max 3), D7: Scarecrow HP carries over between nights (+26 more)
### Community 6 - "Horde Prototype (README)"
Cohesion: 0.12
Nodes (35): D10: Ground enemies before Step 9, Crows on MultiMesh, ground enemies from a KayKit pool, One fixed-order simulation tick, Game code in game/, prototype/ frozen (fork rule), One GameConfig resource, Thief states ENTER / SEEK / STEAL / CARRY / ESCAPED, Horde survival prototype — coding-agent implementation plan, Centralized simulation with reusable storage (+27 more)
Cohesion: 0.14
Nodes (32): Crows on MultiMesh, ground enemies from a KayKit pool, One fixed-order simulation tick, Game code in game/, prototype/ frozen (fork rule), One GameConfig resource, Horde survival prototype — coding-agent implementation plan, Centralized simulation with reusable storage, Prototype implementation milestones and gates, Pool reuse rules (no hot-path allocation) (+24 more)
### Community 7 - "Co-op Lobby & Smoke Test"
Cohesion: 0.15
Nodes (34): CoopLobby, _begin(), failed (signal), has_online_keys(), host(), host_addresses(), join(), join_address() (+26 more)
### Community 8 - "Scarecrow Defender & Fear"
Cohesion: 0.06
Nodes (65): Fear ability (6 m burst, 2 s flee, 12 s cooldown), The scarecrow (player defender), Step 4: Establish the scarecrow's defensive tools, User feedback: "extraordinarily easy" → 30-day scale pass, 5x enemies scale pass (up to 160 enemies; FarmSim.step 0.45 ms avg), Day/night lighting and lantern, pressed(), DayNight (+57 more)
Cohesion: 0.07
Nodes (53): Fear ability (6 m burst, 2 s flee, 12 s cooldown), The scarecrow (player defender), Step 4: Establish the scarecrow's defensive tools, pressed(), add_partner(), set_local(), FollowCamera, _apply() (+45 more)
### Community 9 - "Loot & Theft Events"
Cohesion: 0.14
Nodes (28): place(), record_event(), LootSystem, animal_home(), animal_strays(), claim(), _claim_home(), drop() (+20 more)
Cohesion: 0.16
Nodes (25): place(), record_event(), LootSystem, animal_home(), animal_strays(), claim(), drop(), _empty_sack() (+17 more)
### Community 10 - "Settings, Input & UI Theme"
Cohesion: 0.16
Nodes (19): _open_settings(), SettingsMenu, _apply_value(), _bindings(), changed (signal), close(), closed (signal), describe_keys() (+11 more)
Cohesion: 0.12
Nodes (26): Menus, pause, and settings (user://settings.cfg), GameSettings, apply(), load_from(), save_to(), _on_settings_changed(), _open_settings(), _remember_name() (+18 more)
### Community 11 - "Main Scene & Title Menu"
Cohesion: 0.13
Nodes (29): ended (signal), partner_left (signal), stop(), _ask_new_vacation(), continue_vacation(), _host_coop(), _leave_as_partner(), MainMenu (+21 more)
Cohesion: 0.33
Nodes (9): _ask_new_vacation(), continue_vacation(), _host_coop(), open(), new_vacation(), show_main_menu(), Loaded, read() (+1 more)
### Community 12 - "Farm Zones & Layout Tests"
Cohesion: 0.07
Nodes (74): Harvest Season — farm layout, Animal Pen zone, Crop Field zone, Crop units (30 row segments in 6 plots), The farm's edge (random enemy arrivals and carrier escapes), Farm zones (FarmZone rectangles under Zones/), Farmers' return route and staging points, Fence gaps (GapNorth, GapDriveway, GapEast) (+66 more)
Nodes (60): Harvest Season — farm layout, Crop Field zone, Crop units (30 row segments in 6 plots), The farm's edge (random enemy arrivals and carrier escapes), Farm zones (FarmZone rectangles under Zones/), Farmers' return route and staging points, Fence gaps (GapNorth, GapDriveway, GapEast), Gather points (GatherNode) (+52 more)
### Community 13 - "Enemy System & Theft Tests"
Cohesion: 0.16
Nodes (23): clear(), release(), EnemySystem, apply_hit_handle(), clear(), commit_removals(), enemy_removed (signal), _load_types() (+15 more)
Cohesion: 0.17
Nodes (14): clear(), release(), EnemySystem, apply_hit_handle(), clear(), commit_removals(), enemy_removed (signal), _load_types() (+6 more)
### Community 14 - "Co-op Session Host/Client"
Cohesion: 0.14
Nodes (33): reader(), send(), CoopSession, _apply_avatar(), _apply_event(), _apply_foes(), _apply_snap(), _apply_state() (+25 more)
Cohesion: 0.17
Nodes (26): reader(), CoopSession, _apply_avatar(), _apply_event(), _apply_foes(), _apply_snap(), _apply_state(), _client_message() (+18 more)
### Community 15 - "Rules of the Vacation"
Cohesion: 0.05
Nodes (58): KayKit Character Animations license (CC0), KayKit: Character Animations 1.1 (Kay Lousberg), Prototype Kit license (CC0, Rgsdev), Prototype Kit (Raphael Gonçalves / Rgsdev), MultiMesh batching for birds and bullets, Simulation tick profile at 2,000 birds (steering, motion+collision, flow-field slice, grid), GDScript simulation is the bottleneck, not rendering, Co-op fall rule (out until morning; Game Over only when both are down) (+50 more)
Nodes (54): KayKit Character Animations license (CC0), KayKit: Character Animations 1.1 (Kay Lousberg), Prototype Kit license (CC0, Rgsdev), Prototype Kit (Raphael Gonçalves / Rgsdev), MultiMesh batching for birds and bullets, Simulation tick profile at 2,000 birds (steering, motion+collision, flow-field slice, grid), GDScript simulation is the bottleneck, not rendering, Co-op fall rule (out until morning; Game Over only when both are down) (+46 more)
### Community 16 - "Game Flow, Save & Pause"
Cohesion: 0.28
Nodes (17): ConfirmBox, close(), _yes(), Main, SaveGame, _audio(), _continue_and_new(), _coop_quit_to_menu() (+9 more)
Cohesion: 0.31
Nodes (18): ConfirmBox, close(), _yes(), Main, SaveGame, check(), _audio(), _continue_and_new() (+10 more)
### Community 17 - "Farm Navigation Flow Fields"
Cohesion: 0.07
Nodes (64): Alerts (labeled edge arrows, priority, grouping), AlertManager, _alert(), _arrow(), cap(), collect(), _draw(), _escalation() (+56 more)
### Community 18 - "Resource Economy & Upgrades"
Cohesion: 0.12
Nodes (20): Harvest Season — audio credits, Kenney Digital Audio pack, Kenney Impact Sounds pack, Kenney Interface Sounds pack, Kenney Music Jingles pack (pizzicato set), Kenney RPG Audio pack, Kenney UI Audio (UI SFX Set) pack, "On the Farm" (music track) (+12 more)
Cohesion: 0.13
Nodes (22): Ground thief (enemy), Day/night lighting and lantern, DayNight, add_lantern(), _apply(), _mix(), _process(), setup() (+14 more)
### Community 19 - "Animal System"
Cohesion: 0.17
Nodes (18): AnimalSystem, _apply_visuals(), _follow(), _move(), position(), _record_trail(), replica_record(), start_following() (+10 more)
Cohesion: 0.13
Nodes (22): Animal Pen zone, Finding: a broken pen gate is the costliest event, Animals and the pen (open pen, loose animals, leading home), Thief (enemy type), AnimalSystem, _apply_visuals(), _follow(), _move() (+14 more)
### Community 20 - "Test Runner & Farm Targets"
Cohesion: 0.20
Nodes (10): PlayerCharacter, can_sprint(), die(), _follow_net(), _move_direction(), _physics_process(), reset_sprint(), revive() (+2 more)
Cohesion: 0.16
Nodes (16): ActionEdges, note(), BuildHud, _process(), BuildMode, dismantled (signal), message (signal), refused (signal) (+8 more)
### Community 21 - "Co-op Docs & GD-Sync Link"
Cohesion: 0.09
Nodes (27): Harvest Season — co-op, GD-Sync API keys (keys.cfg), GD-Sync data allowance budget (22 MB per vacation, ~12 KB/s), Unreliable message size limit (under 1,100 bytes; GD-Sync splits at 1,200), Dead reckoning for enemies (25 cm error threshold), Harvest Season patches to GD-Sync (4), Host-authoritative simulation with partner replica (FarmSim.replica), LAN join by address (+19 more)
Cohesion: 0.15
Nodes (13): Host-authoritative simulation with partner replica (FarmSim.replica), Partner panel, name tags, and edge arrow, Avatar, CoopHud, _draw(), _measure_ping(), _process(), setup() (+5 more)
### Community 22 - "Enemy Roster & Construction Plan"
Cohesion: 0.14
Nodes (19): Alert priorities, grouping, and cap, Automated defense (buildable), Crow (enemy), Enemy type table (GameConfig.enemy_types), Fence (buildable), Fence breaker (enemy), Flying rule (fences, gates, traps ignore flyers), Gameplay is 2-D on the XZ plane (+11 more)
Cohesion: 0.15
Nodes (17): Alert priorities, grouping, and cap, Automated defense (buildable), Crow (enemy), Enemy type table (GameConfig.enemy_types), Fence (buildable), Fence breaker (enemy), Flying rule (fences, gates, traps ignore flyers), Gameplay is 2-D on the XZ plane (+9 more)
### Community 23 - "Playtest Notes & Scaling"
Cohesion: 0.11
Nodes (30): enemies_line(), materials_line(), of(), _process(), show_assessment(), show_failure(), _totals_text(), PhaseHud (+22 more)
Cohesion: 0.19
Nodes (13): of(), campaign_ended (signal), new_campaign(), EndPanel, hide_panel(), menu_requested (signal), _on_ended(), _process() (+5 more)
### Community 24 - "Farm Sim Setup Wiring"
Cohesion: 0.19
Nodes (13): find_animals(), pen_changed (signal), setup(), update_pen_open(), arrival_message(), _count_removal(), _on_night_ending(), _on_phase_changed() (+5 more)
Cohesion: 0.26
Nodes (17): stream_of(), FarmersReturn, _build_overlay(), clear(), _finish(), finished (signal), _follow_camera(), _frame_yard() (+9 more)
### Community 25 - "Co-op Link Transport"
Cohesion: 0.13
Nodes (27): CoopLink, close(), _deliver(), get_angle(), get_cm(), get_text(), get_time(), get_v3() (+19 more)
Cohesion: 0.16
Nodes (20): CoopLink, close(), _deliver(), get_angle(), get_cm(), get_text(), get_time(), get_v3() (+12 more)
### Community 26 - "Thief Behavior AI"
Cohesion: 0.22
Nodes (9): Farmers' return ending, Five-night farm vacation (core loop), Step 10: The five-night progression, Planned 30-night campaign, Wave count and spacing scaling, Step 10: Build the five-night progression, Night plans (NightPlan night_1..5), Scarecrow weapons: pitchfork, corn shooter, pumpkin bombs (+1 more)
Cohesion: 0.11
Nodes (21): Step 10: The five-night progression, Step 10: Build the five-night progression, FarmState, asset_counts(), create(), from_dict(), is_valid(), log_night() (+13 more)
### Community 27 - "Soak Night & Benchmarks"
Cohesion: 0.38
Nodes (12): _attack(), _build_tick(), _cycles(), _gather_day(), _gather_tick(), _guard(), _quit(), _run() (+4 more)
Cohesion: 0.24
Nodes (16): Labeled stress benchmark presets (25–2,000 birds, compact/enlarged layouts), run(), run_benchmarks.sh script, Scripted scarecrow bot (soak_night, perfect aim), _attack(), _build_tick(), _cycles(), _gather_day() (+8 more)
### Community 28 - "Co-op Tests"
Cohesion: 0.53
Nodes (6): GDSync (GD-Sync plugin autoload), net_receive(), start_voice(), GDSyncLink, _on_joined(), _on_partner_arrived()
Cohesion: 0.27
Nodes (10): GDSync (GD-Sync plugin autoload), net_receive(), set_microphone(), start_voice(), GDSyncLink, _on_joined(), _on_partner_arrived(), pause() (+2 more)
### Community 29 - "Player Character Movement"
Cohesion: 0.17
Nodes (21): _process(), pay(), structure(), show_state(), _process(), describe(), pay(), _ground_y() (+13 more)
Cohesion: 0.21
Nodes (15): _process(), pay(), structure(), show_state(), _process(), describe(), pay(), built (signal) (+7 more)
### Community 30 - "Farm Layout Doc"
Cohesion: 0.17
Nodes (15): Pen gate breach (gate as start structure), Supply bundles (sacks from the most-stocked material), Step 8: Expand to all three farm targets, Three farm targets: crops, animals, supplies, Shed stock piles (ShedStock), Supply Shed zone, Finding: a broken pen gate is the costliest event, Animals and the pen (open pen, loose animals, leading home) (+7 more)
Cohesion: 0.27
Nodes (10): Shed stock piles (ShedStock), Supply theft and shed stock rules, _claim_home(), most_stocked(), ShedStock, _process(), props_for(), refresh() (+2 more)
### Community 31 - "Co-op Voice Chat"
Cohesion: 0.29
@ -294,19 +307,23 @@ Nodes (19): 1. With losses permanent, the density decides when the farm is empty
### Community 33 - "Interactions & Gathering"
Cohesion: 0.50
Nodes (4): Farm occupancy grid with one flow field per goal set, Deferred from version 1 (farming sim, multiplayer, tech trees), Prototype scope boundaries, Shared octile flow field toward the player
Nodes (4): Farm occupancy grid with one flow field per goal set, Structures are expensive-to-cross cells, not walls, Deferred from version 1 (farming sim, multiplayer, tech trees), Prototype scope boundaries
### Community 34 - "Shed Stock & Supply Targets"
Cohesion: 0.29
Nodes (16): SKY, _crowd(), _enemies_match(), _fall_rule(), _join(), _leaving(), _night(), _partner_moves_and_gathers() (+8 more)
Cohesion: 0.33
Nodes (15): _crowd(), _enemies_match(), _fall_rule(), _join(), _leaving(), _night(), _partner_moves_and_gathers(), _partner_shoots() (+7 more)
### Community 35 - "ResourceStore"
Cohesion: 0.33
Nodes (13): GatherNode, ResourceHud, _process(), ResourceStore, Workbench, _deposit_and_night(), _gathering(), _layout() (+5 more)
### Community 36 - "Farm Projectiles"
Cohesion: 0.17
Nodes (9): _release_slot(), sweep_hit(), FarmProjectiles, fire(), hit (signal), _release(), _resolve_segment(), step() (+1 more)
Cohesion: 0.16
Nodes (10): _release_slot(), sweep_hit(), FarmProjectiles, fire(), hit (signal), _release(), _resolve_segment(), step() (+2 more)
### Community 37 - "Alert Manager"
Cohesion: 0.23
Nodes (13): _breaker_goals(), _start_field_rebuild(), can_afford(), missing(), blocks(), corners(), _distance_to_outline(), footprint() (+5 more)
Cohesion: 0.33
Nodes (9): _breaker_goals(), _start_field_rebuild(), blocks(), corners(), _distance_to_outline(), footprint(), layout_changed (signal), structure_near() (+1 more)
### Community 38 - "Net Budget Tool"
Cohesion: 0.31
@ -317,32 +334,60 @@ Cohesion: 0.15
Nodes (12): #23 [pop-ups] Remove the zone banner and the message feed, #24 [30] Nights by count, per-night enemy speed and HP, #25 [30] Arrivals wait for a free character, #26 [30] Upgrade tiers and timed shed stock, #27 [30] The thirty nights, #28 [30] Thirty-night soak, pool sizes, and a balance report, Decisions (the user's, 2026-10-06), Defaults (assumed; flip any of these on request) (+4 more)
### Community 40 - "Co-op Menu UI"
Cohesion: 0.38
Nodes (11): CoopMenu, back_requested (signal), host_requested (signal), join_address_requested (signal), join_requested (signal), open(), _ready(), search_requested (signal) (+3 more)
Cohesion: 0.21
Nodes (22): CoopMenu, back_requested (signal), host_requested (signal), join_address_requested (signal), join_requested (signal), open(), _ready(), search_requested (signal) (+14 more)
### Community 41 - "Harvest Season — co-op"
Cohesion: 0.18
Nodes (14): Harvest Season — co-op, GD-Sync API keys (keys.cfg), GD-Sync data allowance budget (22 MB per vacation, ~12 KB/s), Unreliable message size limit (under 1,100 bytes; GD-Sync splits at 1,200), Dead reckoning for enemies (25 cm error threshold), Harvest Season patches to GD-Sync (4), LAN join by address, Same-network LAN play (GD-Sync local mode, peer to peer) (+6 more)
### Community 42 - "Snapshot Decoding"
Cohesion: 0.15
Nodes (12): Alien overhaul — follow-ups (outside docs/tasks.md scope), Crop fields (#13), Docs sweep after renames/rebalances, Housekeeping, Loose animals (#12), Playtest after #11 (player-built pen), Post-overhaul fix batch (#16–#22, 2026-10-06), Spec items from the review with no task (+4 more)
### Community 43 - "Enemy Characters & Hits"
Cohesion: 0.18
Nodes (16): EnemyCharacters, acquire(), _animate(), hit(), _process(), spawn(), visual_position(), EDGE (+8 more)
Cohesion: 0.38
Nodes (9): EDGE, _alerts(), _breakers(), _characters(), _crows(), run(), _scenarios(), _table() (+1 more)
### Community 44 - "send"
Cohesion: 0.22
Nodes (14): put_angle(), put_cm(), put_text(), put_time(), put_v3(), send(), _close_menu_if_needed(), _host_tick() (+6 more)
### Community 45 - "Interactions"
Cohesion: 0.27
Nodes (14): Interactions, _blocker(), cancel(), charges(), deposited (signal), _finish_gather(), gathered (signal), message (signal) (+6 more)
### Community 46 - "Upgrades"
Cohesion: 0.24
Nodes (14): can_afford(), missing(), _overlap(), _overlaps_rect(), trap_slow_time(), validate(), _world_blocked(), Upgrades (+6 more)
### Community 47 - "Prop Collision Builder"
Cohesion: 0.42
Nodes (8): _band_points(), _build(), _faces(), _fit(), _initialize(), _kind(), _process_prefab(), _restore_uids()
Cohesion: 0.31
Nodes (10): _band_points(), _build(), _faces(), _fit(), _initialize(), _kind(), _process_prefab(), _restore_uids() (+2 more)
### Community 48 - "Horde Performance Report"
Cohesion: 0.13
Nodes (16): Performance report (prototype horde benchmarks), First shot / first hit stutter check (no first-use stutter), Largest tested passing population: 2,000 birds, 10-minute headless 1,000-bird recycle soak (flat memory), Start-up hitches (10–36 ms frames in the first second), Labeled stress benchmark presets (25–2,000 birds, compact/enlarged layouts), VSync-on ~1 s stalls (compositor throttling of hidden windows), run() (+8 more)
Cohesion: 0.18
Nodes (12): Performance report (prototype horde benchmarks), First shot / first hit stutter check (no first-use stutter), Largest tested passing population: 2,000 birds, 10-minute headless 1,000-bird recycle soak (flat memory), Start-up hitches (10–36 ms frames in the first second), VSync-on ~1 s stalls (compositor throttling of hidden windows), Headless tooling constraints (editor closed, restore UIDs), Performance measurement goals (p95 <= 16.67 ms) (+4 more)
### Community 49 - "test_weapons.gd"
Cohesion: 0.29
Nodes (12): WeaponModels, _add(), mesh_of(), _bombs(), _hud(), _offhand(), _pitchfork(), run() (+4 more)
### Community 50 - "GameConfig"
Cohesion: 0.38
Nodes (11): Assessment, GameConfig, _assessment(), _autosave(), _bad_saves(), busy_state(), _migration(), _round_trip() (+3 more)
### Community 51 - "Co-op Send Path"
Cohesion: 0.29
Nodes (6): Decisions (resolved), Harvest Season — alien overhaul: review, decisions, and task plan, Headline finding from the review, Open assumptions (flagged, not yet confirmed), Suggested starting order, Task breakdown (mirrors Task tool `#1`–`#15`)
### Community 52 - "Pause Menu Signals"
Cohesion: 0.52
Nodes (7): PauseMenu, menu_requested (signal), quit_requested (signal), _ready(), restart_requested (signal), resume_requested (signal), settings_requested (signal)
Cohesion: 0.24
Nodes (10): Prototype Kit texture (8x8 RGB color palette swatch atlas for flat-shaded prototype pieces), PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb), PumpkinBombs, _burst(), burst (signal), _flash(), _new_mesh(), step() (+2 more)
### Community 53 - "Tutorial"
Cohesion: 0.29
Nodes (12): phase_changed (signal), _on_phase_changed(), setup(), Tutorial, _check_done(), _enemies_near(), _finish(), _on_phase() (+4 more)
### Community 54 - "GD-Sync Sync Icons"
Cohesion: 0.50
@ -353,20 +398,20 @@ Cohesion: 0.40
Nodes (5): Leaf_Pine_C solid dark-green pine foliage silhouette, Leaf_Pine white alpha silhouette of a pine foliage cluster, Leaves_GiantPine_C solid green rounded foliage blob shapes, Leaves sprite sheet with colorful painted leaf shapes, ferns, clovers, Leaves_NormalTree white alpha silhouettes of normal tree leaf clusters
### Community 56 - "Campaign Experience (Step 11)"
Cohesion: 0.22
Nodes (9): D9: Retry from the failed night's morning, One authoritative FarmState, Step 11: The complete campaign experience, Step 11: Add the complete campaign experience, Farm audio cues and buses (FarmAudio), Kenney CC0 audio packs, Morning autosave and save migration (SaveGame), Morning review and nightly results (+1 more)
Cohesion: 0.12
Nodes (21): First complete version — five-night vacation build steps, Farmers' return ending, Five-night farm vacation (core loop), D1: Starting the night early (allow_early_night, off by default), M3 First loop (first major milestone), Step 11: The complete campaign experience, Step 1: Rules of the vacation, Step 2: Organize the map into a playable farm (+13 more)
### Community 57 - "Overview Render Tool"
Cohesion: 0.31
Nodes (10): start_channel(), stop_channel(), UpgradePanel, bought (signal), _buy(), close(), message (signal), open() (+2 more)
Cohesion: 0.43
Nodes (8): start_channel(), UpgradePanel, bought (signal), _buy(), message (signal), open(), refresh(), setup()
### Community 58 - "Prototype Round Lifecycle"
Cohesion: 0.27
Nodes (10): Menus, pause, and settings (user://settings.cfg), set_microphone(), GameSettings, apply(), load_from(), save_to(), _on_settings_changed(), pause() (+2 more)
Cohesion: 0.42
Nodes (10): lose_crops(), make_campaign(), run_phase(), run_until(), _early_night(), _five_nights(), _night_log(), _order_and_timers() (+2 more)
### Community 59 - "Grid Design & Scope Limits"
Cohesion: 0.19
Nodes (17): AssetHud, GameTestRunner, _initialize(), _main(), _animal_theft(), _breach(), _bundle_limits(), _fallback() (+9 more)
Cohesion: 0.24
Nodes (17): GameTestRunner, _initialize(), _main(), SKY, _animal_theft(), _breach(), _bundle_limits(), _fallback() (+9 more)
### Community 60 - "GD-Sync Physics/Voice Icons"
Cohesion: 0.67
@ -392,6 +437,26 @@ Nodes (3): PathRocks_Diffuse (mossy grey stepping-stone UV atlas diffuse, Pebble
Cohesion: 0.18
Nodes (10): Alien overhaul — task list, Dependent, Independent, Post-overhaul fix batch (2026-10-06), Thirty nights — task list (2026-10-06), Wave 1, Wave 1, Wave 2 (+2 more)
### Community 81 - "test_theft.gd"
Cohesion: 0.42
Nodes (10): _combat_input(), _consistent(), _escape(), _night_arrivals(), _retry(), run(), _shots(), _stale_handles() (+2 more)
### Community 84 - "equip"
Cohesion: 0.27
Nodes (10): cycle(), equip(), _set_offhand(), setup(), show_weapon(), switched (signal), tick(), setup() (+2 more)
### Community 85 - "stop"
Cohesion: 0.29
Nodes (8): ended (signal), partner_left (signal), stop(), _leave_as_partner(), _on_other_left(), _on_session_ended(), quit_game(), to_menu()
### Community 86 - "MainMenu"
Cohesion: 0.52
Nodes (7): MainMenu, continue_requested (signal), coop_requested (signal), new_requested (signal), quit_requested (signal), _ready(), settings_requested (signal)
### Community 87 - "step"
Cohesion: 0.50
Nodes (5): _finish_field_rebuild(), step(), _step_replica(), _update_hunt(), can_shoot()
## Ambiguous Edges - Review These
- `KayKit Rig_Medium animation libraries (CombatMelee, CombatRanged, General, Movement, Simulation, Special, Tools)` → `Final assessment (weighted share kept, 0–100 points, ratings)` [AMBIGUOUS]
game/RULES.md · relation: conceptually_related_to
@ -406,12 +471,12 @@ _Questions this graph is uniquely positioned to answer:_
- **What is the exact relationship between `KayKit Rig_Medium animation libraries (CombatMelee, CombatRanged, General, Movement, Simulation, Special, Tools)` and `Final assessment (weighted share kept, 0–100 points, ratings)`?**
_Edge tagged AMBIGUOUS (relation: conceptually_related_to) - confidence is low._
- **Why does `CoopSession` connect `Co-op Session Host/Client` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Shed Stock & Supply Targets`, `Scarecrow Weapons & Bombs`, `Net Budget Tool`, `Co-op Lobby & Smoke Test`, `Scarecrow Defender & Fear`, `Main Scene & Title Menu`, `Farm Zones & Layout Tests`, `Enemy System & Theft Tests`, `Game Flow, Save & Pause`, `Co-op Docs & GD-Sync Link`, `Co-op Link Transport`, `Prototype Round Lifecycle`, `Co-op Tests`, `Player Character Movement`, `Co-op Voice Chat`?**
- **Why does `CampaignController` connect `Campaign Controller & Farm State` to `Structures & Build Mode`, `Audio & Farmers Return Ending`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `First Game Plan & Milestones`, `Horde Prototype (README)`, `Co-op Lobby & Smoke Test`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Resource Economy & Upgrades`, `Animal System`, `Test Runner & Farm Targets`, `Playtest Notes & Scaling`, `Farm Sim Setup Wiring`, `Thief Behavior AI`, `Soak Night & Benchmarks`, `Farm Layout Doc`, `Shed Stock & Supply Targets`, `ResourceStore`, `Net Budget Tool`, `Co-op Menu UI`, `Enemy Characters & Hits`, `Interactions`, `Upgrades`, `GameConfig`, `Tutorial`, `Overview Render Tool`, `Prototype Round Lifecycle`, `Grid Design & Scope Limits`, `test_theft.gd`, `step`?**
_High betweenness centrality (0.119) - this node is a cross-community bridge._
- **Why does `CoopSession` connect `Co-op Session Host/Client` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `Co-op Lobby & Smoke Test`, `Enemy System & Theft Tests`, `Game Flow, Save & Pause`, `Co-op Docs & GD-Sync Link`, `Co-op Link Transport`, `Thief Behavior AI`, `Co-op Tests`, `Co-op Voice Chat`, `Shed Stock & Supply Targets`, `ResourceStore`, `Net Budget Tool`, `Harvest Season — co-op`, `send`, `Upgrades`, `stop`?**
_High betweenness centrality (0.116) - this node is a cross-community bridge._
- **Why does `CampaignController` connect `Campaign Controller & Farm State` to `Structures & Build Mode`, `Audio & Farmers Return Ending`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `First Game Plan & Milestones`, `Horde Prototype (README)`, `Co-op Lobby & Smoke Test`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Enemy System & Theft Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Animal System`, `Test Runner & Farm Targets`, `Playtest Notes & Scaling`, `Farm Sim Setup Wiring`, `Soak Night & Benchmarks`, `Player Character Movement`, `Farm Layout Doc`, `Shed Stock & Supply Targets`, `Alert Manager`, `Net Budget Tool`, `Enemy Characters & Hits`, `Pause Menu Signals`, `Overview Render Tool`, `Grid Design & Scope Limits`?**
- **Why does `FarmSim` connect `Waves, Night Plans & Review` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Audio & Farmers Return Ending`, `Scarecrow Weapons & Bombs`, `Horde Prototype (README)`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Enemy System & Theft Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Resource Economy & Upgrades`, `Animal System`, `Test Runner & Farm Targets`, `Co-op Docs & GD-Sync Link`, `Playtest Notes & Scaling`, `Farm Sim Setup Wiring`, `Soak Night & Benchmarks`, `Farm Layout Doc`, `Shed Stock & Supply Targets`, `ResourceStore`, `Farm Projectiles`, `Alert Manager`, `Net Budget Tool`, `Enemy Characters & Hits`, `Interactions`, `test_weapons.gd`, `GameConfig`, `Pause Menu Signals`, `Tutorial`, `Overview Render Tool`, `Grid Design & Scope Limits`, `test_theft.gd`, `step`?**
_High betweenness centrality (0.113) - this node is a cross-community bridge._
- **Why does `FarmSim` connect `Scarecrow Defender & Fear` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Audio & Farmers Return Ending`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `Horde Prototype (README)`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Enemy System & Theft Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Animal System`, `Test Runner & Farm Targets`, `Co-op Docs & GD-Sync Link`, `Playtest Notes & Scaling`, `Farm Sim Setup Wiring`, `Soak Night & Benchmarks`, `Farm Layout Doc`, `Shed Stock & Supply Targets`, `Farm Projectiles`, `Alert Manager`, `Net Budget Tool`, `Enemy Characters & Hits`, `Overview Render Tool`, `Grid Design & Scope Limits`?**
_High betweenness centrality (0.112) - this node is a cross-community bridge._
- **Are the 12 inferred relationships involving `CampaignController` (e.g. with `Outcome evaluator check_outcome` and `_night_log()`) actually correct?**
_`CampaignController` has 12 INFERRED edges - model-reasoned connections that need verification._
- **Are the 13 inferred relationships involving `EnemySystem` (e.g. with `AlertManager` and `_describe()`) actually correct?**

File diff suppressed because it is too large Load diff

View file

@ -110,8 +110,8 @@
"semantic_hash": "6a47d64fcc136324ca395065a707ef76"
},
"README.md": {
"mtime": 1791388136.4422987,
"ast_hash": "2483f37d8229130969507b663b24b0f6",
"mtime": 1791420601.009332,
"ast_hash": "78074ee49b0384a8f3ddf88227cbb876",
"semantic_hash": ""
},
"assets/audio/CREDITS.md": {
@ -195,8 +195,8 @@
"semantic_hash": ""
},
"game/RULES.md": {
"mtime": 1791324211.66601,
"ast_hash": "949e5f8c69ded04111b4e99c9282a0bb",
"mtime": 1791398708.9815342,
"ast_hash": "f9f2c16f6b31663a1810c6a0e7a245c1",
"semantic_hash": ""
},
"plan.md": {
@ -1008,5 +1008,20 @@
"mtime": 1791324224.559026,
"ast_hash": "a9155ff99382d4e465863ed464d27c87",
"semantic_hash": ""
},
"assets/fonts/OFL.txt": {
"mtime": 1791391447.5754592,
"ast_hash": "f276c5fb92536732b115e5d848d89ed4",
"semantic_hash": ""
},
"assets/pictures/screens/splash.png": {
"mtime": 1791388644.636634,
"ast_hash": "0076d8ae11b1245bda7b3ce2c92d96e1",
"semantic_hash": ""
},
"assets/pictures/screens/splash-screen.png": {
"mtime": 1791395446.9523106,
"ast_hash": "4296651d924c855564f2252183430b3e",
"semantic_hash": ""
}
}

View file

@ -1,16 +1,16 @@
# Graph Report - harvest-season (2026-10-07)
## Corpus Check
- 39 files · ~1,634,481 words
- 39 files · ~1,663,935 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 1361 nodes · 4076 edges · 88 communities (74 shown, 14 thin omitted)
- 1368 nodes · 4083 edges · 89 communities (75 shown, 14 thin omitted)
- Extraction: 87% EXTRACTED · 13% INFERRED · 0% AMBIGUOUS · INFERRED: 542 edges (avg confidence: 0.91)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `87b5c11f`
- Built from commit: `78ff5494`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@ -100,6 +100,7 @@
- stop
- MainMenu
- step
- render_overview.gd
## God Nodes (most connected - your core abstractions)
1. `CampaignController` - 119 edges
@ -116,24 +117,24 @@
## Surprising Connections (you probably didn't know these)
- `Scripted soak runs (soak_night.gd)` --semantically_similar_to--> `Stress presets (25/50 to 1,000/2,000 birds)` [INFERRED] [semantically similar]
first-game-plan.md → plan.md
- `PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb)` --references--> `WeaponModels` [INFERRED]
assets/weapons/PumpkinBomb_texture.png → game/scripts/weapon_models.gd
- `Ground-bound birds (no flying navigation)` --semantically_similar_to--> `Gameplay is 2-D on the XZ plane` [INFERRED] [semantically similar]
plan.md → first-game-plan.md
- `Prototype scope boundaries` --semantically_similar_to--> `Deferred from version 1 (farming sim, multiplayer, tech trees)` [INFERRED] [semantically similar]
plan.md → first-game.md
- `PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb)` --references--> `PumpkinBombs` [INFERRED]
assets/weapons/PumpkinBomb_texture.png → game/scripts/pumpkin_bombs.gd
- `PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb)` --references--> `WeaponModels` [INFERRED]
assets/weapons/PumpkinBomb_texture.png → game/scripts/weapon_models.gd
## Import Cycles
- 3-file cycle: `game/scripts/enemy_system.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd`
- 4-file cycle: `game/scripts/enemy_system.gd -> game/scripts/loot_system.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd`
- 4-file cycle: `game/scripts/enemy_system.gd -> game/scripts/scarecrow.gd -> game/scripts/remote_controls.gd -> game/scripts/scarecrow_combat.gd -> game/scripts/enemy_system.gd`
- 5-file cycle: `game/scripts/enemy_characters.gd -> game/scripts/loot_system.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd -> game/scripts/enemy_characters.gd`
- 5-file cycle: `game/scripts/enemy_characters.gd -> game/scripts/thief_behavior.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd -> game/scripts/enemy_characters.gd`
- 5-file cycle: `game/scripts/enemy_system.gd -> game/scripts/scarecrow.gd -> game/scripts/remote_controls.gd -> game/scripts/scarecrow_combat.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd`
- 5-file cycle: `game/scripts/enemy_system.gd -> game/scripts/scarecrow.gd -> game/scripts/remote_controls.gd -> game/scripts/scarecrow_combat.gd -> game/scripts/pumpkin_bombs.gd -> game/scripts/enemy_system.gd`
- 5-file cycle: `game/scripts/enemy_characters.gd -> game/scripts/thief_behavior.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd -> game/scripts/enemy_characters.gd`
- 5-file cycle: `game/scripts/enemy_system.gd -> game/scripts/scarecrow.gd -> game/scripts/thief_behavior.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd`
- 5-file cycle: `game/scripts/enemy_characters.gd -> game/scripts/loot_system.gd -> game/scripts/structure_system.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd -> game/scripts/enemy_characters.gd`
- 5-file cycle: `game/scripts/enemy_system.gd -> game/scripts/scarecrow.gd -> game/scripts/remote_controls.gd -> game/scripts/scarecrow_combat.gd -> game/scripts/farm_projectiles.gd -> game/scripts/enemy_system.gd`
## Hyperedges (group relationships)
- **Prototype classes forked or generalized into game/ systems** — readme_hordesystem, game_scripts_enemy_system, readme_chasebehavior, game_scripts_thief_behavior, readme_arenanavigation, game_scripts_farm_navigation, readme_roundcontroller, game_scripts_campaign_controller, readme_prototypeconfig, game_scripts_game_config [EXTRACTED 1.00]
@ -171,195 +172,195 @@
- **Retry restores the failed night's morning snapshot (verified across suites)** — game_tests_test_campaign_retry, game_tests_test_economy_deposit_and_night, game_tests_test_coop_fall_rule, game_tests_test_flow_failure, game_tests_test_nights_upgrades [INFERRED 0.85]
- **Suites that instantiate farm.tscn and step FarmSim by hand at 60 Hz** — game_tests_test_coop, game_tests_test_economy, game_tests_test_farm_layout, game_tests_test_nights, game_tests_test_roster [EXTRACTED 1.00]
## Communities (88 total, 14 thin omitted)
## Communities (89 total, 14 thin omitted)
### Community 0 - "Campaign Controller & Farm State"
Cohesion: 0.13
Nodes (28): CampaignController, advance_phase(), begin_day(), can_start_night_early(), check_outcome(), _enter(), is_over(), is_timed() (+20 more)
Cohesion: 0.07
Nodes (75): Dawn retreat and grace (D4), Phase cycle (Morning → Day → Dusk → Night → Dawn), Assessment, of(), CampaignController, advance_phase(), campaign_ended (signal), check_outcome() (+67 more)
### Community 1 - "Structures & Build Mode"
Cohesion: 0.15
Nodes (28): StructureSystem, _add_view(), _build_view(), damage(), destroyed (signal), _ground_y(), hurt (signal), make_ghost() (+20 more)
### Community 2 - "Audio & Farmers Return Ending"
Cohesion: 0.07
Nodes (45): Harvest Season — audio credits, Kenney Digital Audio pack, Kenney Impact Sounds pack, Kenney Interface Sounds pack, Kenney Music Jingles pack (pizzicato set), Kenney RPG Audio pack, Kenney UI Audio (UI SFX Set) pack, "On the Farm" (music track) (+37 more)
Cohesion: 0.10
Nodes (31): Harvest Season — audio credits, Kenney Digital Audio pack, Kenney Impact Sounds pack, Kenney Interface Sounds pack, Kenney Music Jingles pack (pizzicato set), Kenney RPG Audio pack, Kenney UI Audio (UI SFX Set) pack, "On the Farm" (music track) (+23 more)
### Community 3 - "Scarecrow Weapons & Bombs"
Cohesion: 0.15
Nodes (25): ScarecrowCombat, _aim_at(), attack(), attack_toward(), attacked (signal), _clear_line(), fired (signal), interval_ticks() (+17 more)
Cohesion: 0.06
Nodes (63): Prototype Kit texture (8x8 RGB color palette swatch atlas for flat-shaded prototype pieces), PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb), Step 10: The five-night progression, Step 10: Build the five-night progression, note(), PumpkinBombs, _burst(), burst (signal) (+55 more)
### Community 4 - "Waves, Night Plans & Review"
Cohesion: 0.07
Nodes (59): Wave count and spacing scaling, User feedback: "extraordinarily easy" → 30-day scale pass, 5x enemies scale pass (up to 160 enemies; FarmSim.step 0.45 ms avg), Dusk warning (banner, hint, phase HUD list), Night plans (NightPlan groups: time, count, spacing, type, target), enemies_line(), materials_line(), show_failure() (+51 more)
Cohesion: 0.25
Nodes (14): WaveDirector, arrived (signal), entry_label(), night_length(), plan_for(), spawn(), spawn_next(), spawn_point() (+6 more)
### Community 5 - "First Game Plan & Milestones"
Cohesion: 0.09
Nodes (34): Harvest Season — first game development plan, D10: Ground enemies before Step 9, D2: Early campaign end (scarecrow death or farm stripped), D3: Phase lengths, D4: Sunrise retreat and dawn grace, D5: Killing or fearing a carrier drops its loot, D6: Recovery rules (touch to recover; animals follow, max 3), D7: Scarecrow HP carries over between nights (+26 more)
Cohesion: 0.13
Nodes (24): Harvest Season — first game development plan, D2: Early campaign end (scarecrow death or farm stripped), D3: Phase lengths, D4: Sunrise retreat and dawn grace, D5: Killing or fearing a carrier drops its loot, D6: Recovery rules (touch to recover; animals follow, max 3), D7: Scarecrow HP carries over between nights, D8: What's allowed at night (+16 more)
### Community 6 - "Horde Prototype (README)"
Cohesion: 0.14
Nodes (32): Crows on MultiMesh, ground enemies from a KayKit pool, One fixed-order simulation tick, Game code in game/, prototype/ frozen (fork rule), One GameConfig resource, Horde survival prototype — coding-agent implementation plan, Centralized simulation with reusable storage, Prototype implementation milestones and gates, Pool reuse rules (no hot-path allocation) (+24 more)
Nodes (30): Crows on MultiMesh, ground enemies from a KayKit pool, One fixed-order simulation tick, Game code in game/, prototype/ frozen (fork rule), One GameConfig resource, Horde survival prototype — coding-agent implementation plan, Centralized simulation with reusable storage, Prototype implementation milestones and gates, Pool reuse rules (no hot-path allocation) (+22 more)
### Community 7 - "Co-op Lobby & Smoke Test"
Cohesion: 0.15
Nodes (34): CoopLobby, _begin(), failed (signal), has_online_keys(), host(), host_addresses(), join(), join_address() (+26 more)
Cohesion: 0.17
Nodes (29): GDSync (GD-Sync plugin autoload), CoopLobby, _begin(), failed (signal), has_online_keys(), host(), host_addresses(), join() (+21 more)
### Community 8 - "Scarecrow Defender & Fear"
Cohesion: 0.07
Nodes (53): Fear ability (6 m burst, 2 s flee, 12 s cooldown), The scarecrow (player defender), Step 4: Establish the scarecrow's defensive tools, pressed(), add_partner(), set_local(), FollowCamera, _apply() (+45 more)
Nodes (49): The scarecrow (player defender), pressed(), PlayerCharacter, can_sprint(), die(), _follow_net(), _move_direction(), _physics_process() (+41 more)
### Community 9 - "Loot & Theft Events"
Cohesion: 0.16
Nodes (25): place(), record_event(), LootSystem, animal_home(), animal_strays(), claim(), drop(), _empty_sack() (+17 more)
Cohesion: 0.20
Nodes (20): record_event(), LootSystem, animal_home(), animal_strays(), claim(), drop(), _empty_sack(), escape() (+12 more)
### Community 10 - "Settings, Input & UI Theme"
Cohesion: 0.12
Nodes (26): Menus, pause, and settings (user://settings.cfg), GameSettings, apply(), load_from(), save_to(), _on_settings_changed(), _open_settings(), _remember_name() (+18 more)
Cohesion: 0.16
Nodes (20): Menus, pause, and settings (user://settings.cfg), GameSettings, apply(), load_from(), save_to(), _on_settings_changed(), _open_settings(), SettingsMenu (+12 more)
### Community 11 - "Main Scene & Title Menu"
Cohesion: 0.33
Nodes (9): _ask_new_vacation(), continue_vacation(), _host_coop(), open(), new_vacation(), show_main_menu(), Loaded, read() (+1 more)
Cohesion: 0.29
Nodes (10): _ask_new_vacation(), continue_vacation(), _host_coop(), open(), new_vacation(), _remember_name(), show_main_menu(), Loaded (+2 more)
### Community 12 - "Farm Zones & Layout Tests"
Cohesion: 0.07
Nodes (60): Harvest Season — farm layout, Crop Field zone, Crop units (30 row segments in 6 plots), The farm's edge (random enemy arrivals and carrier escapes), Farm zones (FarmZone rectangles under Zones/), Farmers' return route and staging points, Fence gaps (GapNorth, GapDriveway, GapEast), Gather points (GatherNode) (+52 more)
Cohesion: 0.23
Nodes (21): CropUnit, FarmMarker, FarmZone, contains(), rect(), FarmZones, edge(), edge_point() (+13 more)
### Community 13 - "Enemy System & Theft Tests"
Cohesion: 0.17
Nodes (14): clear(), release(), EnemySystem, apply_hit_handle(), clear(), commit_removals(), enemy_removed (signal), _load_types() (+6 more)
Cohesion: 0.11
Nodes (29): EnemyCharacters, acquire(), _animate(), clear(), hit(), _process(), release(), EnemySystem (+21 more)
### Community 14 - "Co-op Session Host/Client"
Cohesion: 0.17
Nodes (26): reader(), CoopSession, _apply_avatar(), _apply_event(), _apply_foes(), _apply_snap(), _apply_state(), _client_message() (+18 more)
Cohesion: 0.15
Nodes (28): CoopSession, _apply_event(), _apply_foes(), _apply_state(), _client_message(), _do_request(), _due_foes(), ended (signal) (+20 more)
### Community 15 - "Rules of the Vacation"
Cohesion: 0.05
Nodes (54): KayKit Character Animations license (CC0), KayKit: Character Animations 1.1 (Kay Lousberg), Prototype Kit license (CC0, Rgsdev), Prototype Kit (Raphael Gonçalves / Rgsdev), MultiMesh batching for birds and bullets, Simulation tick profile at 2,000 birds (steering, motion+collision, flow-field slice, grid), GDScript simulation is the bottleneck, not rendering, Co-op fall rule (out until morning; Game Over only when both are down) (+46 more)
Cohesion: 0.13
Nodes (25): Co-op fall rule (out until morning; Game Over only when both are down), Animal Pen zone, Finding: automated defense may be too strong for 6 scrap, Finding: a broken pen gate is the costliest event, Finding: the fence breaker can end a run by itself, Hallway test (the exit gate), Harvest Season — rules of the vacation, Animals and the pen (open pen, loose animals, leading home) (+17 more)
### Community 16 - "Game Flow, Save & Pause"
Cohesion: 0.31
Nodes (18): ConfirmBox, close(), _yes(), Main, SaveGame, check(), _audio(), _continue_and_new() (+10 more)
Cohesion: 0.29
Nodes (15): ConfirmBox, close(), _yes(), Main, _audio(), _continue_and_new(), _coop_quit_to_menu(), _failure() (+7 more)
### Community 17 - "Farm Navigation Flow Fields"
Cohesion: 0.07
Nodes (64): Alerts (labeled edge arrows, priority, grouping), AlertManager, _alert(), _arrow(), cap(), collect(), _draw(), _escalation() (+56 more)
### Community 18 - "Resource Economy & Upgrades"
Cohesion: 0.13
Nodes (22): Ground thief (enemy), Day/night lighting and lantern, DayNight, add_lantern(), _apply(), _mix(), _process(), setup() (+14 more)
Cohesion: 0.33
Nodes (10): Day/night lighting and lantern, DayNight, add_lantern(), _apply(), _mix(), _process(), setup(), snap() (+2 more)
### Community 19 - "Animal System"
Cohesion: 0.13
Nodes (22): Animal Pen zone, Finding: a broken pen gate is the costliest event, Animals and the pen (open pen, loose animals, leading home), Thief (enemy type), AnimalSystem, _apply_visuals(), _follow(), _move() (+14 more)
Cohesion: 0.15
Nodes (21): AnimalSystem, _apply_visuals(), find_animals(), _follow(), _move(), place(), position(), _record_trail() (+13 more)
### Community 20 - "Test Runner & Farm Targets"
Cohesion: 0.16
Nodes (16): ActionEdges, note(), BuildHud, _process(), BuildMode, dismantled (signal), message (signal), refused (signal) (+8 more)
Cohesion: 0.21
Nodes (13): ActionEdges, BuildHud, _process(), BuildMode, dismantled (signal), message (signal), refused (signal), set_active() (+5 more)
### Community 21 - "Co-op Docs & GD-Sync Link"
Cohesion: 0.15
Nodes (13): Host-authoritative simulation with partner replica (FarmSim.replica), Partner panel, name tags, and edge arrow, Avatar, CoopHud, _draw(), _measure_ping(), _process(), setup() (+5 more)
Cohesion: 0.10
Nodes (25): Harvest Season — co-op, GD-Sync API keys (keys.cfg), GD-Sync data allowance budget (22 MB per vacation, ~12 KB/s), Unreliable message size limit (under 1,100 bytes; GD-Sync splits at 1,200), Dead reckoning for enemies (25 cm error threshold), Harvest Season patches to GD-Sync (4), Host-authoritative simulation with partner replica (FarmSim.replica), LAN join by address (+17 more)
### Community 22 - "Enemy Roster & Construction Plan"
Cohesion: 0.15
Nodes (17): Alert priorities, grouping, and cap, Automated defense (buildable), Crow (enemy), Enemy type table (GameConfig.enemy_types), Fence (buildable), Fence breaker (enemy), Flying rule (fences, gates, traps ignore flyers), Gameplay is 2-D on the XZ plane (+9 more)
Cohesion: 0.23
Nodes (12): Automated defense (buildable), Crow (enemy), Fence (buildable), Fence breaker (enemy), Flying rule (fences, gates, traps ignore flyers), Gameplay is 2-D on the XZ plane, Gate (buildable), Slowing trap (buildable) (+4 more)
### Community 23 - "Playtest Notes & Scaling"
Cohesion: 0.19
Nodes (13): of(), campaign_ended (signal), new_campaign(), EndPanel, hide_panel(), menu_requested (signal), _on_ended(), _process() (+5 more)
Cohesion: 0.15
Nodes (19): Harvest Season — farm layout, Crop Field zone, Crop units (30 row segments in 6 plots), The farm's edge (random enemy arrivals and carrier escapes), Farm zones (FarmZone rectangles under Zones/), Farmers' return route and staging points, Fence gaps (GapNorth, GapDriveway, GapEast), Gather points (GatherNode) (+11 more)
### Community 24 - "Farm Sim Setup Wiring"
Cohesion: 0.26
Nodes (17): stream_of(), FarmersReturn, _build_overlay(), clear(), _finish(), finished (signal), _follow_camera(), _frame_yard() (+9 more)
Cohesion: 0.07
Nodes (55): enemies_line(), materials_line(), begin_day(), phase_changed (signal), EndPanel, hide_panel(), menu_requested (signal), _on_ended() (+47 more)
### Community 25 - "Co-op Link Transport"
Cohesion: 0.16
Nodes (20): CoopLink, close(), _deliver(), get_angle(), get_cm(), get_text(), get_time(), get_v3() (+12 more)
Cohesion: 0.10
Nodes (38): CoopLink, close(), _deliver(), get_angle(), get_cm(), get_text(), get_time(), get_v3() (+30 more)
### Community 26 - "Thief Behavior AI"
Cohesion: 0.11
Nodes (21): Step 10: The five-night progression, Step 10: Build the five-night progression, FarmState, asset_counts(), create(), from_dict(), is_valid(), log_night() (+13 more)
Cohesion: 0.67
Nodes (3): settle_supplies(), available(), shed_total()
### Community 27 - "Soak Night & Benchmarks"
Cohesion: 0.24
Nodes (16): Labeled stress benchmark presets (25–2,000 birds, compact/enlarged layouts), run(), run_benchmarks.sh script, Scripted scarecrow bot (soak_night, perfect aim), _attack(), _build_tick(), _cycles(), _gather_day() (+8 more)
### Community 28 - "Co-op Tests"
Cohesion: 0.27
Nodes (10): GDSync (GD-Sync plugin autoload), net_receive(), set_microphone(), start_voice(), GDSyncLink, _on_joined(), _on_partner_arrived(), pause() (+2 more)
Cohesion: 0.16
Nodes (17): Human playtest exit gates (still open), Scripted soak runs (soak_night.gd), Harvest Season — playtest notes, Finding: the day may be long once everything is gathered (106 of 180 s), User feedback: "extraordinarily easy" → 30-day scale pass, 5x enemies scale pass (up to 160 enemies; FarmSim.step 0.45 ms avg), Finding: materials pile up (straw has almost no use), Night 2 is the cliff (112 enemies, ~10x night 1) (+9 more)
### Community 29 - "Player Character Movement"
Cohesion: 0.21
Nodes (15): _process(), pay(), structure(), show_state(), _process(), describe(), pay(), built (signal) (+7 more)
### Community 30 - "Farm Layout Doc"
Cohesion: 0.27
Nodes (10): Shed stock piles (ShedStock), Supply theft and shed stock rules, _claim_home(), most_stocked(), ShedStock, _process(), props_for(), refresh() (+2 more)
Cohesion: 0.21
Nodes (12): Pen gate breach (gate as start structure), Supply bundles (sacks from the most-stocked material), Step 8: Expand to all three farm targets, Three farm targets: crops, animals, supplies, _claim_home(), most_stocked(), ShedStock, _process() (+4 more)
### Community 31 - "Co-op Voice Chat"
Cohesion: 0.29
Nodes (11): CoopVoice, decode(), encode(), _encode_next(), feed(), _gate(), loud_parts(), make() (+3 more)
Cohesion: 0.18
Nodes (17): net_receive(), set_microphone(), start_voice(), CoopVoice, decode(), encode(), _encode_next(), feed() (+9 more)
### Community 32 - "FarmSim Tick & Camera"
Cohesion: 0.10
Nodes (19): 1. With losses permanent, the density decides when the farm is empty, 2. Match the breakers to their pool, 3. Straw and Alien Goop pile up; wood runs out, Appendix: every night, per seed, Arrivals, the peak on the farm, and the tick, Character pools, Method, Not measured (+11 more)
### Community 33 - "Interactions & Gathering"
Cohesion: 0.50
Nodes (4): Farm occupancy grid with one flow field per goal set, Structures are expensive-to-cross cells, not walls, Deferred from version 1 (farming sim, multiplayer, tech trees), Prototype scope boundaries
Cohesion: 0.16
Nodes (16): pen_changed (signal), update_pen_open(), setup(), arrival_message(), _count_removal(), _ground_takes_crops(), _on_night_ending(), _ready() (+8 more)
### Community 34 - "Shed Stock & Supply Targets"
Cohesion: 0.33
Nodes (15): _crowd(), _enemies_match(), _fall_rule(), _join(), _leaving(), _night(), _partner_moves_and_gathers(), _partner_shoots() (+7 more)
Cohesion: 0.26
Nodes (21): set_local(), FollowCamera, _apply(), _process(), snap_to_target(), check(), _crowd(), _enemies_match() (+13 more)
### Community 35 - "ResourceStore"
Cohesion: 0.33
Nodes (13): GatherNode, ResourceHud, _process(), ResourceStore, Workbench, _deposit_and_night(), _gathering(), _layout() (+5 more)
Cohesion: 0.27
Nodes (15): to_dict(), GatherNode, ResourceHud, _process(), ResourceStore, to_dict(), Workbench, _deposit_and_night() (+7 more)
### Community 36 - "Farm Projectiles"
Cohesion: 0.16
Nodes (10): _release_slot(), sweep_hit(), FarmProjectiles, fire(), hit (signal), _release(), _resolve_segment(), step() (+2 more)
Cohesion: 0.17
Nodes (9): _release_slot(), sweep_hit(), FarmProjectiles, fire(), hit (signal), _release(), _resolve_segment(), step() (+1 more)
### Community 37 - "Alert Manager"
Cohesion: 0.33
Nodes (9): _breaker_goals(), _start_field_rebuild(), blocks(), corners(), _distance_to_outline(), footprint(), layout_changed (signal), structure_near() (+1 more)
Cohesion: 0.21
Nodes (15): _breaker_goals(), _start_field_rebuild(), can_afford(), missing(), blocks(), corners(), _distance_to_outline(), footprint() (+7 more)
### Community 38 - "Net Budget Tool"
Cohesion: 0.31
Nodes (12): _kill_one(), MeterLink, _deliver(), _pump(), _report(), _run(), _setup(), WireModel (+4 more)
### Community 39 - "Enemy Roster Tests"
Cohesion: 0.15
Nodes (12): #23 [pop-ups] Remove the zone banner and the message feed, #24 [30] Nights by count, per-night enemy speed and HP, #25 [30] Arrivals wait for a free character, #26 [30] Upgrade tiers and timed shed stock, #27 [30] The thirty nights, #28 [30] Thirty-night soak, pool sizes, and a balance report, Decisions (the user's, 2026-10-06), Defaults (assumed; flip any of these on request) (+4 more)
Cohesion: 0.12
Nodes (15): #29 [intro] Cutscene kit and the loaded-up car, #30 [intro] Hooks: forced lighting, sounds, the chest glow, #31 [intro] Speakers and the three conversations, #32 [intro] The loading screen, #33 [intro] The opening intro, #34 [intro] Timing review with the user, Decisions (the user's, 2026-10-07), Defaults (assumed; flip any of these on request) (+7 more)
### Community 40 - "Co-op Menu UI"
Cohesion: 0.21
Nodes (22): CoopMenu, back_requested (signal), host_requested (signal), join_address_requested (signal), join_requested (signal), open(), _ready(), search_requested (signal) (+14 more)
Cohesion: 0.24
Nodes (15): setup(), _on_welcomed(), pause(), _ready(), restart_night(), resume(), _unhandled_input(), PauseMenu (+7 more)
### Community 41 - "Harvest Season — co-op"
Cohesion: 0.18
Nodes (14): Harvest Season — co-op, GD-Sync API keys (keys.cfg), GD-Sync data allowance budget (22 MB per vacation, ~12 KB/s), Unreliable message size limit (under 1,100 bytes; GD-Sync splits at 1,200), Dead reckoning for enemies (25 cm error threshold), Harvest Season patches to GD-Sync (4), LAN join by address, Same-network LAN play (GD-Sync local mode, peer to peer) (+6 more)
Cohesion: 0.15
Nodes (13): Alert priorities, grouping, and cap, D10: Ground enemies before Step 9, Enemy type table (GameConfig.enemy_types), Ground thief (enemy), Step 3: Make one farm asset stealable, Step 9: The first enemy roster, Thief states ENTER / SEEK / STEAL / CARRY / ESCAPED, Step 3: Make one farm asset stealable (+5 more)
### Community 42 - "Snapshot Decoding"
Cohesion: 0.15
Nodes (12): Alien overhaul — follow-ups (outside docs/tasks.md scope), Crop fields (#13), Docs sweep after renames/rebalances, Housekeeping, Loose animals (#12), Playtest after #11 (player-built pen), Post-overhaul fix batch (#16–#22, 2026-10-06), Spec items from the review with no task (+4 more)
### Community 43 - "Enemy Characters & Hits"
Cohesion: 0.38
Nodes (9): EDGE, _alerts(), _breakers(), _characters(), _crows(), run(), _scenarios(), _table() (+1 more)
Cohesion: 0.26
Nodes (13): Wave count and spacing scaling, Dusk warning (banner, hint, phase HUD list), Night plans (NightPlan groups: time, count, spacing, type, target), NightPlan, count_scale_in(), problems(), scaled_count(), scaled_every() (+5 more)
### Community 44 - "send"
Cohesion: 0.22
Nodes (14): put_angle(), put_cm(), put_text(), put_time(), put_v3(), send(), _close_menu_if_needed(), _host_tick() (+6 more)
Cohesion: 0.33
Nodes (10): PhaseHud, join_words(), on_the_farm(), _dawn_and_morning(), _day(), _dusk(), _morning(), _night() (+2 more)
### Community 45 - "Interactions"
Cohesion: 0.27
Nodes (14): Interactions, _blocker(), cancel(), charges(), deposited (signal), _finish_gather(), gathered (signal), message (signal) (+6 more)
### Community 46 - "Upgrades"
Cohesion: 0.24
Nodes (14): can_afford(), missing(), _overlap(), _overlaps_rect(), trap_slow_time(), validate(), _world_blocked(), Upgrades (+6 more)
Cohesion: 0.23
Nodes (16): start_channel(), trap_slow_time(), UpgradePanel, bought (signal), _buy(), message (signal), open(), refresh() (+8 more)
### Community 47 - "Prop Collision Builder"
Cohesion: 0.31
@ -370,24 +371,24 @@ Cohesion: 0.18
Nodes (12): Performance report (prototype horde benchmarks), First shot / first hit stutter check (no first-use stutter), Largest tested passing population: 2,000 birds, 10-minute headless 1,000-bird recycle soak (flat memory), Start-up hitches (10–36 ms frames in the first second), VSync-on ~1 s stalls (compositor throttling of hidden windows), Headless tooling constraints (editor closed, restore UIDs), Performance measurement goals (p95 <= 16.67 ms) (+4 more)
### Community 49 - "test_weapons.gd"
Cohesion: 0.29
Nodes (12): WeaponModels, _add(), mesh_of(), _bombs(), _hud(), _offhand(), _pitchfork(), run() (+4 more)
Cohesion: 0.18
Nodes (11): MultiMesh batching for birds and bullets, Simulation tick profile at 2,000 birds (steering, motion+collision, flow-field slice, grid), GDScript simulation is the bottleneck, not rendering, Farm draw-call reduction (1,270 → 304 at start), Navigation occupancy grid (0.5 m cells, octile Dijkstra distance fields), Travel times and the 12 s rule, Finding: night 1 alone is not a threat once anything is defended, Two-front pressure (main playtest question) (+3 more)
### Community 50 - "GameConfig"
Cohesion: 0.38
Nodes (11): Assessment, GameConfig, _assessment(), _autosave(), _bad_saves(), busy_state(), _migration(), _round_trip() (+3 more)
Nodes (11): CoopMenu, back_requested (signal), host_requested (signal), join_address_requested (signal), join_requested (signal), open(), _ready(), search_requested (signal) (+3 more)
### Community 51 - "Co-op Send Path"
Cohesion: 0.29
Nodes (6): Decisions (resolved), Harvest Season — alien overhaul: review, decisions, and task plan, Headline finding from the review, Open assumptions (flagged, not yet confirmed), Suggested starting order, Task breakdown (mirrors Task tool `#1`–`#15`)
### Community 52 - "Pause Menu Signals"
Cohesion: 0.24
Nodes (10): Prototype Kit texture (8x8 RGB color palette swatch atlas for flat-shaded prototype pieces), PumpkinBomb_texture (11x11 Material-style color palette swatch grid for PumpkinBomb.glb), PumpkinBombs, _burst(), burst (signal), _flash(), _new_mesh(), step() (+2 more)
Cohesion: 0.28
Nodes (9): KayKit Character Animations license (CC0), KayKit: Character Animations 1.1 (Kay Lousberg), Prototype Kit license (CC0, Rgsdev), Prototype Kit (Raphael Gonçalves / Rgsdev), Prototype asset inventory (Godot 4.7.2 dump), Bird_01.obj bird mesh (1 surface, 386 tris), KayKit Mannequin_Medium character (21-bone Rig_Medium skeleton), Prototype Kit FBX pieces (walls, fences, doors, stairs, primitives) (+1 more)
### Community 53 - "Tutorial"
Cohesion: 0.29
Nodes (12): phase_changed (signal), _on_phase_changed(), setup(), Tutorial, _check_done(), _enemies_near(), _finish(), _on_phase() (+4 more)
Cohesion: 0.44
Nodes (9): Tutorial, _check_done(), _enemies_near(), _finish(), _on_phase(), _process(), setup(), _show() (+1 more)
### Community 54 - "GD-Sync Sync Icons"
Cohesion: 0.50
@ -398,20 +399,20 @@ Cohesion: 0.40
Nodes (5): Leaf_Pine_C solid dark-green pine foliage silhouette, Leaf_Pine white alpha silhouette of a pine foliage cluster, Leaves_GiantPine_C solid green rounded foliage blob shapes, Leaves sprite sheet with colorful painted leaf shapes, ferns, clovers, Leaves_NormalTree white alpha silhouettes of normal tree leaf clusters
### Community 56 - "Campaign Experience (Step 11)"
Cohesion: 0.12
Nodes (21): First complete version — five-night vacation build steps, Farmers' return ending, Five-night farm vacation (core loop), D1: Starting the night early (allow_early_night, off by default), M3 First loop (first major milestone), Step 11: The complete campaign experience, Step 1: Rules of the vacation, Step 2: Organize the map into a playable farm (+13 more)
Cohesion: 0.09
Nodes (27): First complete version — five-night vacation build steps, Farmers' return ending, Five-night farm vacation (core loop), D1: Starting the night early (allow_early_night, off by default), D9: Retry from the failed night's morning, Farm occupancy grid with one flow field per goal set, M3 First loop (first major milestone), One authoritative FarmState (+19 more)
### Community 57 - "Overview Render Tool"
Cohesion: 0.43
Nodes (8): start_channel(), UpgradePanel, bought (signal), _buy(), message (signal), open(), refresh(), setup()
Nodes (7): can_start_night_early(), start_night_early(), CampaignDebug, cycle_scenario(), _describe(), _unhandled_input(), _process()
### Community 58 - "Prototype Round Lifecycle"
Cohesion: 0.42
Nodes (10): lose_crops(), make_campaign(), run_phase(), run_until(), _early_night(), _five_nights(), _night_log(), _order_and_timers() (+2 more)
Cohesion: 0.33
Nodes (6): _on_phase_changed(), is_inside_fence(), outline_material(), setup(), sync_from_state(), update_visuals()
### Community 59 - "Grid Design & Scope Limits"
Cohesion: 0.24
Nodes (17): GameTestRunner, _initialize(), _main(), SKY, _animal_theft(), _breach(), _bundle_limits(), _fallback() (+9 more)
Cohesion: 0.29
Nodes (12): _animal_theft(), _breach(), _bundle_limits(), _fallback(), _hud(), _layout(), _leading(), _pen_by_day() (+4 more)
### Community 60 - "GD-Sync Physics/Voice Icons"
Cohesion: 0.67
@ -434,35 +435,39 @@ Cohesion: 0.67
Nodes (3): PathRocks_Diffuse (mossy grey stepping-stone UV atlas diffuse, Pebble_* / RockPath_* models), Rocks_Desert_Diffuse (sandstone/ochre recolor of rock UV atlas, 2048px, unreferenced by any gltf), Rocks_Diffuse (mossy grey-green rock UV atlas diffuse, 2048px, Rock_Medium_1-3)
### Community 80 - "Alien overhaul — task list"
Cohesion: 0.18
Nodes (10): Alien overhaul — task list, Dependent, Independent, Post-overhaul fix batch (2026-10-06), Thirty nights — task list (2026-10-06), Wave 1, Wave 1, Wave 2 (+2 more)
Cohesion: 0.13
Nodes (14): Alien overhaul — task list, Dependent, Independent, Opening intro — task list (2026-10-07), Post-overhaul fix batch (2026-10-06), Thirty nights — task list (2026-10-06), Wave 1, Wave 1 (+6 more)
### Community 81 - "test_theft.gd"
Cohesion: 0.42
Nodes (10): _combat_input(), _consistent(), _escape(), _night_arrivals(), _retry(), run(), _shots(), _stale_handles() (+2 more)
Cohesion: 0.53
Nodes (5): UiTheme, build(), check_icon(), _initialize(), Settings (settings.cfg) and UI theme
### Community 84 - "equip"
Cohesion: 0.27
Nodes (10): cycle(), equip(), _set_offhand(), setup(), show_weapon(), switched (signal), tick(), setup() (+2 more)
Cohesion: 0.60
Nodes (5): _designs(), _five_nights(), run(), _upgrades(), _validation()
### Community 85 - "stop"
Cohesion: 0.29
Nodes (8): ended (signal), partner_left (signal), stop(), _leave_as_partner(), _on_other_left(), _on_session_ended(), quit_game(), to_menu()
Cohesion: 0.33
Nodes (9): leave(), _leave_as_partner(), _on_session_ended(), to_menu(), _check(), _finish(), _initialize(), _run() (+1 more)
### Community 86 - "MainMenu"
Cohesion: 0.52
Nodes (7): MainMenu, continue_requested (signal), coop_requested (signal), new_requested (signal), quit_requested (signal), _ready(), settings_requested (signal)
### Community 87 - "step"
Cohesion: 0.50
Nodes (5): _finish_field_rebuild(), step(), _step_replica(), _update_hunt(), can_shoot()
Cohesion: 0.33
Nodes (9): FarmSim, _finish_field_rebuild(), spawn_enemy(), spawn_thief(), step(), _step_replica(), _unhandled_input(), _update_hunt() (+1 more)
### Community 88 - "render_overview.gd"
Cohesion: 0.70
Nodes (4): _draw_grid(), _draw_zones(), _initialize(), _render()
## Ambiguous Edges - Review These
- `KayKit Rig_Medium animation libraries (CombatMelee, CombatRanged, General, Movement, Simulation, Special, Tools)` → `Final assessment (weighted share kept, 0–100 points, ratings)` [AMBIGUOUS]
game/RULES.md · relation: conceptually_related_to
## Knowledge Gaps
- **102 isolated node(s):** `Headline finding from the review`, `Decisions (resolved)`, `Open assumptions (flagged, not yet confirmed)`, `Task breakdown (mirrors Task tool `#1`–`#15`)`, `Suggested starting order` (+97 more)
- **108 isolated node(s):** `Headline finding from the review`, `Decisions (resolved)`, `Open assumptions (flagged, not yet confirmed)`, `Task breakdown (mirrors Task tool `#1`–`#15`)`, `Suggested starting order` (+103 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **14 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
@ -471,12 +476,12 @@ _Questions this graph is uniquely positioned to answer:_
- **What is the exact relationship between `KayKit Rig_Medium animation libraries (CombatMelee, CombatRanged, General, Movement, Simulation, Special, Tools)` and `Final assessment (weighted share kept, 0–100 points, ratings)`?**
_Edge tagged AMBIGUOUS (relation: conceptually_related_to) - confidence is low._
- **Why does `CampaignController` connect `Campaign Controller & Farm State` to `Structures & Build Mode`, `Audio & Farmers Return Ending`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `First Game Plan & Milestones`, `Horde Prototype (README)`, `Co-op Lobby & Smoke Test`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Resource Economy & Upgrades`, `Animal System`, `Test Runner & Farm Targets`, `Playtest Notes & Scaling`, `Farm Sim Setup Wiring`, `Thief Behavior AI`, `Soak Night & Benchmarks`, `Farm Layout Doc`, `Shed Stock & Supply Targets`, `ResourceStore`, `Net Budget Tool`, `Co-op Menu UI`, `Enemy Characters & Hits`, `Interactions`, `Upgrades`, `GameConfig`, `Tutorial`, `Overview Render Tool`, `Prototype Round Lifecycle`, `Grid Design & Scope Limits`, `test_theft.gd`, `step`?**
_High betweenness centrality (0.119) - this node is a cross-community bridge._
- **Why does `CoopSession` connect `Co-op Session Host/Client` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `Co-op Lobby & Smoke Test`, `Enemy System & Theft Tests`, `Game Flow, Save & Pause`, `Co-op Docs & GD-Sync Link`, `Co-op Link Transport`, `Thief Behavior AI`, `Co-op Tests`, `Co-op Voice Chat`, `Shed Stock & Supply Targets`, `ResourceStore`, `Net Budget Tool`, `Harvest Season — co-op`, `send`, `Upgrades`, `stop`?**
_High betweenness centrality (0.116) - this node is a cross-community bridge._
- **Why does `FarmSim` connect `Waves, Night Plans & Review` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Audio & Farmers Return Ending`, `Scarecrow Weapons & Bombs`, `Horde Prototype (README)`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Enemy System & Theft Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Resource Economy & Upgrades`, `Animal System`, `Test Runner & Farm Targets`, `Co-op Docs & GD-Sync Link`, `Playtest Notes & Scaling`, `Farm Sim Setup Wiring`, `Soak Night & Benchmarks`, `Farm Layout Doc`, `Shed Stock & Supply Targets`, `ResourceStore`, `Farm Projectiles`, `Alert Manager`, `Net Budget Tool`, `Enemy Characters & Hits`, `Interactions`, `test_weapons.gd`, `GameConfig`, `Pause Menu Signals`, `Tutorial`, `Overview Render Tool`, `Grid Design & Scope Limits`, `test_theft.gd`, `step`?**
_High betweenness centrality (0.113) - this node is a cross-community bridge._
- **Why does `FarmSim` connect `step` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `Horde Prototype (README)`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Farm Zones & Layout Tests`, `Enemy System & Theft Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Resource Economy & Upgrades`, `Animal System`, `Test Runner & Farm Targets`, `Co-op Docs & GD-Sync Link`, `Farm Sim Setup Wiring`, `Soak Night & Benchmarks`, `Co-op Tests`, `Farm Layout Doc`, `Interactions & Gathering`, `Shed Stock & Supply Targets`, `ResourceStore`, `Farm Projectiles`, `Alert Manager`, `Net Budget Tool`, `Enemy Characters & Hits`, `send`, `Interactions`, `Upgrades`, `Tutorial`, `Overview Render Tool`, `Prototype Round Lifecycle`, `Grid Design & Scope Limits`, `equip`?**
_High betweenness centrality (0.124) - this node is a cross-community bridge._
- **Why does `CoopSession` connect `Co-op Session Host/Client` to `Campaign Controller & Farm State`, `Structures & Build Mode`, `Shed Stock & Supply Targets`, `ResourceStore`, `Scarecrow Weapons & Bombs`, `Net Budget Tool`, `Co-op Lobby & Smoke Test`, `Enemy System & Theft Tests`, `Upgrades`, `Game Flow, Save & Pause`, `Co-op Docs & GD-Sync Link`, `stop`, `step`, `Co-op Link Transport`, `Co-op Voice Chat`?**
_High betweenness centrality (0.121) - this node is a cross-community bridge._
- **Why does `CampaignController` connect `Campaign Controller & Farm State` to `Structures & Build Mode`, `Scarecrow Weapons & Bombs`, `Waves, Night Plans & Review`, `First Game Plan & Milestones`, `Horde Prototype (README)`, `Scarecrow Defender & Fear`, `Loot & Theft Events`, `Enemy System & Theft Tests`, `Co-op Session Host/Client`, `Rules of the Vacation`, `Game Flow, Save & Pause`, `Farm Navigation Flow Fields`, `Resource Economy & Upgrades`, `Animal System`, `Test Runner & Farm Targets`, `Farm Sim Setup Wiring`, `Soak Night & Benchmarks`, `Farm Layout Doc`, `Interactions & Gathering`, `Shed Stock & Supply Targets`, `ResourceStore`, `Alert Manager`, `Net Budget Tool`, `Co-op Menu UI`, `send`, `Interactions`, `Upgrades`, `Tutorial`, `Overview Render Tool`, `Grid Design & Scope Limits`, `equip`, `stop`, `step`?**
_High betweenness centrality (0.109) - this node is a cross-community bridge._
- **Are the 12 inferred relationships involving `CampaignController` (e.g. with `Outcome evaluator check_outcome` and `_night_log()`) actually correct?**
_`CampaignController` has 12 INFERRED edges - model-reasoned connections that need verification._
- **Are the 13 inferred relationships involving `EnemySystem` (e.g. with `AlertManager` and `_describe()`) actually correct?**

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1 @@
1791422454.3396769
1791995186.2451305

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -985,13 +985,13 @@
"semantic_hash": ""
},
"docs/tasks.md": {
"mtime": 1791323984.9837573,
"ast_hash": "2fa7e460c3b9cc5e4f9d7ad5eec76b23",
"mtime": 1791423030.0118597,
"ast_hash": "f81b9de7a63b3a25fb7c05067678c8c5",
"semantic_hash": ""
},
"docs/plan.md": {
"mtime": 1791316305.8515518,
"ast_hash": "1ca49ccee829e9970c98abd1a2c68a7d",
"mtime": 1791423014.9100025,
"ast_hash": "6c5a4e9916b50908cf01fb2ff2f562dd",
"semantic_hash": ""
},
"assets/audio/synth/alien_beam.wav": {
@ -1023,5 +1023,35 @@
"mtime": 1791395446.9523106,
"ast_hash": "4296651d924c855564f2252183430b3e",
"semantic_hash": ""
},
"assets/audio/synth/car_door.wav": {
"mtime": 1791424300.3959036,
"ast_hash": "ea3f5ac3cd5d79a41b9cf7efca321679",
"semantic_hash": ""
},
"assets/audio/synth/life_flash.wav": {
"mtime": 1791424300.3960261,
"ast_hash": "742c98cd634ee578aa71644b6e30d5e9",
"semantic_hash": ""
},
"assets/audio/synth/part_fall.wav": {
"mtime": 1791424300.3962376,
"ast_hash": "bba04eab145542bdaa176a27f35ab122",
"semantic_hash": ""
},
"assets/audio/synth/ufo_hum.wav": {
"mtime": 1791424300.3964493,
"ast_hash": "2341eaec50106406801f1b7e04fa9b06",
"semantic_hash": ""
},
"assets/audio/synth/ufo_whine.wav": {
"mtime": 1791424300.3969135,
"ast_hash": "cb7030a1d7ccc3f2bc294146e803b40c",
"semantic_hash": ""
},
"assets/audio/synth/ufo_zoom.wav": {
"mtime": 1791424300.3971803,
"ast_hash": "4242d924dce602de54347fa504488522",
"semantic_hash": ""
}
}