carrotcake Blog 🍃


official devlog for carrotcake written by Louis Durrant

Thursday Report: Tripped and Felled

Posted on Aug 15, 2019

It’s been a little quiet here on the blog, but rest assured – I’ve been making some good progress.

I’ve done some traveling for the summer, taking some time out, and coming back to The Garden Path with a fresh head.

As we enter the second half of the year, the larger puzzle pieces of the game are slotting in to place, and I can begin transitioning toward clean up and polish. This way I can make sure the game is as solid as it can be before I start really generating some content.

Before my time away, I shared some video of tree felling. This was something I had been dreading to implement, only because I imagined it would need to involve a great deal of collision detections, and even some physics (god forbid). For instance, if a tree is cut down in a densely forested area, there may not be enough room to fall entirely, and it would need to rest up against the tree that blocks its path.

With that said, I’ve decided I’m cheating for now. Since the game is 2D, everything acts much like a cardboard cut out. Nothing has any depth, and the game decides (based on location) which prop appears in front of which – giving the illusion of depth. It’s why the character can walk around a tree, and disappear when behind it.

Since positions are often measured within fractions of pixels, it’s actually highly unlikely a felled tree would ever be in exactly the same horizontal row as any other prop, so it would just fall above or below it.

There is, of course, a point at which the illusion of depth would be broken. That said, felling a tree is, by design, uncommon, and keeping things this way saves me a great deal of time to spend elsewhere in development.

Each tree has a health node that tracks how broken down it is. A tree will heal overtime, but a player must be careful not to hack away at a tree too much. Chopping a tree is desirable, as it will provide certain items, but getting carried away will result in the tree being felled.

When a tree is felled, a tween is executed for the tree to slowly fall. I had attempted to animate this by hand node, but I ultimately had much more control creating the animation directly through code. The very slow, creeping start helps to give the tree that real sense of weight, especially as the speed picks up greatly toward the end, and the weight of the tree brings it down.

This speed is important, because it helps acts as a cover as the game swaps between two different props – the tree as it stood, and a new fallen tree prop. The smoke and other particles also help to cover up the swap. The positioning still isn’t perfect, but it works well for now.

I used a large collection of free sounds sourced online to create the sound of the tree falling. The initial snap, to the creaking of the trunk, to the thud at the end. The final thud still needs some work, as it sounds a little too clean and tight. But give it a listen if you haven’t done so already.

While at the moment the fallen tree is essentially just the existing tree but sideways, I’m hoping to have it be its own distinct prop, that ages and fades into the environment as time passes, that may even provide its own items, otherwise unobtainable.

The fishing mechanic is finally taking shape. I mentioned earlier in the blog that I wasn’t quite ready to announce my plans, but with everything now underway, I’m excited to share it.

In The Garden Path, all fish are ‘song fish’, and they are attracted by a certain pattern of melody that the player may whistle while they fish. There will be four distinct keys that will allow the player to whistle different notes when selected, and different keys will attract different fish.

This essentially works by moving an invisible marker around an invisible grid. Each fish has their own co-ordinates, and whistling different notes will move this invisible marker along the grid in a different direction.

None of this will appear to the player, but they will get a sense if this marker is close as the fish will act more or less interested in the bait.

An exact co-ordinate match will not be necessary, however the fish that are harder to catch will be more picky, requiring a more precise match than others.

Different fish will also be available according to different seasons, and times of day.

Fish, once caught, may be used to sing their song to the garden, and provide a unique effect, then vanishing. Others may simply be more valuable, and have traits that appeal to different characters throughout the Garden.

The challenge at the moment is providing the fish with convincing movements, according to its level of interest with the player’s song, which I’m working on at the moment.

I think this is a unique and fitting fishing mechanic that I can’t wait to see unfold. It’s had great feedback so far, and I can only hope I find that balance between joyful to play, and skillful enough to remain engaging.

After all, if you sleep you’ll miss it.

Follow me on…

TwitterMastodon