Skip to content

Conversation

@scd31
Copy link

@scd31 scd31 commented Sep 28, 2025

With argo run --release -- --bbox 45.943511,-66.675682,45.981934,-66.605644 --path server/world --ground-level 80 --terrain --fillground --interior --roof --debug I get this:

image

my river is restored (:

this was the result of 2 separate bugs.


/// Clips a way to the bounding box boundaries using Sutherland-Hodgman algorithm for polygons
/// or simple line clipping for polylines
fn clip_way_to_bbox(
Copy link
Author

Choose a reason for hiding this comment

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

Bug #1 is in here somewhere - we end up chopping things off incorrectly. I've removed this code as it seems like a lot of logic that shouldn't actually be doing much (generally our element processing clamps things to within bounds anyway, right?). But I also understand someone spent a lot of time writing this in the first place. I just don't personally want to be the one to figure out what is wrong in here (plus, there may be more bugs lurking here)

}

// Process each outer polygon individually
for (i, outer_nodes) in outers.iter().enumerate() {
Copy link
Author

Choose a reason for hiding this comment

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

I pretty much fully reverted this. Bug #2 is that processing each polygon individually completely ruins the point of the merge_loopy_loops function

}
}

if !nodes.is_empty() {
Copy link
Author

Choose a reason for hiding this comment

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

These various changes is so we don't accidentally exclude a node/way that's being used in our relation


merge_loopy_loops(&mut inners);
if !verify_loopy_loops(&inners) {
// If inners are invalid, process outer without inners
Copy link
Author

Choose a reason for hiding this comment

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

This also didn't seem like a great fallback to me. If the inner loop is invalid we probably don't want to just fill it in!

@scd31
Copy link
Author

scd31 commented Sep 28, 2025

image

sick, this has also improved new york massively. It's moist!

@scd31
Copy link
Author

scd31 commented Sep 28, 2025

image

Fixed docks as well in the latest commit. https://wiki.openstreetmap.org/wiki/Key:waterway Apparently "waterway=dock" represents a water area, so I've implemented that

@scd31
Copy link
Author

scd31 commented Sep 28, 2025

image

new york city is now fully wet! badda bing badda boom

@louis-e
Copy link
Owner

louis-e commented Sep 29, 2025

Incredible work as always. Tons of thanks to you!
However I'm getting those errors in Minecraft 1.21.8 when loading the world:
[20:36:16] [Worker-Main-25/ERROR]: Chunk file at [16, 17] is missing level data, skipping
[20:36:16] [Worker-Main-24/ERROR]: Chunk file at [15, 19] is missing level data, skipping
[20:36:16] [Worker-Main-23/ERROR]: Chunk file at [15, 18] is missing level data, skipping
[20:36:16] [Worker-Main-20/ERROR]: Chunk file at [17, 18] is missing level data, skipping
...

Minecraft then replaces the faulty chunks with the standard generated flat Minecraft "terrain". I fixed it locally to try out the waterway generation. Could you check back on your end if this regression is introduced by this PR?

@scd31
Copy link
Author

scd31 commented Sep 29, 2025

@louis-e Yeah that's a regression introduced by my other PR. I'll remove the commit from this so it's not blocking

@scd31
Copy link
Author

scd31 commented Sep 29, 2025

@louis-e done

@louis-e
Copy link
Owner

louis-e commented Oct 2, 2025

Perfect, thank you so much!

@louis-e louis-e merged commit 82f3460 into louis-e:main Oct 2, 2025
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.

2 participants