feat(structures): stamp .schem props at OSM features#1131
Conversation
Add a generic Sponge .schem stamper and place bundled models at matching OSM features: a tower crane plus scattered excavators on large construction sites, a rare tractor on farmland, playgrounds in leisure areas, boats on open water (ocean/large lakes, not rivers), a lighthouse at man_made=lighthouse, and four fountains at amenity=fountain (the large one only for big fountains). Replaces the old procedural playground props and fountain. Placement is deterministic and tile-seam safe; cost scales with feature count, not area, so peak memory and generation time stay flat at 300 km2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
⏱️ Benchmark run finished in 0m 50s 📈 Compared against baseline: 18s time, 1005 MB memory 🟢 Generation time is unchanged. 📅 Last benchmark: 2026-06-29 17:57:22 UTC You can retrigger the benchmark by commenting |
There was a problem hiding this comment.
Pull request overview
This PR adds a generic Sponge .schem stamping pipeline for non-tree props and wires it into OSM element processing so bundled models (crane/excavators/tractor/playgrounds/boats/lighthouse/fountains) can be placed deterministically based on tags and feature size.
Changes:
- Introduces a
.schemloader + rotation-aware stamper that preserves block states/properties. - Adds bundled prop placers (crane, excavator, tractor, playground variants, fountain variants, lighthouse, boats) and hooks them into landuse/leisure/amenity/man_made/water processing.
- Extends
WorldEditor/block definitions to support water-distance queries and additional blocks used by schematics.
Reviewed changes
Copilot reviewed 18 out of 30 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/world_editor/mod.rs | Adds water_distance() accessor for ESA water distance-to-shore field. |
| src/structures/mod.rs | New structures module exporting all prop placers + schematic utilities. |
| src/structures/schematic.rs | Generic Sponge .schem loader and rotation-aware stamping with block-state preservation. |
| src/structures/crane.rs | Places a bundled crane on large construction sites. |
| src/structures/excavator.rs | Scatters bundled excavators on large construction sites. |
| src/structures/tractor.rs | Rare tractor placement on large farmland fields. |
| src/structures/playground.rs | Scatters bundled playground variants in leisure areas. |
| src/structures/fountain.rs | Places fountain variants, with a “large” variant for big footprints. |
| src/structures/lighthouse.rs | Places a bundled lighthouse for man_made=lighthouse. |
| src/structures/boat.rs | Scatters boats on “open water” using a global grid + water-distance gating. |
| src/main.rs | Registers the new structures module in the crate. |
| src/element_processing/water_areas.rs | Calls boat scattering after filling water polygons. |
| src/element_processing/man_made.rs | Hooks man_made=lighthouse to schematic placement (ways + nodes). |
| src/element_processing/leisure.rs | Replaces procedural playground props with schematic playground stamping. |
| src/element_processing/landuse.rs | Adds crane/excavator/tractor placement for construction/farmland landuse. |
| src/element_processing/amenities.rs | Replaces procedural fountain generation with schematic fountain stamping. |
| src/data_processing.rs | Ensures natural=water + amenity=fountain routes to the fountain handler instead of water fill. |
| src/block_definitions.rs | Adds many new block IDs/names needed by schematic-stamped structures. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address PR review: document that water_distance caps at 15 (so a water cell at 0 is deep open water, which is why the boat check uses == 0), and replace the stale procedural-fountain doc comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d cell place_structure used the if-absent write path (None/None), so structure blocks landing on existing water/terrain were dropped (boat hulls, playground sand pads). Pass an empty blacklist to force the write. Snap way-fountain placement to the nearest filled cell so concave footprints still place inside. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a generic Sponge .schem stamper and place bundled models at matching OSM features: a tower crane plus scattered excavators on large construction sites, a rare tractor on farmland, playgrounds in leisure areas, boats on open water (ocean/large lakes, not rivers), a lighthouse at man_made=lighthouse, and four fountains at amenity=fountain (the large one only for big fountains). Replaces the old procedural playground props and fountain.