Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Outerra Tech Demo download. Help with graphics driver issues

Pages: [1] 2

Author Topic: Terrain Generation with Plate Tectonics  (Read 18910 times)

lawrencemann

  • Newbie
  • Posts: 6
  • newbie
Terrain Generation with Plate Tectonics
« on: April 23, 2012, 04:54:13 pm »

Greetings everybody,

For a long time now I've been desiring to see a terrain generator that relies on plate tectonics. The projects that have such a goal seem to be few and far between, so it seems that it's too difficult to do or that the approach is too unpractical when compared to more artificial/direct methods (like fractals). In any case it seems like it's not a very popular topic in the (hobbyist) game programmer scene. Due to that and the potential in this approach I decided to try to make terrain with plate tectonics myself.

For my bachelor's thesis (that I started some 10 months ago) I made a simple terrain generator that loosely mimics plate tectonics. It starts with a flat fractal generated terrain that is randomly split into plates. The plates are moved linearly until they grind to halt due to friction. Sometimes plates overlap i.e. collide. If the overlapping portions of the plates are continents and there's "too much" overlap, then the continents are merged together. If oceanic crust collides with any other plate, the sea floor "subducts", meaning that the subducting crust is moved from the denser plate onto the overlying plate. After the rate of action on the "lithosphere" drops too much, the terrain is split into new set of plates and the process just described is repeated.

The results are rather good considering the simplicity of the implementation:





The thesis is freely downloadable from http://urn.fi/URN:NBN:fi:amk-201204023993 .
There's also a Youtube video showing the simulator in action:

Lastly, the source code is distributed under GPLv3 in SourceForge: http://sourceforge.net/projects/platec/

It seems to me like even the most naïve model of plate tectonics is able to produce more convincing heightmaps than conventional fractal based methods. The reason I'm posting my findings here is the suggection of "cameni" in the GameDev.net forums, who seems believe that physically based approach might be useful for projects like Outerra especially when combined with fractals to create realistic landscapes with infinite level of detail: http://www.gamedev.net/topic/623145-terrain-generation-with-plate-tectonics/

All in all, I wish my post has been inspiring to you! :) I'd be really happy to hear your unrestrained feedback, suggestions for improvements and ideas of applications where plate tectonics based terrain generation could be used.
« Last Edit: April 23, 2012, 04:56:08 pm by lawrencemann »
Logged

th3flyboy

  • Newbie
  • Posts: 9
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #1 on: April 23, 2012, 10:55:47 pm »

Interesting stuff, but the one thing I feel obligated to point out is that the source code, being GPL v3, requires anything based on it, so in other words anything using that code as a reference, to also be GPL v3, however IANAL so I may or may not be exactly correct on that. I don't think that the source code released could really be used in much outside of GPLv3 projects unless it were under something like the MIT or BSD license instead.
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6622
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: Terrain Generation with Plate Tectonics
« Reply #2 on: April 24, 2012, 01:17:04 am »

As I have written on gamedev forum, it's an interesting concept - with simple rules you get nice looking results. The licensing is irrelevant, to integrate it into Outerra (or into a planet maker) it would have to be reimplemented to work on GPU, to map it to a sphere, to change the rules to respect energies etc., quite a lot of implementation details to solve yet.
Alternatively it can be a separate tool used to produce coarse data for OT, in which case the license is irrelevant as well.
Logged

lawrencemann

  • Newbie
  • Posts: 6
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #3 on: April 24, 2012, 12:39:38 pm »

the source code, being GPL v3, requires anything based on it, so in other words anything using that code as a reference, to also be GPL v3

That's the impression I also have of the GPLv3 and that's exactly why I chose to use it - I want to actively promote openness in the software industry and using GPLv3 is this kind of "rubbing it to your face" method of doing it.  :P

Cameni, could you shed more light on the "to change the rules to respect energies" part? What comes to moving the whole thing onto a sphere, that's one of the most near term major improvements I'm considering. It's also briefly discussed in the Thesis in chapter 9 "Future Work", page 58. :)
Logged

cameni

  • Brano Kemen
  • Outerra Administrator
  • Hero Member
  • *****
  • Posts: 6622
  • Pegs is clever, but tae hain’t a touch sentimental
    • outerra.com
Re: Terrain Generation with Plate Tectonics
« Reply #4 on: April 25, 2012, 04:28:42 am »

I didn't have the time to read the paper yet, but I noticed in the video that sometimes a very long strip of terrain would be lifted just as easily as a short one. Is the threshold when two plates get "welded up" depending on the amount of surface overlap or on the amount of directional overlap?
Logged

monks

  • Full Member
  • ***
  • Posts: 212
Re: Terrain Generation with Plate Tectonics
« Reply #5 on: April 27, 2012, 07:21:21 pm »

This is great stuff. I agree with what cameni said- you need to get it onto the gpu- that's where the revolutionary stuff is now, and considering the potential size of maps, you need all the muscle you can get.

 8 minutes at 1024 is pretty good. At the moment generating worlds takes days if not weeks for the really big ones. In terms of how long people seem currently prepared to wait, I think if you aimed for something in the order of 8-24 hrs on a gpu, you'd have a tool that would greatly speed things up, and I imagine what you could potentially acheive a lot more realism in that time. You need erosion as well though of course. We're working at 40,000 px square.
 I think you also need to get it onto a sphere- that way you can export georeferenced terrain and folks can use it in engines like Outerra. ME-DEM (the terrain project I'm involved with) may be unique in its georeferenced approach. We don't have a full planet (yet), but we are able to get it into Outerra much more easily because it's georeffed.
 
The Alex Jarocha Ernst I saw a few years back and is the closest thing I've seen to what you have here.There was a small simulation of tectonic uplift combined with erosion on YouTube somewhere.It created some nice results.you might also be interested in Howard Zhous work http://howardzzh.com/research/terrain/. I've not read your paper yet.

monks
« Last Edit: April 27, 2012, 07:24:21 pm by monks »
Logged

lawrencemann

  • Newbie
  • Posts: 6
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #6 on: May 03, 2012, 03:31:24 pm »

I noticed in the video that sometimes a very long strip of terrain would be lifted just as easily as a short one. Is the threshold when two plates get "welded up" depending on the amount of surface overlap or on the amount of directional overlap?

Welding up depends on the amount of surface overlap only. I assume the "very long strip of terrain" anomaly is mainly due to working in 2D cartesian coordinates instead of on the surface of a sphere.

8 minutes at 1024 is pretty good. At the moment generating worlds takes days if not weeks for the really big ones. In terms of how long people seem currently prepared to wait, I think if you aimed for something in the order of 8-24 hrs on a gpu, you'd have a tool that would greatly speed things up, and I imagine what you could potentially acheive a lot more realism in that time.

Thanks! This is very interesting piece of information indeed! I never had an idea what could be considered improvement time wise and what not. 8-24 hours is an insanely long time, but perhaps it's not so insanely long after everything works in spherical coordinates and with dynamic volume modeling.

The Alex Jarocha Ernst I saw a few years back and is the closest thing I've seen to what you have here. ... I've not read your paper yet.

I strongly recommend you too to read my paper, at least chapter 6 "Earlier works", where I review e.g. forementioned Alex Jarocha Ernst's work and few others too. Some of them are far closer to what I've been trying to do than Alex's attempt.
Logged

monks

  • Full Member
  • ***
  • Posts: 212
Re: Terrain Generation with Plate Tectonics
« Reply #7 on: May 04, 2012, 04:46:25 pm »

Yes I know! :) But if you're potentially outputting 60-100k maps, things start to runaway pretty quickly. But I guess it all depends on what realism you can squeeze into say 8 hrs. If you can do it in less, then all the better.
 I hope that it at least gives you an insighht into what I see folks doing- at least with indie dev programs. I think most of them do use the software that I use, ie World Machine, GeoControl, Leveller, Wilbur, L3DT.
 To give you some kind of idea of where the industry is at, I had contact from an enviroment artist who was working on GoW 4,and he was blown away by the pics of our terrain in Outerra- wanting to know how we did it. I was really shocked, because I didn't think what we were doing was anything advanced (apart from the goreffing bit). But on reflection I suppose it is really because most games don't require/give such large fovs on game levels and so don't require that level of realism, and Outerra is clearly unique and way ahead of the game in that department. The mountain ranges are a dead give away. In fact Outerra forced me to bite the bullet and develop a new approach. The only comparable terrains are in flight sims and they're almost always real earth data. So that gives us an insight into where the games industry is at regards terrain modelling. We're pretty much stuck right now.
 
 I've been doing terraining as a hobby for maybe 10 years. I've beta tested most of the software I use. The single biggest barrier to moving procedural terrain modelling on from where we are now, is the creation of larger scale terrain features such as mountains ranges, continental divides and long rivers that connect mountains to plains to sea, and the like- basically geography. After a few years of trying out stuff and badgering devs about new tools  :D  (especially regards mt ranges), I gave up using procedurals for the time being and switched to using real world data but manipulated in various programs.
 So, you can see that not even the best enviroment artists are able to generate procedural terrain on these scales that looks even half way real because the tools just aren't there- so they have to use real earth data, like say they did in Crysis. My process is comparatively time consuming and I do it for the love of it, not to budget or deadlines. So there is definitely a niche there for you (a top down procedural solution for planets)- and one that will grow in the future with 100% certainty as engines like Outerra come online.
 Another thing I've grown to realise over the years is that terrain consists of two sides of a coin: terrain and rivers. The importance of rivers are largely overlooked I find- no doubt because in small terrains you don't have to think whether the hydrology of a terrain make sense. So, really you'd need to combine the tectonic uplift with an erosion process. Ideally for an earth-like planet, you'd also have some intermittent glacial action too because that produces distinct features that no other process can.
 There's a guy who programs a procedural terrain generator for gpu called Florian Bosch. We did talk a bit about what we saw as the problems needing to be solved. He's not really that passionate about terrain though-he has his finger in a lot of pies. He did suggested tectonics combined with a thin crust deformation (not fully volumetric). http://codeflow.org/

 Just read your chpt 6. Yes, the supercontinent cycle is really where it's at.The Caltech one looks easy to implement...haha...wow,
"With the new algorithms, the scientists were able to simulate global mantle flow and how it manifests as plate tectonics and the motion of individual faults. According to Stadler, the AMR algorithms reduced the size of the simulations by a factor of 5,000, permitting them to fit on fewer than 10,000 processors and run overnight"

 Even they have to wait..had to smile at that :)

monks
« Last Edit: May 04, 2012, 06:00:07 pm by monks »
Logged

lawrencemann

  • Newbie
  • Posts: 6
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #8 on: May 12, 2012, 01:08:45 pm »

I didn't think what we were doing was anything advanced (apart from the goreffing bit). ... The mountain ranges are a dead give away. In fact Outerra forced me to bite the bullet and develop a new approach. The only comparable terrains are in flight sims and they're almost always real earth data.

I gave up using procedurals for the time being and switched to using real world data but manipulated in various programs. So, you can see that not even the best enviroment artists are able to generate procedural terrain on these scales that looks even half way real because the tools just aren't there- so they have to use real earth data, like say they did in Crysis.

The terrain, or the Earth, rendered in Outerra is astonishingly good looking, no denying that. I was a little confused how you actually do it - take real world data and fill the blanks with some sophisticated blend of fractal algorithms that are able to effectively simulate erosion, rocks and overhangs, or generate everything from scratch (quoting your features-page: "A completely random fractal terrain is possible too"). I assume the videos and screenshots exhibit the approach you typically use - adding details to real world data.

From terrain generation perspective, this I can understand. This interpretation also agrees with everything else you wrote, so I assume I'm not so far off. :D Therefore it seems obvious that physically based approach for generation of huge realistic terrain does have a good deal of demand among the (indie) game programmers.

There is not much I can say about using GPU for 8-24 hours to generate "60-100k" maps (what ever it means - pixels?), but I agree that to get the same level of credibility that can be seen in the videos and pictures from Outerra engine, by using physically based approach, will take much (programming) effort and require all the computing power available (for private a person). However, what I can say about is that I fully agree with you on the importance of rivers and simulation of water in general after landforms are produced. However, they are quite insignificant, maybe with the exception of glaciers and large seas, from the plate tectonics point of view. The forces there are so great that what ever river(s) is/are able to cause between tugs of two colliding continents will disappear when plates move again. But water in all forms is crucial when moderately large terrain forms are considered, no doubt about that!

The work of Florian Bosch, and others who have been working with similiar stuff, is really cool and could be applyed to the maps produced by a plate tectonic terrain generator to produce very realistic outcome. My vision of the future of Physically Based  Terrain Generation is to
  • Move away from bitmaps towards meshless modeling of the crust
  • Put everything on a sphere
  • Implement physically accurate deformation of the meshless crust
  • After the tectonic process has been stopped: apply physically accurate (?) river/water erosion

I think that's the roadmap for incredibly good looking fully procedural terrain! :)
Logged

monks

  • Full Member
  • ***
  • Posts: 212
Re: Terrain Generation with Plate Tectonics
« Reply #9 on: May 12, 2012, 01:46:41 pm »

I was going to send you this link at the other forum, but since you're here, here it is:

http://runtime.bordeaux.inria.fr/StarPU/

Maybe with help from this you can program for the gpu more easily?
To quote a friend, "Also of note is that there are some efforts to use LLVM which is an open source compiler framework for doing GPU code. This would be major if this worked. That implies that you can write C++ and run it on GPU"

 I think with gpus everyone could have access to planetary terrain modelling which could do a good visual fake of the process in a reasonable ammount of time (heuristics). The true simulation stuff that Caltech has is not going to happen anytime soon!

 I see people asking for planetary visualisations  all the time on the many terrain related boards I visit. There's definitely a demand for it. The closest we have right now is Fractal Terrains Pro and Wilbur.

 Yes, the river erosion is just the icing on the cake. It's insignificant in planetary terms, but you'd obviously need to add that as a last process when you were satisfied with the tectonics and glaciation. Yes, I think you could separate out the two with good results. You can see some vids in our gallery of some synthesized glaciation. :)
 
http://www.me-dem.me.uk/videos/gts/videos.htm

monks
Logged

lawrencemann

  • Newbie
  • Posts: 6
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #10 on: May 26, 2012, 04:46:38 pm »

To quote a friend, "Also of note is that there are some efforts to use LLVM which is an open source compiler framework for doing GPU code. This would be major if this worked. That implies that you can write C++ and run it on GPU"

That sounds like it could be very effective tool to utilize gpu for the non-dedicated hobbyists like me! :) GPU could be used offline to generate terrain etc., because GPU is completely eaten up during rendering in real time games - or that's what a friend at a significant game house told me. But that was your point from the start. :)

Yes, the river erosion is just the icing on the cake. It's insignificant in planetary terms, but you'd obviously need to add that as a last process when you were satisfied with the tectonics and glaciation. Yes, I think you could separate out the two with good results. You can see some vids in our gallery of some synthesized glaciation. :)

I checked the vids and they're certainly very impressive! However i barely realized what's going on or how great of an achievement it is what you have done - i cannot weight it because the field (of erosion) is completely unknown to me. However, after looking the map around Salt Lake City i was convinced that to get playable maps one MUST implement a rather realistic erosion simulation! That's nothing out-of-reach however, many people like you have already done it in many different ways.
Logged

xiong

  • Jr. Member
  • *
  • Posts: 29
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #11 on: June 29, 2012, 10:18:11 pm »

i'm not a geo earth major, but this plate tectonics have yet to be proven?
my understanding of this theory is that each earth continent is a floating island?
the contents (solid parts) of the earth consisted of different layers, so i suppose this theory would be correct if the whole layer would break and move around?

base on what i'm reading so far on this forum, this program is creating earth from topdown instead of bottomup? is that why the tasks to get the land features correct to satellite pixs, topo maps, surveying data, etc?

i'm just thinking that this program would be very useful to planet makers (planet creators) that start from the core of the planet up. at least that's what i'm hoping to do with this program.
Logged

ZeosPantera

  • ||>>-Z-<<||
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2518
  • #1 Outerra Fan Boy
    • My Youtube
Re: Terrain Generation with Plate Tectonics
« Reply #12 on: June 30, 2012, 12:05:10 am »

:/ Plate Tectonics are a pretty solid and well known theory.
Logged
"Fear accompanies the possibility of death, Calm shepherds its certainty" - General Ka Dargo

RaikoRaufoss

  • Blood may move the wheels of history, but only our cunning keeps the wheels oiled.
  • Sr. Member
  • ****
  • Posts: 374
    • http://www.sabaton.net/
Re: Terrain Generation with Plate Tectonics
« Reply #13 on: June 30, 2012, 12:18:44 am »

Yes, they are.  Plate tectonics was created to explain how continents could drift.  Proof of it would increase in the 1950s, as paleomagnetism (study of Earth's magnetic field which was frozen in ancient rocks) showed that the continents had moved, and this would be finally reinforced by other discoveries covered here: http://www.ucmp.berkeley.edu/geology/techist.html
Logged
Far from the fame
Far away from the fame
But we still remember your name
Karel Janoušek
We mourn the day that you died
So be our guide
CZECHOSLOVAKIA'S PRIDE!!!!!!

lawrencemann

  • Newbie
  • Posts: 6
  • newbie
Re: Terrain Generation with Plate Tectonics
« Reply #14 on: July 02, 2012, 04:24:12 pm »

:/ Plate Tectonics are a pretty solid and well known theory.

Exactly. There are question marks within plate tectonics, like mantle plumes, their character and existence, but what comes to plates themselves and their movement - well established theories/observations.

I didn't include history of plate tectonics to my thesis, because the intended target audience is assumed to know it already.
« Last Edit: July 02, 2012, 04:26:18 pm by lawrencemann »
Logged
Pages: [1] 2