Skip to content

Forest mapgen via region_settings #25425

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

Merged

Conversation

ralreegorganon
Copy link
Contributor

@ralreegorganon ralreegorganon commented Sep 7, 2018

Summary

SUMMARY: Infrastructure "Add forest composition attributes to region_settings and use in mapgen."

Purpose of change

Forests are currently a completely hardcoded mapgen, making it difficult to introduce new terrains and furnitures or adjust the overall parameters.

This change creates a new forest section in the region_settings which allows modification of these forest settings via json, either via region_settings or region_overlay entries, which means mods can also trivially add to or adjust the forest composition. These settings are then used in a new forest mapgen function.

Describe the solution

Additional context

The new forests should be roughly equivalent to the old ones, though some of the additional tree and shrub species that were previously underrepresented (or not present at all) should be a bit more common, and I've added some additional ground clutter (e.g. dirt, tree trunks, boulders) to liven up the forests a bit.

The primary reason why I've initially flagged this PR as [WIP] is that I'd like to get some testing and feedback to ensure that I've not accidentally totally ruined access to some critical forest-based resource. I do have ideas for further changes to the forest compositions, both for balance and verisimilitude, but I'd prefer to keep that for follow-ups.

If you're on Windows and want to run applications downloaded from strangers on the internet, I've compiled a version of this for testing purposes, which you can download here.

It's important to note that the previous and new forest mapgen functions handle both forests and swamps (and actually differentiates between forest which are at the boundaries of forests and forest_thick which are the inner forests).

The forest in spring...
forest_spring

...and a swamp
swamps

It's fairly straightforward to adjust the composition, keeping in mind that with the way regional settings are currently applied, there is effectively only one region for the entire map. So, you could turn the swamp above into a berry bog...

bogs

...but EVERY swamp will now use that definition. Being able to have multiple regions is certainly an area of future work, as one could imagine differentiating between coastal swamps (e.g. a salt marsh) and interior swamps or other similar changes based on region.

Using region_overlay entries, it's quite trivial for a mod to significantly change the nature of a forest--for example, Whaley has been working with an early version of these changes to introduce new fauna (plants native to New England), groundcover (leafy forest floor), muddy water, and adjust the density of the forest and spawn rates to create something like this:

catawoods6

Part of un-hardcoding the previous forest mapgen was moving some of its special events out to map extras--the spiderwebs, jabberwock, and Shia that were hardcoded in the forest are now map extras that are referenced by the forest map extras via the normal json configuration, though nothing precludes them now being referenced anywhere a map extra can be used.

I also added three new map extras to give a bit more life to the forest:

mx_grove

From wikipedia - The main meaning of "grove" is a group of trees that grow close together, generally without many bushes or other plants underneath.

This map extra finds the first tree in the area, and then converts all trees, young trees, and shrubs in the area into that type of tree. Here we see a grove of fruit trees:

groves

mx_shrubbery

Similar to a grove but for shrubs, this map extra finds the first shrub in the area, and then converts all trees, young trees, and shrubs in the area into that type of shrub.

shrubbery

mx_clearcut

From wikipedia - Clearcutting, clearfelling or clearcut logging is a forestry/logging practice in which most or all trees in an area are uniformly cut down.

This map extra converts all trees and young trees in the area to stumps.

clearcut

Finally, some more closing images through the seasons, to follow the spring from above:

summer
forest_summer

fall
forest_fall

winter
forest_winter

@ZhilkinSerg ZhilkinSerg added <Enhancement / Feature> New features, or enhancements on existing <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 Sep 7, 2018
@kevingranade
Copy link
Member

kevingranade commented Sep 7, 2018

Bug against github interface: only allows one 👍

@nexusmrsep
Copy link
Contributor

nexusmrsep commented Sep 7, 2018

This is big! Love it. Can see potential of going north (ice field regions), south (deserts), up (hills - replace trees with big boulders), or anywhere actually...

@FulcrumA
Copy link
Contributor

FulcrumA commented Sep 8, 2018

I like the overall idea, but I'd like certain adjustments. Clearcut map extra should happen only at the edge of such a forest, people don't go deep into it to make those unless there's some innawoods settlement/house - in which case, assuring that there's a relatively rare, small wooden cabin map extra, with basic house loot would be nice (I believe such a cabin already exists, it's just being spawned pretty randomly).

@ralreegorganon
Copy link
Contributor Author

Clearcut map extra should happen only at the edge of such a forest

My primary goal here is getting the infrastructure into the game so that you can just adjust numbers in json for this sort of thing.

I'm not opposed to adjusting the numbers for this--it's just a matter of modifying it for the relevant overmap terrains. The forest terrains currently have approximately a ~0.41 % chance of being clearcut, which means across the approximately 3750 to 10000 forests on an overmap, somewhere between 15 and 41 are clearcut.

That being said, I'm inclined to wait until I (hopefully) hear more playtesting comments before making any sort of initial numbers pass.

people don't go deep into it to make those unless there's some innawoods settlement/house

No, I actually think there is plenty of it in deep forest without any sort of habitation-related reason, but then we go down the rabbit hole of things like logging roads and much larger contiguous swaths of clearcut terrain, which is out of scope for something like a map extra--they're limited to a single overmap terrain and really just for adding some flavor--it's where helicopter crashes, portals, minefields, supply drops and like come from.

image

assuring that there's a relatively rare, small wooden cabin map extra, with basic house loot would be nice

Cabins (including the one you're thinking of) are more of an overmap special than a map extra. I am primarily focused on making this PR about the infrastructure which then opens up the possibilities for content down the road.

@ralreegorganon ralreegorganon force-pushed the forest-mapgen-region-settings branch 3 times, most recently from fc54c20 to 069fb69 Compare September 10, 2018 04:06
@ralreegorganon ralreegorganon force-pushed the forest-mapgen-region-settings branch from 069fb69 to cc98f83 Compare September 10, 2018 20:48
@ralreegorganon ralreegorganon changed the title [WIP] Forest mapgen via region_settings Forest mapgen via region_settings Sep 10, 2018
@ralreegorganon
Copy link
Contributor Author

I'm taking the [WIP] off this.

One thing to note is that any mod which includes a default regional settings will need to include the new sections. The Bright Nights mod included with the game does this, and I've updated it accordingly here.

@ZhilkinSerg ZhilkinSerg merged commit da4e596 into CleverRaven:master Sep 12, 2018
@ralreegorganon ralreegorganon deleted the forest-mapgen-region-settings branch November 14, 2018 18:05
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. <Enhancement / Feature> New features, or enhancements on existing [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.

5 participants