Optional joins for mutable overmap specials #51657
Merged
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
Infrastructure "Allow joins in mutable overmap specials to be optional"
Purpose of change
To add more flexibility to the layout of mutable specials it is convenient to allow some joins for particular overmaps to be available to satisfy unresolved joins, but not trigger their own unresolved joins. This helps in particular with the final phase when you want to clean up all the leftover unresolved joins.
Describe the solution
Generalize the definition of joins to allow this in the JSON, and handle appropriately in the code.
Extend the unit tests to spawn a test crater to exercise this feature.
Convert craters to use this feature.
Craters now have two different OMTs:
crater
andcrater_core
.crater
is still hardcoded (that will change in a future PR) but I definedcrater_core
in JSON. It now features an explosive effect so that there is an actual crater. I think this makes it slightly more interesting than it used to be because now it might provide access to underground tunnels or something like that.But overall, crater mapgen is still super dull.
It took me a while to figure out a way to use the explosives activating on mapgen feature to generate the crater holes, because explosions stop at the edge of the reality bubble. The trick is to put four explosions near each other, but ensure that one is in each submap. That way, every submap causes an explosion no matter which order they are loaded in.
@ephemeralstoryteller @mlangsdorf You might want to use this same trick in the
mx_dsa_bombed_crater
(the only other placeACTIVATE_ON_PLACE
is currently used, in Dark Skies Above).Describe alternatives you've considered
I also want the concept of an optional join that will try to be satisfied, but not trigger an error when it isn't. I could add that in the same PR, but I wanted to get this out, and I don't have an example in mind to use these other semantics as yet.
Each
crater_core
terrain has its own hole, rather than them all blending into one big hole. The latter would be tricky to pull off (perhaps not impossible using conditional nested mapgen), but I choose to imagine that they were created by a collection of related explosions rather than one big one.Testing
Spawn a bunch of craters.
Run the new unit test.
Additional context
Here are some new craters on the overmap:
Here's what they look like up close: