Autumn Leaves In King Under The Mountain
Changing of the seasons
Here's a little dev blog post about trees changing colour in King Under The Mountain which I found on ModDB this morning. King Under The Mountain [official site] is listed as "a simulation strategy game where you build and manage a settlement in a fantasy world". That's as maybe, but I don't believer there's a playable build at the moment so I am definitely here for the trees!
It's a simple thing where variation is introduced into the forested areas by means of pixel colour swatches which are linked to each species of tree. I've seen riffs on the idea before but there was something really nice about acknowledging September's arrival with a video showing in-development trees changing colour.
In the video above you can keep an eye on the top left information which tells you which season the game thinks it is and chart the colour changes.
In case you're curious, how it works is the game randomly generates colours for a tree's trunk and its leaves by taking the four basic colours of the assigned trunk or leaf swatch and drawing a random amount from each to land somewhere within the spectrum designated by those colours. It's easier to understand if you look at these two images:
The colour gradient square has a colour from the swatch at each corner and then represents different blends you can get by varying the ratios of each. The game will pick a value from inside the square and then apply it to the trunk of the beech tree. Same goes for the leaves, but using the colours from the right hand swatch.
Then, as time passes and summer moves to autumn the non-evergreen trees will gradually move through a series of progressively more orangey palettes. Here's an example:
The dev blog continues:
"Currently when it's autumn (but in the future it will also be tied to the ambient local temperature) the leaves change colour going from left to right using a mix of each row, until eventually the leaves fall off, ready to re-grow next spring. You can see this in action in the video at the top of the post.
The plan is to include an animation of leaves falling from the tree, culminating in a large amount of leaves falling to cover the abrupt change to when the tree loses its leaves. This will come later when there's support for particle effects in the game engine."
Here's the full blog entry on the game's official website if you wanted to read more.