Results 1 to 4 of 4

Thread: First Experience With Fractal Terrain Generation

  1. #1

    Default First Experience With Fractal Terrain Generation

    Hi,
    I've been a programmer for a couple of years now, and a long time lurker of this website. I decided to combine the two interests and came up with a Fractal based Terrain Generator in C#. I thought I might share my results with you all!

    Island Blend and Noise.png

    Island.png

    A rough outline of the process used:
    I first generate two Plasma Fractals, using the Diamond-square algorithm. One will be the actual map image, whereas the other will be used as a shader of sorts to add some variance to the colours of the map.

    Island.png

    I take one of the images and colour it based upon the RGB value of each pixel. This gives me the basic map, unshaded. This isn't as slow as it sounds when you edit the raw Bytes of the image.

    Island.png

    I then go through the image and multiply the RGB value by a coefficient calculated from the corresponding pixel on the shader map, to give some variance to the colour.

    Island.png

    Finally, I randomly displace each pixels RGB values by a small amount - Adding 'noise'

    Island.png

    Sorry I had to use a different map for each image, the way I programmed it is such that it does all the colouring at once to speed things up. It would be a fair rewrite to get a different image for each stage of the same map!

    And finally, a shot of the program:

    Screenshot 2014-09-13 01.15.46.png

    Overall, the generation time is pretty darn quick - around 1 second for a 600x600 pixel map. Times *should* linearly scale, too: ie, a 1200x1200 map will take approx. 2 seconds to complete. I could speed things up (and clean up the code a lot ) in a later rewrite.

    I'm not 100% pleased with the results, overall - there is often unrealistic features, and everything looks a bit fractal-ly. I won't post the .exe file here as most browsers are convinced it's a virus, and I'd rather not have to deal with that. I can however post it's github page, if anyone is interested

    Thanks,
    Tom

  2. #2

    Default

    add erosion

  3. #3

    Default

    Quote Originally Posted by xoxos View Post
    add erosion
    I've started looking into more realistic mapping, and while it looks quite complex, it also looks like a lot of fun The aim of this was just to create pretty looking terrain using a top down approach, it's obviously not really realistic Really starting to get interested in the bottom up style as described here: Blobs in Games: Teleological vs. ontogenetic map generation Anyone have any pointers as to where I could look to get started?

  4. #4
    Administrator waldronate's Avatar
    Join Date
    Mar 2007
    Location
    The High Desert
    Posts
    3,607

    Default

    https://www.google.com/?gws_rd=ssl#q...n%20generation is an excellent starting point. Ultimately, it will depend on your goals (fast generation for in-game world generation, realistic generation, artistic generation, learning new programming techniques, etc.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •