Croakwood Devlog #10 - How villagers interact with the world

Hey, it's been some time!
If you want to know what we've been up to, make sure to check out Wholesome Direct on June 6th :)

Wholesome Direct

1780761600

In one of the previous posts I described how the villagers navigate around the world and in this one I want to talk a bit about how they decide where to go and what to do.

Let's take this woodcutter hut for example:

There's a tool rack containing an axe, a few trees around the hut and a place where logs can be stored.
It's quite obvious what needs to happen here in order to produce logs, but how do we put this into program code?
An easy solution would be having some code that says "if you're a woodcutter, here's step by step what you need to do: get the axe, chop a tree, carry the log to storage and put away the axe".
This could be done quite easily with a state machine or if you want something a bit more powerful with a behaviour tree.

That's how we implemented it initially and what we also did for the guests in Parkitect.
However, there's a few problems:

  • What if the woodcutter gets interrupted after chopping the tree? For example the player might have built a wall that prevents the woodcutter from returning to the workshop. The woodcutter is still holding the axe, and now there's logs on the floor that need to be transported away. Suddenly our clear list of instructions for what to do doesn't work anymore. We could provide multiple lists of instructions for different situations or make the instructions a bit more flexible (the first instruction in the example could say "get the axe if you are not already carrying it")... but that means we need to think of every possible combination of things that could possibly happen.
  • This doesn't create very natural looking behaviors. What if the woodcutter decides to chop two trees in a row? They would put away the axe after chopping the first tree, just to immediately pick up the axe again for the second tree. Maybe we could remove the "put away axe" instruction and allow them to keep carrying the axe, but when do they put it away then? For example they should definitely not hold the axe anymore when they go sleep. We could have a "put away any tool you're holding" instruction as the first item in our "how to sleep" instruction list, but again: for every behavior a villager can do we'd have to think of every possible state they might be in and make sure it's something valid.

So this felt like a pretty fragile solution and we've been struggling with it for some time until we learned about Goal-Oriented Action Planning (GOAP).
GOAP is a planning system that generates the necessary list of instructions in order to achieve a certain goal.
It's a bit like pathfinding, but instead of searching through a list of positions to find a path to a certain location you're searching through a list of possible instructions to find a valid sequence.
The way it works is that first we need to define what actions are available to the villager, and every action also has a list of preconditions that need to be fulfilled in order to be able to execute the action, and a list of effects the action has.
For our woodcutter example it looks like this:

If we now give the villager a goal of "has put down log" the GOAP algorithm takes all of these actions and tries out all valid combinations in a somewhat smart way until it finds a sequence where the last action has an effect of "has put down log".
So for example the trees now offer a "chop" action that has a precondition of "has axe" and an effect of "has log". The villager is not holding an axe currently so this action is not possible.
The axe tool rack has a "pick up axe" action with a precondition of "has empty hands" and an effect of "has axe". The woodcutter is not holding anything currently so this action is possible, and then afterwards the "chop" action becomes possible because its precondition has been fulfilled now and it keeps going like this until finding the "put down log" action of the log storage.

This is really cool, because now we just have to define all of the individual actions correctly which is a lot more manageable and less error-prone.
What's also great is that this makes adding new objects and behaviors into the game quite easy! We just have to set up the new actions an object provides and maybe define a new goal and the villagers can immediately interact with it. It feels so much easier than our initial approach that it's a bit like magic.
Sometimes it even leads to surprises where the villagers reach a goal in a way that makes complete sense but we did not expect :)

The downside of course is that generating the action sequences is not free in terms of computations, especially if there's a large list of possible actions to try, so it's important to keep that list as small as possible. What's also a bit tricky is that Croakwood towns can have many villagers and they are all following their own plans, but because it usually takes quite some time to complete an action list there's not many of them having to create new plans at the same time.
So far this has not been an issue but it's something we'll need to keep an eye on.

Croakwood Devlog #9 - Object Placement Tools

In preparation for Game Garden and in the time afterwards we've spent some time on polishing how placing objects works.

Placing objects is one of the main things you do in this game of course, so it needs to feel good and be intuitively understandable.
There's a few considerations we have to make for these tools. There are some restrictions we need to make simply due to how the game works, but generally we want to give players a lot of freedom so they can design their town however they want. At the same time we want everything to feel playful and easy to understand, and not like you're using some sort of 3D modeling software.
How fast you're able to get to a good looking result is also a very important consideration. We want players to be able to design a full house within a few minutes.

One basic tool that helps with this allows you to quickly duplicate any existing object:

Oftentimes this makes it unnecessary to search through the menus for the object that you're looking for, so this already speeds up building a lot.

Sometimes you just want to move an object. You could use the duplication tool to create a new object, then delete the old one... but simply picking up the object and moving it feels much nicer and better :)

And of course sometimes you just want to be able to go back a few steps, so there's undo.

Undo is one of the most-requested features for Parkitect. Unfortunately it's not something that can be added easily into a game that wasn't designed with undo in mind.
For Croakwood we knew that people would really want to have this, so we made sure to add support for this very early on.

We differentiate between two different types of objects, decorations and furniture.
Decorations are objects like plants, vases or crates and we allow players to place them very freely. They aren't locked to any grid and don't have any collision, so you can use them in a lot of creative ways.
Decorations can be rotated quite freely.

Furniture are objects that the villagers need to interact with, like chairs, tables or beds. Due to technical reasons furniture had to be locked to a grid and to 90° rotations so far.

Another nice side-effect is that this made furniture placement pretty quick due to the limited options, and we liked that figuring out how to fit all the required furniture into a house felt a bit like a small puzzle game.
Due to improvements we made to villager movement this year the technical limitations that required furniture to be on a grid do not exist anymore and we wondered... would it hurt to give a bit more freedom?

After giving it a try it's working quite well - the furniture still collides so your space is still limited, and the added freedom gives you more options for decorating the houses without adding significant complications. So we're keeping it like this for now :)

For some objects you can drag to create multiple of them in a row, and they can snap together automatically:

One case where it's not very fun to build something out of many individual tiles are roofs. They can have fairly complex shapes and there's a large number of pieces.

Having to piece these back together isn't very fun, so instead there's a tool that does it for you.
Getting this to work well took quite some time but it's pretty good finally :)

Vancouver Game Garden Recap

It’s been quite a few years for most of the members of our team since we last attended a convention, especially as exhibitors. As mentioned in the previous post, a few weeks ago we had the pleasure of running a booth at a local event (for our two Canadians), Vancouver Game Garden, and we had a fantastic time!

The team has been quite eager to put a Croakwood demo into the hands of the public, get some direct feedback, and just generally experience what reactions to the game in action would be like. For the months leading up to the event, we spent quite a bit of time focusing on completely overhauling the placeholder UI that we’d been using throughout development. This was also something we felt we needed to do before attempting to demo the game publicly.

With our recent work on UI and a few other key features fresh in our minds, we decided on bringing a build that focused primarily on the creative town building aspects of Croakwood; a very important piece of the game that we are keen to have feeling fun and intuitive. We also implemented an extremely early version of what fulfilling a specific request from a frog villager might look like, just to add some optional guidance in lieu of a tutorial for now. For the setting, we provided a cozy pre-built town that could be freely decorated and added to. The resource and production chains needed were already set up and in motion so as to not take focus away from exploring the creative systems or simply observing life in the day of a frog.

For both days of Vancouver Game Garden, we had an incredible volume of people stop by to try out the demo or learn more about Croakwood. We had Parkitect veterans, Croakwood wishlisters, frog appreciators, cozy gamers, people who don’t usually play games, not-so-cozy gamers, and even folks who travelled quite a distance to attend just because of Croakwood! We even got a chance to finally have some of our peers in the local game development scene sit down and try the game. We were floored by the positive reactions, rapidly ran out of stickers, encountered some weird bugs, took a ton of notes, and at the end of it all came away with a LOT of valuable feedback, suggestions, and ideas. Hopefully we’ll be able to expand on some of those learnings in future posts!

The table for our booth ended up being larger than we had accounted for, so we utilized some of the extra space by putting out a large paper sheet, some art supplies, and encouraged passerbys to draw a frog, and wow! The folks at the event delivered and then some - we ended up with four full sheets of incredible frog art.

For those unable to attend, we’ve recorded some footage from the demo to share here as well!

To everyone who attended and came by the Croakwood booth - thank you so much! All of the compliments, smiles, and excitement we got to experience has been passed along to the whole team. Whether exhibiting or not, we are very much looking forward to the next Vancouver Game Garden!

FAQ

There are some questions that have been asked a few times recently, so we'd like to answer them :)

Are you releasing this demo for everyone to play (for example on Steam)?

A demo for an event is a bit different from a demo that you can play at home.
At this event, people only had about 10-15 minutes to check out the game, so the demo has a very limited amount of content and is focused on letting people see and achieve something quickly.
At home you surely want to spend more time with it, so we'd like to have more content ready first before doing a demo on Steam!

We will eventually have a few ways for people to get early versions of the game before the real launch.
We'll do one or multiple playtests on Steam that will be available to a limited number of people who want to help us test the game and provide feedback, and later towards the release of the game there'll be a demo that everyone can access.

If you want to help with testing the game before release you can register for it now on Steam.

Once we have a test version ready, a limited number of people will be chosen randomly.
We'll post about it once the test starts, and if you've been selected you'll receive an email from Steam.

Are you going to demo the game at other events?

Maybe! We think there's a good chance, but we don't know yet when or where. Once we do we'll post about it here.
Since a lot of our team is based in Canada and Germany that'd be the most likely event locations.

What's the overall development state of the game currently?

We're really happy with how it's progressing, it's just taking time to get everything done (a bit more time than we expected to be honest! Which is not unusual for game development...).
The house building and decorating portion of the game is in really good shape. The villagers generally work really well, they're able to navigate the town and interact with it without any issues.
A lot of work this year went into the UI design and structure and that's in really good shape now too.
Of course there's always more to add and improve for everything, but generally we're happy with the state of these parts now.
Our main remaining work until release will be focused on adding more gameplay content (for example giving the villagers more activities to do; making sure the villagers react in more ways to the town; making sure players have goals to work towards).
Oftentimes with big projects like these there's a long phase of experimentation and figuring out what the game is going to be, and it's not totally clear what's still missing and how all of the ideas are going to fit together.
We think we're beyond that phase since some time and have a good understanding now of what we still need to get done to be able to release the game - it "just" needs to be done now :)

Croakwood at Vancouver Game Garden

We're bringing a first demo of Croakwood to Vancouver Game Garden on September 27-28, alongside many other great games from local independent developers.

If you happen to be in Vancouver we'd be excited if you come and give it a try!
The demo encompasses a slice of roughly the first hour of gameplay with a focus on town building mechanics.

The event location is the Roundhouse Community Centre at 181 Roundhouse Mews in Vancouver.
Entrance is on September 27 and 28 from 11am to 5pm and is completely free.

It's the first time we're showing the game in public, so it'll be very interesting to see what kind of feedback we receive and what works well and what doesn't :)