Listen, aim, fire!

EandE: By Matthew Cooper

This final project for Music 256A is an exciting step into the world of audio-only gaming. The player uses volume/pitch/panning cues to accurately sight in on an audible target. If the player fails to hit the target before they are found, the game is over. The overall experience is quite enjoyable and the game is kept interesting by allowing the user to move to faster and faster levels that truly challenge them to listen carefully and memorize the desired sound characteristics.

The game is packaged as a native OS X application that should run on most Mac systems (tested on OS 10.8). The built application does not have any non-system dependencies. The source code links to the Portaudio and libsndfile libraries.

Download

Below are links to the project source and a compiled application.

Note for Voiceover users

I recommend turning Voiceover off (Command + F5) while playing, as it makes the arrow keys more responsive; however, the game plays well with Voiceover as well.

Rules of the Game

Each round consists of a randomly generated target position being heard in one of five locations (far left to far right in 45 degree steps). The player must aim and kill the target within the timer period or they lose the game.

The timer is set to 16 seconds initially. More points can be earned by pressing enter to shorten the timer. The player wins at 30 kills, so the goal is to have the greatest possible number of points at this time.

When the timer is greater than 5 seconds, a two step aiming process is used. First, the keys 1-5 select which of the 5 positions the target is in. Next the player uses the pitch and volume of a steady aiming tone to precisely narrow in on the target. (Aim for maximum volume and pitch.) Pressing space will fire.

When the timer is below 5 seconds, the game switches to a rapid firing system. Now the player simply selects the target position with the 1-5 keys as before. If correct the player successfully shoots and kills the target. (Move quickly here.) Large point values can be obtained in these fast modes.

Software Design

The key inspiration was the idea of an audio-only game that could hold the player's interest for extended periods of time. In order to achieve this, the game was made very randomized and variably difficult.

In the more difficult modes, the game becomes quite hard to win. Nevertheless, the player is challenged to test their auditory skills in a manner that most people normally don't do.

System Implementation

The program is written in a mix of C and Objective-C. This was done for simplicity and to make it possible to build into a portable and clean OS X application.

The game components are well modularized. The game engine updates at 60Hz and audio is generated at 48000Hz sampling rate with a buffer size of 256 samples.

Enemy and player modules provide the core logic experienced by the user. These modules are connected by a keyboard input module that tracks key states, and a score tracker. The application window displays the current score and timer value from these modules.

Evaluation

The key criteria that I used in evaluating the program over it's development were sound quality, responsiveness, general playability, and appropriate pace of play.

The most critical piece turned out to be the pace of play. By carefully trimming sound content, it was clear that the game could be made to play at an appropriately fast pace.