Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Create different Biomes #40

Open
Open
@IPotatoCouch

Description

@IPotatoCouch

Different biomes / regions could be nice to have :]

Activity

Eldemarkki

Eldemarkki commented on Jul 15, 2020

@Eldemarkki
Owner

This solution that I quickly thought up of would only work with 2 biomes, but maybe someone smarter than me knows how to extend it to more than 2. I haven't spent much time on this.

First, create 2 noise functions; 1 for biome A called GetA(x, z), and one for biome B called GetB(x, z). Those functions would generate the height for the biomes. So GetA() could for example be an infinite plains biome, and GetB() and infinite mountains biome.

Then, have a third noise function representing the blend. For any given point (x, z), the height of point (x, z) would be y = Lerp(GetA(x, z), GetB(x, z), GetBlend(x, z)). GetA() and GetB() representing the noise functions of A and B. GetBlend() would tell how much to blend the biomes: 0 would be completely biome A, and 1 would be completely biome B.

I would rather do something like this, than a height-based biome, as height-based gives rings of biomes and I don't really like the look of that

IPotatoCouch

IPotatoCouch commented on Jul 17, 2020

@IPotatoCouch
Author

Thanks for the tip! This sounds like a good solution. For multiple biomes I was thinking would it be possible to generate a biomes map, something like this maybe.

BiomesMap

Each biome has its own color, so with a map like this it would be easy to determine where each biome is located. One issue is blending biomes together. Maybe even make biomes bleed into each other, so it would give more realistic results. I'm not smart enough to figure this out tho..

Eldemarkki

Eldemarkki commented on Jul 17, 2020

@Eldemarkki
Owner

Yeah, the blend is very difficult. I remember once (like maybe a year ago) trying a climate based biome system, where the inputs are 2 noise maps, one for precipitation and one for temperature. Here's picture of what I mean:

In that experiment, I think I could generate the biomes nicely, but blending the heights was the biggest problem which I never managed to solve.

IPotatoCouch

IPotatoCouch commented on Jul 17, 2020

@IPotatoCouch
Author

That looks really nice! What if you blend the biomes map like this? Each biome has its own noise so once the map is blended so as the noise maps. Would that be possible?

BiomesBlend
BlendedBiomes

This is a bit ugly example, but does this even make sense? In my head this sounds logical yet I have no idea how to accomplish this.. :D

IPotatoCouch

IPotatoCouch commented on Jul 17, 2020

@IPotatoCouch
Author

Biomes map would almost act like a mask for noise maps, if the biomes map is 'blurred' you would get a smooth transition

Eldemarkki

Eldemarkki commented on Jul 17, 2020

@Eldemarkki
Owner

I think that's a great idea! I'll post something here if I manage to think of some implementation. It's definitely a hard problem.

IPotatoCouch

IPotatoCouch commented on Jul 17, 2020

@IPotatoCouch
Author

Awesome thank you! 🙂 Been scratching my head for hours, it's quite a task.. A bit too much for my brain too handle 😄

Eldemarkki

Eldemarkki commented on Jul 17, 2020

@Eldemarkki
Owner

I looked for the repository about the climate based biomes (like in the diagram in the previous comment) and found it! I made a few changes to fix the blending, and made the repository public. Here it is: https://github.com/Eldemarkki/TerrainBiomeGenerator.

This is what it looks like with blending=0:
kuva

And this is with blending=3:
kuva

It's not perfect, the colours are quite sharp looking at some places, and it is not very realistic as there are multiple places where it goes from desert to tundra, but that can be tweaked quite easily.

And in case it wasn't obvious, that is not using marching cubes.

The blending is done by just taking the average height around the sampling point. The transition from any biome to ocean is not blended, because I don't want the ocean to suddenly go upwards near the transition.

IPotatoCouch

IPotatoCouch commented on Jul 18, 2020

@IPotatoCouch
Author

Really nice! This works pretty well! Will you be implementing this approach to Marching-Cubes-Terrain project as well? 🙂

Eldemarkki

Eldemarkki commented on Jul 18, 2020

@Eldemarkki
Owner

I'm not really sure. If I end up implementing it, it most likely will not be in the main repository, but in the TerrainBiomeGenerator repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @Eldemarkki@IPotatoCouch

      Issue actions

        Create different Biomes · Issue #40 · Eldemarkki/Marching-Cubes-Terrain