Monday, January 23, 2017

Building a Castle in the Swamp

Sometimes building software is like building a castle in a swamp.

You build the software, it burns down, falls over and sinks in the swamp.  So you have to rebuild.

When I put a previous blog post on Reddit, a number of Redditors commented that the mountain symbols would benefit from a greater range of sizes.  With all the mountains about the same size, they tend to make a uniform jumble when grouped together:
The program actually does vary the size of the mountains some, but visually the difference isn't apparent.  However, there's an obvious problem if I increase the variance (somewhat exaggerated here):

The problem is that smaller mountains aren't just scaled-down versions of bigger mountains.  To look good, the smaller mountains need to change their character.  Here's an example from the nice Ehren map from Kacey at the Cartographer's Guild:
The biggest mountains are peaky and detailed, and as the mountains get smaller they get flatter, softer and simpler.  Compare these to my mountains, or this example (taken from here):
The mountains used on this map are basically just scaled down as they get smaller, and look very artificial.


What I'd really like is the ability to smoothly interpolate between mountains that are tall, peaky and concave all the way through short, flat and convex mountains, like these hand-generated examples:
This is possible but certainly a big change from the way the current code works.  Hence the rewrite.

I find that re-writing code is often less effort than you might expect.  The second time around, you can avoid many of the mistakes and dead-ends, and there's often a lot of code that can be partially re-used.  I'm hoping that's the case this time :-).

2 comments:

  1. Just wanted to say I love this blog. Keep it up man!

    ReplyDelete
  2. Thanks, I always appreciate the encouragement!

    ReplyDelete