March 15, 2021

Detail VIII: A Case Study II

I had previously worked on height generation here: Detail I: One Mile Hexes. The underlying terrain is one of the more fundamental issues to tackle, as it determines road and river placement.

However, as we shall see, it's not of first priority for this particular Case Study. In the general case, the topography is important for placing rivers and other features; it'll be important here for roads, but rivers are all predetermined.

With that in mind, the altitudes of each 20-hex are defined as best I can. The 20-hex I'll work on first is designated No. 24. Its neighbors are 14, 15, 23, 25, 34, and 35. The heights for each of these must also be defined, or at least for most of them if available.

With these in hand, we can use IDW to get weights for each 1-hex based on the distance to the centers of the neighboring 20-hexes. The IDW output is heavily dependent on the number of neighbors $k$ and the exponent $x$ used to control the drop. The following graph shows the altitudes of a line of hexes across the middle of 24 and 25, with $k=2,\, x=2$.

Applied to all subhexes, the altitude is as follows (heights exaggerated for display, these low heights do not show up well in greyscale):

Some artifacts are still just barely visible, because $k=2$ means that only the central 20-hex and the closest neighbor will matter. Expanding that to $k=3, x=3$ may yield better results. There are still some artifacts, but these will probably get washed out when we add a little noise.

The amount of noise is determined by the topography type. Hex 24 is coded as "hills," and so the standard deviation of the gaussian function is set to $\sigma=150/6$. I'm still playing with those values: that is not a lot of height variation over 364 sq miles. Hex 25 has a topography of "plains," so the gaussian is contracted to $\sigma=25/6$.

 

That's not looking too bad. I considered a further "relaxation" step, where each hex would spill a bit of its height into its lowest neighbor. But that would require information we don't have in the self-contained system for the border hexes, and might lead to edge artifacts when 20-hexes are combined. So for now this seems good enough.

No comments:

Post a Comment