Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5] 6 7

Author Topic: The World is Just Awesome - Advanced Terrain Generation Thread  (Read 21588 times)

Normandy

  • Bay Watcher
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #60 on: June 20, 2011, 10:20:29 am »

@malimbar04
I've read over those articles. While they provide insight into how I might implement a fluid simulator, it doesn't really go far enough in teaching me fluid dynamics as a whole. For example, I'm not really writing a pure fluid simulator; plates can be rather gooey and stretchy (i.e. plastic) but they're definitely far from being true fluids. It's not something I can "get away with" since it's fundamentally different, and since I lack the conceptual understanding of how to construct the model in the first place, articles like those fail to really help me.

@Erior
Haha, it's alright. I'm just thinking over things very carefully and critically. If it comes off as hostile, that's my fault.

The thing is that I'm headed for uni soon, and I'll finally begin getting a formal education in multivariable calculus and all those fancy maths that should allow me to do the things that I currently want to try. There are two main features of this simulator that I want to get absolutely right; plate tectonics and the water table. With proper simulation of those two I can basically recreate every single type of large-scale topology imaginable.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #61 on: June 20, 2011, 12:51:52 pm »

Are you dead-set on handling this in an ab initio way? Because I think there may be easier ways to get a simulation that shows behavior very similar to plate tectonics without actually having to model reality extensively.
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #62 on: June 20, 2011, 02:09:39 pm »

Such as? (yeah, still lurking this thread, it's interesting stuff)
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Erior

  • Escaped Lunatic
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #63 on: June 20, 2011, 02:18:52 pm »

I think Virex has a point by noticing that's perhaps more effective to try to model something similar to the processes and not the complete set of processes involved in plate tectonics. You will have courses at the uni, but I can tell you something before (because I know by direct experience). If you absolutely want to stick with the reality in its totality, you will be VERY disappointed by your results. Simpler models yields often very good results and going further in modeling details has a huge lot of side effects (model is a mess... model is slow... you can't calibrate the parameters because you can't understand the processes... general knowledge of the processes in not sufficient...) and only very marginal gains in terms of realism/accuracy.

A tectonic model at a global scale including magma flows and such does not exist at this time... and I'm sure someone has already tried. Of course this didn't mean that you can't do that, and I sincerely whish you luck, but that's for sure the project of a whole researcher's life, and most probably not a lone one but with a team to back him up.  :)

So all the best. Please keep us informed in your progress and consider a simpler version if the difficulties are getting to big.

@Siquo (I was about to post when you did reply  ;) )
Such as skipping some very deep (and mostly not understood) processes like magma convection or consider the continents as plastic (which is globally not that true either... or only in some conditions) and concentrate on more visible ones. As an example: model the plate movement with a more or less random and variable vector instead of magma flow, which is complicated, the scientific community has really no clue of the whole, and is prone to an incredible amount of errors/incertitudes. That's like, say, including the solar black spots cycle while describing the evaporation/precipitation cycle of water.
Logged

Normandy

  • Bay Watcher
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #64 on: June 20, 2011, 05:31:49 pm »

Well, the issue I have with a simplistic model is that there is no slider bar between "realistic" and "simplistic". You either model a solid as a rigid body or you don't. You either have fluid pressure or you don't. You can skip minutiae, but you can't skip the big picture.

I always program following the philosophy "complexity does not follow simplicity, it precedes it." I'm not a particularly experienced programmer, so I'm not always able to immediately see what patterns will work and what patterns will not. Same goes for terrain generation. Sure, I could make a simple model look good in theory, but that's if I had years of experience examining and looking at the methods and results of other terrain generators.

As for magma flow, I admit, it is rather esoteric not well understood. My primary intent was to test to see if I could get decent looking plates by using randomized seed magma temperatures, not to realistically model magma convection. If I figured out that much, then further development in any magma-related features (i.e. rifts, volcanoes, partial melts, igneous intrusions, etc...) would be a lot easier to fit in with a unified framework.

Currently though, this project is on the backburner for me (once again, I'm going to wait until after I've learned the requisite maths to grapple with this). The whole project hinges on a realistic model of plate tectonics; after all, IMO terrain generation has pretty much been covered in detail for pretty much all other parts. Take a look at the DF terrain generator; it has everything I plan for with the sole exception of plate tectonics. So why back out of plate tectonics? (well actually, discounting igneous rock differentiation and certain special rock interactions, such as limestone forming karst topography)

EDIT:
Also, some more background information (I honestly haven't thought much about this project in a while, I've forgotten some of the things that I've thought through already). One benefit to keeping interactions as local as possible is the ability to multi-thread my calculations, or pass them off to the GPU (there's this really cool new technology which allows GPUs to do other intensive parallel calculations like physics simulators; look up OpenCL).

Why I don't just stack plates on top of one another is actually a result of one of my biggest gripes with noise-generated heightmaps. There are no "mountain ranges" there are only giant mounds of rock labeled "mountains". ffs I want my terrain generator to generate mountain peaks and mountain passes, not a giant mound of rock. The difference between hills and mountains in the real world (tm) is that mountains are generated under much more extreme stress; so instead of simply deforming plastically, rock at some points actually buckles becomes weak points for stress to be released. This pushes up sharp peaks instead of rounded mounds. There is no way I can see that being simulated in any way other than actually modeling stresses and strains.
« Last Edit: June 20, 2011, 05:47:55 pm by Normandy »
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #65 on: June 20, 2011, 06:16:24 pm »

Sometimes you just can't do the complex stuff, or at the very least don't start more complex than the bare minimum of what you need.

For instance, for one of my simulation projects, I wanted to evolve planetary atmospheric content based on the probability curve of the velocity of molecules of a gas based on its molecular mass and partial pressure at a the planets temperature compared to the planets escape velocity until an state of equilibrium is reached between surface out gassing and atmospheric loss. That is well within the realm of "possible but very complex and a ridiculous amount of hard work", there are such models in existance. And it is not coincidentally really close to the time that I abandoned that project.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Vattic

  • Bay Watcher
  • bibo ergo sum
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #66 on: June 21, 2011, 03:57:55 am »

Why I don't just stack plates on top of one another is actually a result of one of my biggest gripes with noise-generated heightmaps. There are no "mountain ranges" there are only giant mounds of rock labeled "mountains". ffs I want my terrain generator to generate mountain peaks and mountain passes, not a giant mound of rock. The difference between hills and mountains in the real world (tm) is that mountains are generated under much more extreme stress; so instead of simply deforming plastically, rock at some points actually buckles becomes weak points for stress to be released. This pushes up sharp peaks instead of rounded mounds.

I agree completely and was excited to see where this project might lead. I thought this had died and it kind of has but I'm glad to hear you'll be working on it again someday.
Logged
6 out of 7 dwarves aren't Happy.
How To Generate Small Islands

Normandy

  • Bay Watcher
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #67 on: June 21, 2011, 12:07:01 pm »

@Nadaka
Your example is actually pretty simple. Use total gas mass, molecular mass, and atmospheric pressure to find partial pressures (which is a simple ratio, IIRC). Use partial pressure to determine RMS velocity for the gas. Use inverse probability density function (my chem is really rusty, I'm not particularly sure which probability distribution it is or what the formula would be to get the measure of spread, but I know good models exist) with the escape velocity squared to determine what percentage of gas escapes the atmosphere. Simulate for a few hundred or thousand more steps and you'll probably reach equilibrium.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #68 on: June 21, 2011, 12:09:29 pm »

Well, the issue I have with a simplistic model is that there is no slider bar between "realistic" and "simplistic". You either model a solid as a rigid body or you don't. You either have fluid pressure or you don't. You can skip minutiae, but you can't skip the big picture.

I always program following the philosophy "complexity does not follow simplicity, it precedes it." I'm not a particularly experienced programmer, so I'm not always able to immediately see what patterns will work and what patterns will not. Same goes for terrain generation. Sure, I could make a simple model look good in theory, but that's if I had years of experience examining and looking at the methods and results of other terrain generators.

As for magma flow, I admit, it is rather esoteric not well understood. My primary intent was to test to see if I could get decent looking plates by using randomized seed magma temperatures, not to realistically model magma convection. If I figured out that much, then further development in any magma-related features (i.e. rifts, volcanoes, partial melts, igneous intrusions, etc...) would be a lot easier to fit in with a unified framework.

Currently though, this project is on the backburner for me (once again, I'm going to wait until after I've learned the requisite maths to grapple with this). The whole project hinges on a realistic model of plate tectonics; after all, IMO terrain generation has pretty much been covered in detail for pretty much all other parts. Take a look at the DF terrain generator; it has everything I plan for with the sole exception of plate tectonics. So why back out of plate tectonics? (well actually, discounting igneous rock differentiation and certain special rock interactions, such as limestone forming karst topography)

EDIT:
Also, some more background information (I honestly haven't thought much about this project in a while, I've forgotten some of the things that I've thought through already). One benefit to keeping interactions as local as possible is the ability to multi-thread my calculations, or pass them off to the GPU (there's this really cool new technology which allows GPUs to do other intensive parallel calculations like physics simulators; look up OpenCL).

Why I don't just stack plates on top of one another is actually a result of one of my biggest gripes with noise-generated heightmaps. There are no "mountain ranges" there are only giant mounds of rock labeled "mountains". ffs I want my terrain generator to generate mountain peaks and mountain passes, not a giant mound of rock. The difference between hills and mountains in the real world (tm) is that mountains are generated under much more extreme stress; so instead of simply deforming plastically, rock at some points actually buckles becomes weak points for stress to be released. This pushes up sharp peaks instead of rounded mounds. There is no way I can see that being simulated in any way other than actually modeling stresses and strains.


That is not entirely true and besides you don't want to model it as a rigid body because plates deform under stress and you already admitted you want volcanoes and plates rifting, all of which are incompatible with a rigid body.



Take for example the following approximation for the stresses:



Each plate has a plate center, Pi,c which is essentially just an abstract designator that doesn't really have a physical meaning.

We can then define a plate influence function for plate Pi as Ii(r) = |r-Pi,c|, essentially the length of the vector from the plate's center to the point r.

Using this influence function we can define the stress scalar between two plates i and j as Ss,i,j(r) = (max{Ii(r)*rigi(r),Ij(r)*rigj(r)}/min {  Ii(r)*rigi(r),Ij(r)*rigj(r)  })(rigi(r)+rigj(r))/2 with rigi(r) the rigidity function for plate i. The stress scalar function is essentially composed of 2 hyperbola-like functions squashed together. The rigidity scalar pretty much defines how far the stress of the far plate penetrates into the near plate and also moves the location of the plate boundary further from the hardest plate. A very high value for rig(r) around a plate edge (there where Ii(r) = Ij(r)) means the stress scalar drops very steeply, while a low value for rig(r) means the stress will be felt very far from the plate edge. A decent first approximation for rig(r) would be to just use perlin noise, but you could also use a more complicated function for this.


Now, each plate also has a translational vector v and a rotational vector O which is per definition equal to O = omega*(r-Pi,c), so one only needs to track the angular velocity omega. We can then define the total stress vector as s(r) = v + O. The binary compressive stress is then equal to: si,c =   Ss,i,j(r)(si(r)-sj(r))*norm(Pj,c-Pi,c), with * the dot product operator and norm() the normalization function for a vector (which yields a vector with the same direction but a length of 1). The local shear stress can be modeled in the same way, but instead using the normalized vector perpendicular to Pj,c-Pi,c.

This model (or actually the one generalized to work with an arbitrary number of plates, which should be trivial) should give you voronoi-like plates for a constant rigidity function, with stress dependent on the relative angular and rotational velocities of the plates and stress drop-off dependent on the rigidity of the plates. If you'd however use a non-constant rigidity function, say a perlin-based function or one based upon a real model of the rock properties, you'd get twisted plate edges and a seemingly chaotic stress function. Said stress function can then be used to determine the shape and types of geological phenomena found in the model.

Several extensions to the model are possible. The first and most obvious is to add a time-variant component to the velocities. One way to do that is to take the net vector of all stresses working on a plate scaled with the local influence and rigidity function, and use that to modify the rotational and translational velocities. By adding magma-induced stress (via a perlin noise function or a true magma model) you can keep the plates moving unpredictably and prevent them from reaching equilibrium.
Magma-induced stresses could also be used to generate plate fracturing. First thing would be to add a time component to the stresses which causes a gradual transition from one stress to another. Then you generate new plate centers according to a magma-based function and keep them for some time. If a center causes enough stress it will cause a rupture and you keep it, otherwise you reject it and generate a new center.
« Last Edit: June 21, 2011, 12:29:53 pm by Virex »
Logged

Normandy

  • Bay Watcher
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #69 on: June 21, 2011, 12:51:29 pm »

@Virex:
I meant to use rigid bodies only as an example of something that you do or you don't do, but yeah, prolly should have used a different example.

I still don't have a full understanding of stresses and strains and plastic deformations yet, but I've at least got the gist of your mathematics.

I'm not sure I understand the plate influence function fully. If the plate center really is an arbitrarily chosen point as you say, if we take the boundary case and place the plate center on the plate interface, the stress scalar function will approach infinity as it approaches the plate center. Heck, anytime you approach the plate center the stress scalar function will approach infinity.

Also, wouldn't the choice of plate center (and I presume the axis from which we define the rotational vector) only affect stress from the rotational vector? And even then, only by changing the local translational velocity (i.e. O). I thought stress wasn't relative to choice of axis?

Lastly, there definitely are factors missing from your model, the dimensional analysis doesn't match up. From your binary compressive stress function we get unitless * length / time * unitless. Stress is mass / second / second / meter. It might be a constant factor, but still, there is something missing from your analysis.

EDIT: Wow I just completely screwed up basic physics for a second there, excuse me while I retcon my math.
« Last Edit: June 21, 2011, 08:21:37 pm by Normandy »
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #70 on: June 21, 2011, 01:55:44 pm »

@Virex:
I meant to use rigid bodies only as an example of something that you do or you don't do, but yeah, prolly should have used a different example.

I still don't have a full understanding of stresses and strains and plastic deformations yet, but I've at least got the gist of your mathematics.

I'm not sure I understand the plate influence function fully. If the plate center really is an arbitrarily chosen point as you say, if we take the boundary case and place the plate center on the plate interface, the stress scalar function will approach infinity as it approaches the plate center. Heck, anytime you approach the plate center the stress scalar function will approach infinity.
It is not really arbitrary like that. The plate boundaries are defined by the plate centers, so moving a plate center towards a boundary will push that boundary towards the other plate center until the system breaks down when both plate centers are on top of each other (but that system would be nonsense anyway). It's arbitrary in the sense that there is no physical relation between a plate center and anything present in reality, it's just an abstract bookkeeping object.

Also you're right about the stress scalar, it does go to infinity, which it should not. I think I´m going to have to tinker with it a bit more, since it doesn't behave as intended. The goal is to find a function that is at it's maximum if both values are equal and drops of steeply to either side if they are unequal.


Edit: got it!  Ss,i,j(r) = exp^(1-max{Ii(r)*rigi(r),Ij(r)*rigj(r)}/min{Ii(r)*rigi(r),Ij(r)*rigj(r)})(rigi(r)+rigj(r))/2) shows the desired behavior in the range between the points but it deviates beyond them if the rigidities aren't equal, so it needs to be cut off at the centers.[/quote]
« Last Edit: June 21, 2011, 02:25:17 pm by Virex »
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #71 on: June 21, 2011, 02:23:47 pm »

@Nadaka
Your example is actually pretty simple. Use total gas mass, molecular mass, and atmospheric pressure to find partial pressures (which is a simple ratio, IIRC). Use partial pressure to determine RMS velocity for the gas. Use inverse probability density function (my chem is really rusty, I'm not particularly sure which probability distribution it is or what the formula would be to get the measure of spread, but I know good models exist) with the escape velocity squared to determine what percentage of gas escapes the atmosphere. Simulate for a few hundred or thousand more steps and you'll probably reach equilibrium.

I know it is doable. It is still a ridiculous amount of effort to go through to produce a list of chemical percentages that can almost always be chalked up to: This is a giant ball of hydrogen and helium with traces of other elements, this is a tiny airless ball of rock or this is a medium sized rock surrounded by carbon dioxide and trace amounts of other elements. Going to big, to early is an easy way to grind down your motivation and bring your project to a premature and incomplete conclusion. And not necessarily because you can't do it, but because it becomes not fun anymore. I think that was the point I was trying to make. It might be better in the long run to start with a simpler process that allows you to make progress, but can be expanded or replaced at a later point.

Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Normandy

  • Bay Watcher
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #72 on: June 21, 2011, 08:51:46 pm »

@Virex:
Ah, we had different definitions of abstract then. What I need to do is smash two plates against each other, see how the stresses work out, then write a function to model that (which is my actual plan to write a simulation of the plates first, then see if there are any simplifications I can make from there). I think the function might look hyperbolic or exponential like you have it, but I'm still not sure exactly. I'll get back to you on that.

@Nadaka:
I'm perfectly fine with not proceeding with this project until I'm ready. I mentioned in the OP that I'm doing this purely for myself, so it really doesn't matter to me if I have to put off this project for a few months to do it right. As I mentioned earlier, this project is currently on the backburner for me (which is why I rather unceremoniously abandoned the thread), until I get more of an education; I'm currently pursuing other projects first (like learning OpenGL and multiplayer game programming; see http://www.bay12forums.com/smf/index.php?topic=83414.msg2271153#msg2271153 if you're curious, but I'm not not ready to show anything for that project anytime soon).

This topic still does interest me though, so if you guys want to continue discussing it, feel free. I'll continue to interject my own thoughts and work on the subject as long as you guys continue to post.
« Last Edit: June 21, 2011, 08:53:27 pm by Normandy »
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #73 on: June 22, 2011, 04:31:42 am »

So you're going to study geophysics? Cool!
Logged

thezeus18

  • Bay Watcher
    • View Profile
Re: Project: The World is Just Awesome - Advanced Terrain Generator
« Reply #74 on: December 10, 2011, 05:08:16 pm »

Is there any news on this front?
Logged
Pages: 1 ... 3 4 [5] 6 7