Q*Bert 3D

Escape From Flatland

Release Notes

 

:Overall Software Design:

The Q*Bert world consists of a pyramid, Q*Bert, his enemies, rocks, and two special blocks, namely the bomb and freeze blocks.  Q*Bert, his enemies, and the rocks all have one thing in common, they move.  Therefore they are controlled by finite state machines that are extensive enough to get the job done, nothing more.  The pyramid and special block, which are a part of the pyramid, do not move and are controlled by simple Boolean variables.

 

:Main Program Loop:

The Q*Bert game begins by defining all the necessary data, initializing important values, and finally displaying some introduction screens.  After these tasks are complete, the code enters the main program loop.  Execution continues here until the process is terminated.

 

 

:Pyramid Design:

  The first structure we will discuss is the pyramid.  The pyramid is defined as a static structure shown here.

 

 

As the witty observer will notice, this number array will appear as a pyramid if the numbers are thought of as a height.  Thus, 0's represent the ground, the outer perimeter of 1's are the first level, and the sole 7 in the middle is the top and center of the pyramid.  Each block on the pyramid has an associated Boolean variable to keep track of whether it has been "visited" by Q*Bert.  The texture map applied to the block depends on this value.  Not only does this provide the layout for the pyramid, it also gives us a way to decide if Q*Bert is allowed to jump in any given directions.  For instance, is Q*Bert is on a level 1 block, he can not jump down (He is not allowed to leave the pyramid).  Also, if he's standing on top of the pyramid, He can not jump onto a non-existent block.

  These similar structures are used to define the locations of the bomb and freeze blocks as well as the areas they effect when activated.

 

 

As previously mentioned, each block has certain values associated with it.  The data structure for each block is defined as below.  Most of this structures members are for use by the special blocks.

 

:Q*Bert, Enemy, and Rock States:

Q*Bert, his enemies, and rocks are the only objects in the game that can and do move.  Because of this, their data structures are more extensive than that of the pyramid blocks.  All of the below data structures drive the state machine for it's respective object.  Since Q*Bert can do more than his enemies, his state machine data structure is more complicated.  However, the state machines all have an important similarity, the states are exclusive, i.e. they can only be in one state at a time.  This was done for programming ease.  For example, This is seen in game play in that Q*Bert can not jump and fire rocks at the same time.

 View Q*Bert FSM            View Enemy FSM                View Rock FSM

 

:Sound Design:     

Q*Bert has many sounds which accompany all actions in the game.  All sounds are 16 bit wav files sampled at 44.1 KHz on one channel.  There are no special audio effects, they are simply played at the appropriate time.

 

 

:Visual Effects:

The most notable visual effects occur when Q*Bert activates a bomb or freeze block.  However, these are also the simplest effects of the game.  In both cases, blocks within the affected area have a different texture applied to them momentarily.  In the case of the freeze block, If there are enemies on affected blocks, their texture is changed to an icy color.  The bomb block is slightly more complicated.  Along with texture swapping, a particle system is jettisoned from all of the affected block for a brief time.

The more subtle (and in our opinion cooler) effects are the subtle effects of Q*Bert and enemy legs shuffling when they jump from block to block.  Also, Q*Bert bends over to pick up rocks.  While these are small effects, we feel they add a great deal to the game.  These effects are all accomplished by organizing the structures of the models as shown the the image below.  Once this structure is defined for the models, individual parts of the model can be rotated or pivoted about using Dark Basic commands.  Both the enemy and Q*Bert model have this structure.

 

 

Although not a visual effect, the camera implementation deserves a mention.  Originally, the camera was controlled by the user; however, in the final version of Q*Bert, the camera is controlled in dark basic.  The camera rotates around the center of the pyramid, using yaw, pitch, and roll manipulations, always keeping Q*Bert as close to the center of the screen as possible.  

 

:Artificial Intelligence:

There are two ways for the Q*Bert's enemies to notice him and go into attack mode.  Until one of these cases is encountered, the enemies move about the pyramid at random.  

For the first scenario, let us define a one jump reachable block as any block that can be reached by only one jump.  Every time an enemy lands on a new block, the state machine checks to see if Q*Bert is on a one jump reachable block.  If so, the enemy will turn the most direct route (i.e. the enemy will not turn three times when one turn will produce the same result) to Q*Bert's position and jump to that block.  Q*Bert better have left that block when the enemy gets there!

The second scenario requires that we define visible path.  Given an enemy facing a certain direction, a visible path is a row of blocks such that each block can be jumped to without turning.  If the enemy is looking towards a higher block, this row of blocks does not extend beyond the highest block in the row.  This prevents enemies from, in a sense, seeing through the pyramid.  If Q*Bert is in an enemies visible path, the enemy will follow the path until he catches Q*Bert or Q*Bert is no longer in the visible path.  Below is an example of a visible path.

 

 

To extend the AI, we can give the enemy a memory.  For instance, if chasing Q*Bert on a visible path and Q*Bert jumps out of the path, the enemy could remember which way Q*Bert left the path.  While this has not been implemented, it would greatly extend the capabilities of the AI.

 

:Design Tradeoffs:

While Q*Bert is great as provided, there were several features we had to restrict or simply leave out because of our limited development time.

We were only able to implement one level look.  As the game currently stands, the game will continue until all three of Q*Bert's lives are lost.  If Q*Bert beats a level, the score will carry over to the next game, unfortunately, subsequent levels all have the same look as the original.  

As previously mentioned, Q*Bert can only be in one state at a time.  Game play could be enhanced if he could jump and turn or jump and fire a rock at the same time.  This feature was not implemented to keep the programming task simple, so that all of the game play could be completed.

As is obvious from the special block data map provided above, the location of these blocks is fixed.  The reason for this is simple.  It was done to maximize the on-screen visual effect and destruction of each activation.  We feel that in a more complete version of the game, these blocks could be placed at random or at least pseudo-random to vary the game play from one level or game to the next.

When enemies are frozen as a result of a freeze block, they are permanently in that halted state.  Having the enemies only frozen for a limited time would provide a sense of urgency and suspense to the game while encouraging Q*Bert to quickly kill his enemies.  While implementing this would not require too much extra programming logic, it was left off to ensure completeness of the game as a whole.

In the beginning of development, all objects in Q*Bert were shadowed.  While this was a nice little extra addition, it slowed our development machines to a crawl as it is very computationally intensive to draw real-time shadows.  The speed up gained by removing shadows was well worth it.

Lastly, the originally implemented background music was removed.  With background music playing and Q*Bert's nearly constant jumping, rocks falling, and special blocks, the game was audibly cluttered.  We decided to remove the background music under the theory that less is more. 

 

\ Home | Game Description | Game Design | Schedule | Image Library

\ Presentations | Game Screen Shots | Final Design Notes /

\ Play Q*Bert | Q*Bert Source  /

\ About Us /