-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
3D mapgen #74169
Merged
Merged
3D mapgen #74169
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions
bot
added
[JSON]
Changes (can be) made in JSON
Map / Mapgen
Overmap, Mapgen, Map extras, Map display
[C++]
Changes (can be) made in C++. Previously named `Code`
astyled
astyled PR, label is assigned by github actions
json-styled
JSON lint passed, label assigned by github actions
labels
May 29, 2024
github-actions
bot
added
the
Code: Tests
Measurement, self-control, statistics, balancing.
label
May 30, 2024
github-actions
bot
added
<Documentation>
Design documents, internal info, guides and help.
[Markdown]
Markdown issues and PRs
labels
Jun 1, 2024
github-actions
bot
added
the
<Bugfix>
This is a fix for a bug (or closes open issue)
label
Jun 2, 2024
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jun 2, 2024
github-actions
bot
removed
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jun 3, 2024
github-actions
bot
added
the
BasicBuildPassed
This PR builds correctly, label assigned by github actions
label
Jun 4, 2024
Brambor
reviewed
Jun 15, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
astyled
astyled PR, label is assigned by github actions
BasicBuildPassed
This PR builds correctly, label assigned by github actions
<Bugfix>
This is a fix for a bug (or closes open issue)
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Tests
Measurement, self-control, statistics, balancing.
<Documentation>
Design documents, internal info, guides and help.
[JSON]
Changes (can be) made in JSON
json-styled
JSON lint passed, label assigned by github actions
Map / Mapgen
Overmap, Mapgen, Map extras, Map display
[Markdown]
Markdown issues and PRs
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
None
Purpose of change
Allow mapgen to make use of 3D functionality.
Fix #74044, i.e. dermatik roof matching level below.
Describe the solution
Describe alternatives you've considered
It WOULD be possible to generate each Z level, record which other Z levels are affected, wipe the results between each level, and then determine a level generation order (or that there is a circular dependency). However, that would be rather expensive. The approach to generate everything with a default generation order (top-down) and then work out a load order when an out-of-order case was detected falls on the generation potentially writing to preexisting maps, and you can't undo that. You could potentially get away with that if you copied all preexisting submaps and then replaced the originals with the (potentially) updated copies when done (making new copies once a suitable generation order has been determined). I think that's too much code mess for a rather niche case, though.
All the use cases I know of where you'd want to tie things on multiple Z levels together go upwards (match roof to building for Aftershock ruins, match roof to wall for dermatik mound, match tree top to tree for all trees). I wouldn't mind to receive suggestions for cases where you'd want to tie lower levels to higher one and don't want to switch the level dependency if someone can think of them.
Testing
Additional context
You may have seen this PR before. I switched "back" to 3D_mapgen after some other work and continued without incident. Then uploaded it to 3D_mapgen, and now I can't upload to 3d_mapgen after switching back to the "real" branch, so I'll try to continue here instead (if it works).
A weird thing is that the code talks about not bothering to save uniform submaps because it's cheaper to recreate them, but then it proceeds to save every submap on every Z level without sorting out uniform ones.
I would assume that if you actually wanted to be able to selectively skip uniform levels you'd also need something lightweight to recreate them, rather than the current only option of recreating the whole OMT on all Z levels (although that logic doesn't actually regenerate things that already exists).