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

Biome generation: Allow mapgens to alter biome zero level #5885

Closed
wants to merge 1 commit into from
Closed

Biome generation: Allow mapgens to alter biome zero level #5885

wants to merge 1 commit into from

Conversation

paramat
Copy link
Contributor

@paramat paramat commented Jun 2, 2017

WIP still need to test.

Allows mapgens to raise or lower the entire set of registered biomes per-mapchunk by setting the 'biome zero level' instead of that level always being y = 0.
This will allow the option of repeating the registered set of biomes in mgv7 floatlands without needing to register a duplicate set of biomes just for floatlands.
Will also allow future mapgens to create a world of multiple stacked realms without needing to register a set of biomes for every realm.
Will probably allow further interesting possibilites for future mapgens.
(I am currently experimenting with new core mapgens that can make use of this PR).

Also intended in other PRs: The same feature for registered ores and decorations.

@paramat paramat added @ Mapgen Feature ✨ PRs that add or enhance a feature WIP The PR is still being worked on by its author and not ready yet. labels Jun 2, 2017
@paramat
Copy link
Contributor Author

paramat commented Jun 2, 2017

Works for mgv7 floatlands with MTGame floatland biomes disabled and:

 	// Init biome generator, place biome-specific nodes, and build biomemap
 	biomegen->calcBiomeNoise(node_min);
-	MgStoneType stone_type = generateBiomes(0);
+	s16 biome_zero_y = ((spflags & MGV7_FLOATLANDS) &&
+			node_min.Y > shadow_limit) ?
+			floatland_level - 1 : 0;
+	MgStoneType stone_type = generateBiomes(biome_zero_y);

@paramat
Copy link
Contributor Author

paramat commented Jun 2, 2017

Build failed for silly reasons.

@Fixer-007
Copy link
Contributor

Will also allow future mapgens to create a world of multiple stacked realms without needing to register a set of biomes for every realm.

Terrain and biomes will be random on both realm?

@paramat
Copy link
Contributor Author

paramat commented Jun 2, 2017

Hmm unfortunately if biomes repeat they will have identical distribution on each level because heat and humidity noises are 2D noises. So now i'm unsure about this PR, we are intending to have differing biomes for mgv7 floatlands.

Terrain is independent from biomes and is created by a core mapgen, my current experimental core mapgen has the same character of terrain on each level but the terrain is not identical on each level. The noise used is shifted by 62000 nodes per level so no terrain on a level will match any other terrain on any other level, every piece of terrain on every level is completely unique.

Ii might be possible to shift heat and humidity noises in the same way.
EDIT: Ninja'd.

@Fixer-007
Copy link
Contributor

Why not shift (a lot) biomes too?

@paramat
Copy link
Contributor Author

paramat commented Jun 2, 2017

Yeah, just edited my comment above with that.

@paramat
Copy link
Contributor Author

paramat commented Jun 2, 2017

What this comes down to is, is it interesting to have the same set of biomes used on every level? I would prefer differing biomes per level.
For now i'll close this and instead work on a more interesting biome feature (which would conflict anyway).

@paramat paramat closed this Jun 2, 2017
@paramat paramat added Won't add The feature request was rejected and will not be added. and removed WIP The PR is still being worked on by its author and not ready yet. labels Jun 2, 2017
@paramat paramat deleted the biomezero branch June 4, 2017 19:36
@paramat
Copy link
Contributor Author

paramat commented Jun 13, 2017

Will resurrect this in a new PR as is very useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature ✨ PRs that add or enhance a feature @ Mapgen Won't add The feature request was rejected and will not be added.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants