Loose animals now roam the whole playable map, day and night. Each walk goes to a goal 4-8 m away that is walkable, in a clear straight line, at least 2 m inside FarmZones.playable (passed into AnimalSystem.setup), and neither inside the pen nor across it. Every morning a loose animal is back at its loose spot (no save change). Animals no longer escape on their own: - _stray and LootSystem.animal_escaped are gone. - A new LootSystem.animal_loose makes an animal LOOSE where it stands and unpens it. It covers a carrier killed or scared (drop), a broken follow leash, and an animal getting out of an open pen (animal_strays, which still records animals_strayed). - An animal dropped inside the pen is home again. - An animal let out of an open pen walks out along the escape field, then roams. If the pen shuts first, it stays home. - return_dropped still pens followers at dawn's end, but leaves loose animals loose. - The only loss paths left are a carrier leaving the farm (thief escape, or removal with reason LEFT). Loose spots at x = -12 move inward to (6|9|12, 0.5). The toast, review-panel, dropped-animal toast, RULES.md and header text no longer promise animals wander off or run for the edge. test_targets: _loose_start has a 90 s day + 90 s night roam run (every animal >4 m, never off the map or into the pen, none lost), a morning reset to the spots, a killed carrier leaving the animal loose, and an unopposed thief carrying one off. _animal_theft, _leading, _breach and _make_loose follow the new rules. AWAY moves off the map so roaming animals can't start following the parked scarecrow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
541 lines
34 KiB
Markdown
541 lines
34 KiB
Markdown
# Harvest Season — rules of the vacation
|
||
|
||
The rule set every other system follows. Decision numbers (D1–D10) refer to
|
||
`first-game-plan.md`, section 2. Every number is a starting value in
|
||
`res://game/resources/game_config.tres` (`GameConfig`) and gets tuned during balancing.
|
||
|
||
Enforced in code: phases, timers, outcomes, loss records, and the retry snapshot
|
||
(`CampaignController`, `FarmState`); theft and recovery of crops, animals, and supplies, the
|
||
sunrise retreat, and the end of the dawn grace (`FarmSim`, `ThiefBehavior`, `LootSystem`,
|
||
`AnimalSystem`, `ShedStock`; Steps 3 and 8); the scarecrow, gathering, and building (Steps 4–6);
|
||
the night plans, dusk warnings, morning review, and lighting (Step 7: `WaveDirector`,
|
||
`ReviewPanel`, `PhaseHud`, `DayNight`); the enemy roster and the alerts (Step 9: `EnemySystem`,
|
||
`ThiefBehavior`, `EnemyCharacters`, `AlertManager`); the five nights and the upgrades (Step 10:
|
||
`NightPlan`, `Upgrades`, `UpgradePanel`); the menus, saving, settings, results, endings, tips, and
|
||
sound (Step 11: `Main`, `SaveGame`, `GameSettings`, `ReviewPanel`, `EndPanel`, `Assessment`,
|
||
`FarmersReturn`, `Tutorial`, `FarmAudio`). Rules for later steps are written here first and
|
||
marked with the step that implements them.
|
||
|
||
## The vacation
|
||
|
||
- The farmers are away for **five nights**. The scarecrow protects the farm until they return.
|
||
- Each night is one cycle: **Morning → Day → Dusk → Night → Dawn**. After the fifth dawn the
|
||
farmers return, which ends the game, and the farm is assessed on what remains.
|
||
- Losses carry over. Stolen crops don't regrow, lost animals don't come back, and stolen supplies
|
||
are gone. Damaged structures stay damaged until repaired.
|
||
|
||
## Phases
|
||
|
||
| Phase | Length | What happens | Enforced |
|
||
|---|---|---|---|
|
||
| Morning | Untimed | The morning screen: last night's results (taken, recovered, and lost per category; enemies defeated; damage; materials gathered and spent); what's left; what needs repair (and whether the pen is open); materials; tonight. Autosaved. The day starts when the player presses "Start the day". | Now |
|
||
| Day | 180 s | Safe. Gather, build, repair, upgrade. | Now (timer) |
|
||
| Dusk | 30 s | Still safe. The banner names tonight ("Dusk: Breakers at the fences"), with tonight's hint under it. The phase HUD lists what tonight brings ("Tonight, from every side: crows and supply thieves"), not where: they arrive anywhere along the farm's edge. Nothing is marked on the farm itself. Last chance to prepare. | Now |
|
||
| Night | 150 s (the last night 180 s) | Enemies attack to steal farm assets or damage defenses. They arrive as the night's plan says (below). The HUD list and the hint stay up for the first 12 s of the night. | Now |
|
||
| Dawn | 20 s | Sunrise: no more enemies arrive and all of them retreat (D4). Carriers can still be stopped. Then remaining enemies leave, any still carrying loot take it with them (lost), and the night's losses are recorded. | Now |
|
||
|
||
**Night plans.** Each night has a plan (`NightPlan`, `game/resources/nights/`). A plan is a list of
|
||
groups of enemies. Each group has:
|
||
- an arrival time into the night, a count, and the spacing between them;
|
||
- the enemy type: thief, crow, or fence breaker (below);
|
||
- what they're after: crops, animals, supplies, or any of the type's targets.
|
||
|
||
**Where they arrive** isn't planned: every enemy comes in at its own random point along the farm's
|
||
edge, so a group spreads out all around the farm instead of filing in through one spot. Enemies on
|
||
foot arrive 3 m outside the map (`GameConfig.spawn_margin`), anywhere with a route onto the farm;
|
||
crows arrive 8 m out (`flyer_spawn_margin`). The south and west sides are open ground; on the north
|
||
and east, what's left of the old perimeter fence still stands, so enemies arriving behind it walk
|
||
in through its gaps (or around its ends).
|
||
|
||
A plan also has a title, a dusk hint, and optionally its own night length and scales (below).
|
||
Nothing arrives by day, at dusk, or after sunrise.
|
||
|
||
**The five nights** (Step 10). Each one tests something new. The plans are the nights' designs.
|
||
From night 2 on, every group plays at **7 times its size, about 3.3 times as often**
|
||
(`GameConfig.wave_count_scale` 7, `wave_spacing_scale` 0.3): each group's enemies come in a
|
||
stream twice as long, and the quiet stretches between groups are short. **Night 1 plays as
|
||
designed** (its plan's own `count_scale` and `spacing_scale` are 1): with only the pitchfork, it
|
||
is a few crows at a time to learn the stab on. The counts below are as played:
|
||
|
||
| Night | Title | What it tests | Who comes |
|
||
|---|---|---|---|
|
||
| 1 | Crows at the crops | Intercepting crop thieves | 11 crows: one at a time at first, then pairs, a group of three at 86 s |
|
||
| 2 | Thieves in the yard | Protecting a second target | 77 crows, plus 35 thieves after the shed and the pen |
|
||
| 3 | Breakers at the fences | Responding to damage and breaches | 14 fence breakers with 35 thieves behind them, 42 crows |
|
||
| 4 | From both sides | Dividing attention | 3 moments when two groups arrive at once: 77 crows, 42 thieves, 14 breakers |
|
||
| 5 | The last night | The whole farm layout | 3 announced waves over a 180 s night: 84 crows, 56 thieves, 21 breakers |
|
||
|
||
Up to 160 enemies can be on the farm at once (`enemy_capacity`): 48 thieves and 20 fence
|
||
breakers on foot (the character pool), and the rest in the air.
|
||
|
||
Every kind of enemy in tonight's plan shows up in the dusk warning in the phase HUD, so nothing
|
||
unannounced arrives (the last night's hint spells out its three waves). Nothing marks where they'll
|
||
arrive: anywhere along the edge. Debug scenarios (F2) replace tonight's plan for testing.
|
||
|
||
**Light.** Day is bright. Dusk turns to sunset, night falls over its first 8 s to moonlight, and
|
||
dawn brightens back to sunrise. At night the scarecrow carries a lantern and enemies glow
|
||
faintly, so the farm stays readable.
|
||
|
||
**Starting the night early (D1).** The player can skip the rest of the day or dusk straight to
|
||
the night, but only when `allow_early_night` is on. It is **off by default**.
|
||
|
||
**What's allowed when (D8).**
|
||
|
||
| Action | Day / Dusk | Night / Dawn | Enforced |
|
||
|---|---|---|---|
|
||
| Gather materials | Yes | No | Step 5 |
|
||
| Build new structures | Yes | No | Step 6 |
|
||
| Repair, dismantle, patch the scarecrow | Yes | Yes | Steps 4, 6 |
|
||
|
||
## Farm assets
|
||
|
||
Three kinds of asset can be stolen, and all three are in play from the start:
|
||
- **crops**: the crop field's 30 units;
|
||
- **animals**: the 8 animals (they start loose, outside the pen: see **Animals and the pen**);
|
||
- **supplies**: the construction materials stored in the supply shed (the pouch can't be stolen).
|
||
|
||
A kind with nothing in it at the start is not in play. The asset HUD (top center) shows what's
|
||
left of each, and a count flashes red when it drops and green when it rises.
|
||
|
||
### Theft lifecycle
|
||
|
||
| State | Meaning | Feedback |
|
||
|---|---|---|
|
||
| Targeted | An enemy is heading for the asset | Marker over it; arrow at the screen edge if off screen |
|
||
| Being stolen | The enemy is taking it, which takes visible time (crops 2.5 s, animals 2 s, a sack of supplies 3 s). Damage resets the timer. | Progress ring |
|
||
| Carried | The enemy is heading for the nearest escape point, slower than usual | The asset shown on the enemy, outlined in its category's color (crops gold, animals pink, supplies blue), with a badge |
|
||
| Dropped | The carrier was stopped | A crop or sack lies on the ground, glowing; an animal is loose where it fell (below) |
|
||
| Recovered | The scarecrow got it back | It returns home (an animal follows the scarecrow home) |
|
||
| Lost | The carrier escaped off the farm | Permanently gone |
|
||
|
||
- **Stopping a carrier (D5).** Killing a carrier drops its loot. Fear also makes carriers drop
|
||
their loot (`fear_drops_loot`).
|
||
- **Recovering (D6).** Crops and supplies: touch the dropped item and it goes straight home.
|
||
Animals: touch one and it follows the scarecrow (at most 3 at once) until it's back inside
|
||
the pen.
|
||
- Another thief can pick up a dropped item.
|
||
- Anything still on the ground when the dawn grace ends returns home automatically
|
||
(`loot_returns_at_dawn`). Loose animals stay loose.
|
||
- Nothing leaves the farm on its own: an animal that gets out of a breached pen is only loose, and
|
||
an item is lost only when its carrier escapes off the farm.
|
||
|
||
Implemented for all three (Steps 3 and 8). The arrows at the screen edge are filled by state
|
||
(orange targeted, red carried, yellow dropped) and ringed in the category's color.
|
||
|
||
How enemies steal (the enemy types are in **The enemies**, below):
|
||
- **Targets.** Each enemy takes only its type's categories: crows take crops; thieves take
|
||
animals and supplies.
|
||
- It comes for one of them (its night-plan group's), or any.
|
||
- A dropped item of those it can see within 12 m comes first (crows see 20 m from above).
|
||
- If nothing in its category is left at home, it goes for another of its own, picked by
|
||
`target_weights`.
|
||
- With nothing of its own left, it leaves.
|
||
- **Crops.** A crow claims a random unit still in its plot and flies straight to it, over
|
||
anything in the way. It lands on it, takes it (2 s), and flies straight off the farm with it, out its
|
||
nearest side. Only one enemy claims an item at a time.
|
||
- **Animals.** A thief claims a random animal, penned or loose. A shut pen keeps it out, so it
|
||
breaks its way in (a gate's 30 HP take about 18 s). It catches the animal, which freezes, in
|
||
2 s. It carries the animal off, held under it, at 70 % speed to the **nearest** point of the farm's edge.
|
||
- **Supplies.** A thief goes to the shed pile of the material the shed holds most of (logs,
|
||
crates, or hay bales; each pile has a spot in front).
|
||
- There it fills a sack (3 s) with up to 5 units of that material, never more than the shed has.
|
||
- If the shed has run out by then, it takes nothing and goes for something else.
|
||
- If its claim disappears (the scarecrow recovered it, or an animal followed the scarecrow
|
||
away), it claims another.
|
||
|
||
## The enemies
|
||
|
||
Implemented in Step 9. The type table is `GameConfig.enemy_types`.
|
||
|
||
| | Crow | Thief | Fence breaker |
|
||
|---|---|---|---|
|
||
| Moves | Flies at 5.5 m/s | Walks at 3 m/s | Walks at 1.9 m/s |
|
||
| HP (hits) | 1 | 3 | 6 |
|
||
| Goes for | Crops | Animals and supplies | Barriers guarding valuables |
|
||
| Structures | Flies over fences and gates; traps don't touch it | Routes around barriers, breaks through when it must (2 per hit) | Smashes them (8 per hit, every 1.5 s): a fence in 3 hits, a gate in 4 |
|
||
| The scarecrow | Never fights | Hits on contact (1 HP) | Turns on it within 4 m or when shot, and hunts it when nothing is left to break (2 HP per hit) |
|
||
| Best answer | Stab or shoot it (one hit), or automated defenses by the crops | Fences and gates to slow it, traps, defenses | Shoot it from range before it reaches you (or bomb it), and keep repairing what it smashes |
|
||
|
||
- **Crows** cruise at a visual altitude and come down to land on their crop. Altitude is only
|
||
visual: shots at combat height and automated defenses hit them anywhere.
|
||
- **Fence breakers** steal nothing. They walk to the nearest barrier within 6 m of the crop
|
||
field, the pen, or the shed, smash it, and go for the next. The pen's gate is always one of
|
||
those.
|
||
- Their breaches open the way for thieves, who walk through without stopping.
|
||
- With no guarding barriers left, they go for any barrier, then for the scarecrow.
|
||
- A breaker that comes within 4 m of the scarecrow, or is shot, turns on it. It gives up the
|
||
chase beyond 12 m while there's still something to break.
|
||
- **Fear** scares every type.
|
||
|
||
**Alerts.** Arrows at the screen edge point at whatever is happening off screen:
|
||
- Each arrow is labeled ("3 crows — Crop Field", "Thief escaping with an animal!", "Breach! —
|
||
Animal Pen"), filled by kind, and ringed in the loot's category color.
|
||
- **Kinds, in priority order:** escapes; breaches (a barrier being smashed, or just broken);
|
||
thefts; dropped loot (#21: loose animals roam freely and get no arrow).
|
||
- Alerts of the same kind, type, and loot in the same zone are grouped.
|
||
- An escape escalates as its carrier nears the exit: the arrow grows, pulses faster, and turns
|
||
red.
|
||
- At most 5 arrows show at once.
|
||
|
||
## Animals and the pen
|
||
|
||
Implemented in Step 8. Since #12 the animals start loose and the pen is player-built; since #21
|
||
they roam the whole farm and are never lost on their own.
|
||
|
||
- **Loose animals.** The 8 animals (4 chickens, 2 pigs, 2 sheep) start loose, each at its own spot
|
||
outside the pen (`animal_loose_spots`).
|
||
- They roam the whole farm, day and night. Each walk goes to a spot 4–8 m away that the animal
|
||
can reach in a straight line, inside the farm (at least 2 m in from its edge) and outside the
|
||
pen; then it stops to graze.
|
||
- Structures stop them, so a fence line can hold them.
|
||
- They never leave the farm on their own, and never walk into the pen by themselves.
|
||
- Each morning, every loose animal is back at its own spot.
|
||
- Any thief can claim a loose animal (penned or loose, it picks one at random).
|
||
- **The only way to lose an animal is a thief carrying it off the farm.**
|
||
- **Dropped animals.** When a thief carrying an animal is stopped (killed or scared), the animal
|
||
is loose where it fell and roams from there. If that's inside the pen, it's home again.
|
||
- **Leading animals home (D6).**
|
||
- Walk up to a loose animal and it follows the scarecrow, walking its trail in line, gates
|
||
included. At most 3 follow at once; a toast says so when the line is full.
|
||
- Inside the pen it's home (penned) and stays calm for 30 s (it won't get out of an open pen).
|
||
- A follower whose scarecrow gets more than 20 m away is loose where it stands.
|
||
- Thieves can't take an animal that's following the scarecrow.
|
||
- **In the pen.** Penned animals wander inside the pen and stop to graze, and each morning they're
|
||
back in the pen. The pen's fences and gate are player-built: the scarecrow (and animals
|
||
following it) walk through the gate, but wandering animals and enemies can't.
|
||
- **The pen is open** when there's a way out that crosses no structure: nothing built yet, or a
|
||
gate or fence broken or taken down.
|
||
- A toast says so when it happens, and so does the morning review.
|
||
- At night (night and dawn), one calm penned animal gets out of an open pen every 10 s. It's
|
||
loose at once (no longer penned): it walks out through the opening at 1.1 m/s, then roams like
|
||
any loose animal. The night's record counts it as strayed.
|
||
- By day they stay in.
|
||
- Building a gate (or a fence) back in the opening shuts the pen. An animal still on its way out
|
||
when the pen shuts stays home.
|
||
- At the end of the dawn grace, animals still following the scarecrow are back in the pen. Loose
|
||
animals stay loose; the next morning puts them back at their spots.
|
||
|
||
## Supplies
|
||
|
||
Implemented in Step 8.
|
||
|
||
- The shed's stock is shown by its piles: logs (wood) and hay bales (straw) east of the barn
|
||
doors, crates (scrap) west of them.
|
||
- Each pile shows one prop per few units (4 wood, 3 scrap, 4 straw), up to its full size.
|
||
- A label gives the amount while the scarecrow is near.
|
||
- A hidden prop doesn't block the scarecrow or shots. Enemies always route around a pile's
|
||
full footprint.
|
||
- A supply thief's sack holds up to 5 units, never more than the shed has.
|
||
- Killed (or scared), it drops the sack. Walk up to the sack and its contents go back to the
|
||
shed.
|
||
- A carried or dropped sack still counts as on the farm. Carried off, its contents are gone.
|
||
- Supplies lost in the night's record are the units carried off. Storing and spending don't
|
||
count.
|
||
|
||
## The scarecrow
|
||
|
||
Implemented in Step 4. The numbers are in `GameConfig`.
|
||
|
||
- **Health:** starts with **10 HP**, and HP **carries over between nights** (D7).
|
||
- After a hit is accepted, the scarecrow ignores further hits for 1 s, so several hits on
|
||
the same tick cost one.
|
||
- A hit blinks the scarecrow red and tints the screen.
|
||
- **Thieves fight back on contact.** A thief hits the scarecrow for 1 HP when all of these
|
||
hold:
|
||
- it is close enough to touch;
|
||
- it is seeking, stealing, carrying, or breaking (not fleeing or retreating);
|
||
- it has a clear line (not through a fence or wall);
|
||
- its own 1.2 s cooldown is over. The cooldown starts on every attempt.
|
||
- Fence breakers hit for 2 HP every 1.5 s, but only while fighting the scarecrow. Crows
|
||
never fight.
|
||
- **Weapons**, in two slots; hold a button to keep attacking. Every scarecrow starts with the
|
||
**pitchfork**; the **corn shooter** and **pumpkin bombs** are bought at the workbench (below).
|
||
- **Main weapon** (left mouse / RT): the pitchfork or the corn shooter, in the right hand.
|
||
Switch with **Tab / d-pad down** (the next one owned) or **1 / 2**, outside build mode (there
|
||
those keys pick structures).
|
||
- **Off-hand** (right mouse / LT): pumpkin bombs, in the left hand, thrown without putting the
|
||
main weapon away; both buttons work at once. Right mouse is still dismantle / leave build
|
||
mode in build mode, and the click that leaves it throws nothing.
|
||
- Both show on the scarecrow and in the HUD's weapon panel (bottom right), which also lists the
|
||
ones still to buy. Numbers in `GameConfig`.
|
||
| Weapon | What it does | Damage | How often |
|
||
|---|---|---|---|
|
||
| Pitchfork | A stab at the aim: the nearest 3 enemies within 2.2 m (plus their size) and 50° either side of the aim, with a clear line (not through walls); crows too | 2 (a thief in 2 stabs, a crow in 1, a fence breaker in 3) | Every 0.5 s |
|
||
| Corn shooter | The gun: kernels flying at combat height, stopped by walls | 1 (2 with heavy seeds) | 6 a second (8 with rapid fire) |
|
||
| Pumpkin bombs | Thrown at the cursor (or 7 m ahead with the stick), 2–10 m away, in an arc; bursts on landing, hurting every enemy within 3 m (crows too; walls don't stop it; never the scarecrows, animals, or structures). While one is ready, an orange ring shows where it would land and how far it reaches (brighter while the button is held) | 3 (a thief at once, half a fence breaker) | One every 4 s; the next grows back in the hand. Every morning one is ready |
|
||
- Each weapon keeps its own wait, so switching doesn't skip one. A weapon no longer owned (a
|
||
retry from a morning before it was bought) goes back to the pitchfork, or out of the
|
||
off-hand. One bought from the workbench menu goes straight into its hand.
|
||
- **Fear** (Q / left shoulder): every enemy within **6 m** flees straight away for **2 s**.
|
||
- Carriers drop their loot (D5).
|
||
- Enemies in the middle of a steal lose their progress and their claim.
|
||
- Afterwards they go back to stealing, or carrying if they kept their loot.
|
||
- Fear then needs **12 s** to recharge. A ring at the scarecrow's feet, and the HUD, show
|
||
when it's ready.
|
||
- **Sprint** (hold Shift / L3 while moving), once the **Sprint** upgrade is bought: the scarecrow
|
||
runs **1.6 times** as fast (8 m/s) for up to **3 s**. When the sprint ends (time's up, let go, or
|
||
stopped) it needs **10 s** to recharge; still holding, the next sprint starts as soon as it's
|
||
back. The HUD shows it ready, running, or recharging. Each new morning it's ready again.
|
||
- **Patching up** (hold F / Y): stand still, unable to shoot, for **2 s**, then **+3 HP** for
|
||
**2 straw**. The straw is paid when the patch completes.
|
||
- Releasing early, taking a hit, or using fear cancels it.
|
||
- Keep holding to patch again.
|
||
- It isn't available at full health, while gathering, or without the straw (a message says
|
||
what's missing).
|
||
- It works in any phase (D8).
|
||
- **Defeat:** at **0 HP** the scarecrow falls and the game is over at once (scarecrow first,
|
||
ahead of a stripped farm). A Game Over panel offers **Retry the night** (D9) and **New
|
||
vacation**. Every new morning, also after a retry, revives the scarecrow with fear ready.
|
||
|
||
## Materials and gathering
|
||
|
||
Implemented in Step 5. The numbers are in `GameConfig`; the gather points are listed in
|
||
`game/LAYOUT.md`.
|
||
|
||
- **Three materials:** wood, scrap, and straw.
|
||
- The supply shed's stock starts at 4 wood, 2 scrap, 4 straw.
|
||
- The scarecrow's **pouch** holds **15 units** in total.
|
||
- Walking into the Supply Shed zone empties the pouch into the shed, in any phase.
|
||
- **Paying:** costs come from the pouch first, then the shed, and are all-or-nothing.
|
||
- **Patch:** 2 straw.
|
||
- **Buildables:** fence 2 wood; gate 4 wood + 1 scrap; slowing trap 3 scrap + 1 wood; automated
|
||
defense 6 scrap + 2 wood + 2 straw.
|
||
- **Upgrades:** below.
|
||
- **Gathering** (hold E / X at a gather point), by day only (day and dusk, D8):
|
||
- Each gather takes **1.5 s** (rooted, no shooting) and puts the point's yield (2) into the
|
||
pouch, using one charge.
|
||
- Keep holding to gather again. Letting go, a hit, fear, or nightfall cancels it.
|
||
- The pouch needs room for the whole yield, so no charge is ever half wasted.
|
||
- Used-up points fade grey. They grow back overnight, at the end of the dawn grace.
|
||
- There are 4 points per material on the farm: about 18 wood, 18 scrap, and 20 straw a day.
|
||
- **Outside the fence:** the scarecrow can walk off the farm (through the gaps in the north and east
|
||
fence, or straight off the open south and west sides), as far as the old farm's
|
||
outer fences (the invisible walls are there now, not on the farm's fence).
|
||
- Four gathering areas wait outside, each point yielding **3** per charge with 3–4 charges:
|
||
- the North Grove: wood, north of the barn;
|
||
- the Old Hangar: scrap, north-east;
|
||
- the East Road: scrap, the abandoned car;
|
||
- the South Fields: straw, on the old plowed fields.
|
||
- They grow back overnight like the others. Gathering is still daytime only.
|
||
- Building, the enemies' paths, and the night stay inside the fence. At dusk and at nightfall,
|
||
a scarecrow still outside gets a warning.
|
||
- **Work area:** press E / X at the tool table, by day, to open the upgrade menu (below).
|
||
- **Persistence:** materials (shed and pouch), used gather points, and upgrades carry over
|
||
between nights and are restored by a retry.
|
||
- **Measured** (`soak_night.gd --mode=gather`): gathering everything and storing it takes about
|
||
**106 s** of the 180 s day, with 4 shed trips. That leaves about 70 s of day plus the 30 s of
|
||
dusk for building (Step 6).
|
||
|
||
## Upgrades
|
||
|
||
Implemented in Step 10. Bought once each, by day, from the menu at the work area's tool table. The
|
||
menu works with mouse, keyboard (arrows and Enter), or gamepad (d-pad and A). Close it with
|
||
Escape / B, interact again, or by walking off. The scarecrow stands still while it's open.
|
||
|
||
| Track | Upgrade | Effect | Cost |
|
||
|---|---|---|---|
|
||
| Weapon | Corn shooter | The gun: corn kernels from afar (below) | 10 scrap, 4 wood |
|
||
| Weapon | Rapid fire | The corn shooter fires a third faster (needs the corn shooter) | 12 scrap, 8 wood |
|
||
| Weapon | Heavy seeds | Each kernel does 2 damage (needs the corn shooter) | 14 scrap, 10 straw |
|
||
| Weapon | Pumpkin bombs | Thrown bombs that burst over 3 m, one every 4 s (below) | 12 straw, 6 scrap |
|
||
| Fear | Wide fear | Fear reaches 30% farther | 20 straw, 4 wood |
|
||
| Fear | Quick fear | Fear recharges 20% faster | 16 straw, 6 scrap |
|
||
| Scarecrow | Straw stuffing | +2 max health | 12 straw, 4 wood |
|
||
| Scarecrow | Sprint | Hold Shift / L3 to sprint: 1.6 times as fast for 3 s, then 10 s to recharge | 8 wood, 6 straw |
|
||
| Defenses | Reinforced fences | Fences and gates +50% health (standing ones keep their share) | 20 wood, 6 scrap |
|
||
| Defenses | Long-range defenses | Automated defenses reach 30% farther | 14 scrap, 10 wood |
|
||
| Defenses | Sticky tar | Slowing traps hold 50% longer | 14 straw, 6 scrap |
|
||
|
||
- **Cost:** all eleven cost 222 materials (74 scrap, 58 wood, 90 straw), drawing on the same
|
||
stock as building. Measured (before Sprint and the weapons were added): the scripted
|
||
scarecrow, building its plan, could afford 6 of the 8 over the five days.
|
||
- **Needs:** rapid fire and heavy seeds can't be bought before the corn shooter ("Needs the corn
|
||
shooter first").
|
||
- **Persistence:** upgrades carry over between nights and come back with a retry. The automated
|
||
defense's shots don't get heavy seeds.
|
||
|
||
## Construction
|
||
|
||
Implemented in Step 6. The numbers are in `GameConfig`.
|
||
|
||
- **Build mode** (B / d-pad up):
|
||
- Pick with 1–4 (or Tab / d-pad down), rotate with Z / C (d-pad) in 45° steps, and build with
|
||
LMB / RT.
|
||
- Positions snap to a 0.5 m grid. Building is instant, by day only (D8), and within 9 m of the
|
||
scarecrow.
|
||
- RMB / B over a built structure dismantles it, refunding half its cost, rounded down, into
|
||
the shed. Anywhere else it leaves build mode.
|
||
- The scarecrow doesn't shoot or gather in build mode.
|
||
|
||
| Buildable | Cost | HP | What it does |
|
||
|---|---|---|---|
|
||
| Fence | 2 wood | 20 | 2 m segment (1.5 × 1.5 m on the diagonal); ground enemies can't pass |
|
||
| Gate | 4 wood, 1 scrap | 30 | A fence the scarecrow walks through (it swings open); enemies can't |
|
||
| Slowing trap | 3 scrap, 1 wood | 10 triggers | A ground enemy stepping on it moves at half speed for 2 s; each crossing uses a trigger |
|
||
| Automated defense | 6 scrap, 2 wood, 2 straw | 25 | Shoots the nearest enemy within 7 m with a clear line, once a second (it leads the target) |
|
||
|
||
- **Placement:** a ghost shows green, or red with the reason. A structure can't go:
|
||
- outside the farm, within 2.5 m of a gap in the remaining perimeter fence (the scarecrow's way
|
||
out to the gathering areas), or in front of the barn doors;
|
||
- on a crop row, or into anything solid;
|
||
- onto another structure (fences may touch end to end, for corners);
|
||
- onto the scarecrow or an enemy (a gate may go where the scarecrow stands).
|
||
- It also needs daytime and the materials.
|
||
- **Blocked routes:** a barrier is never a wall to navigation, just expensive. Each barrier cell
|
||
counts as an 18 m detour.
|
||
- Enemies walk around a short fence but break through a long one.
|
||
- A fully enclosed target always has a route, which ends at the cheapest barrier. The thief
|
||
stops there and hits it (2 damage every 1.2 s, so about 12 s for a fence) until it breaks,
|
||
then carries on. A fence breaker does the same at 8 damage every 1.5 s.
|
||
- A broken structure leaves debris and a **"Breach!"** toast.
|
||
- Enemy routes are rebuilt over a few ticks whenever structures change. There are six routes:
|
||
the farm's edge, the pen, the three shed piles, and the fence breakers' targets. Measured: about
|
||
120 ms in total over 47 ticks, at most 2.6 ms in one tick.
|
||
- **Flying enemies** (crows) ignore fences, gates, and traps. The automated defense and the
|
||
scarecrow still hit them.
|
||
- **Damage and repair:**
|
||
- Damaged structures show an HP bar and a red tint, and wobble when hit.
|
||
- Hold E / X next to one (any phase) to repair it fully in 1.5 s. The cost is the build cost
|
||
times the missing share of HP (or triggers), rounded up.
|
||
- Damaged structures come first in the interact focus.
|
||
- **Persistence:** structures (position, rotation, HP) carry over between nights and are
|
||
restored by a retry.
|
||
|
||
## How the vacation ends
|
||
|
||
| Outcome | Condition | Result |
|
||
|---|---|---|
|
||
| Scarecrow destroyed | Scarecrow HP reaches 0, in any phase | Game Over |
|
||
| Farm stripped (D2) | **Every** kind of asset in play is gone: crops, animals, and stored supplies all at zero. Losing one kind isn't enough. Supplies only count as gone when thieves emptied the shed (and no sack is still on the farm). Spending the last materials doesn't strip the farm. | Game Over |
|
||
| Vacation complete | The fifth night's dawn ends | The farmers return; final assessment |
|
||
|
||
- **The failure screen** names the cause and the night it happened on (with its plan's title),
|
||
then what was kept, what's left, what the night had cost so far, and the vacation's totals.
|
||
Retry the night is focused; Main menu goes back to the title screen.
|
||
- **The farmers' return** plays after the last dawn: their station wagon drives in at the
|
||
driveway gap and parks by the house, and the farmers walk to the porch, wave to the scarecrow,
|
||
and cheer. Fire, interact, or Enter / A skips it.
|
||
- **The final assessment** follows:
|
||
- Crops and animals count the share still on the farm.
|
||
- Supplies are also spent on building, so they count by theft instead: the share of
|
||
everything that passed through the farm (the shed's starting stock plus everything
|
||
gathered) that thieves didn't carry off.
|
||
- The score is the weighted share kept, as 0–100 points. Weights: crops 0.5, animals 0.3,
|
||
supplies 0.2, renormalized over the categories in play.
|
||
|
||
| Points | Rating |
|
||
|---|---|
|
||
| 95+ | Blue-ribbon harvest |
|
||
| 80+ | Bumper crop |
|
||
| 60+ | Fair season |
|
||
| 40+ | Lean season |
|
||
| below 40 | Hanging by a thread |
|
||
|
||
- **Order of checks.** The outcome is checked every tick, after gameplay and before any phase
|
||
change. A destroyed scarecrow is checked first, then a stripped farm, then completion. If a
|
||
failure and the end of the final dawn happen on the same tick, the result is a **loss**.
|
||
- **Retry (D9).** After a Game Over, Retry restarts the failed night from its morning, with
|
||
everything as it was then: earlier losses, damage, and scarecrow HP. New Vacation starts the
|
||
whole campaign over.
|
||
|
||
## Night record
|
||
|
||
Counted from each morning to the end of its dawn grace, and recorded when the dawn ends
|
||
(`FarmState.night_log`):
|
||
- crops and animals lost, supply units carried off;
|
||
- what was taken, recovered, and strayed (animals that got out of an open pen), per category;
|
||
- enemies killed per type, and those that got away with loot;
|
||
- the scarecrow's damage taken and patches;
|
||
- structures built, damage dealt to them, structures broken, and repairs;
|
||
- upgrades bought;
|
||
- materials gathered (into the pouch) and spent (building, repairs, patching, upgrades), per
|
||
material.
|
||
|
||
The morning screen opens with the last night's record. Its table shows taken, recovered, and
|
||
lost per category; animals taken include those that got out of an open pen (loose, not lost).
|
||
Under the table come the enemies, the damage, and the materials. The final assessment adds up
|
||
all the nights.
|
||
|
||
Decided in Step 8: a farm whose supplies were *spent* rather than stolen is not stripped. The
|
||
shed counts as raided when a thief takes the last of its stock, and storing anything clears that
|
||
(`FarmState.shed_raided`).
|
||
|
||
## Saving and continuing
|
||
|
||
- **Autosave.** Every morning is saved to `user://savegame.json` (the farm state with a version
|
||
number). A new vacation is saved at once.
|
||
- **Continue** resumes at the saved morning. After a Game Over that's the failed night's morning,
|
||
the same as Retry. Finishing the vacation deletes the save.
|
||
- **Nothing else saves.** Quitting mid-day or mid-night (Save & quit, Quit, closing the window)
|
||
keeps the morning's save, so the pause menu says what Continue picks up. Going back to the
|
||
menu puts the farm behind it at that morning without writing anything.
|
||
- **Bad saves.** A missing, damaged, or newer save can't be continued, and the main menu says
|
||
why. An older save is upgraded when there's a known way (version 2 to 3: the new nightly
|
||
records start at zero) and refused otherwise. New vacation replaces any save; it asks first
|
||
only when the save is a good one.
|
||
|
||
## Menus, pause, and settings
|
||
|
||
- **Title screen:** Continue, New vacation, Settings, Quit, over the farm standing still.
|
||
- **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
|
||
Cancel focused.
|
||
- **Settings** apply at once and are saved to `user://settings.cfg`, apart from the save game.
|
||
Bad or missing values fall back to the defaults.
|
||
|
||
| Setting | Default | Range |
|
||
|---|---|---|
|
||
| Master / music and stingers / sound effects / ambience volume | 80 / 70 / 80 / 60 % | 0–100 % (0 mutes) |
|
||
| Move stick dead zone | 20 % | 5–90 % |
|
||
| Aim stick dead zone | 30 % | 5–90 % |
|
||
| Fullscreen | off | |
|
||
| VSync | on | |
|
||
| 3D resolution scale | 100 % | 50–100 % (the HUD stays sharp) |
|
||
| Tips on the first day and night | on | |
|
||
|
||
- Mouse aim follows the cursor directly, so there's no mouse sensitivity setting. The settings
|
||
list every binding; there's no remapping.
|
||
|
||
## First-day tips
|
||
|
||
On night 1 a short tip shows above the hotbar when it's useful, one at a time, and goes away
|
||
once it's done:
|
||
- **By day:** move, gather, store at the shed (once the pouch has something), and build (after
|
||
storing, or once half the day has gone).
|
||
- **At dusk:** when the thieves come (from every side).
|
||
- **At night:** fight with the pitchfork, and where to get the other weapons (once enemies are in), fear (when two or more are close), recover (when
|
||
something is dropped), and patch up (when hurt).
|
||
|
||
The most urgent tip wins. Backspace / Back hides them, and Settings turns them off. A finished
|
||
tip doesn't come back on a retry.
|
||
|
||
## Sound
|
||
|
||
- **Buses:** Master, then Music (stingers and outcome jingles), SFX, and Ambience.
|
||
- **Positional sounds** are heard from the scarecrow, facing the way the camera does, so a crow
|
||
cawing in from the east is heard on the right.
|
||
- **No pile-ups:** each cue has a minimum gap between plays and a voice limit, so a flock
|
||
arriving is a few caws, not twenty.
|
||
- **Coverage:** gathering, building, repairs, hits, deaths, fear, theft, breach and loss
|
||
alarms, the dusk bell, stingers at dusk, nightfall, sunrise, and morning, the outcome jingles,
|
||
and day and night ambience that crossfades through dusk and dawn.
|
||
- **Music**, crossfading between phases:
|
||
- "On the Farm" on the title screen, in the morning, by day, and when the farmers are back;
|
||
- "Purgatory" at night;
|
||
- nothing at dusk, at dawn, or after a Game Over: only the ambience.
|
||
|
||
## Co-op
|
||
|
||
Two players, each with a scarecrow, keep one farm (Main menu → Play with a friend; the details are
|
||
in `game/COOP.md`):
|
||
- **What's shared:** the shed, the pouch, upgrades, and structures. Either player can gather,
|
||
build, repair, buy upgrades, and start the day.
|
||
- **What's your own:** your scarecrow's health, and the weapon in your hands: a weapon bought
|
||
is there for both, and each player picks their own main weapon. Upgrades to max health apply to both.
|
||
- **Falling:** a scarecrow at 0 HP is out until the morning, when it comes back at half health.
|
||
**Game Over only when both are down at once.**
|
||
- **Enemies** go for the nearer scarecrow.
|
||
- **Saving:** the host's game saves; the partner's doesn't. A co-op save continued alone plays by
|
||
the solo rules.
|
||
- **Menus** don't pause the farm in co-op.
|