Tuesday, November 15, 2016

Islands Are Just Mountains Up To Their Necks in Ocean

I've posted previously about creating islands.  In keeping with the mountain theme on Reddit, I'm going to talk about how to create archipelagos out of mountains.

Some islands -- like the Hawaiian islands -- are formed by volcanoes rising from isolated spots on the sea floor.  Other islands -- like the Caribbean islands -- are formed by the same sort of plate tectonics that create mountain ranges.  It's just that the action happens where the ocean is deep enough to cover up most of the mountains.  Only the tops of the "mountain range" rise out of the sea, forming a chain of islands along the edge of the tectonic plate.  This suggests creating an island chain by using the same process used to create mountain ranges but putting them in an ocean area and sinking them so that only the tops are visible.

While this would work to create free-standing ocean islands like the Caribbean islands, my maps don't have a lot of open ocean, so I'm going to use this technique to create island chains that extend off the end of a peninsula, like the Florida Keys:

Or the South Shetland Islands off the coast of Antarctica:

This actually happens "naturally" on some of the maps that Dragons Abound creates, where a mountain range runs into the sea.  But because of the way Dragons Abound creates ocean areas, it doesn't happen often, and I'd like a way to purposely create archipelagos.

The first problem is to create the proper shape of islands -- a kind of wedge-shaped area of islands stretching out from a peninsula.  So if I have a bit of map that has a little peninsula like this:

I want to add some islands in roughly this area:

If the islands start dense and wide near the shore and get narrower and lower as they stretch out to see, it will hopefully appear as if the same ridge that created the peninsula continues out to sea, sinking lower and becoming islands.

As it happens, the same tent mask that I used to create mountain ranges will serve for this purpose as well. 
The end of the tent mask creates exactly the wedge shape that I need.  I just need to set the length of the tent to zero and just use one end.  To test this out, I'll try filling the mask with a solid chunk of land. (I'm placing this off the edge of a simple circular land shape to get a notion of how it would sit in relation to a peninsula.)
That looks pretty good.  Now I need to generate mountains in the mask rather than just flat land.
Here I've used noise parameters that will give me a lot of small pointy mountains -- three octaves of ridged multi-fractal noise.  I chose this because I want to get a lot of small islands, but you can play around with different noise formulae to find a setting that you like.

Now I need to sink the mountains into the ocean so that only the tops are showing.  With a little playing around with heights, I got this:
Which already looks pretty good.  I control how far to sink the mountains by setting a percentage of area within the mask that should be islands, and then I lower all the mountains until only that percentage is above water.  (I'm showing more islands in these images than I think looks best on a map because I want the shape of the chain to be evident.  In practice, I find about 25% land looks good.)

For a further refinement, you can perturb the shape of the mask with noise to get something that is less regular.  Here is the basic mask:
And here are some perturbed versions: 

I'm using fairly minor perturbations here.  It's important that the island chain point away from peninsula to be convincing, so I don't want to lose that basic arrow shape.  Here is an example of an island chain created with a perturbed mask:
Obviously it would be easy to use other mask shapes here, such as a long narrow arc to create something like the Caribbean islands.

Now that I can create an island chain, the next step is to identify candidate peninsulas on the map and figure out how to properly align the mask with the peninsula.  Sadly, the research field of peninsula identification seems to be moribund, so I was forced to invent my own algorithm.

A peninsula is a point on the coast line where the land bulges out into the sea.  To detect these spots, I slide 2 points (Beginning and End) along the coast line, keeping them a fixed distance along the coast apart.  At each step, I check whether the midpoint of the line between Beginning and End is over land.  For example:
Here the green point is on the midline between Beginning and End and is over land.  So I know that the coast between Beginning and End forms a peninsula.  If there is water, I have a bay:
(In practice, it's better to check a number of points along the line between B and E and make sure they're all land, because in some situations where B and E are straddling a long narrow bay the midpoint might be land with water to one side.)

Once a peninsula is detected, the next step is to determine where to anchor an island chain and which direction it should point.  This starts by placing a new point on the Middle point of the coastline between Beginning and End:
This point is the anchor for the island chain.  To measure how "pointy" the peninsula is, I create a line from the Middle point to the line between Beginning and End:
The ratio of the length of this line to the length of the line between Beginning and End is a measure of the peninsula's "pointiness".  Pointier peninsulas are better for anchoring island chains.  I don't want to put an island chain off every peninsula, so I scan the coastline, rank candidate locations based upon their pointiness, and then use the top candidates.

Here's an example island with the top four peninsulas highlighted:
You might note that the blue arrow isn't always perpendicular to the red dotted line.  This happens because "M" is at the midpoint of the coast line between "B" and "E".  Since the coastline is wiggly, the midpoint is not always exactly in the "middle".  In the example at the lower right part of the map you can see how sliding the red dotted line along the coast sometimes finds somewhat odd "peninsulas".  However, in general the algorithm works pretty well.

The best candidate on this map turns out to be the lower middle peninsula, so that is where I'll add an island chain.  To size the mask for this chain, I'll make the base of the wedge the length of the dotted red line, and I'll make the length of wedge about three times the length of the blue line.  On the following map I've filled in the mask with solid land to illustrate it's size and shape:
Keeping the mask no wider than the peninsula helps it look like a continuation of the peninsula.  The length is more a matter of taste -- choose what looks good to you.

Before creating the island range, I perturb the mask to make the regular shape less obvious:
And now I can generate the islands:
Here are a couple more examples:

In some cases, the archipelago extends into an area where there's already land -- an island off the coast, or another peninsula.  Adding a check that the mask area of the archipelago does not contain any land would prevent this from happening.  I choose to let it happen -- at best it looks like a small chain of land that connects two other land masses, which I like.

That covers the basic process Dragons Abound uses to create small archipelagos.

No comments:

Post a Comment