Source code for BrainBallBy Rim van Wersch, March 23 2006 |
BrainBall is a game we designed and implemented for the , a smaller game design contest where the main objective was to implement two simultaneous views of the game world in such a way that both views make up the gameplay together. For more information about the game itself, playing instructions and the binary release, please refer to our BrainBall showcase.
About this source code release
The complete source code for BrainBall is available for download at the bottom of this page. We've used various techniques presented here on MDXInfo in the game, to show how these can be implemented in a complete game environment. You'll find an overview of the main techniques used in BrainBall in the next section. Be warned though that since BrainBall was implemented in one week, the source code may seem a bit messy.
Unfortunately we cannot spare the time to write an article series to examine the source in detail, since we're struggling to get the ShipHo article series finished already If you have any questions or comments regarding the BrainBall source though, please just .
? ?Figure 1. The same old BrainBall screenshot yet again :)
Some MDX features of interest
This source version of BrainBall runs at an average of 50fps on a Radeon 9800 Pro with full detail enabled. There is still room for optimization, since we only optimized the ball shader from the original release to get from 40 to 50 fps. Anyway, interesting features of BrainBall for developers include:
- Normal mapped, shader instanced playfield meshes
- Per pixel lighting of the ball with specular highlights
- Full screen glow, softened with Pieter's bloom effect
- XInput for using the XBox360 controller in MDX1.1
- Simple registry code for a quick way of remembering settings
Prerequisites required to build and run BrainBall
-
.NET Framework 1.1 or 2.0
-
February 2006 DirectX redistributable or SDK if you want to build it
- A decent SM2 compatible card (Radeon 9800 Pro and up) for running the game with full effects. It will run on lower cards but only on low quality (change setting in the menu). On a Radeon Mobility 9000 this was very playable.
- A halfway decent subwoofer for enjoying the sound effects when falling off the maze
Files for this article
Filename | Size |
? BrainBallSource.zip | 1.1 MB |
Further reading
-
? -
Our shader instancing tutorial
? -
Our normal mapping tutorial
? -
Pieter's bloom effect sample
? -
XInput utility library
?