At university I got interested in creating 3D rendering software engines. After rebuilding the Wolfenstein 3D engine I wanted to build the engine of the second 3d shooter that made a big impression on me: Doom. This one was a bit tougher, as it uses more sophisticated algorithms.

doom_java

doom_java3

doom_java2

Understanding and implementing the binary space partitioning tree was quite satisfying. I consider this engine 2.5D, as it’s impossible to have rooms above each other. After implementing most rendering features from the real game, I added some improvements, such as force fields and the ability to jump.

Features

  • 2D polygon BSP Trees
  • frustum clipping
  • some form of raycasting
  • vertical texture mapping for walls
  • horizontal texture mapping for floor and ceiling
  • vertical texture mapping for the sky (space)
  • hidden surface removal (HSR)
  • collision detection
  • dynamic wall heights
  • animated textures
  • multiple levels of light with a CLUT(Color LookUp Table)
  • bounding boxes
  • 50% opacity walls (Force Fields), also done with a CLUT
  • gravity (for player physics)
  • load levels from the original game (WAD file)

Demo

Below is a demo of the engine in Java as applet. To run this, you might have to lower Java’s security settings to medium or add my website to the Exception list.

Controls

Walk forwards W Level select L
Walk backwards S Change light-level M
Turn left A Toggle gravity(earth/moon) G
Turn right A Toggle clipping(on/off) C
Jump Space Stop rendering Z

« other projects