Monday, January 9, 2023

Warp speed

I liked the effect of domain warping at the global level, and I wondered: might it help at the regional level too? With the regional terrain, there's a constant danger of the underlying tile pattern becoming apparent and making the terrain look like a grid. So I'm always looking for ways to disrupt this.

Originally, I intended every tile at regional level to be calculated entirely independently of the others, so that the whole map could be scrolled tile-by-tile while keeping every feature the same. I eventually gave up on that. Now, although many features are created on a tile-by-tile basis, many bleed across into their neighbours. You can't scroll tile-by-tile now: each regional area always has the same 32x32 tiles in it. So I thought: suppose I were to apply domain warping to an entire regional area. Might that make it less grid-like?

One complication is that the warping needs to be faded away towards the edges of the region, so that it joins up neatly to neighbouring regions. This wasn't hard to do. I then spent a great deal of time tinkering with various ways of doing it. One problem was that rivers can't be warped in this way. Or rather, they can, but they look terrible. I did find that warping the mountains worked well to make them a bit less gridlike - but for this to work, I had to warp the normal terrain too, because otherwise the mountains might move away from the higher normal terrain that normally lies beneath them. Since I wasn't moving the rivers, warping the terrain around them did leave some rivers travelling over what were effectively aqueducts if the land around them was lowered. I tried making it so that warping is only done if it would raise the land in question. This solved the river problem, but now the high terrain under and around mountains tended to get stretched across the landscape, creating broad plateaux, which looked weird. (There could also be a similar effect near the edges of the map if the natural variation in warp synced with the reduction in warp strength at the borders, creating stretch marks.) The only way to get around this that I could find was to reduce the strength of the warp effect, but doing this enough to overcome that problem meant that it had little overall impact.

So eventually I gave up on warping the terrain on land. However, I did find a similar effect worked well on the rifts and ridges on the sea floor. Because these feature a lot of parallel ridges, they can look a  bit like they've been drawn with a ruler. But a bit of warping really helped here, since there are no rivers or anything to get in the way. Rather than simply warp the whole undersea terrain after the ridges have been drawn, I generated the terrain normally but warped the coordinates that the ridges would be drawn to, and then drew them to those coordinates. This meant that the ridges themselves don't look stretched, but they are forced away from the underlying tile structure.

Compare this before shot:


...to this after one:


It's a shame I couldn't get this to work equally well on land, despite all that tinkering, but I think this is still a nice improvement, minor though it is.

No comments:

Post a Comment