diff --git a/game/LAYOUT.md b/game/LAYOUT.md index bdb0b36..9f97227 100644 --- a/game/LAYOUT.md +++ b/game/LAYOUT.md @@ -5,11 +5,14 @@ The playable farm built in Step 2 of `first-game-plan.md`. All numbers here are ## The map -- **Playable area: 60 × 60 m**, x −13…47 and z −45…15 (`FarmZones.playable`). The rest of the - old farm is out-of-bounds scenery. +- **Playable area: 60 × 80 m**, x −13…47 and z −45…35 (`FarmZones.playable`). It was 60 × 60 m + (to z 15) until #20 extended it 20 m south over the old plowed soil, where the lettuce/cabbage + and corn fields grow. The rest of the old farm is out-of-bounds scenery. - **Perimeter:** what's left of the wooden fence (`fence_005`, 52 segments): the north side and - the east side, with **3 gaps**. The south side and most of the west side were taken out, so the - farm is open ground there. + the east side down to z 15 (the original map's south-east corner), with **3 gaps**. The south + side and most of the west side were taken out, and the east side's southern 20 m (z 15…35) has + none, so the farm is open ground there. Just beyond that stretch, about 1 m outside the map, + the old farm's outer fence runs north to south (x ≈ 48.2, z 18…46). - **The farm's edge** is where enemies come from and go: every enemy arrives at its own random point along it, and carriers escape across it (see "The farm's edge" below). - **Scarecrow bounds:** invisible walls on the old farm's outer fences (`Zones/Perimeter/PlayerBounds`, @@ -21,7 +24,7 @@ The playable farm built in Step 2 of `first-game-plan.md`. All numbers here are Top-down picture with zone outlines: ```sh -godot --path . --script res://game/tools/render_overview.gd -- --out=/tmp/farm.png --center=17,-15 --size=66 --zones +godot --path . --script res://game/tools/render_overview.gd -- --out=/tmp/farm.png --center=17,-5 --size=86 --zones ``` ## Zones @@ -34,8 +37,10 @@ name when the scarecrow walks in. | Zone | Rectangle (x, z) | What's there | Purpose | |---|---|---|---| | Crop Field | 14…46, −18.6…11.4 | The sunflower field: 6 plots, 30 crop units, two 2 m walkways between the plot bands | Exposed asset; crows' target | +| Lettuce Field | −6…4, 20…30 | Cabbage heads on the south-west plowed soil: 2 plots, 10 crop units. Sprouts after night 2 | A later crop field (see "The later fields" below) | +| Corn Field | 24…34, 20…30 | Corn stalks on the south-east plowed soil: 2 plots, 10 crop units. Sprouts after night 4 | A later crop field | | Supply Shed | −6…8, −24…−14 | The red barn's south doors and the apron in front of them, with stock piles that grow and shrink with the stock (`ShedStock`): crates for scrap (west of the doors), logs for wood and hay bales for straw (east of the doors); also sacks and barrels | Stored materials; supply thieves' target | -| Work Area | 8…14, −24…−15 | Tool table, workbench, chair, bucket, between the barn and the house | Crafting, repairs, and upgrades | +| Work Area | 25.6…31.6, −29.8…−20.8 | Tool table, workbench, chair, bucket, between the barn and the house | Crafting, repairs, and upgrades | | Animal Pen | −10…4, −11…−1 | Brown paddock fence, a gate in the opening on the east side (a gate structure, standing from the start), henhouse, 4 chickens, 2 pigs, 2 sheep | Livestock; animal thieves' target. Enemies can only reach the inside by breaking the gate | | Woodlot | 37.5…46.5, −35…−21 | The fir tree line, dead trees and branches, log piles | Wood | | Scrap Heap | 25.5…36.5, −44…−33 | Old pickup, wagon, wheelbarrow, lawn mower, barrels, crate, on the farmyard dirt | Scrap | @@ -78,7 +83,7 @@ Each point is a `GatherNode` under its zone, holding the props it is made of. workbench. The middle and south-west of the map (x −13…14, z −1…15) are deliberately open ground for -building defenses. +building defenses, and so is the south end around the later fields (z 15…35). ### Crop units @@ -94,6 +99,29 @@ visible. | Middle band (z −6.5…0.4) | Plot 3: units 11–15 | Plot 4: units 16–20 | | South band (z 2.4…9.4) | Plot 5: units 21–25 | Plot 6: units 26–30 | +### The later fields (#13, #20) + +Two more crop fields sprout during the campaign. Until then their units are dormant: hidden, and +not stealable (`CropUnit.sprout_night`, `LootSystem`). #20 moved them onto the bare plowed soil +south of the original map: the ithappy `ground_008_004` tile (south-west, x −25.3…7.5, +z 14.6…45.3) and `ground_011_003` (south-east, x 13.4…46.1, z 14.2…44.8). + +| Field | Zone (x, z) | Units | Plants per unit | Sprouts after | +|---|---|---|---|---| +| Lettuce Field | −6…4, 20…30 | Plot 7: 31–35, Plot 8: 36–40 | 8 cabbage heads (`plant_004` / `plant_005`, ≈0.45 m) | Night 2 | +| Corn Field | 24…34, 20…30 | Plot 9: 41–45, Plot 10: 46–50 | 10 corn stalks (`plant_001`, scaled to ≈2.1 m) | Night 4 | + +- Each unit is one north–south row, about 6.6 m long (z ≈ 21.7…28.4). The rows are 0.95 m apart. +- **Height:** the soil's surface is 0.2–0.65 m above the grass. Each field's zone sits at the + soil's median height under its plants (y 0.44 and 0.31), and every plant follows the soil + beneath it. + - A cabbage rests on the lowest soil under its leaves. + - A corn stalk's base is 6 cm into the soil. + - `test_farm_layout` checks that no plant floats. +- **Tokens:** a carried or dropped crop shows its own field's plant (`LootSystem.CROP_TOKENS`). +- **Thieves:** a crop thief goes straight at its target once inside that target's field, given a + clear line (`ThiefBehavior.field_rects`, one rectangle per field). + ## The farm's edge and the fence's gaps **Arrivals.** Every enemy arrives at its own random point along the farm's edge @@ -116,7 +144,8 @@ always walk out to the gathering areas. | GapEast | east, z −20…−17 | Woodlot and the crop field's north-east corner | The signposts of the three gaps that were in the removed south and west fence (SignSouthEast, -SignSouthWest, SignWest) still stand. +SignSouthWest, SignWest) still stand. Since #20, SignSouthEast and SignSouthWest stand inside the +map, near the old south edge (z ≈ 13.8). ## Travel times @@ -124,20 +153,27 @@ Scarecrow at run speed (5 m/s). Path lengths come from the navigation grid with radius (0.4 m), from zone center to zone center. The Animal Pen's center is inside the pen, so routes to it go through the gate. -| From \ to | Crop Field | Supply Shed | Work Area | Animal Pen | Woodlot | Scrap Heap | Haystacks | -|---|---|---|---|---|---|---|---| -| **Crop Field** | — | 7.2 s | 5.4 s | 6.8 s | 5.9 s | 7.3 s | 8.0 s | -| **Supply Shed** | 7.2 s | — | 2.8 s | 4.3 s | 9.7 s | 9.1 s | 8.3 s | -| **Work Area** | 5.4 s | 2.8 s | — | 4.7 s | 7.1 s | 6.6 s | 5.7 s | -| **Animal Pen** | 6.8 s | 4.3 s | 4.7 s | — | 10.8 s | 11.0 s | 10.3 s | -| **Woodlot** | 5.9 s | 9.7 s | 7.1 s | 10.8 s | — | 3.5 s | 5.3 s | -| **Scrap Heap** | 7.3 s | 9.1 s | 6.6 s | 11.0 s | 3.5 s | — | 2.3 s | -| **Haystacks** | 8.0 s | 8.3 s | 5.7 s | 10.3 s | 5.3 s | 2.3 s | — | +| From \ to | Crop Field | Lettuce Field | Corn Field | Supply Shed | Work Area | Animal Pen | Woodlot | Scrap Heap | Haystacks | +|---|---|---|---|---|---|---|---|---|---| +| **Crop Field** | — | 8.5 s | 5.9 s | 7.2 s | 4.4 s | 6.8 s | 5.9 s | 7.1 s | 8.0 s | +| **Lettuce Field** | 8.5 s | — | 6.0 s | 9.0 s | 12.5 s | 6.4 s | 14.2 s | 15.4 s | 15.5 s | +| **Corn Field** | 5.9 s | 6.0 s | — | 11.0 s | 10.1 s | 8.9 s | 11.8 s | 13.0 s | 13.7 s | +| **Supply Shed** | 7.2 s | 9.0 s | 11.0 s | — | 6.9 s | 2.9 s | 9.7 s | 9.1 s | 8.3 s | +| **Work Area** | 4.4 s | 12.5 s | 10.1 s | 6.9 s | — | 8.0 s | 3.0 s | 3.2 s | 3.7 s | +| **Animal Pen** | 6.8 s | 6.4 s | 8.9 s | 2.9 s | 8.0 s | — | 10.8 s | 10.3 s | 9.4 s | +| **Woodlot** | 5.9 s | 14.2 s | 11.8 s | 9.7 s | 3.0 s | 10.8 s | — | 3.5 s | 5.3 s | +| **Scrap Heap** | 7.1 s | 15.4 s | 13.0 s | 9.1 s | 3.2 s | 10.3 s | 3.5 s | — | 2.3 s | +| **Haystacks** | 8.0 s | 15.5 s | 13.7 s | 8.3 s | 3.7 s | 9.4 s | 5.3 s | 2.3 s | — | -The longest trip is 11.0 s (Animal Pen ↔ Scrap Heap). The rule is no key area more than 12 s from -another. The two defended fronts sit 6–7 s apart: the crop field in the south-east, and the pen -and shed in the west. Holding one leaves the other exposed. The gathering spots are in the north, -so a day of gathering pulls the scarecrow away from both fronts. +- **The rule:** no key area more than 12 s from another. Among the original zones the longest + trip is 10.8 s (Animal Pen ↔ Woodlot). +- **The later fields** at the map's south end are farther out: up to 15.5 s (Lettuce Field ↔ + Haystacks). `test_farm_layout` bounds them at 16 s. +- **The defended fronts:** the sunflower field in the east, and the pen and shed in the west, sit + 6–7 s apart. Holding one leaves the other exposed. From night 2 the lettuce field joins them at + the south-west end (6.4 s from the pen), and from night 4 the corn field at the south-east end + (5.9 s from the sunflower field, 6.0 s from the lettuce). +- **Gathering** is in the north, so a day of gathering pulls the scarecrow away from every front. Ground-enemy path from the middle of each side of the farm's edge (3 m out) to the nearest edge of each zone, in meters (enemy radius 0.35 m). Enemies arrive anywhere along the edge, so these are @@ -145,13 +181,20 @@ samples, not routes everyone takes; arriving behind the north fence means walkin | Zone | North | East | South | West | |---|---|---|---|---| -| Crop Field | 35 | 6 | 7 | 30 | -| Supply Shed | 31 | 45 | 36 | 10 | -| Work Area | 29 | 39 | 35 | 24 | -| Animal Pen (inside) | 51 | 53 | 30 | 28 | -| Woodlot | 44 | 9 | 48 | 56 | -| Scrap Heap | 30 | 26 | 55 | 50 | -| Haystacks | 11 | 37 | 55 | 43 | +| Crop Field | 35 | 16 | 27 | 30 | +| Lettuce Field | 76 | 67 | 17 | 29 | +| Corn Field | 78 | 37 | 11 | 50 | +| Supply Shed | 31 | 54 | 56 | 14 | +| Work Area | 33 | 32 | 63 | 48 | +| Animal Pen (inside) | 46 | 61 | 45 | 6 | +| Woodlot | 44 | 19 | 68 | 60 | +| Scrap Heap | 30 | 36 | 76 | 54 | +| Haystacks | 11 | 47 | 75 | 47 | + +Since #20 the side middles are further south: the east and west ones at z −5 (they were at +z −15), the south one at z 38. The east one is behind the east fence, so enemies arriving there +walk round to a gap or the fence's south end first. Further south on the east side (z 18…38), +arrivals stand behind the old farm's outer fence and walk round its north end (z ≈ 18). ## Navigation @@ -162,10 +205,14 @@ samples, not routes everyone takes; arriving behind the north fence means walkin - Obstacles are inflated by the mover's radius. - Distance fields use octile Dijkstra with no corner cutting. -For enemies: the playable area plus a 5 m margin is 20,164 cells. 390 shapes are rasterized, and -the grid builds in about 25 ms (headless, editor binary). Because the grid comes from the same -collision the player walks against, physics and navigation can't drift apart. Step 3 adds flow -fields toward the crop plots and the farm's edge on top of it. +For enemies: the playable area plus a 5 m margin is 25,844 cells (20,164 before #20 extended the +map). 367 shapes are rasterized, and the grid builds in about 27 ms (headless, editor binary). +Because the grid comes from the same collision the player walks against, physics and navigation +can't drift apart. Step 3 adds flow fields toward the crop plots and the farm's edge on top of it. + +A flow-field rebuild after placing a fence (escape, pen, 3 shed piles, fence breakers; 2,000 cells +per tick) takes about 200 ms of work over 85 ticks. Before #20 it was about 150 ms over 64 ticks. +Its largest slice stays about 3 ms. ## What changed from the old farm @@ -175,6 +222,9 @@ fields toward the crop plots and the farm's edge on top of it. - the north-west field's soil tile - 29 segments of the old inner east fence that would have doubled the new perimeter - **Moved:** the hay stack from beyond the north fence into the farmyard (Haystacks). +- **#20:** the map grew 20 m south to take in the bare plowed soil there. The lettuce/cabbage and + corn fields (from #13, first placed on the grass at z 2…12) moved onto that soil, with their own + plants instead of sunflowers. The South Fields' hay moved south of the new edge. - **Collision:** - `build_prop_collision.gd` generated collision for the newly placed prop types. - Animals get none: they are moving entities (`AnimalSystem`). @@ -228,12 +278,16 @@ Four outside zones (`FarmZone.outside`) hold more to gather. Every point there y | North Grove (wood) | (12, −52), 16 × 12 | GroveDeadTree, GroveSnag, GroveDeadfall (dead trees, 3 charges), GroveLogs (log pile, 3) | GapNorth | | Old Hangar (scrap) | (38, −53), 18 × 13 | HangarWreck (old SUV, 4), HangarBarrels (3), HangarCart (3) | GapNorth, GapDriveway | | East Road (scrap) | (51.5, −15), 6 × 14 | RoadsideCar (the abandoned red car, moved in from `Level/`, 4), RoadsideBarrels (3) | GapEast | -| South Fields (straw) | (9.5, 31), 66 × 30 | FieldStackWest, FieldStackEast (4-bale stacks, 4), FieldBaleWest, FieldBaleEast (round bales, 3) | none: the south side is open | +| South Fields (straw) | (9.5, 41), 66 × 10 | FieldStackWest (−14, 41.5), FieldStackEast (36, 41.5) (4-bale stacks, 4), FieldBaleWest (−3, 42), FieldBaleEast (21, 41) (round bales, 3) | none: the south side is open | `FarmZones.zone(kind)` only ever returns the farm's own zone, and `zones()` lists only the farm's. `outside_zones()` lists these, and `zone_at()` finds both (the zone banner says "North Grove (outside the fence)"). +**The South Fields** (#20) are the strip of plowed soil between the map's south edge (z 35) and the +old farm's south fence (z ≈ 46.4). Their hay rests on the soil there, south of the later crop +fields and clear of the enemies' arrival line (z 38). + **Placing outside points:** the North Grove sits east of the tall barn on purpose. Behind the barn (x < 9), the game camera can't see the scarecrow. The semi-trucks west of the farm are beyond the old west fence (x ≈ −28.5), so they're out of reach.