Skip to content

Buildings improvement#742

Merged
louis-e merged 18 commits intomainfrom
buildings-improvement
Feb 8, 2026
Merged

Buildings improvement#742
louis-e merged 18 commits intomainfrom
buildings-improvement

Conversation

@louis-e
Copy link
Owner

@louis-e louis-e commented Feb 7, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 7, 2026 13:18
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

⏱️ Benchmark run finished in 0m 33s
🧠 Peak memory usage: 963 MB

📈 Compared against baseline: 30s
🧮 Delta: 3s
🔢 Commit: 44023f9

🟢 Generation time is unchanged.

📅 Last benchmark: 2026-02-08 15:41:38 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Copy link
Contributor

Copilot AI left a comment

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 expands map feature coverage and substantially refactors building generation to produce more varied, tag-driven building styles and roof shapes, plus adds support for rendering place=* areas.

Changes:

  • Extend Overpass retrieval + world processing to include and render place=* ways as ground blocks.
  • Major refactor of buildings.rs: introduce building categories/presets, deterministic style resolution, new roof generators, and new special building-type generators.
  • Extend block definitions with additional block IDs/properties needed for new building/roof/door features.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/retrieve_data.rs Adds place to the Overpass query filters.
src/data_processing.rs Routes place=* ways to a new generator.
src/element_processing/landuse.rs Adds generate_place to fill place=* areas with block types by tag.
src/element_processing/buildings.rs Large building-generation overhaul: categories/presets/styles, roof system changes, and new special generators (shelter, parking, roof-only, etc.).
src/block_definitions.rs Adds new block IDs and properties (doors, slabs, pane, terracotta) and introduces deterministic window/floor selection helpers.

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

Copy link
Contributor

Copilot AI left a comment

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 6 out of 7 changed files in this pull request and generated 5 comments.


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

@louis-e
Copy link
Owner Author

louis-e commented Feb 8, 2026

retrigger-benchmark

Copy link
Contributor

Copilot AI left a comment

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 6 out of 7 changed files in this pull request and generated 4 comments.


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

Copy link
Contributor

Copilot AI left a comment

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 6 out of 7 changed files in this pull request and generated 1 comment.


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

Copy link
Contributor

Copilot AI left a comment

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 6 out of 7 changed files in this pull request and generated 4 comments.


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

Copy link
Contributor

Copilot AI left a comment

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 6 out of 7 changed files in this pull request and generated 3 comments.


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

Copy link
Contributor

Copilot AI left a comment

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 6 out of 7 changed files in this pull request and generated 5 comments.


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

Comment on lines +2016 to +2019
config: &BuildingConfig,
args: &Args,
generate_non_flat_roof: bool,
) -> HashSet<(i32, i32)> {
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

The generate_non_flat_roof parameter name doesn’t match how it’s used: the logic treats it as “will any roof be generated” (to decide whether to place the top ceiling), not specifically “non-flat roof”. Renaming it (and updating call sites) would make the control flow much easier to follow and reduce the risk of future regressions.

Copilot uses AI. Check for mistakes.
Comment on lines +2066 to +2071
// Set top ceiling (only if flat roof or no roof generation)
// Use the resolved style flag, not just the OSM tag, since auto-gabled roofs
// may be generated for residential buildings without a roof:shape tag
let has_flat_roof = !args.roof || !generate_non_flat_roof;

if has_flat_roof {
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

has_flat_roof is computed as !args.roof || !generate_non_flat_roof, which is effectively “should place a flat ceiling because no roof will be generated”, not “flat roof”. The current variable name and preceding comment are misleading; consider renaming to something like should_place_top_ceiling and adjusting the comment accordingly.

Suggested change
// Set top ceiling (only if flat roof or no roof generation)
// Use the resolved style flag, not just the OSM tag, since auto-gabled roofs
// may be generated for residential buildings without a roof:shape tag
let has_flat_roof = !args.roof || !generate_non_flat_roof;
if has_flat_roof {
// Set top ceiling when no non-flat roof will be generated
// Use the resolved style flag, not just the OSM tag, since auto-gabled roofs
// may be generated for residential buildings without a roof:shape tag
let should_place_top_ceiling = !args.roof || !generate_non_flat_roof;
if should_place_top_ceiling {

Copilot uses AI. Check for mistakes.
Comment on lines +1058 to +1060
if !states.contains_key("direction") {
states.insert("direction".to_string(), BedrockBlockStateValue::Int(0));
}
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

Door conversion defaults direction to 0 when facing is missing. Since many of the project’s door blocks only set half (and omit facing), this default will be applied broadly and may not match Java’s default door facing, leading to inconsistent orientation in Bedrock exports. Consider defaulting direction to the Bedrock value that corresponds to Java’s default facing (commonly north) when facing isn’t provided.

Copilot uses AI. Check for mistakes.
Comment on lines +992 to +1000
/// Convert Java door block to Bedrock format with upper_block_bit.
///
/// Java doors use `half=upper/lower`, Bedrock uses `upper_block_bit` (bool).
/// Also maps door names: `oak_door` → `wooden_door`, others keep their names.
fn convert_door(
java_name: &str,
props: Option<&std::collections::HashMap<String, fastnbt::Value>>,
) -> BedrockBlock {
let bedrock_name = match java_name {
Copy link

Copilot AI Feb 8, 2026

Choose a reason for hiding this comment

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

New Bedrock property conversions were added for doors/trapdoors, but there are no unit tests covering these mappings (e.g., half→upper_block_bit, facing→direction, and defaults when facing/open/hinge are absent). Adding a few focused tests in the existing #[cfg(test)] module would help prevent subtle export regressions.

Copilot uses AI. Check for mistakes.
@louis-e louis-e merged commit 6adb8d0 into main Feb 8, 2026
@louis-e louis-e deleted the buildings-improvement branch February 8, 2026 18:43
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