Monday, November 25, 2019

New Mountain Style (Part 2)

In the last posting I talked about my motivation for a new design approach, and reviewed in some detail a mountain style that I'm going to implement as an exploration of that approach.  In this posting I start working on the implementation.

The first element of a mountain is the topline.  The topline runs across the top of the mountain from left to right.  In the simple example below, I've traced the topline in blue:


In the style I'm trying to recreate, almost all the toplines are either simple carat shapes (as above) or a carat with a small secondary peak to one side or the other.  Here's the sample of toplines I traced from one section of the map:

The tallest mountains (about 1 in 20, or 5%) have a flattened peak.  Other parameters are how symmetrical the mountains are (these are very symmetrical) and their proportion (these are generally 3-4x longer in the horizontal direction).

My initial function creates a carat shape with the provided possible peak locations (pretty close to the middle) and proportions.  (Part of my design approach splits the creation from the drawing of the mountain, so for now I'll use simple lines when drawing the mountain.)
Next I create sub-peaks by putting a jog in the mountain's side:
Comparing these to the original subpeaks above, I can see these aren't quite right.  These subpeaks are symmetrical, while the subpeaks in the original mountains have about the same proportions as the mountains themselves.  The mountains with subpeaks are also wider, to maintain their proportion.  And there are too many mountains with subpeaks on both sides.  Let me try to address those issues:
This looks better, although there need to be more mountains with no subpeaks.  Placing these with the toplines from the original drawing looks pretty plausible:
As noted in the previous posting, the original drawing has most mountains slanted to the right; not sure if I'm going to implement that or not.  (Update: In a discussion with /u/greypawz, he said that he was aware of the slant but it was unintentional.)

There are two types of large mountains as well.  They are larger than the other mountains, and have either a flat top or a sharp peak.  These are constructed by adding the flat top or the sharp peak to the regular mountain shape.  Here are some examples:
Finally, let me take a mix of toplines and compare them to the reference map:
I created this mix manually and it's not as dense as the reference map, but to my eye looks very similar.  It's worth noting that the reference map doesn't have a uniform mix of mountain sizes.  There are more small mountains than big ones; that's something I'll need to replicate.

Now let me move on to the ridgelines.  Here's the illustration from the previous posting where I drew in the ridglines in blue:
To summarize the last posting, ridgelines appear on almost every mountain, come more-or-less straight downward from the peak for about half the height of the mountain and then alternate sharp angles, each segment being about a quarter to half the height of the mountain, and generally ending after crossing the baseline of the mountain.

I will start by drawing the first segment of the ridgeline down from the peak of the mountain about half the height of the mountain and keeping it roughly vertical:
(Here I've started coloring my generated mountains with the same color scheme as I used when analyzing the reference mountains.)  The next step is to add alternating left and right segments until the ridgeline extends as far as the baseline.
One problem that can arise is that the ridgeline can be too close to one side or the other of the mountain.  I can guard against this by putting the end of the first segment in a middle region of the mountain, even if that means it is less vertical.  That also lets me generate some first segments that are more slanted, since there are a few of those in the original map:
There are also secondary ridgelines that come down from secondary peaks.  I've identified some here in yellow:
These are two lines, one of which comes down from the secondary peak and one which comes downward from the adjacent valley.  They meet down around the baseline.  (Note that these get reverse shaded: dark if they're on the light side of the mountain and light if they're on the dark side.)  Not all secondary peaks get these ridgelines.  These are fairly easy to create:
The next step is the secondary toplines.  These originated on the corners of the ridgeline and run parallel to the topline.  Here's the reference map showing ridgelines (blue) and secondary toplines (green):
The secondary toplines generally start at the corners that are the furthest from the centerline of the ridge.  Most commonly there is one secondary topline on the shadowed side of the mountain.  Less frequently there is also a secondary topline on the lit side of the mountain, or a second topline on the shadowed side.  All told, secondary toplines appear on about half the mountains, and never on the smallest mountains.
Here I've made the green secondary toplines about the same slope as the red topline and long enough to sometimes cross the baseline.

One lesson I've learned is that in routines like this, with lots of different parts, it's easy for them to occasionally clash with each other, or to have other minor problems.  But even if this only happens very infrequently, if you use the routine a lot (as I will to generate many mountains on each map) these problems will show up enough to spoil maps.  Here's an example of a problem:
Here a long secondary top line is being drawn across a secondary ridgeline.  This doesn't happen very often, and in many cases the overlap is minor.  But this will look bad on a map, and isn't the kind of error a human artist would make.  So I'll put in a check to keep that from ever happening.

That completes the basic construction of the mountain.  In the next posting I'll start working on drawing the individual mountains.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.