Since I just recently looked into terrain generation, I thought I’d share what I’ve made with it.
Perlin Noise has given me a fair bit of trouble when trying to implement it. Not sure what exactly I was doing wrong, but it was still kinda weird. I ended up discovering a more simple method of generating natural terrain at this site, however the method I originally thought up looks just as smooth in my opinion.
I started off width a 2D array of 1’s (or some other starting number). Then I used a function that raises the values surrounding inputs (x, y) inside of the 2D array; the closer it is to (x, y), the more the terrain is raised, and vice versa. Call this function multiple times at random (x, y) locations, and I have the height map to generate the terrain. I later found a smoothing function that I used for more smooth looking hills.
I used this to generate a Minecraft terrain (which is free to take), and it worked pretty well. Obviously takes a long time to generate, since it’s creating a couple ten thousand parts, but since only the top layers are being added into workspace it goes a lot faster than one would expect.
A large overview of the Minecraft Terrain generated. Not exactly meant for looking from a distance, but still cool.
A close up image of the terrain.
Below the grass is a layer of dirt. Makes for a cool effect c:
As I said, the map is hollow, but since the information is still stored in a script, you are capable of digging into the map. Just delete the part you click, and make the surrounding parts (if not deleted) visible.
Then I put a layer of bedrock on the bottom surface.
I also dabbled in using triangles to generate terrain. I figured I would use the method mentioned above for this, and it looked pretty neat.
I also made a basic version of what I did in the Minecraft generation (without any smoothing) after somebody asked me how to make terrain. It doesn’t look as neat, but it can be a useful reference (especially since I made some comments on the code as well).
Tell me what you think :­O