carrotcake Blog 🍃


official devlog for carrotcake written by Louis Durrant

Thursday Report: The Groundwork

Posted on Oct 11, 2018

Thursday Report: The Groundwork

On Thursdays I write up a short report on my developments and thoughts if to do nothing more than keep myself accountable. Enjoy!

Last week I was up transferring my websites over to new hosting and briefly lost access to my email addresses, which wouldn’t be a problem if it weren’t for Medium’s unusual passwordless log-in system. So, oops! Plenty to dive into this week.

My priority over the last couple weeks was to improve on to the dialogue system. It’s still bare-bones, but I’m figuring out ways to make it more complex.

Previously, upon approaching an NPC and pressing the action button, the NPC will spout a single line, and the the dialogue would end.

My solution for adding multiple lines of dialogue was to convert the dialogue data into an array. An array is simply a series of strings (text) separated by a comma, where each string can be summoned by pointing to its number in the order it appears.

Then, all we do is +1 to the original number so the game knows to look to the next dialogue entry, in order. This would go on forever, though, so we need to find when the dialogue would end. For this, I conclude a line of dialogue with ‘END’, the game then checks if the word ‘END’ is in the current line. If it is, the word is hidden, and instead of continuing onto another line of dialogue, a signal is emitted to let both characters they are free to go on their merry way.

I like this system because it’s based on human language, and it’s simple.

Sounds scary!

In the future, for dialogue options, I’ll likely introduce a similar system, where if a line ends in ‘OPT’, or something similar, the game knows to pass the dialogue onto the player.

But this is all very static for now. NPC’s will always say the same line of dialogue. Eventually some selective database will need to be put in place to deliver a range of different lines to the player, and provide the player with dialogue options contextually.

That being said, this isn’t a conversation game. Listening, however, will play a large part. I’m hoping that a large part of my time working on this game will eventually be in the writing — what the characters say and express. Most dialogue options will be agree, disagree or say nothing. Options are important to keep the player engaged, and also feel as though the world is reacting to them. A little goes a very long way.

Concept for dialogue selection.

The above is just a concept at this stage. I like the idea of most UI elements feeling as though they’re floating within the world, and not on some abstracted plane on the user’s screen. Thought-bubbles play into this nicely. Perhaps using icons instead of text would give it a different feel. That’s something I’ll need to decide.

You may have also noticed in the GIF above — snow! In efforts to move the world building forward, I devised a new way of tiling the ground. A while ago I started building a tile-sheet of sprites — essentially a sheet small squares with slight differences that get drawn from and form the world. The two major issues with this is, first, blockiness — when you build a world from squares our minds can really sense the mathematics order of it, and things seem rigid. Secondly, is repetitive textures. Our brains are designed to see patterns, and it’s remarkable how puzzle-piece even the most random of textures can look when stepping back.

Instead, I’ve made a single large block of plain white that’s just larger than the average screen. On top of that sits a speckled texture that gives the ground that flowering, grassy feel. The texture overhangs, so that it merges with the blocks surrounding it. The result, even when zoomed out, is a ground that’s impressively seamless. But the best part is something I hadn’t considered — colour modulating!

Here’s the overlay atop the block.

Any texture that’s pure-white can be changed to any other colour through the engine. This means that, on the fly, both the colour of the ground and the overlay can be faded into a different tone dynamically.

With this we can have the grass reflect the seasons, snow cover, or anything else. I’m hoping to see if I can introduce this to tree foliage, to perhaps randomize the colours of each tree for variety, and have them gradually fade between seasonal colours.

This is ugly, but it demonstrates the point.

And just to finish us off, a new WIP animation for the old traveling gardener. He doesn’t have a name yet, despite much inner-deliberation. Turns out when a character has a cane you can’t animate them as you normally would.

This old man represents a time before the player arrives in the garden, and welcomes all fresh and exciting things to come.

Follow me on Twitter.