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

Optional joins for mutable overmap specials #51657

Merged
merged 2 commits into from
Sep 19, 2021

Conversation

jbytheway
Copy link
Contributor

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 and crater_core. crater is still hardcoded (that will change in a future PR) but I defined crater_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 place ACTIVATE_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:
crater-overmap
Here's what they look like up close:
crater-small-example
crater-big-example

@actual-nh actual-nh added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Sep 16, 2021
To add more flexibility to the layout of mutable specials it is
convenient to allow some joins for particular overmaps to be optional.
This helps in particular with the final phase when you want to clean up
all the leftover unresolved joins.

Generalize the definition of joins to allow this in the JSON, and handle
appropriately in the code.

Convert craters to use this feature.

Extend the unit tests to spawn a test crater to exercise this feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Enhancement / Feature> New features, or enhancements on existing Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants