Level Counter

Story: 60, Challenge: 0.

Saturday, April 27, 2013

Boss fights? Boss fights.

My dear girlfriend mentioned that 60 levels of straight progressive puzzles can get somewhat repetitive. Others have mentioned this to me before, but she helped come up with a good solution: Boss fights. 

The basic idea is that every 20 levels or so the regular flow of puzzles will be interrupted by a special level that introduces unique mechanics and a greater challenge. These levels will be harder, faster, and more exciting than the usual flow of the game, while still using the core puzzle components introduced until that point. 

Seeing as boss fights are rather challenging, I will most likely add a "skip" button to them, as my main demographic may be a bit too young to handle that level of challenge. I will have to have these levels beta tested by as many people as possible, but I believe they are a great addition to the game. 

So far two of the planned three boss fights have been designed and implemented. the third will be the final level of the game and as such requires more time to plan and execute (your ideas are always welcome). 

These snapshots demonstrate the first two bosses, both of them keep the Pachinguys from reaching their goal in some way, and both create interferences in the Pachinguys way, which represent the first and probably last place where randomness will exist in the game. 


The development names for these bosses are hydra and runner. Hydra shoots fireballs from its many heads and runner shakes the world when he jumps and shoots lasers from his eyes (that last one may be changed to something that makes more sense when graphics and story are considered). 

With two more levels built and a third "taken" for the final boss I am less than 10 levels away from a complete game (including challenge levels, not including graphics and sound).

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.

Sunday, April 7, 2013

Animation and sound infrastructures.

It’s been a while since new code went into Pachinguys. I've spent my time creating two infrastructure systems that will become increasingly important as time progresses, handling animation and Sound.

Animation system: contains mappings from animation names to their corresponding animated sprites, so, in essence I can just say "play the Pachinguy idle animation now" and have all the details abstracted. Every animation object gets its location, rotation, visibility etc. from a single parent sprite that serves as the model. So the existing static sprite system (the squares and circles) can be used as parents. In time every static sprite will have an animation object attached to it, and the static sprites will be made into Entities (all the data qualities of sprites but non drawable), so only the animations will remain. Andengines implementation of scene graph made this system very easy to implement.

Sound system: the sound system maps sounds and music to names. So again I can just say "play background_music_1 now" and have the details abstracted. It differs from the animation system in its implementation though. The sound system is static. Meaning there is only one "instance" of it in the entire game. This is because playing, for instance, two background tracks, at the same time, makes no sense. Having a single entry point for sound and music enables me to easily keep track of how many sounds are playing, and avoid noise clutter.

I found Andengines sound and music support to be lacking. The main issue was the lack of ability to check if a certain sound has finished playing (required to avoid playing the sound over itself). There is even no way to get the duration of a sound. Android's native MediaPlayer resolved that issue as it provides both duration and completion getters. For now both Andengines and native androids schemes are supported, only Andengines is currently used. This may change as the needs of the sound system become clearer (haven't really thought about sound until now to be honest :) ). 

the next thing on the agenda is some research into how Andengine handles asset resolution for different screen sizes (the 32X32 pixels textures used for the phone version would get stretched beyond recognition on a tablet so some way to use bigger textures will need to be found). Sadly it seems that Andengine bypasses the native android resource system which does exactly that, hopefully it has some other trick up its sleeve for this purpose. And of course the final levels still need to be designed.