- Home /
How would I generate a forest using perlin noise?
I always thought spawning objects using perlin would be an easy answer but now I'm realizing a huge problem! I'm not using a tile system, so the resolution (space between items) becomes a problem and I will also be generating objects in-game so I need to be able to rescan spaces I haven't seen yet when running through the map. So my stupid solution was to check every 0.1f unit using perlin noise but that doesn't seem to be enough resolution for the perlin function to give me actual noise. There's a lot of variables here that can change the outcome so I'll simply ask, what do you do to randomly generate objects in a game that's not using a tile system?
Hello, can you give more information about how you want you forest ? There is many ways of using perlin noise i'm a little bit confused.
Dunno how else you'd do it but create a tree on the spot where perlin (e.g) returns a number below .1f
What i will do its generate a tree base of a chance of the perlin. I explain: you compute the perlin noise depending of the position. Then you take a random value and if its < of the perlin you place a tree however nothing. Do this every x meter and you will have differents density of tree. You could also scale distance between trees with perlin noise (perlin*maxDistance).
Answer by PlayCreatively · Dec 14, 2019 at 02:24 PM
I've figured the problem. If you're going to use perlin noise
, make sure your input is a few decimal points, otherwise you'll get no noise. Only thing you have to do is add an offset to your values, or you can call it the seed: float offset = 3.452f
Mathf.PerlinNoise(X + offset, Z + offset);
Your answer
Follow this Question
Related Questions
Block based map generator 5 Answers
Where to start in galaxy map generation for a 4x game? 1 Answer
Is it possible to round a perlin noise value to 1 or 0? 1 Answer
How to spawn a random hexagon pattern? 0 Answers
Terrain help 0 Answers