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

Fix: Farms could be generated at sea level #7877

Closed
wants to merge 1 commit into from

Conversation

SamuXarick
Copy link
Contributor

An incorrect height check function was being used, which could result in leveled land with height lower than 1.

lGBnGP7 - Imgur
VYOHgMM - Imgur

An incorrect height check function was being used, which could result in leveled land with height lower than 1.
@FLHerne
Copy link
Contributor

FLHerne commented Dec 26, 2019

Why does this matter?

(is the problem that the lowered area can overlap with existing sea, leading to the industry being flooded?)

@SamuXarick
Copy link
Contributor Author

Why does this matter?
(is the problem that the lowered area can overlap with existing sea, leading to the industry being flooded?)

Not that I'm aware, but if that happens, then it's probably during final stage of world gen, running tile loop.

I will investigate.

@nielsmh
Copy link
Contributor

nielsmh commented Dec 26, 2019

I don't see why this is a problem, and I don't see why this change would affect it.

@SamuXarick
Copy link
Contributor Author

4 farms in the map, all in the same spot.zip

I discovered something else related to this, tested with a map size of 64x4096, snowline 3 and terrain set to Flat.

Farms can only be placed when the condition if (GetTileZ(tile) + 2 >= HighestSnowLine()) fails, which is a very rare occurence by itself, but sometimes, the planting of the first farm, can increase the chances of the 2nd farm being planted nearby due to terraforming the tiles around it to height zero.

Since the generated number of tiles with height zero is constrained to the same are area, multiple farms can spawn next to each other. I had one map generate 7 farms next to each other at height 0, while the map only had a total of 10.

7 farms at height 0, out of 10 total

@frosch123
Copy link
Member

Please stop spamming the PR list.

@frosch123 frosch123 closed this Dec 27, 2019
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