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

Feature: Configurable rainforest line height #8879

Closed
wants to merge 1 commit into from

Conversation

2TallTyler
Copy link
Member

Motivation / Problem

This is a patch created by @reldred and @JGRennison. I am simply upstreaming their work from JGRPP, with their consent.

Currently, rainforest height is 1/4 of the chosen Maximum map height. This is not intuitive nor is it explained anywhere.

More importantly, it also does not allow all-green sub-tropic maps, since the minimum maximum height is 15. This is true even for heightmaps — the only workaround is to bulldoze all the desert in Scenario Editor, then replant rainforests by hand (rainforests are defined by rainforest trees, which spawn only in rainforest land, so you need to plant them manually to create rainforest land).

Description

This changes the rainforest line height to be controlled the same way as the snow line height, both in Settings and during map generation.

From reldred's PR to JGRPP:

Default setting is 8 which matches and should provide default behavior in new map creation.

world_generation

If you set the rainforest line height to 1, you get all rainforest! Water towers don't spawn, but the same is true for farms and forests for certain snow line settings, so I don't think we need to worry about players breaking this.

green

Limitations

I have not done a savegame bump before, so please check to ensure I've done this correctly.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@reldred
Copy link

reldred commented Mar 22, 2021

Just had a quick look, the parts that I wrote at least look alright. Good luck with merge! I'm personally really enjoying it in my own games.

@nielsmh
Copy link
Contributor

nielsmh commented Mar 22, 2021

I just want to comment that I think this is not the right approach. It will work, but there's really supposed to also be rainforest on the low parts of the map, and nothing wrong with deserts on the high parts either. The original map generator splits tropical maps in half along a diagonal, and makes one side mountainous rainforest and the other half flat-ish desert.

I'd really like to see an alternate approach for TGP where it creates a belt of rainforest through a desert map, or a belt of desert through a rainforest map, such that about half the world is one and the other half is the other.

@James103
Copy link
Contributor

I'd really like to see an alternate approach for TGP where it creates a belt of rainforest through a desert map, or a belt of desert through a rainforest map, such that about half the world is one and the other half is the other.

That could be accomplished by using another (different) Perlin noise map as the source of humidity on the map. When the value of that humidity map is above a threshold, the tile is rainforest. Otherwise, the tile is desert. This threshold could be configurable in order to control the amount of rainforest area on the map, where the extreme ends would result in all-desert or all-rainforest, and in-between values producing various patches of deserts and rainforests on the map.

@reldred
Copy link

reldred commented Mar 22, 2021

I just want to comment that I think this is not the right approach. It will work, but there's really supposed to also be rainforest on the low parts of the map, and nothing wrong with deserts on the high parts either. The original map generator splits tropical maps in half along a diagonal, and makes one side mountainous rainforest and the other half flat-ish desert.

I'd really like to see an alternate approach for TGP where it creates a belt of rainforest through a desert map, or a belt of desert through a rainforest map, such that about half the world is one and the other half is the other.

I agree, and this lines up with something that TrueBrain and I have been chatting about all night on discord; getting these 'regions' that the Original map generator had back also fixes issues with Arctic maps where forests aren't generating. Alas, that is a much larger problem to solve with TGP, and hasn't been solved yet. This patch already exists and fixes a problem right now.

Realistically, this is a band-aid on the problem of the rainforest line being defined as max_height/4, and we've been discussing at great lengths the problem that max_height creates for us all for a few days now because TGP in quite a few cases will never get to it. TrueBrain and I more or less agree on an approach now to solve that problem, but it doesn't do anything about the unique personality that the Original map generator gives both Arctic and Tropic maps; the distinct regions.

Ultimately, I'm also working on configurable width of the tropic zone (separate from rainforest zone) around rivers and also hoping to make it configurable for the coast line as well so that tropic industries stand a better chance to spawn. Again, they're band-aids on the problem, but I can make bandaids, I can't do surgery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants