Wishlist Alder's Blood on Steam: Store.steampowered.com
Coloring System in Alder's Blood
If you're following us on social media, you probably saw a GIF showing coloring system in Alder's Blood. This time we want to discuss this topic a little longer in a video form. Hope you enjoy it!
Today Michał and Kamil D. are talking about our coloring system, the very first bit of customisation for hunters’ in Alder’s Blood.
Character color swapping involves some shader magic. There's this awesome youtube channel called "Making Stuff Look Good in Unity". If you want to learn something about writing shaders i strongly encourage visiting it. There's this one video called "Pixel Art Palette Swapping" explaining some basic concepts that we are using, check it out, it's worth it.
It works this way: when we're sampling an image, we split color channels into 12 'buckets', and each 'bucket' has a corresponding color from the color pallete. Then instead of showing you the sampled pixel, we use the color from the palette. This approach works fine out of the box when working with pixel art, but in our case it introduced some major issues.
- We couldn't do any gradients
- Black lineart on the character is 'soft' so it messes up our color maps
We currently can't do gradients between colors, but what we can do, is use the green channel to determine the shading of each pixel. The more green it is, the darker the shading gets. This allows us to make parts of clothing and others darker, without using additional colors from our limited palette. This is important since we can only have 12 colors.
And when it comes to the lineart problem, we simply split the sprites into two separate parts - the color map, and the lineart.
Ok, sounds really good, right? But there’s one downside. Something that had an influence on Michał’s back problems, haha. Well, we have stop motion animations. Don’t get us wrong, the change from skeletal animation to stop motion was the best decision we made for Alder’s Blood, but to make the coloring work, we had to change the hierarchy of the hunter prefab. You can see the difference here, with the older assets. Right now we have a lineart sprite that is not colored, then a color map, the thing that is affected by the shader and creates the outline as well, and a shadow, also not colored. This way the shader can read the color information without any interference. At first we tried to make only one sprite, but there was no way of controlling the single pixels around the lineart. They were covering the colors with like 5% of black, pushing the color of the map into a different step in the shader. Sounds very smart, but what was happening was just glitches along the lineart.
Weapons are colored the same way but we're using a different color channel. Red is for the character, Blue is for the weapon, and green, as I said earlier, determines how dark the color gets. This way clothing color doesn't affect the weapon at all, and we can even create some weapon variants this way without redrawing all the animation frames.
Together it creates a nice package that increases the visual fidelity of the game. But that’s not all we are planning for this. We want to include different skins for hunters. So you will not only be able to change the color of the clothes, but also the clothes as well. The skin will affect the whole hunter prefab, you won’t be able to change just individual things like the hat or coat, but I think it still should be cool enough.
For every skin we will have to create a different animation set, so we will need to do some adjustments in the game files like pairing animation clips with not only equipped weapons but also selected skin. But it's nothing compared to the tremendous amount of work required to draw all those animation frames.
Hope you liked this DevLOG and see you in the next one! :)
If you like what we do, please consider supporting us during the IndieDB competition by voting for Alder's Blood here: Indiedb.com
Join our social media to be always up-to-date with new GIFs, screenshots and more!
PS And because we probably won't post anything new before Christmas, we would like to wish you a...Silent Night and prosperous New Year.
Happy holidays everyone!