Hi, I’m a little bit lost when comes this but I’d like random terrain generation based on a seed but I’m not sure which algorithm/built-in algorithm I should use --based on speed, if it will actually create the same number again and doesn’t make two very similar numbers (or at least not likely).–
Use Random.seed. Or use System.Random and supply a seed when doing a new Random().
–Eric
2 Likes
Also, for terrain generation, consider using Mathf.PerlinNoise, which is really handy for that sort of thing. Just mix several noise calls, at different resolutions (multiples of x and y for its inputs) and scales (multiples of the result), and boom, you have a fractal terrain.
I’ve done a Live Session (in Learn/Live Training) on “Height Maps”, which include some basic random generation that you might be interested in. Don’t forget Unity has its own Random class, which you can see in the scripting reference.