[Code Request C#] Noise and Terrain

Hey everyone I have a major problem. After many attempts to understand some basic terrain generation with standard 1x1x1 cubes I seem to have met my match with my knowledge of C#. After working on all different aspects of my game I have seemed to got stuck with the terrain, currently only using a basic for statement to generate a flat area for testing. Well my blocks and other things like inventory and item drop features I made work great. Now I am asking for any help one may offer in giving me some working code that I could use to help me understand the idea of noise and unity’s cubes. Im NOT doing voxels as I dont understand that concept, right now I just want to get basic cubes working. My goal is to create a plains area that goes up and down randomly with good spaces of flat before a hill. I know I am asking a lot but I think if someone would give me this terrain code I could really build off of it. Visual examples seem to work for me a lot. Anyways I hope someone accepts so I can continue working on my fun little game.

P.S. This is a Non-endless world I am trying to create.

Bump!

I highly suggest learning voxels anyway. Everything you need to know will be learned along that path.

All a voxel engine is, is a collection of coordinates, accomplished easily through three “for” loops (one per dimension), that then sets each of those coordinates to true or false. False is air, True is ground. Minecraft just renders a block around the ground points, but you can get more involved. Noise is a very different topic, and to truly understand it, if you don’t already know calculus, you’ll want to get a good start, then move on to learning about Perlin Noise and try to write a Perlin algorithm yourself. I think you’ll find a natural course after that.

If you really don’t want to learn voxels, have a look at concatenation programming, or simply generate a heightmap, and run that into the terrain. There’s a lot of tutorials online involving that method.

The best thing I can tell you, is I don’t know anyone who thought wrapping their head around everything in a voxel engine was easy until it finally worked, even if we think it’s cake now.

Oh… ok well then noise is to complex for me… never in a million years learn calculus. Would you explain voxels then or maybe I should just keep flat ground and render only what cubes the players near.

If you are interested in noise i would look into libnoise.

http://libnoise.sourceforge.net/

There are a few C# ports of libnoise, some are unity specific.

http://forum.unity3d.com/threads/162158-Released-Aubergines-Noise
http://forum.unity3d.com/threads/68764-LibNoise-Ported-to-Unity
http://code.google.com/p/libnoise-dotnet/