Monday, April 30, 2018

Back In The Woods (Part 4): Trunks

Before I jump into implementing tree trunks, I want to fix up a few problems from my (currently pretty simple) routine for putting trees on the map.  I put this together quickly at the end of the last post, and showed this example:
There are a few problems with this example.  First, the colors are hard-coded, so it's not picking up the map theme colors for the forest.  Second, the logic for avoiding rivers, seas and mountains isn't working.  This is because it is using the same approach I used for forest masses.  For this style of forest, I can't get so close to other map features -- I have to stay away the radius of the tree icons (or even more).

After fixing those problems I have this:
This fixes those problems, although I note that the “liut Mam" city icon is on top of some tree icons.  I'm not sure that's good, but I'll leave it for now.

Moving on to tree trunks, when I look at my example maps that use individual tree icons, most of the trunks are pretty simple:  a dark line coming downward out of the tree shape, usually about 20-25% the height of the tree shape, and somewhat bigger at the bottom than at where it joins the tree.
These have some shading, too, but I'm not worrying about that yet.

To add trunks, the first thing I need to do is turn trees into structures.  Up until this point, I've just been treating trees as an array of polygons but now I need to distinguish the tree shapes from the trunk shapes.

Once that's done I can construct a trunk as a polygon that gets broader at the base to represent the roots, e.g., something like this:
Now I draw the trunk from the center of the tree and somewhat longer than the radius of the tree.  By drawing the trunk first, the clumps will conceal the upper part of the trunk.  That gets me to this:
The "roots" might need a little tweaking but it looks like this approach will be okay.  With some rudimentary colors:
A little "cartoony" but the basic shape looks pretty good.  Let's see what it looks like on the map.  For individual trees with trunks, the icons are usually spaced out more widely.
Not too bad.  I see a few problems -- the “roots" at the base of the trunk aren't always obvious, and some of the trees aren't showing any trunk at all -- but overall the effect is pretty pleasing.

Next time I'll work on adding texture and shading to the trees.

No comments:

Post a Comment