PDA

View Full Version : Tectonic plate fakery

isomage
03-14-2009, 06:27 AM
I just wanted to run my latest experiment past you all. This is just a vague overview of what i've done so far, not a tutorial or anything.

One of the problems with simple fractal heightfields is that you get all your mountains in the center of your continents, which leaves something to be desired -- while such mountain ranges do exist, you also tend to get coastal mountain ranges, and these are often overlooked by terrain generators.

So I decided to see if I could proceed from random "tectonic plate" boundaries and generate continental elevations in such a way that plate boundaries could end up being subduction zones, or mountain ranges, or whatever.

Caveat: I know nothing about geology.

The first thing to do, then, is come up with some random large squiggle-bordered areas on the sphere, just like Earth's plate boundaries (http://en.wikipedia.org/wiki/File:Plates_tect2_en.svg). To this end, I opted for a Voronoi (http://en.wikipedia.org/wiki/Voronoi_diagram) tessellation of the sphere, but I used turbulence to perturb the boundaries so that they'd look more natural.

Once the plate boundaries had been determined, I needed to decide which edges would be convergent (plates smashing together) or divergent (plates pulling apart). In real life there are also transform boundaries (plates grinding past each other), but... baby steps.

I simplified this step by having each plate either be expanding on all edges or contracting on all edges. Thus, where two expanding plates meet we have a convergent boundary, where two contracting plates meet we have a divergent boundary, and where an expanding plate meets a contracting plate I decided to model a subduction zone (one plate going under the other).

So in this model, the first type of boundary should have a predisposition toward mountains, the second to rifts, and the third to mountain ranges along coastlines (recall the original motivation).

My first draft therefore uses a base heighfield of 1/f noise (a summation of several octaves of Perlin noise) which is filtered by a map generated from the Voronoi cells with high values at the convergent boundaries and the centers of contracting plates, and low values at the divergent boundaries and centers of the expanding plates.

Here are some results so far (representing only one day of design, implementation, and testing, so very much a rough draft!). Horizontal and vertical pixel coordinates map directly to longitude and latitude so the images can be easily mapped onto a sphere. Plate boundaries are shown in gray. Feedback is not only welcome but hoped-for.

NeonKnight
03-14-2009, 06:38 AM
Looks good can't wait to see more.

Kestenvarn
03-14-2009, 07:52 AM
The first and second ones seem to have turned out well...

overlordchuck
03-14-2009, 10:15 AM
This is great so far. Perhaps you'd be willing to write a bit of a tutorial when finished?

RobA
03-14-2009, 02:02 PM
Those don't look bad at all! They certainly don't look like FT generated noise maps.

What are you developing in?

-Rob A>

Ascension
03-14-2009, 03:47 PM
These look very solid...probably cuz you put a lot of thought into it. That third one looks a lil iffy with how the continents are smashed right up against the plate boundaries but, then again, I'm no geologist either. :) Keep up the nice work.

isomage
03-14-2009, 04:59 PM
What are you developing in?

It's written in C and uses libnoise to perturb the plate boundaries and generate the base heightfield.

isomage
03-14-2009, 05:08 PM
That third one looks a lil iffy with how the continents are smashed right up against the plate boundaries

Yeah, I'm not too sure about that one either. The west coasts of North and South America are on plate boundaries, but I think I need to work on the transition a bit more.

Robbie
03-14-2009, 05:26 PM
Paging doctor slayton! This would be a GREAT collaboration...but I may be speaking out of turn. Plate tectonics would be a GREAT way to base a world on...I'd like to see someone experiment with mathematics that factored in plate tectonics, wind currents and water currents in world generation. I think the math is probably possible.

RobA
03-14-2009, 06:01 PM
Yeah, I'm not too sure about that one either. The west coasts of North and South America are on plate boundaries, but I think I need to work on the transition a bit more.

Possibly running and exponential filter against it would flatten the coastal areas. Or some simple erosion model or slope limiting.

-Rob A>

aidenprice
03-15-2009, 06:41 AM
After a very long time lurking I'm finally in my element and need to post.

I don't suppose you could indicate on your examples which plate boundaries are convergent and which are divergent could you? Just some simple arrows pointing in towards or away from each boundary would do.

It would be very useful in critiquing the results. Not that I'm trying to sound disparaging, I think this will be utterly brilliant.

Aiden

isomage
03-15-2009, 08:00 AM
I don't suppose you could indicate on your examples which plate boundaries are convergent and which are divergent could you?

Sure. I've also changed how the boundaries are made: the previous version had each plate either expanding or contracting on all edges (which wasn't very realistic but seemed easier at first glance), but now the individual boundaries themselves are randomly determined.

Here are some new maps, still suffering from the same discontinuity problems, but now with transform boundaries in gray, divergent in blue, and convergent in red.

Redrobes
03-15-2009, 08:35 AM
AidenPrice: Welcome, post an intro message ;) Your handle rings a bell from distant memories too but I cant think why. Anyway, good to see you here.

Isomage: Good stuff. I agree that rand terrain generators suffer in the way your trying to fix and this looks like a good way to do it. Interesting. I think su-liam uses libnoise too - you might tap him if he comes on line too. Its looking good so far so keeping an eye on this.

aidenprice
03-16-2009, 09:59 PM
Isomage; Looking better.

- Randomly assigning convergent/divergent/transform does lead to a few unlikely situations, like the middle plate in map 1 where there are convergent boundaries on opposite edges and divergent ones opposite each other on the other edges, though I don't know how you'd fix that without simulating all the stress and movement on each plate which is way beyond what is necessary.

- The divergent boundaries look good, the reason being that divergent boundaries create sea floor that is the same elevation on both sides (worry about mid-ocean ridges later I reckon). Unfortunately that works against your convergent boundaries which tend to be a bit more one sided, even when two continents collide, it depends on which of the two plates is subducted. Perhaps offsetting the height field only for convergent boundaries might work (he asks with no real idea what he's talking about)?

- A similar sort of offset could work well for a transform boundary (along the length of it though, rather than away from it) moving parts of continents in opposite directions.

Sorry to sound like a critic without offering any real help.

Redrobes; Intro posted, really looking forward to seeing some more of Geotersys!

Regards,

Aiden

isomage
03-16-2009, 11:51 PM
- Randomly assigning convergent/divergent/transform does lead to a few unlikely situations, like the middle plate in map 1 where there are convergent boundaries on opposite edges and divergent ones opposite each other on the other edges, though I don't know how you'd fix that without simulating all the stress and movement on each plate which is way beyond what is necessary.

Yeah. In a final map the plate boundaries will be omitted, though, so you wouldn't notice that kind of thing.

Perhaps offsetting the height field only for convergent boundaries might work

That's basically what I'm doing, but where I have a convergent boundary next to a non-convergent one (as two adjoining edges of a plate), I get a discontinuity in the plate's terrain -- I haven't figured out yet how to blend the terrain smoothly between the two boundary influences.

isomage
03-17-2009, 05:49 AM
I think I may be getting somewhere...

Kestenvarn
03-17-2009, 06:09 AM
Looking neat!

RobA
03-17-2009, 08:34 AM
Looks quite promising! Are you ready to crank up the resolution and bit depth now, and give us a real example instead of these teasers ;) ?

-Rob A>

haroim
03-17-2009, 01:02 PM
looks very good! I have been trying other software, but with only fractals it doesn't look very realistic. When will the first test version come out? :!:

isomage
03-17-2009, 05:26 PM
I think any kind of release and examples with more detail are going to have to wait a bit -- I was able to solve the discontinuities but only at the cost of a huge increase in rendering time.

The basic method is still to divide the sphere into Voronoi cells from 8 randomly distributed points, and perturb the cell boundaries with noise, and randomly assign each boundary one of the three types, but I've changed how the cells and boundaries filter the underlying fractal field.

Each cell contribues either a medium or low value (randomly selected per cell) which increases to 1 at its boundary; thus some cells will tend to preserve the height of the underlying field, and some will lower it, so that's how we get continents and oceans. This is averaged with another value based on a point's distance from a convergent plate boundary, being 1 at the boundary and dropping off exponentially with distance. That average is then multiplied against the base fractal field. Thus we're more likely to get high elevations along or near convergent boundaries, and these may be coastal where they're between a high and a low cell, in the middle of a landmass where they border two high cells.

Getting the ridges on the convergent fault lines has required an additional pass through all the points on the map, where points lying on convergent boundaries are identified and stored so that in the final pass each point's distance from its nearest fault point can be found, and that's slowed things down a lot. I might be able to speed it up if, for example, I don't count all the points on the convergent faults (perhaps finding only ones which are farther than some small distance from previously found ones), but I'll need to play with it.

isomage
03-18-2009, 04:49 AM
Managed to speed things up significantly, and have started working on adding details.

haroim
03-18-2009, 05:42 AM
looks fantastic! :) Could we see the borders again?

isomage
03-18-2009, 05:46 AM
Sure, here are the plate boundaries for that last image.

Remember, though, that I'm not trying to come up with a realistic plate tectonics-based planet -- I'm just using the notion of bounded regions to help me generate continents which may have coastal mountain ranges :)

isomage
03-18-2009, 06:36 AM
Here it is on a sphere (with GIMP's "map object" filter).

isomage
03-18-2009, 06:48 AM
All this work and I'm not sure my results are half as nice as what Fractal Terrains does.

In the end I'm probably just gonna use this stuff as input to my hex map generator (http://axiscity.hexamon.net/users/isomage/wildgen/), so it's not really that big a deal. But geez, this stuff is hard. The people who wrote FT and all those other apps (Terragen, Wilbur, etc) have earned my respect.

haroim
03-18-2009, 06:56 AM
would it be hard to output the height map in numbers, so I can put it in a database? It would be great if that was possible.

isomage
03-18-2009, 07:17 AM
Here you go.

The file contains the width and height in pixels on the first line, followed by width * height floating point elevation values (0.0 - 1.0), one per line. If you read them sequentially in width columns of height points each you should be able to reconstruct the map. The resolution of this data set is 9 points per degree, so if the planet is Earth-sized, that's about seven and a half miles per pixel at the equator.

Note that it's a spherical projection, so is distorted at the top and bottom; you can, however, map it to a sphere (width is longitude and height is latitude) and view the result from any angle.

Have fun :)

EDIT: attachment removed due to errors; see below.

haroim
03-18-2009, 07:29 AM
wow, thanks. Now i only have to find a way to reconstruct this :P

edit: you say it has an resolution of 9 points per degree, that would be 180*360*9 = 583200 points, but there are only 6371 points in the file. So that would be about 0.09832 point per degree, or am i doing something wrong here?

isomage
03-18-2009, 04:48 PM
I must've erred when I dumped the data. I'll look into it.

haroim
03-18-2009, 05:06 PM
when making the map, are longitude and latitude coords generated? if so, could you output in this way:" ( '' , 'long', 'lat', 'height'), ( '' , 'long', 'lat', 'height'), ", that would make life a lot easier for me, because i can put it directly into the database. If you could find the time to do this i would be very grateful.

isomage
03-18-2009, 05:20 PM
Unfortunately, the zipped text is 27 MB even without the coordinate data, which is in excess of the forum's attachment size limit. I'm not sure it'd be of much interest / use at a low enough resolution to post.

haroim
03-18-2009, 07:06 PM
well, thanks for trying it. Could you keep this feature, so when the program is ready i can do it for myself?

anyway, thanks for trying, I hope the program will be ready soon :)

RedKnight
03-19-2009, 03:58 AM
cool stuff

haroim
04-06-2009, 02:21 PM
isomage, are you still working on this?

isomage
04-06-2009, 10:33 PM
I was playing around with an erosion model with a view towards incorporating it into this, but haven't really done anything with it for a couple of weeks.

nphillips
09-17-2009, 11:48 AM
Isomage --

I love the work you're doing on this. Is there any chance you might release the source? It's definitely going down the right road for a project I'm working on.