Skip to content

feat(structures): stamp .schem props at OSM features#1131

Merged
louis-e merged 3 commits into
mainfrom
feat/osm-structures
Jun 29, 2026
Merged

feat(structures): stamp .schem props at OSM features#1131
louis-e merged 3 commits into
mainfrom
feat/osm-structures

Conversation

@louis-e

@louis-e louis-e commented Jun 28, 2026

Copy link
Copy Markdown
Owner

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.

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>
Copilot AI review requested due to automatic review settings June 28, 2026 21:49
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 50s
🏗️ Generation time: 19s (excl. data fetching)
🧠 Peak memory usage: 1047 MB (↗ 4% more)

📈 Compared against baseline: 18s time, 1005 MB memory
🧮 Delta: 32s time, 42 MB memory
🔢 Commit: 37d8b32

🟢 Generation time is unchanged.
⚠️ This PR increases peak memory.

📅 Last benchmark: 2026-06-29 17:57:22 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .schem loader + 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.

Comment thread src/world_editor/mod.rs Outdated
Comment thread src/structures/boat.rs Outdated
Comment thread src/element_processing/amenities.rs
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 18 out of 30 changed files in this pull request and generated 3 comments.

Comment thread src/structures/schematic.rs Outdated
Comment thread src/element_processing/amenities.rs
Comment thread src/element_processing/man_made.rs
…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>
@louis-e
louis-e merged commit 47161ea into main Jun 29, 2026
3 checks passed
@louis-e
louis-e deleted the feat/osm-structures branch June 29, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants