Skip to content

Implement more realistic elevation#702

Merged
louis-e merged 9 commits into
mainfrom
better-elevation
Jan 8, 2026
Merged

Implement more realistic elevation#702
louis-e merged 9 commits into
mainfrom
better-elevation

Conversation

@louis-e

@louis-e louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner
2026-01-08_19 42 20

Copilot AI review requested due to automatic review settings January 8, 2026 18:52
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 38s
🧠 Peak memory usage: 915 MB

📈 Compared against baseline: 30s
🧮 Delta: 8s
🔢 Commit: 2d9892f

⚠️ This PR worsens generation time.

📅 Last benchmark: 2026-01-08 22:04:19 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 implements more realistic elevation mapping by changing from a heavily scaled/compressed elevation model to a 1:1 (or scale-factor:1) mapping of real-world elevation to Minecraft blocks. The old system used a BASE_HEIGHT_SCALE constant and aggressive compression; the new system only compresses terrain when it would exceed Minecraft's build height limit.

Key changes:

  • Removed BASE_HEIGHT_SCALE constant and replaced with scale-based realistic elevation mapping
  • Added valley bridge detection that uses fixed deck heights to span valleys without dipping
  • Introduced absolute Y coordinate placement methods for bridges to avoid terrain-following behavior

Reviewed changes

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

Show a summary per file
File Description
src/elevation_data.rs Removed BASE_HEIGHT_SCALE constant and implemented realistic 1:1 elevation scaling with conditional compression only when terrain exceeds build limits
src/world_editor/mod.rs Added get_ground_level method to query terrain elevation at specific coordinates without offsets
src/element_processing/highways.rs Implemented valley bridge detection with terrain sampling, added absolute Y coordinate placement for bridges with level decks, and created separate pillar generation for bridges
src/element_processing/buildings.rs Updated bridge generation to use max endpoint elevation for level bridge decks instead of terrain-following placement
src/element_processing/bridges.rs Modified bridge generation to use absolute Y coordinates and improved ramp calculations based on overall bridge progress

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

Comment thread src/elevation_data.rs Outdated
Comment thread src/elevation_data.rs Outdated
Comment thread src/element_processing/highways.rs Outdated
Comment thread src/elevation_data.rs Outdated
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

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

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


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

Comment thread src/elevation_data.rs
Comment thread src/element_processing/highways.rs Outdated
Comment thread src/element_processing/highways.rs Outdated
@louis-e louis-e requested a review from Copilot January 8, 2026 19:40
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

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

Copilot reviewed 7 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.

Comment thread src/elevation_data.rs Outdated
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

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

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


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

Comment thread src/element_processing/buildings.rs Outdated
Comment thread src/element_processing/bridges.rs Outdated
Comment thread src/element_processing/highways.rs Outdated
Comment thread src/element_processing/highways.rs Outdated
Comment thread src/world_editor/mod.rs
Comment thread src/element_processing/highways.rs
@louis-e louis-e requested a review from Copilot January 8, 2026 21:20
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

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

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


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

Comment thread src/element_processing/bridges.rs
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

retrigger-benchmark

@louis-e louis-e requested a review from Copilot January 8, 2026 22:02
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

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

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


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

Comment thread src/elevation_data.rs
Comment thread src/element_processing/highways.rs
@louis-e

louis-e commented Jan 8, 2026

Copy link
Copy Markdown
Owner Author

Slower benchmark due to first API call failing. So unrelated to our changes

@louis-e louis-e merged commit 550870d into main Jan 8, 2026
2 checks passed
@louis-e louis-e deleted the better-elevation branch January 8, 2026 22:14
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