- Home /
World Seed
Hi :) its my first question, im building a voxel terrain system, im just using my own 2D perlin noise to get the terrain height for now, but i was wondering how can i have a world seed system like minecraft, in the sense that if the seeds are the same, trees will spawn in the same place, any ideas? i cant just set the random seed because the trees wont spawn in order, maybe another perlin noise? i have no idea. im thinking about having a noise function for temperature, humidity and height, then getting other values from that, such as tree spawning, let me know
Answer by AlwaysSunny · Apr 13, 2015 at 04:15 AM
When I did this, I had multiple layers of blended noise and multiple nested generations, all kinds of crazy stuff going on. I never felt the need to use more than one "world" seed.
The control over the various aspects of noise generation should come from the other parameters; scale, octaves, iterations, blending (if any), etc. These are experimentally found fixed values you can safely hard-code. Assuming these parameters are fixed, the same seed will produce the same world every time. This is highly desirable in most situations.
In case you are unaware, the seed value should be applied to the position arguments from which you sample noise. Adding the seed value to the position arguments is sufficient to introduce the seed to the generator and have it function as described.
thank you, this helps a lot! so i think im just going to have a few noise fields and set the perimeters(scale, offset, etc) right at the start by setting the random seed, then calling random.range right after, that should get me the same noise every time, i just hope i tooks good XD, thanks again
Answer by KdotJPG · Apr 14, 2015 at 02:14 AM
I don't really have much to say about implementing a save system, but there is one thing I feel strongly about that I would like to advise you on: Don't use Perlin noise!
Perlin noise has significant directional artifacts. It's an older function, and regardless of the fact that people talk about it all the time and that it's the one that's built into Unity, it's more often than not a worse choice than the alternatives.
Look up Simplex noise (Perlin's newer function) and OpenSimplex noise (a similar function I came up with that works a bit differently). You should be able to find C# implementations of both.
Your answer
Follow this Question
Related Questions
Texture mapping procedural mesh with texture atlas? (Minecraft style terrain gen) 1 Answer
Noise block terrain generation? 0 Answers
Minecraft Biomes: How to Make? 2 Answers
Tiled Terrain 0 Answers
Smooth Voxel terrain. How is it done? 2 Answers