Game Development Reference
In-Depth Information
Even though the game's environment appears to be 3D, it really is not. In reality, the game uses a
technique called ray casting pioneered by John Carmack from id Software (one of the original creators of
the game) to simulate a 3D environment. Ray casting is also called 2.5D and provides the geometry to
render perspectives and other pseudo-3D elements.
Tip A nice ray casting tutorial by F. Permad discusses the basics such as drawing textures, floors, ceilings,
walls, shading, and more. Plus, it has some neat Java examples. It can be found at
http://www.permadi.com/tutorial/raycast/index.html .
According to an article on Wikipedia at http://en.wikipedia.org/wiki/Wolfenstein_3D , Wolf 3D
was released by id Software in 1992 to a huge success. It popularized the first-person shooter game for
the PC. The source code was later released under a shareware strategy that helped the game to be ported
to almost any platform imaginable, including these:
Windows and Pocket PC
Linux
Nintendo Entertainment System (NES) and Super Nintendo (SNES)
Atari Jaguar
Mac OS
Game Boy Advance
PlayStation and PSP
Xbox 360
iPhone and iPod Touch
When I started fiddling with the idea of bringing Wolf 3D to Android, I knew the key of the project
would be to find a highly portable version for Linux, because first, Android is built on Linux, and second,
high portability will minimize potential compilation and optimization errors that are very common
when using different versions of the GNU C compiler. The best two candidates I could find on the web
follow:
Wolfenstein 3D for GP32: This is a port to the Gamepark32, a Korean handheld
device similar to the PSP. It is written in C. Wolf 3D for GP32 is available online at
http://sourceforge.net/projects/gp32wolf3d/ .
Wolf3D S60: This is port of Wolfenstein 3D and Spear of Destiny for Nokia S60 cell
phones. Wolf3D S60 is available online at http://sourceforge.net/projects/
wolf3d-s60/ .
Digging through the source of both projects, I realized that both were almost identical and based on
a defunct port for Linux found on the Web. Of these two, the Gamepark32 version seemed the cleanest
and easiest to understand, so I decided to use it. If you wish to understand why nobody has taken the
time to port this code to Java, take a look at Listing 6-1.
Search WWH ::




Custom Search