Home Articles Tutorials Resources About

Source code for BrainBall


By 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

Please note that the February 2006 DirectX SDK is absolutely required! If you're getting a FileNotFoundException when running BrainBall, this typically indicates you don't have the latest DirectX version installed yet. Please visit the link above and download the February 2006 SDK to enable you to build the source.



Files for this article

Filename Size
? BrainBallSource.zip 1.1 MB



Further reading

?
MDX info is an initiative by vector4. All content is copyright ? 2005-2006 by its respective authors | About MDX info | Terms of Use |
Coming soon!