Game Design Game Development Geek / Technical

Toytles: Leaf Raking Progress Report – Yard-Coverage-Based Dialogue

Here’s this week’s progress report for new updates to Toytles: Leaf Raking, my family-friendly leaf-raking business simulation available for iPhones, iPads, and Android devices.

Get it at the Toytles: Leaf Raking page.

In last week’s sprint report, I talked about finishing up screen transitions and fixing some defects. I finally started to work on adding the new dialogue.

Sprint 21: Time-based dialogue

  • Story progression when finishing a yard (unique monthly client dialogue w/ difference between clear/uncleared yards

I did 6.5 hours of game development this past week, and while a significant amount of it was geared towards the new dialogue functionality, I did find I had accidentally introduced a major, game-breaking defect, so I also spent time investigating and fixing it.

The Defect

Originally, the game had no screen transitions. When I switched from one screen to the next, it was immediate, which meant that I could save the state of the game immediately whenever the player made a decision.

For example, if you moved from one neighborhood to another, it took 10 in-game minutes, and that was a decision I didn’t want you to pretend didn’t happen by shutting down the game and then reloading it.

Similarly, choosing to go to sleep to end your day is a decision that gets saved.

However, once I added transitions, I had to delay changing the screen you see until after the fade out, then I would fade the new screen in.

The defect got introduced because I shouldn’t save until the screen change occurs, but it saved before the fade out, which meant that the old screen was saved.

If you kept playing the game, it would be no big deal. The game works just fine.

But if you close the app, then when you reload it, you could be on the wrong screen.

For a non-game-breaking problem, you could visit the kitchen to talk to your parents. If you close the game and reload your save, you would still be in the front foyer and not in the kitchen, and yet the dialogue from your parents would still be on screen. This issue is no big deal because there is no in-game impact from seeing dialogue in the wrong part of the house.

However, what IS a big deal is going to sleep at the end of the day. The game saves while you are on the sleep screen, then on normal weekdays you go to school, then at 3:00pm you in the front foyer. If you shut down the game and reload it, it would reload the game at 3:00pm but on the sleep screen. And the entire point of the sleep screen is that you don’t do anything but wait for time to pass until you wake up. But since you aren’t supposed to be on the sleep screen, time isn’t passing.

My personal favorite manifestation of this defect was discovering that if you saved up $1000 and went to the store, purchased the Ultimate Item(tm), and shut down the game while the screen was transitioning to the You Won screen, then when you reload the game, you would be back in the store, only without $1000. The game saved the fact that you spent it.

Interestingly, the game also saved the fact that you bought the Ultimate Item(tm), but it won’t register that you’ve won. You have to attempt to purchase any item in the store for the code that checks for the victory condition to run. So this specific problem isn’t technically game-breaking, but it would probably have upset players when they thought the game cheated them out of the game-winning money which they spent the entire time earning.

I fixed these issues by ensuring that anytime there is a screen transition that the save occurs only after the transition has ended.

The Dialogue

After taking the detour to fix the fairly major defect I introduced with screen transitions, I finally got back to writing dialogue. I’m actually pretty excited about the way my dialogue system is coming together.

I finished adding new dialogue tags for determining which month it is based on the current date as well as tags for yards being clear or yards being not clear.

In code, they are the following new tags:


As a reminder, the way the tags are used is in two parts. First, I get a list of possible tags based on the current game state. So if Mr. Cardinal is my client and I am in his yard on the day before Thanksgiving and his yard has any leaves covering it, then the tags that would be generated by the current game state are IS_CLIENT_TAG, IS_NOVEMBER_TAG, and IS_YARD_NOT_CLEAR_TAG.

The second part is that each piece of dialogue in the game is tagged, and so I can now tailor the messages that any neighbor says to you based on a number of tags. So I can write some dialogue and tag it with all three of the above tags, and in the game when you visit him, the game state-based tags will match all of the tags for that piece of dialogue, and so he’ll say something unique and topical:

Mr Cardinal's dialogue in November

And once you rake all of the leaves in his yard, the IS_YARD_CLEAR_TAG would need to match a different piece of dialogue, which furthers the story of Mr. Cardinal being an inventor:

Mr Cardinal's dialogue in November

As I said, I’m pretty excited about the possibilities, especially as I add more tags. The combinations of tags, and so the dialogue that matches various combinations, can be endless.

So when can you play it?

I took off a few days from the day job this week, so I expect to put in some time to finish writing all of the dialogue and create the new version of the game for review in the App Store and Google Play.

But I wish I had a release sooner.

I underestimated how much work it would be to write 6 new lines of dialogue (2 x each of the 3 months) for each neighbor. I didn’t want to make a new release until I had new dialogue in the game, as I didn’t think screen transitions alone would make for a compelling update.

I think in hindsight I realize that I should have worked on the new dialogue first so that there was always potential to release a new version of the game.

But hey, it’s a mistake I can learn from. Next time I plan a release, I will make sure that I work on the must-haves first rather than last.

Thanks for reading!

Toytles: Leaf Raking Player's Guide

Want to learn when I release updates to Toytles: Leaf Raking or about future games I am creating? Sign up for the GBGames Curiosities newsletter, and get the 24-page, full color PDF of the Toytles: Leaf Raking Player’s Guide for free!

One reply on “Toytles: Leaf Raking Progress Report – Yard-Coverage-Based Dialogue”

Comments are closed.