carrotcake Blog 🍃

official devlog for carrotcake written by Louis Durrant

Thursday Report: Back Where They Belong

Posted on Jul 4, 2019

While I typically expect my freelancing to slow down around this time of year, it’s been feeding into my schedule very steadily. That’s great news for staying afloat, but does mean I have less time to work on The Garden Path than I’d planned.

But still, I’ve made some strides in the last few weeks since my last post, and, all things considered, I’m ahead of where I thought I would be.

Perhaps the most important new element is garden aging. The game can now tell how long it’s been between saves and grow each plant accordingly when booting in. I’m keen to have a good number of stages of growth for each plant, especially trees. Many games have just two or three stages – maybe a seedling and then in a few days: a full tree. Trees in The Garden Path will take many real-world weeks to grow, and even more to mature fully. Different aged trees and plants might also provide different harvestables too – young fern may be collected as fiddleheads, for instance.

To build this, I created a new database called ‘families’. Any ‘prop’ (which is my terminology for a physical object in the game world, like a tree) may belong to a family. A ‘family’ is then just a list of all the different props, in order, that grow into one another, and the age at which they do so. A ‘birch tree’ family contains a sprout, a seedling, a sapling, a young tree, and a mature tree, to give an example.

Everything is still just placeholders, but even seeing one placeholder plant become another after a few days have past makes the world feel much less static.

The other piece of the game’s code I’ve worked on is loading all props from a save file into their respective locations. It’s one thing loading in an ‘acre’, but every prop needs its ID, it’s position and it’s age to be placed by the game exactly as they were when they player left.

All props have their corresponding ‘spawn point’. This is an extremely basic point on the map that carries just three pieces of data – the aforementioned ID, position and age. That, in theory, is everything the game needs to then load in the corresponding prop. This also means that props can be placed without loading in, helping with load times and performance. Only props close to the player are loaded, and once far away from the player can be safely unloaded.

Ultimately this was just making sure the right data goes in the right place, but it’s a huge boon having it implemented. I can now move things around, and when I come back, they’re just how I want them.

As mentioned over on Mastodon, I used the money I made from the sales on to invest in some VST instruments for the game’s music. Everything I had been using prior had been the free instruments that come baked in with the software. These are usually a live instrument recorded playing a single note, then pitch-shifted to match what’s being played on a keyboard. This works to an extent, but tends to result in something quite robotic sounding. That’s fine for some games, you might even want that rigidity for, say, a pixel art game. I want The Garden Path to feel more organic and nostalgic, however.

High quality VSTs can be recordings of instruments in situ with a large number of microphones, performing each note and transitions between notes, and in a number of different playing styles. If I push a note harder on my keyboard, for example, I’ll actually get a separate recording of that instrument being played harder. If I want the instrument far away, I can fade between a microphone that was close to the instrument, and one further back. It’s not quite as good a live recording, but it’s pretty damn close.

The difference has been mesmerizing, beyond what I had imagined (which is great because they often have a no-refund policy). Not only do the instruments sound more authentic, but the quality of the recordings mean they open up the piece and give more breathing room to the entire composition. It’s hard to describe, but poor recordings can often muddy up different frequencies of the sound, making things blend together and sound mushy.

The only instruments I’m lacking now are the mallets, which still feel a little bit out of place in the mix. I’ve got my fingers crossed I’ll be able to pick up some recordings soon. In the meantime, here’s a quick look into what I’ve been doing with the new instruments. This is not the final mix by any stretch, but hopefully it gives you a taste.