Procedural Map Biomes 2D

Hello everybody,
I managed to create a top down map with 2D sprites, that procedurally generates at every compile, but I’m not really sure how to implement biomes in it. The basic map generates from an array where I put values corresponding to the different tiles I have, and by making it random it doesnt really create biomes, but just small patches of the different floor tiles, like this:


and this is the actor blueprints:

so my question is how can I make bigger patches of different floor tiles in that array so that the biomes are consistent and bigger?

Thanks in advance

1 Like

What about doing it by reading from a texture? You can use the method to read the texture

and there’s a lot of noise textures with the engine that look like they’d create good biomes

image
image
image

2 Likes

Yes, I thought about the perlin noise but since this is my first project I don’t know much about it and I don’t know how to create the texture you shown, so if you can explain it to me or link some video about it it would be really appreciated. Also, once I have that, since the texture is black and white so I can’t set a tile based on the color of the map in that coords, how do I “select” every area where I should put all the biomes?
Thanks again!

1 Like

I didn’t make them, the default engine and starter content folders are crawling with them :slight_smile:

You can also get some very good noise on the market

Rather than using RGB for your biome, you can just use noise textures at different scales to decide where to put what.

There’s also a lot of tuuts on making your own noise, it looks fairly simple

and ( tada! )

http://kitfox.com/projects/perlinNoiseMaker/

2 Likes

Thanks for the video link, was very usefult to understand perlin noise. The real problem now is that I’m building a top down 2D game, and my map won’t have any elevation. Also he is doing this perlin noise in python and I don’t have any clue on how to do that in unreal engine sicne I can’t code in C++ and I’m still getting used to blueprints.:sweat:
So I think the only way to do biomes might be some type of rgb noise?
I’d like to end up with something like what’s in this thumbnail tho I can’t really follow his tutorial because he’s using Godot Engine :'):

Did you try the last link? You can make color noise there.

Yes I did, but I need to create it inside unreal and not download the noise image since I want it to be seedable and most importantly procedural. Maybe I’m missing some steps or we misunderstood

Ah, I see, didn’t know that… :slight_smile:

You might be able to do it in blueprint, but you probably need C++.

Ah, f@%& I don’t even know how to create a c++ file lol. Maybe I can try creating an RGB noise material and then read that, and for every seed I read the noise in the square with coordinates starting at (0,0) and then advancing by the size of the map I want to create each time.
Example:
map size = 256
seed = 1
the noise i read would be in the square with vertices (0,0), (256,0), (256,256), (0,256).
seed = 2
the noise i read would be in the square with vertices (256,256), (2562,256), (2562,2562), (256,2562).
etc…

That ‘fast noise’ generator I recommended ( up there ) does perlin. What’s wrong with that?

I actually created this blueprint with that fast noise, but I don’t know to see the image of the noise i created.

You need to read the docs :wink:

I know it works, I’ve used it…

Anyway, there is no image, it’s data, which exactly what you want :slight_smile:

Because if you had an image, you’d only have to read it to get the data. With this FNG, you get the data immediately.

Alright, that’s better then. But the docs say that once I created the wrapper like i did to call the GetNoise2D or GetNoise3D functions which I can’t find. Don’t I have to call them on the construction script page?

Edit:
Found that, I had to call the Get Noise Wrapper first and now I can see the functions.
image

1 Like

They are also right there, in the list :wink:

image

Wait I don’t have that Fast Noise category :face_with_raised_eyebrow:
image

Default Perlin

Oh ok if you meant from the get wrapper object yeah thats what I searched it from when I found it. Before I was searching it without “getting” the wrapper variable.

I hooked everything up and this is what came out.


So basically after the contruction script I create the noise, after that I make an array of the size of the map I want to make and the with 2 for loops I assign to every array element the value of the noise. After that I can proceed looping trough the array and building the tiles from the noise value, for which I don’t know the ranges of :sweat:.

I think it’s normalized, so -1 to 1

Oh I just realized I have to convert my array to float

1 Like