Level Counter

Story: 60, Challenge: 0.

Saturday, April 20, 2013

Generic Tutorial System

I've finally gotten around to implementing the tutorial system. It’s been a challenge as I've decided to make it as general as possible. But it turned out great.
It has three major components:

1) Hooks: places within the system that initiate some form of tutorial interaction. For that end I've created a new block type, the tutorial block, which is invisible, numbered, and calls the tutorial system when a guy passes through it. I've also added a hook on the start and finish of levels. 

2) Strategy: as part of a strategy pattern. The behavior of the tutorial system relies on interchangeable strategies. These strategies can be swapped according to the level being played to allow separation of the logic of different levels strategies into separate strategy objects. Currently only one level needs a tutorial but my goal was a general system so I've taken the time to implement it properly. 

3) Core tutorial system: this system is responsible for providing the methods for the strategies for placing tutorial overlays and hints on the game scene.
This system went through several design iterations. It started as a regular class. Became a singleton (first implemented as a java enum but later changed for several reasons). Until finally it became a truly stateless component (once the strategy pattern was in place) and thus implemented as a static class, much like the sound system.
The final product can be seen in these screenshots (the light gray blocks are the tutorial blocks, only drawn for debugging, will be invisible in the release version):


Tutorial overlay with placeholder graphic
explaining the players' goal.
A tutorial hint explaining
a specific game mechanic.
The main focus for me in the tutorial design is to minimize the use of writing. It serves the double benefit of avoiding the need for localizations, and opening the game for non readers (young and casual gamers). 

I'm very proud of the way this system turned out. It was a lot of work but it now feels right, is very open to enhancements, and is flexible enough to be used in future games as well.

No comments:

Post a Comment