Recall that barrier islands are flat or lumpy areas of sand that form by wave and tidal action parallel to the mainland coast. That often occur in long chains that may go on for many tens of miles. The barrier islands are often separated by small tidal inlets, and may form lagoons between the islands and the mainland. North Carolina's Outer Banks are a typical example:
When I implemented barrier islands for Dragons Abound, I was forced to make the islands at least a couple of locations thick. If I tried to make islands that were just one location thick, the underlying triangles become very obvious in the outline of the island:
Now that I can draw a land mass without regard to the underlying locations, I can make a thin, smooth barrier island.
My original implementation of barrier islands worked by creating an outline where I wanted the island to be, and then turned any of the underlying Delauney triangles within the outline to land. Now that I can define land as polygons, I don't need the second step of turning on the underlying triangles. I can just use that outline directly as the barrier island:
But as you can see, the outline I create isn't quite perfect -- it folds back on itself near the bottom end. When you project a line in a direction as I do here to create the polygon, it can create some weird shapes. When I was just using this as a way to locate land locations, this was irrelevant. But now that I'm using this directly, I'm going to have to clean it up and make it look more like an island.
I do a couple of things to improve the island outline. First of all, instead of projecting from the actual coast, I project from a smooth version of the coast that removes most of the small folds and bumps. Second, I scan through the outline and clip away any self-intersections where the island coastline crosses itself. Finally, I cap the ends of the islands with arcs rather than just a straight line connecting the inside to the outside.
Here is a (zoomed in) example of a cleaned up, narrow barrier island:
If you look at natural barrier islands you'll see that the outward facing sides of the islands tend to be smooth while the insides are more irregular. Presumably these islands are mostly sand, and the wave action on the outside tends to smooth them out, while the protected insides can be more irregular. I can simulate that by adding some noise to the inside of the barrier island profile:
Here's an example of a possible problem:
Because it was created in a narrow inlet, the barrier island is overlapping the coast. When land is tied to the underlying locations, it isn't possible for two land masses to overlap. (They just end up merged.) But now that the shape of the island isn't tied to the underlying locations, I need to add some smarts to keep from getting implausible results.
The one improvement I'd still like to make is to add some small breaks into the islands, similar to what happens at the south end of the North Carolina Outer Banks. That's on the TODO list for now.
when a barrier island overlaps and merges with the coast, it is sometimes called a "spit" like Sandy Hook (NJ) in miniature
ReplyDeleteI probably should allow that -- it's just easier to reject it than to merge it with the coastline.
Delete