Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add /region, fix bounds & improve union perf #1491

Merged
merged 3 commits into from
Feb 8, 2025
Merged

Conversation

Pablete1234
Copy link
Member

@Pablete1234 Pablete1234 commented Feb 8, 2025

Region viewing command

Adds /region <region-id> command, which will display a regions' bounds and blocks.

This is useful for mapmakers creating maps, or mapdevs double-checking maps.

Block-bounded off-by-one region fix

Fixes a very old bug with block iterating in regions, where some blocks were excluded. This can affect only contexts where the region is used for block-bounded things, like fill actions, structures, or core, monument or hill definitions; things where pgm wants to "list the blocks" in the region.

Fix impact

Looking thru 2000 maps none of them seem to be affected negatively by this, most will end up with larger iterating area but pgm discards the blocks when checking contains. Only a few (20 maps) had a modified block count included, where the blocks in the region increased count. However we did not find it affecting gameplay (eg: a core definition region being 1 block bigger means nothing if there's no obsidian there, it ends up being exactly the same). Also note this only affects regions defined in non-full-block coordinates, so a cuboid with max=-10.0 is unaffected, one with max=-10.5 will be moved over by one.

Optimization to block-traversing of unions

Additionally optimizes union iterating, where instead of going thru the whole bounds we can take some smarter approaches by iterating the children instead. This is purely a technical change with no gameplay implications.

cswhite2000
cswhite2000 previously approved these changes Feb 8, 2025
Signed-off-by: Pablo Herrera <[email protected]>
cswhite2000
cswhite2000 previously approved these changes Feb 8, 2025
@Pablete1234 Pablete1234 merged commit 2515b69 into dev Feb 8, 2025
2 checks passed
@Pablete1234 Pablete1234 deleted the add-region-cmd branch February 8, 2025 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants