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

Allow aliasing extendable lake shore terrain #32724

Merged
merged 1 commit into from Jul 29, 2019

Conversation

ralreegorganon
Copy link
Contributor

Summary

SUMMARY: Infrastructure "Allow aliasing extendable lake shore terrain"

Purpose of change

The lakes I added in #30442 have procedurally generated shores, which will also utilize the mapgen of a subset of overmap terrains if they are adjacent to the shore in order to "extend" that mapgen right up to the water (e.g. if the shore is next to a forest, then the forest will be extended up to the water).

If someone wants to put a cabin on a forested island in a lake, a reasonable mapgen entry might be the single cabin overmap terrain surrounded by lake shore. However, because that cabin isn't listed in the "extendable lake shore terrain", the lake shores will just default back to normal regional ground cover. If the user were to list the cabin terrain in the "extendable lake shore terrain", it still wouldn't have the desired effect since the game would just try to put a cabin on every adjacent lake shore.

What we really want is the ability to tell mapgen that the cabin should be treated like a forest for the purposes of extending the overmap terrains to lake shores...so I did that.

Describe the solution

  • Added a new section in the lake regional settings where overmap terrain matching rules and aliases can be defined.

  • Updated the lake shore mapgen to utilize these aliases when determining which overmap terrain to extend to the water.

Additional context

Suppose we make a new overmap terrain, have it specify "predecessor_mapgen": "forest_thick" and then place it in the lake surrounded on all sides by lake shore. Here's a look at the result before and after this change.

before this change
image

after this change
image

@ralreegorganon ralreegorganon added <Documentation> Design documents, internal info, guides and help. [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` [Markdown] Markdown issues and PRs labels Jul 29, 2019
@ZhilkinSerg
Copy link
Contributor

Not astyled probably.

@ralreegorganon
Copy link
Contributor Author

ralreegorganon commented Jul 29, 2019

Not astyled probably.

Oops. Had astyled and forgot to push...

@ZhilkinSerg ZhilkinSerg merged commit 63d4246 into CleverRaven:master Jul 29, 2019
@ralreegorganon ralreegorganon deleted the aliasing-lake-shores branch April 7, 2020 16:09
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` <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants