Don't Hang Me | Hot Spot Framework | 1013: The Game | Projects

 
DirectX Projects - Quake III BSP Loader  
 
 

C++ VERSION | C# VERSION


Quake III BSP Loader - C++ Version

SOURCE CODE
(.EXE may not work properly from 'RUN' link; click 'SOURCE CODE' link and run the .EXE there)


runtime requirements: Microsoft .NET Framework 1.1 and DirectX 9.0a
code requirements:
Visual Studio .NET 2003 and the DirectX SDK


This is a port very loosely based on the C# code below, which I did in my own free time in order to keep my C++ skills from waning.  Since C# and C++ are such different beasts, it was essential to rebuild the project from the ground up, but once again with good OOP principles.

Like the C# code, much of this project was culled from several tutorials, but how they were brought together to create the final product was based on my own coding experience.  The tutorial were OpenGL-based, so it fell upon me to use my own DirectX know-how in order to reprogram all of the rendering routines  Because of the design separation, the structure allows different renderers (e.g. DirectX or OpenGL) to be chosen at runtime.  At this time the OpenGL code has not yet been implemented.  I was not assisted on this project.

The separation I created for this project according to the Model/View/Controller paradigm became the direct basis for the first iteration of the Hot Spot Framework.


Several new features were added to this version:

  • The user can choose between full screen or windowed mode
  • The somewhat ad hoc collision detection of the C# version was replaced with Brush collision detection, culled from yet another tutorial
  • Mouse control for viewing.

This version's frame rate is marginally better than its C# counterpart, remaining relatively steady around 30 fps (one of several goals of this port), whereas the C# version tends to oscillate wildly depending on how many leaf faces are being rendered.

The application is controlled by keyboard and mouse.

Keyboard:

W / Up Arrow - Forward
S / Down Arrow - Backward
A / Left Arrow - Strafe Left
D / Right Arrow - Strafe Right
Space Bar - Jump / Jetpack

ESC - Quit

Mouse:

Look up, down, left, right


Sources:

Gametutorials.com
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm

  • Quake III Collision Part 3

DirectX Tutorials
http://www.gametutorials.com/Tutorials/directx/DirectX_Pg2.htm

  • Full Screen Mode


Quake III BSP Loader - C# Version

SOURCE CODE


runtime requirements: Microsoft .NET Framework 1.1 and DirectX 9.0a
code requirements:
Visual Studio .NET 2003 and the DirectX SDK


This is a project I did for a Computer Science Graphics course with partner Mark Butteris.  Most of the project involved adapting C++ tutorials into C# code, though some parts -- like the collision detection and BSP loading routines -- had to be written from scratch.

While it wasn't necessary to introduce good OOP design into the project, I did so anyway because I hate messy code.  This version of the program has been refactored somewhat to better follow software design guidelines and to get rid of some of the extraneous bits left over from previous projects that used similar Model/View/Controller patterns.

Since the collision detection was done with rudimentary 3D math (sphere-on-plane collisions) and not with the Brush information included in the .BSP file, there are a few errors.  The collision routine does now allow for any convex areas in a polygon face, causing phantom floors and walls to crop up.  This was corrected in the C++ version.


The application is controlled entirely by keyboard:

W / Up Arrow - Forward
S / Down Arrow - Backward
A / Left Arrow - Strafe Left
D / Right Arrow - Strafe Right
Q / Page Up - Rotate Left
E / Page Down - Rotate Right
Space Bar - Jump / Jetpack
CTL + L - Changes texture mode: 1) Texture/Lightmap, 2) Lightmap-only, 3) Texture-only

ESC - Quit


Sources:

Gametutorials.com
http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg5.htm

  • Quake III Bsp Loader Part 3

  • Quake III Collision

 
 

Don't Hang Me - Copyright © 1998 - 2008
Hot Spot Framework - Copyright © 2005 - 2008
1013 - The End of the Line - Copyright © 1996 - 2004

Sean Corse | sean.corse@thatsorange.com | http://www.thatsorange.com