## Monday, January 20, 2020

### New Mountain Style (Part 8)

I've found a few problems during the previous development stages that I didn't address, so I'll try to take care of them now.

The first problem is that sometimes the range of drawn mountain sizes is too large; the largest mountains are so big they look odd on the map.  An example:
The largest mountain in the left chain is much bigger than the others and looks odd as a result.  (Although admittedly this is something of a matter of taste.  Maybe you like the look of a huge mountain anchoring the mountain chain.)  The real problem here might be that the very big mountain is mostly surrounded by much smaller mountains, but detecting and correct that situation would be difficult.  The easier way to address this is to tune the parameter that controls the maximum mountain size.  This compresses the range of mountain sizes that will be drawn.  After playing around a bit with the parameters:
This seems better to my eye.

A second problem can be seen in this screen shot:
The red lines are drawn to connect the ridgeline of one mountain to the topline of the next mountain.  But they've obviously gone wrong in the upper-left mountain chain.

The reason is that I wrote the mountain chain code to draw mountain chains top down.  In the upper-left mountain chain you can see that the green line the mountain chain is following turns to go upward where the problematic red lines begin.  You can see another problem with the last mountain in the chain -- it doesn't actually connect to the previous mountain.  In contrast the other mountain chain -- which goes downward -- is fine.

I won't run through the whole logic of drawing a mountain chain upwards, but the general idea is that instead of intersecting the topline of the new mountain with the ridgeline of the old mountain, you have to do the opposite -- intersect the topline of the old mountain with the ridgeline of the new mountain.  This turns out to be a surprisingly small code change (at least once I quit confusing the X and Y axes in the code):
Now you can see the right side of the mountain chain makes more sense, and only short red lines are needed to connect adjacent mountains.

Another problem becomes apparent when I add a land texture:
Each mountain blocks out a chunk of the map below its baseline.  I added this because when tightly packed, the ridgeline of the back mountain often peeks out below the front mountain.  But this seems to be less of a problem with this method of filling the mountain areas, so I can probably reduce the size of the masking.
That looks pretty good; no peeking problems, at least on this map.

The last problem (at least for now) that I want to address is the straight lines on the mountain sides.  In my analysis of the original map I noted that almost all the mountains had straight sides:
But straight sides don't look that good on my maps.  Reviewing the original map I think that the sides tend to have subtle curves that break up the monotony.  I can add slight curves and some more hand-drawn jitter to my mountains to try to make the mountains look less mechanical:
I've kept the effect pretty subtle here and may increase it later, but I think it helps to keep the mountains from looking so mechanical and repetitive.

Next time I'll work on developing an SVG filter to make these look more like they were drawn with a pencil.

#### 1 comment:

1. I guess a cool effect would be zooming in on the map and the mountains draw themselves, bigger ones breaking down into smaller ones more closely showing the details of the terrain...