Croakwood Devlog #5

In a game about frogs you kind of need to have water, which means you need to program a water shader. A shader is basically a short program that calculates what color a pixel should receive. To me as a programmer they can be somewhat intimidating to create - you need to write some code that, somehow, produces something that matches a certain artistic vision. Whenever I'm working on a shader I find that oftentimes the result looks terrible for a long time until eventually a tiny change is made and suddenly everything looks great, but figuring out what tiny change is required can be a long process of trying lots of different things.

Oftentimes it's also not clear from the start what the artistic vision is, especially when the art style of the rest of the game is still evolving, but you have to start somewhere. So one of our first tests around late 2021 for the water looked like this:

We liked the reflections and the wavy outlines around the edges of the water, but it felt like it was still missing something.

Eventually Marve came up with this concept art for the fishing hut:

This concept is really more about the the objects for the fishing hut, but it still gave us a some direction for what the water could look and "feel" like.

Over the next few years we kept making small tweaks to the water shader until eventually arriving at the current version, which looks like this:

This is what I meant at the start of this post - from a technical point of view this is really not all too different from the very first version we had, there's just some tweaks to the color, the transparency, the width and shape of the outlines, and some "smaller" additions like the ripples from the fish and other things swimming in the water, but with all of these things together it eventually looks good.

We'll surely keep making more small changes but for now we're quite happy with how it looks.

Shorelines

I couldn't find a lot about how other games are doing their water, so I wanted to give a bit of technical insight into how we're doing ours.

Probably the easiest approach for this kind of effect is the version we used in Parkitect, which looks like this:

This is being created by checking if the distance from the water surface to the depth in the depth buffer is below a certain threshold. It's very easy to do and quite cheap performance-wise, but you can't do a wave movement animation towards the shore and it can look as if the effect is painted onto the objects inside the water (because it essentially is; the effect can not extend beyond the geometry of the objects inside the water, so you can also only ever see it on the side that's facing the camera, not all around the object).

In Croakwood we went for a slightly more complex approach. We're placing an orthographic camera that's looking straight down just above the water surface to get a texture that contains the outlines of anything intersecting the water surface.
Here's an example with the generated outline texture on the right:

To be able to distinguish what type of shore it is we render the terrain into the green color channel and anything else into the red color channel (we do this so that we can give the wave effect a different movement direction and slightly different look depending on whether it's around the terrain or an object).

Then for every pixel in this outline texture we calculate the distance to the nearest shoreline pixel which can be done really fast on the GPU as explained in this excellent article.

Signed Distance Field generated for the shoreline effect (the version on the right is just a different visualization to better understand what's going on)

And that's all we need to know where the shoreline effect should appear! They work for objects of any shape, fully surround them and nicely combine if there are multiple nearby objects.

Waves

The waves created by swimming frogs and fish look like they might be fairly complex, but it's surprisingly just a couple dozen lines of code in a compute shader. This article and this video explain it better than I could.

Croakwood Devlog #4

In this post our art director and concept artist Marve gives some insights into her thoughts on the setting of the game and some of the influences for the art direction.

Mood

We decided pretty early on we want to keep the overall style semi-realistic and not wander too far into fantasy. From earlier conversations we referenced story-book like elements a lot, and its still one of our guiding elements in various design choices.

The story-book feel is reflected in the vibrant color scheme, stylized light and extra warm shadows, to really emphasize this almost dream-like warm summer day. The perfect time for frogs to be active!

Most importantly, there is no human involvement in our world. You wont encounter any stray tin cans or bottle caps. We really wanted to keep the forest and all the natural elements very untouched and wild.

In a way the forest is a character on its own. The light won't reach under thicker forest nooks which creates a much more cool and mysterious atmosphere. The frogs will be discovering their surroundings alongside the players, it's supposed to be a bit secretive and unpredictable. The trees and mushrooms grow too tall, the trails can lead to unknown locations and various strange creatures can cross your path.

To help along with the immersion we found it very important to have a direct reference to scale. Seeing familiar plants, mushrooms and trees are really nice ways to grasp how small our frogs are. Also, there's something so charming about imagining such a village existing in a massive forest you have walked in.

Early concept art exploring different ideas for biomes

Our world is set at a temperate climate with plenty of greenery and rain but nothing too tropical or desert dry. This helps narrow down the selection of flora and fauna we add to the environment.

With some creative freedom, a lot of it is reflected in the building materials, furniture, the clothes frogs wear and symbols they use in their arts and crafts.

Anyone who's had the chance to spend a lot of time in nature as a child might feel right at home here. A small yard or a garden used to feel like a massive playground, a whole forest would be filled with endless possibilities and mysteries.
We want to give you this feeling of being close to the ground, where bugs and snails roam around under leaves and grass blades and the sunrays peek through the leaves.

Influences

These are some of our main influences for the mood and look:

Midsummer, Djamila Knopf

This painting from Djamila Knopf has that specific feeling of wonder and warmth that reminds you of the carefree and quiet summers of childhood. There's so much magic and playfulness here and it always fills you with a sense of home. This is what we want Croakwood to feel like - warm, welcoming and a little bit dream-like.

Another huge influence here has been Arrietty, the movie by Studio Ghibli. Aside from the dollhouse furniture and borrowed human items, one of the most charming parts is how the tea poured in a mug behaves, it's so delightfully weird, thick and viscous; nothing like we're used to seeing. Small details like that help so much with pushing the believability.

Because we do not have humans living in our world, the focus for Croakwood is more on natural elements the frogs can use to craft their tools, workshops and houses.

In addition, Alexandre Diboine has his amazing world of Saltenpepper, which also has influenced the art direction quite a bit. The way he handles shapes and textures is very close to what we’re aiming for.

Tiny Garlic Shop, Alexandre “Zedig” Diboine

Small beings living among massive plants and vegetables; a lot of furniture and house designs are a direct reference to the environment around them; how large an actual garlic is in that space and how big and chunky the rolled up leaves are in the background - all of this pushes the believably and makes it much easier to imagine how it might be like to live in this world.

Setting

Croakwoods main location for the frogs is an open and light filled meadow in the middle of large ancient forest, a space lush with various flowers, mushrooms, shrubs and building materials taken straight from the environment.

There's a lot you can show with how the materials are used and the textures and detail density, for example how the wood grain would be a lot more bloated and the grooves and cracks will be more visible. Large pinecone makes an excellent material for some roof shingles. Tree bark is sturdy enough to build up walls and fences. And pine needles make a great rustic looking thatched roof.

Our frogs are also a bit chaotic and fun loving creatures, they might not always follow the most convenient building regulations. Patchwork of various materials make great little cottages. They can be very resourceful with what materials they use and how they build their houses.

Some of the first concepts for frog houses

The grid system and modular nature of the construction pieces do create some limitations, but we’ve been working hard to add plenty of variety in fun materials and elements to make this world extra cozy and alive.

Towns in Croakwood are meant to look like natural parts of the environment, everything is carefully and lovingly handcrafted by the villagers themselves. Also, the frogs coexist with the forest and its inhabitants - all the resources they make can provide for more than just for the town.
Perhaps you could use some to trade in exchange of a secret or as an offering for a mischievous forest spirit?

Croakwood Devlog #3

In a game about building frog towns the frogs are unsurprisingly pretty important.
Here's a look at how they developed over time and what we had in mind while working on them.

First of all, as with everything else, figuring out their look took some time and we went through some revisions.
The first try was a more biologically accurate version with the eyes on the side of the head. When viewed from the front the model looked like a perfectly fine frog, but in game it was a bit weird...

Left: first test version. Right: an updated version to fix some of the issues with it (but not quite the final version yet)

...especially when viewed from a more top-down camera, as you'll oftentimes see them in the game:

The positioning of the eyes made them look kinda angry from this camera view, so we changed this by moving the eyes more to the front. The head shape was also changed so you're more likely so see their "chin", which makes their default appearance look a bit more as if they are smiling.

To give them some individuality there's a bunch of different patterns and colors they can have. Here's a small selection:

To make the frogs feel more alive we gave them the ability to look around freely:

We can mark objects in the game as "interesting to look at" to have some control over where they are looking, but they can also simply look at some random unspecific point somewhere in front of them.
Apart from making them more interesting to watch it feels really good to see the frogs actively looking at the nice town you've built for them as they wander around 🙂

They can also react to things happening around them and express their current mood. Here's some of the animations we have for that:

We have some ideas for how to push this a bit further to be a bit more readable and noticeable, but this is something we still need to work on.

One problem we had is that the frogs have pretty long feet and whenever they stood on stairs or sloped terrain the feet would clip into the ground and disappear entirely:

Not very nice! So we improved it by moving the feet out of the ground using IK:

Croakwood Devlog #2

Where do you even start developing a game? There's so many things you need to work on at the same time.
A good starting point probably is the terrain and general environment, so let's take a look at how that developed.

As with any feature, it starts very simple. Over time we get a better idea for what exactly we need and we keep iterating to improve and expand.
Since we knew it would be a grid-based game again our starting point was the Parkitect terrain. The main challenge is that you have to be able to build paths and buildings on the terrain, which means the terrain can't be too bumpy, but we still wanted it to look somewhat smooth and natural.

First Croakwood terrain tests, ~early 2022

What we came up with is not too different from Parkitects terrain actually - it's secretly still using the same blocky slopes that work well for putting paths on them, but then we add a bunch more polygons to it, smoothen it using ideas from Bezier surfaces and add a bit of random bumpiness.

This creates the problem of the bumps in the terrain clipping through the paths...

...which we can solve by flattening the terrain wherever a path is.

Another technical challenge we had to solve that our terrain could only be a single big rectangle initially, but we wanted to create maps that are very irregularly shaped sprawling woods, with little pockets where you can build.

Big rectangular terrain, ~mid 2022

Creating this kind of playable space inside a big rectangle would mean there'd be a lot of wasted space, which is bad for performance. We solved it by splitting up the terrain into lots of small rectangles that can be created wherever we want, which allows us to give the map a much more freeform shape.

And since the terrain was more detailed than Parkitects we also had to add a system for reducing details in far-away areas.

Finally, to make the terrain look more interesting we added a way to paint it with a bunch of different textures.

To decorate the terrain even more we wanted a way to place lots of objects on it, for example blades of grass.
Figuring out a fitting style for the grass took some iterations. Especially early on we didn't fully know what the game was going to look like yet, so the first version was more of a technical test:

Early grass test, ~late 2021

Eventually we figured out that having a nice transition between the terrain texture and the grass is really important for it to look good.
On the technical side, the key to achieving this was to give the grass the same normals as the terrain to make everything look less messy, and to fade its color towards the terrain texture at the bottom.
Here's a test where they blend together more nicely:

Better fitting grass, ~mid 2022

And finally it received some more texture to reach the current state. In addition to the grass there's a couple of other objects that can be spammed across the terrain.

This is getting quite technical now, but there were a few questions that stumped us for a while:

  • how do you store grass in the savegame? Obviously you can't store the position of each individual blade of grass, that'd be way too much data
  • how do you even keep the grass in memory? Keeping hundreds of thousands of positions for the grass blades on a huge map in memory would be too much

The answers came from a great video on the grass in Ghost of Tsushima: you create a low-resolution density map that says how much grass should be in an area, then when that area becomes visible you generate the data you need for the grass instances (i.e. the position, rotation, which mesh to use) - we do this in a compute shader, so it's super fast. When the area goes invisible you can unload all that instance data. So all you ever need to have in memory is what's visible, and all you need to store in the savegame is the low-resolution density map.

Density map debug view

This allows to spawn large amounts of small objects at low performance cost.