When in full screen mode you can use the mouse to look.
When in windowed mode viewing (looking) can only be done using keyboard commands, since the mouse is used for accessing Window menus. The application runs in windowed mode and full screen mode. There is also a simple flash light feature (implemented using a flashlight light map and a simple vertex shader) that lets you illuminate the darker areas such as vents. Since elevators and other animations are not implemented there is a “levitate” feature so that you can move vertically to areas only accessible via elevators and ladders. The camera object includes a bounding-box roughly the size of the Half Life character in the game, and collision detection is implemented so that you can navigate through the levels moving up and down stairs and ramps, perform wall sliding, etc. You can move the camera through the levels in a typical FPS fashion using keyboard and mouse input to look, run/walk/strafe, crouch, jump, and wall slide. The levels are rendered in first person perspective and so you the player are the camera viewing the level environment. They are also rendered with a small amount of transparency to indicate that they are physically transparent. To allow navigation through the levels, most of these entities that are interactive or animated in the game are rendered here without collision detection so that you can simply walk through them. This application does not support animation and so these scene entities are static. It also renders scene entities, which are additional objects such as crates, doors, windows, grates, and elevators. This is a Windows application, using DirectX 9, which reads Half Life 1 BSP and WAD files and renders the static levels with textures and light maps applied.
Instructions on how to arrange the binary, BSP, WAD files so that you can run the level viewer application is provided in the “Using the Code” section below.
This is what I did and then simply performed a search for BSP and WAD file extensions in my Half Life game install directory. You can get the Half Life 1 game (for only $9.99) from Valve at. These files are the intellectual property of Valve and so to obtain them for use in this viewer application you will need to purchase the game from Valve. Also please note that this project does not include any Half Life BSP or WAD files. Note that I have no affiliation whatsoever with either Valve or Id, and that I created this rendering application all on my own.
But all of the information for entity and model animation resides in the BSP files and anyone with interest should be able to add these animations using this source code as a starting point. This application does not do any animation and so doors don’t open and elevators don’t move. If it is true that Half Life 2 levels use an extended version of the older BSP files than someone should be able to take this source code and likewise extend it to render these newer level files.
However, I believe that the newer Half Life 2 environments still use BSP files that are extended for the newer rendering features (but I haven’t looked into this in any great detail). This application currently only loads and renders Half Life levels. I had a lot of fun writing this application and it occurred to me that others who are interested 3D game development might find the source code useful in learning about 3D rendering. Dobbs magazine while working at Id to be very illuminating. In particular I found the Michael Abrash articles that he wrote for Dr.
I mainly used information and articles I found on the web about Quake 2, Half Life, WAD and BSP files. So I decided to attempt to write a rendering engine that would render existing game levels. Since I am a developer and not an artist I didn’t have the skills to create my own models, levels, and textures. At the same time I found myself in between jobs and so I embarked on an effort to learn about 3D rendering with the goal of creating my own 3D rendering engine. A few years ago I became interested in first person shooter games and in particular how the world levels are created and rendered in real time.