And then…

Of course, immediately after posting about the weird new glitch, I figured out what was causing it;  under my new setup, I was usually ending up with districts considering themselves to be neighbors of themselves.. which meant that they were always performing a three-way blend between themself, themself, and their neighbor, instead of fairly blending just between themself and a neighbor;  this was causing each district to unfairly bias toward its own terrain settings.

Now that I’ve fixed the “No, you’re not your own neighbor” bug, I’ve run into a new, more subtle one.  You  might be able to see it in the screenshot above (or to the left, depending on just how wide your browser window is), but I’ll include a screenshot here that makes it much more visible:

In this shot, you can see a weird sharp corner in the height map.  For some reason, the district at the bottom part of the screen isn’t blending into the high ground at the top of the screen, the way that the districts on the left and the right are.

If you view the full image, you’ll see dim blue lines which are the district boundaries (they’re drawn far below the terrain and I’m not looking straight down, so they don’t line up precisely, but I hope you can see what’s going on);  that bottom district isn’t blending with the higher top district because it doesn’t share any edges or vertices with that top district, but it’s still less than the blend distance away from the top district.

To fix this, I think I’m going to have to throw away the whole concept of blending between the current district and all adjacent districts;  instead, I’m going to have to switch to something more like “blend between the current district and all other nearby districts, even if those nearby districts don’t actually touch my borders”.