Skip to content

Park bench - #910

Merged
louis-e merged 9 commits into
louis-e:mainfrom
luigi052005:park-bench
Apr 12, 2026
Merged

louis-e merged 9 commits into
louis-e:mainfrom
luigi052005:park-bench

Conversation

@luigi052005

Copy link
Copy Markdown
Contributor

I tried to make the benches look more like actual benches.
huge_2026-04-10_22 00 30

@luigi052005

Copy link
Copy Markdown
Contributor Author

I think the result would be genuinely better if the bench always faced the nearest path instead of being given a random rotation. Is that something I should try to implement?

@louis-e

louis-e commented Apr 11, 2026

Copy link
Copy Markdown
Owner

I think the result would be genuinely better if the bench always faced the nearest path instead of being given a random rotation. Is that something I should try to implement?

I like the idea and I struggled with that in the past. It would make it look better visually, but I'm concerned about the impact on the generation time. Performing the calculations to correctly align the benches might be a few milliseconds on a small area, but it will add up on large areas. In the features I added in the past few months, I always tried to weigh up what matters the most for the individual cases: visual improvement or generation time impact? I'm aware that this shouldn't be too strict, so I will try to judge it on an individual basis after taking a closer look at the calculation efficiency.

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

Updates amenity bench generation to look more like real benches by using slabs + upside-down stairs and orienting benches based on nearby road surfaces, while also refactoring upside-down stair creation into a shared helper.

Changes:

  • Add top_stair() helper to set stair half=top and reuse it in building facade stair generation.
  • Introduce nearest_road() in amenities to pick a bench axis based on nearby road blocks (fallback to deterministic RNG).
  • Replace the old bench (smooth stone + logs) with a slab seat and two upside-down stair end pieces.

Reviewed changes

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

File Description
src/element_processing/buildings.rs Refactors upside-down stair creation to use the shared top_stair() helper.
src/element_processing/amenities.rs Reworks bench placement (geometry + facing) and adds nearby-road detection heuristic.
src/block_definitions.rs Adds shared top_stair() helper for creating upside-down stair blocks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/element_processing/amenities.rs Outdated
Comment thread src/element_processing/amenities.rs
Comment thread src/element_processing/amenities.rs
@luigi052005

Copy link
Copy Markdown
Contributor Author

We can also just keep the orientation random, like before.

…paths, and searching that instead of the actual blocks.
@luigi052005

Copy link
Copy Markdown
Contributor Author

retrigger-benchmark

@github-actions

github-actions Bot commented Apr 12, 2026 •

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 48s
🧠 Peak memory usage: 2054 MB (↗ 119% more)

📈 Compared against baseline: 30s
🧮 Delta: 18s
🔢 Commit: e95f472

🚨 This PR drastically worsens generation time.

📅 Last benchmark: 2026-04-12 14:21:50 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

@louis-e

louis-e commented Apr 12, 2026

Copy link
Copy Markdown
Owner

retrigger-benchmark

@louis-e

louis-e commented Apr 12, 2026

Copy link
Copy Markdown
Owner

Just had a deeper look, looks good to me. I also like the idea of overhanging traffic signals. The ↗ 119% more memory usage isn't caused by this, will investigate where this comes from. Thanks!

@louis-e
louis-e merged commit c97d4a5 into louis-e:main Apr 12, 2026
1 of 2 checks passed
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.

3 participants