Results 1 to 10 of 27

Thread: May/June Lite Entry: Gulf of Malabor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Wip Noise and terrain

    Even though I'm using Photoshop for compositing and special effects, I'm still going to keep as much computation as possible in my own code. This has several advantages:

    • Flexibility - most of what I can do easily myself isn't offered in stock Photoshop filters. There might be custom plugins to do these things, if I could find them and were willing to pay for them.
    • Controlability - The parameters used by both the basic Photoshop filters and other plugins are designed to be used interactively, and so they don't suit my purposes very well.
    • Reproducibility - Photoshop's built-in Clouds filter, for example, provides quite nice fractal noise. However, besides the problem of controlability (how do I change fractal dimension, scale, or any number of other parameters?), there's the matter of reproducibility: it's different every time I call it. Within the context of one image, this is fine: I can save it and use it again. But what if I want to render a version in higher resolution? Since my coastline is based on fractal noise, it would change every time I change resolution (and have to rerender the noise).

    For all of these reasons (plus, it's more fun this way!), I'm keeping everything I can out of Photoshop. For instance, here's a version of the map with coloration by altitude. The altitude in this case is created by a multifractal, which increases fractal dimension (makes the terrain spikier) at higher altitudes.
    Click image for larger version. 

Name:	malabor-3.png 
Views:	53 
Size:	232.7 KB 
ID:	13641

    I've also moved what lighting effects I can into my own code. For instance, rendering the above with Lambertian lighting on the terrain gives:
    Click image for larger version. 

Name:	malabor-5-norivers.png 
Views:	67 
Size:	394.5 KB 
ID:	13642

    (I've also done some work on rivers, which I'll leave for the next update.)

  2. #2
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Post

    Now that I've got a height map, making rivers is simply a matter of following the slope of the terrain. First, though, I have to fill up basins in the terrain. In nature, basins could fill up with either sediment or water; to make things simpler, I fill them up with sediment, which turns them into gently sloping plains. Running rivers from each point in the direction of greatest downhill slope gives a first approximation at the river systems:
    Click image for larger version. 

Name:	malabor-5.png 
Views:	63 
Size:	859.1 KB 
ID:	13765

    It looks cool, but it's a bit ridiculous. To improve on this, I calculate a graph of river connectedness instead of an image. Then I can do a few things to make the rivers look nicer:

    1. Decimate the rivers, i.e. remove most of the points. This cuts back on the high-frequency wiggles and makes the rivers look more map-like.
    2. Connect the remaining points with smooth curves, rather than straight lines. This makes the rivers look smoother and more undulating.
    3. Don't draw all of the rivers. I'm only drawing the "major" rivers; in this case, those whose drainage basin is sufficiently large, at least 1/3 the size of the largest. I then only draw "major" tributaries, which in this case is those which make up at least a third of the river's total flow at that point. I then stop rivers when they get too small.

    I then stroke the rivers with a pen whose width depends on the size of the river at that point, and get something like
    Click image for larger version. 

Name:	malabor-6.png 
Views:	121 
Size:	359.1 KB 
ID:	13766
    which I like very much.

    I'm still not crazy on the distribution of rivers, though. I'm probably going to work on that next.

  3. #3
    Guild Journeyer msa's Avatar
    Join Date
    May 2009
    Location
    New York, NY
    Posts
    249

    Post

    You are as awesome as you are insane for doing this in code. I can't wait to see how this works out. I have a secret (or not so secret) obsession with randomly generated maps from playing too many roguelikes.

    In any case, consider yourself reped, you crazy freak.

    Regarding the reproducibility point, the solution is to generate your noise and save it in a layer, and then just duplicate that layer over and over. I'm not saying that invalidates your mad designs, but its at least how you address that problem.

    Good luck!

  4. #4
    Guild Member
    Join Date
    Apr 2009
    Location
    A Coruña, Galicia, Spain
    Posts
    93

    Post

    Wow. Really impressive. I like very much how the rivers are done.

  5. #5
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Wip Now with forests!

    Well, I've finally got forests looking acceptable. (But not perfect. I still don't think the colour fits.) Basically, I add green shapes to the sketch:
    Name:  sketch.png
Views: 163
Size:  12.6 KB
    then use the same technique as I use for generating the coastline to create the outlines of forests. I then place points according to a Poisson process, drawing them as lit spheres, and render them just like the mountains (but in green).
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	malabor-10.png 
Views:	70 
Size:	344.4 KB 
ID:	14011  

  6. #6
    Guild Journeyer gilgamec's Avatar
    Join Date
    Mar 2009
    Location
    Colonia Claudia Ara Agrippinensium
    Posts
    130

    Map Final version

    Well, I'm not going to be able to do any more work on this before Wednesday, so I'll post my final version here now. I didn't get as far as I had hoped, but I'm not entirely embarrassed by the final result, so I'll consider it a success.

    I tried to rerender it at 4k x 4k, and discovered two things:

    1. Some of my code is exorbitantly inefficient. The entire map takes less than five minutes to create from scratch at 1k x 1k, but at 4k x 4k, it took over four hours. As nearly as I can tell, none of the procedures should take that much time, so I must have messed something up along the way.
    2. I haven't caught all of the scale dependencies. At 4k x 4k, the height map is pretty much the same, but the river systems are wildly different. (And for the worse.) This is why I decided to stick with the 1k x 1k version for the final, even though it shows some less-than-pleasant aliasing on the text.

    To fix #1, I'll have to look over my code before the next Challenge. For #2, I think that I'm going to have to place coordinate systems on a firmer footing - this might mean explicitly grounding everything geodesically, or handling more chaotic systems (like the rivers) at multiple scales at once.

    Anyways, this was fun. Hopefully next month's Challenge will be something equally nice to sink my teeth into.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	malabor-final.png 
Views:	75 
Size:	343.6 KB 
ID:	14035  

Posting Permissions

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