Devlog 6 - Pixel art and water shader improvements
Pixel art and dynamic shadows
As we build new Adam & Ricky maps, we are slowly refining the art style we want to be using throughout the game.
We have been improving the graphical detail of almost all of our assets, from the grass that fills a large part of the maps, to the larger and more special items. Obviously that means it’s going to take a bit longer, but we’re sure it will be well worth the wait.
Another improvement we’ve made to the graphics, is the inclusion of dynamic shadows for certain objects and enemies/NPCs.
Water, shader porn
For a while now we’ve been pondering about how we want to portray water in the game world. Although it’s a pixel art game, and risking a bit of hate from those good old purists, in this case we went for a more realistic approach.
Is it worth it? See for yourself in the video below:
As you can see in the video, Adam is reflected in the water. It’s not just Adam though, it’s everything comes into contact with it, from enemies, to rocks and other decorative elements.
To create this effect, we duplicated the sprites that came into contact with the water, we flipped them, and we placed them on a render layer below the one that contained the water shader. This shader is simply a distortion shader animated with blending.
Sprites can be duplicated dynamically, or be already duplicated before compiling the game. The dynamic ones will be all the moving sprites that can either enter or exit the water area, and the rest will be fully static, such as stones, plants, etc.
An then, in the same way as we do everything outside the water, we organize the layers to give it that cool depth.
SORTING_ORDER_BACKGROUND_WATER_OVER_EFFECTS_MAX = -10; SORTING_ORDER_BACKGROUND_WATER_OVER_EFFECTS_MIN = -20;
SORTING_ORDER_BACKGROUND_WATER = -30;
SORTING_ORDER_BACKGROUND_WATER_MIRROR = -31; SORTING_ORDER_BACKGROUND_WATER_CLOUD_MIRROR = -32; SORTING_ORDER_BACKGROUND_WATER_LIVING_MAX = -40; SORTING_ORDER_BACKGROUND_WATER_LIVING_MIN = -60; SORTING_ORDER_BACKGROUND_WATER_PROPS_MAX = -70; SORTING_ORDER_BACKGROUND_WATER_PROPS_MIN = -80; SORTING_ORDER_BACKGROUND_WATER_WALLS_MAX = -90; SORTING_ORDER_BACKGROUND_WATER_WALLS_MIN = -100;
That way we can be sure that the fishes and other elements above the floor, and other pieces above water aren’t all affected simultaneously by the shader distortion.
Ultimately, we anted do add a few extra properties to the water so interacting with it wont feel boring as hell:
- A water splash effect when walking on it or throwing something into it.
- Color shifting. Depending on the size of the pool or lake, or if an enemy dies and splatters all his blood in the water thus turning it red.
- If an item falls into the water, they sink, and if the item had blood on it, it will leave some marks that will dilute over time.
- If a player or enemy i son fire, going into the water will get rid of the burning.
And that’s all for today folks! See you in the next post!