Conditional nesting in mapgen - by overmap neighbor adjacency #22131
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.
A step in the direction of jsonized labs. Still not there yet, but not far from it.
A nested entry now has an optional
"neighbors"
field. If the field exists, the nested mapgen will only be applied if all the neighbors match the ones specified there. For example:In this case one of the two nested mapgens will be applied at random point in square from
[ 10, 10 ]
to[ 20, 20 ]
only if north is a forest or field and south is a forest or field (can be mixed, like north being forest and south being field).I edited the
swamp_shack.json
to show this new feature. The changes are as follows:Additionally, minor tweaks:
const mapgendata &
instead ofmap *
to json mapgen pieces. That structure is already created in mapgen above and it usually goes to waste. This structure contains adjacency data (for the feature here), but also "biome" data. Biomes are nowhere near functional, but having this data would make it somewhat more likely that this will move somewhere sometime.mapgendata
structure.