This project is a program to load GoldSrc BSP files. The GoldSrc BSP file format has been derived from the id’s Quake 2 file format by Valve Software for their Half-Life game series.
It has been realized with
- Lazarus, Free Pascal
- SDL2, OpenGL.
02/08/2018, v0.1 alpha
- Capabilities
- Load BSP files and show contents of data lumps (exception: VIS Lump)
- Load WAD files and render contained textures
- Load BSP file and all WAD files which are necessary to render the fully textured scene
- Navigate by simple camera through scene
- To-Do’s
- lightmapping from lightmap data
- VIS Lump: treat it at all
- collision detection
- face culling
- have spaces between textures in atlas texture to prevent bleeding-effect (esp. in tiled textures recognizable)
- make blue colorkey transparent
- sky cube
- release the source code (if beta stadium reached)
Important Sources
BSP and WAD File Formats
I cannot state how important these documents were in understanding the structure of the BSP and WAD file formats. Without them, this project wouldn’t have been possible.
- http://hlbsp.sourceforge.net/index.php?content=bspdef
- http://hlbsp.sourceforge.net/index.php?content=waddef
- http://jheriko-rtw.blogspot.de/2010/11/dissecting-quake-2-bsp-format.html
- http://www.flipcode.com/archives/Quake_2_BSP_File_Format.shtml
Matrix and Vector Functions
I used the SupraEngine.Math Unit by Benjamin ‘BeRo’ Rosseaux (benjamin@rosseaux.com) for this.
- http://free-pascal-general.1045716.n5.nabble.com/GLM-library-alternative-td5728879.html
- License: zlib
Implementation Hints
- SDL2 surface to OGL texture
- Repeating OGL textures from texture atlas