• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
  • entries
    11
  • comments
    28
  • views
    23548

Skipping Ahead

Sign in to follow this  
Followers 0
TheChubu

1518 views

Hi again! For this entry I'm going to talk about the Midpoint Displacement stage and post more pictures, everybody loves pictures! (Yes, I'm a sellout, shush!) Skipping whatever is left of the ridge generation phase and the river generation phase since I'm having difficulties with the last stage right now and the river phase is incomplete.

[font='comic sans ms']

In the beggining...

[/font]


I remind you the paper where all of this comes from: Ridges and Rivers, Bottom Up Approach There is another version somewhere that was meant for other presentation I think, same authors, same date, just described differently.

Stages of the terrain generation algorithm:

  • Ridge particle generation. Traces ridge lines on the map, blurs the height values.
  • River particle generation. Creates velocity field and traces river lines on the map. Discard everything except river lines and the original ridge lines after that.
  • Inverse midpoint displacement pass. Fill up the ridges and rivers network with some relevant data.
  • Midpoint displacement pass. Fill up the rest of the missing data.

    Last two are pretty much a single stage.

    We covered up ridge generation stage in the previous entries. River generation stage is more or less an erosion algorithm applied to few particles. You spawn a particle at the top of a random ridge, and simulate its trajectory around the terrain, "carving" a river on the landscape.

    [font='comic sans ms']Craving for rivers[/font]



    All of this is made with a single purpose, feeding specific data to a midpoint displacement algorithm. That specific data represents the features of a believable terrain, ie, ridges and rivers that follow a logical path (at least for the rivers).

    Once that stage is done you'd end up with something like this:
    gauss_river.png
    Image is lightened up a little because it was too dark for viewing.

    Rivers are light blue and ridges are the yellow lines. The blurred gray heights are there just for reference, they're actually dropped once the river generation stage is complete (ie, you're only left with the ridge lines and the river lines).

    There are a few problems with the river generation, such as, they live in a magical land without friction, thus they carve their way around like balls in a pinball, and they have no notion of water mass, so their size is constant.

    This particular stage could go on forever as it is (perpetual motioners dream)... But I placed a timer on it, it stops after a second or so. Hack, totally, I know. I'll get it fixed eventually. It deserves its own entry though.

    [font='comic sans ms']Midpoint Displacement's Inverse[/font]



    Now here is where it gets more interesting. Remember that I said that the point of the algorithm is to feed a midpoint displacement pass some useful data? Well, its not that simple.

    The midpoint displacement algorithm is nice in the sense that for a given square, its internal values depend on the external values (this link might have more information about it). The center and the sides of the square depend on the heights of the corners. For any subsquare inside, it follows the same rule.

    It is an algorithm that can be feed some data, say, reference points like, oh surprise, ridges and rivers. In theory the algorithm could follow the points already precomputed as reference to compute the points that are missing. Thus obtaining a terrain that makes sense in the context of the rivers and ridges already present in it.

    In reality, it isn't that simple. If you grab the heightmap as it is. The information available would be just too low to get a decent "contextualized noise" out of it. That's why the paper presents another stage to fill up the heightmap with some "guide points" for the midpoint displacement algorithm.

    The authors use something they call... (dramatic drum roll in the background) Midpoint Displacement's Inverse. (MDI from now on) And the point of all of this is that I can't understand what it is.

    [font='comic sans ms']MDI and my problems with it[/font]



    It sort of describes it as a way of guess the corner values of every square and subsquare of the heightmap by interpolating its "child values", which I guess it means the midpoints that you obtain from a regular midpoint displacement pass.

    So far I can't understand their (lack of) explanation about the process.

    See, say that I have the 5 midpoints of a square, and I want to figure out the corner values. You can get a rough estimate (as in "almost wrong estimate" ) of what the corner values were by interpolating the values that it contributed to.

    Plasmafrac2.gif
    Example from the Wikipedia.

    As you can see there, the top left corner contributes to the values of the left midpoint, upper midpoint and the middle midpoint. If you do (1+2+3.5)/3 you get 2.16'. Which isnt 0 at all but I guess is better that having no point at all.

    These (very) rough estimates should help the regular midpoint displacement pass so the values it produces follows the general landscape that the ridges and rivers defined. That's all I could get from the paper.

    Doing the MDI pass as I imagined doesn't yields good results:
    gauss_GrayscaleMDI.png
    There you have the bright higher ridge lines and the wider darker river lines going down from the top of the ridges.

    As you might or might not see, the map isn't filled with corner points like the example of the paper shows. I'm producing barely any new point, but I can't see how could I be more lax with the algorithm so I can interpolate more points.

    The interpolation as I see it needs at least one thing. The point I'm trying to find contributes to three other points, and I need those 3 points to exist to get an average out of them and get the corner value's estimate.

    This happens very little on the map given the information it has. There just isn't that many points to get corners from. Moreover, the image you saw its not even checking for the middle value of the square, it tries to find the midpoints of the sides of the square and averages them, and it stills doesn't happens a lot.

    So I end up without enough data to feed the regular Midpoint Displacement pass. Here is an example:
    gauss_GrayscaleMD.png
    The result shows almost the same discontinuities the paper talks about before trying with the MDI pass. That means that my MDI pass isn't working as it should.

    Though I understand now why the paper insist on storing everything on a few lists for processing later. If you want to do all of this on some for loops, you're going to need a lot of if checks, since you have to check if there is a need of calculating the height value, and if it isn't, to use the height value that already exists for the later computations. Which usually means to check for all of the 9 values of every sub-square (corners and midpoints) to see if you have to calculate them or not. It was a bit of an index madness for me there biggrin.png

    Here is a colored version just for giggles:
    gauss_ColoredMD.png

    So...

    That's it until I figure out the MDI proccess. If someone want's to help, it would be appreciated. Bye!

0
Sign in to follow this  
Followers 0


3 Comments


What I am saying here is only loosely related to what you are doing as it deals with terrain but I though it might interest you:

 

http://www.youtube.com/watch?v=jLycrOvclnU

 

In that video, you can see the terrains I made from a simple MSPaint bitmap in a few minutes in Blender. Watch for this one at about 1:38 :

hightmap.png

and this one at about 2:40 :

city1.png

0

Share this comment


Link to comment

This still just seems to me like an extremely convoluted method to achieve some rather 'meh' results.

 

First, you have the rigid structure of "ridges here, rivers there" that precludes any sort of interesting terrain variation that isn't composed of neat ridges in relative isolation. Secondly, you seem to waste a lot of work, building a map full of ridges only to discard it and rebuild something different later. Thirdly, the midpoint displacement algorithm just seems to be a needlessly complex means of generating randomized detail. The only real redeeming characteristic I see of the algorithm is the ability to flesh-out a ridge/river map with fractal detail, but you don't really need to jump through all of these weird hoops just to accomplish that task.

 

From what I saw in the linked paper, the resulting terrain just feels... off. Erosive features just don't really look like that. You can achieve much more realistic results from a simple raindrop erosion simulation: seed a terrain with some generated fractal noise, spawn an arbitrary number of raindrops across the map, and simulate stepping their movement as they run downhill to their lowest neighbor, simultaneously raising the sample they run to and lowering the sample they run from by some fraction of the difference in their heights. It's brain-dead simple, it relies upon a single pass of a noise generator plus a single pass of the erosion simulator, and if you enhance the erosion simulator to model raindrop accumulation and to track traffic "heaviness", or flow of raindrops, then you get lake/pond collection "for free" and a detailed flow map showing the most heavily-used waterways. Here are some quick examples, erosion only, performed upon a basic ridged noise fractal:

 

tf2AOYT.png

 

Even given the hideous quick texturing, the shape of the terrain feels much more natural to me than the ridges-and-rivers technique can produce.

0

Share this comment


Link to comment

@latch Well, it seems that having good lighting/materials goes a long way to make good terrain :D

 

@FLeBlanc Yeah you're probably right. I've seen water erosion algorithm's results before, it was the first thing I looked for after learning how to make a heightmap out of noise, and I know they have pretty good results even with simple algorithms. I wanted to try something different though. As I said before, I'll try with water erosion algorithms after I finish with this (or if give up trying to figure it out lol).

 

One question, if the water particle movement is done based on the heights of the neighbors, given that we're talking about a grid of points, wouldn't that produce some "squared" artifacts since every direction works in 45º steps?

0

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now