Add support for dynamic predecessor mapgen #52208
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 "Add support for dynamic predecessor mapgen"
Purpose of change
The idea is that some
oter_t
s are just a modification of the existing terrain, and we want to remember what that terrain was and generate it before proceeding with the mapgen for the current terrain.Describe the solution
We implement this by adding a flag to the
oter_type
indicating that it needs to save predecessor information, and a fallback predecessor terrain to the mapgen. This serves two purposes: allowing it to opt in to this feature, which means it is no longer forced to define terrain for every location, and defining a fallbackoter_t
to use in the event none is stored in the overmap (which can happen, e.g. when the mapgen definition changes between overmap mapgen and tile mapgen for a particular OMT).Use this new feature for the anthill.
Describe alternatives you've considered
Could have switched these OMTs to use
update_mapgen
rather than plain mapgen.Testing
Spawn some anthills; see below.
Additional context
Here are some pictures of anthills in various terrains:
Previously all anthills appeared in mostly grass with a few bushes.