A WIP retro 3D game engine inspired by GoldSrc and Quake
Progress can be found here
Using H-74, and test_model.p3m in games/test/
demo.mp4
Supported
- Linux
- Windows 2000+
- Windows 98
- MacOS
- HaikuOS
- Emscripten
Untested
- FreeBSD
- NetBSD
- OpenBSD
- Windows 95
In progress
- Xbox (NXDK)
- Needs an XGU renderer
- Dreamcast
- Needs a PowerVR renderer
- 3DS
- Needs a Citro3D renderer
- GameCube
- Needs a GX renderer
- Wii
- Needs a GX renderer
- PS2
- Needs a GSKit renderer
- Android
- Need to finish the touch UI
- Needs a GLES 3.0 renderer
Wanted
- UWP/GameSDK
- Needs a D3D 9 renderer
- PSP
- PS Vita
- Switch
Maybe
- Xbox (XDK)
- Needs a D3D 7/8 renderer
- N64
- MSDOS
- TI-Nspire CX
Running the engine
- Download a game (the engine will not run without a game)
- Drop the game into a directory called
gamesand use the-gameoption, or ensure thedefaultgamevariable ininternal/engine/config.cfgis set to the game's directory name - Put any mods into a directory called
modsand use the-modsoption, or ensure they are listed in themodsvariable in one of the configs- You can use
config.cfgininternal/engine/or in the game's user data directory - Mods are listed as comma-separated values without spaces between values
- You can use
- Run the executable
Building on Unix-like platforms for that same platform
- Install GNU Make
- Install GCC with GNU Binutils, or Clang with LLVM
- Pass
TOOLCHAIN=llvm- CC=clangto the Makefile to use Clang - On 32-bit HaikuOS, pass
CC=gcc-x86to the Makefile to use the correct GCC executable
- Pass
- Install SDL 2.x or 1.2.x
- If building the dedicated server, pass
MODULE=serverto the Makefile, or if building the editor, passMODULE=editor
Building for Windows
- If cross-compiling on a Unix-like platform
- Install GNU Make
- Install MinGW
- Install MinGW SDL 2.x or 1.2.x
- Pass
CROSS=win32to the Makefile
- If MSYS2 is supported
- Install MSYS2 and use the MINGW64 backend
- Install GNU Make
- Install GCC with GNU Binutils, or Clang with LLVM
- Pass
TOOLCHAIN=llvm- CC=clangto the Makefile to use Clang
- Pass
- Install MinGW SDL 2.x or 1.2.x
- If MSYS2 is not supported
- Install Git bash
- Install Make for Windows and add it to the
PATH - Download MinGW and add it to the
PATH - Donwload and extract MinGW SDL 2.x or 1.2.x into MinGW
- If building the dedicated server, pass
MODULE=serverto the Makefile, or if building the editor, passMODULE=editor
Building for older Windows
- Download MinGW 7.1.0 win32 sjlj and add it to the
PATH- It might work with other versions but they need to not require
___mb_cur_max_funcfrom msvcrt.dll orAddVectoredExceptionHandlerfrom kernel32.dll
- It might work with other versions but they need to not require
- If cross-compiling on a Unix-like platform
- Install Wine
- Pass
CROSS=win32 TOOLCHAIN='wine 'to the Makefile
- If bulding for Windows 2000
- Download psrc-sdl2 MinGW 7.1.0 build, and extract it to
external/Windows_i686
- Download psrc-sdl2 MinGW 7.1.0 build, and extract it to
- If building for Windows 98
- Download SDL 1.2.x modified to be compatible with Windows 98, and extract it to
external/Windows_i686 - Pass
USESDL1=y NOMT=yto the Makefile
- Download SDL 1.2.x modified to be compatible with Windows 98, and extract it to
- If building the dedicated server, pass
MODULE=serverto the Makefile, or if building the editor, passMODULE=editor
Building for web browsers using Emscripten
- Install GNU Make
- Install Emscripten
- Pass
CROSS=emscrto the Makefile
Building for the Xbox using the NXDK
- Set up the NXDK
- Set up XGU
- Go to the NXDK directory
- Go into the
lib/directory - Clone XGU into an
xgu/directory
- Set up the
xisodirectory- Create a directory called
xiso - Copy (or symlink) the
internaldirectory intoxiso/ - Copy (or symlink) the games and/or mods you want to include in the disc image
- There should be a directory (or link) called
games, and if you have mods, a directory (or link) calledmods
- There should be a directory (or link) called
- Create a directory called
- Pass
CROSS=nxdkto the Makefile
Building for the Dreamcast using KallistiOS
- Set up KallistiOS
- See this wiki page for a tutorial
- Set up img4dc
- Go into the KallistiOS directory
- Go into
utils/ - Git clone
https://github.com/Kazade/img4dc - Enter
img4dc/and build it
- Set up the
cdidirectory- Create a directory called
cdi - Copy (or symlink) the
internaldirectory intocdi/ - Copy (or symlink) the games and/or mods you want to include in the disc image
- Create a directory called
- Pass
CROSS=dcto the Makefile
———
Full Makefile usage
- Rules
build- Build an executable or ROMrun- Build an executable or ROM and run itclean- Clean up intermediate filesdistclean- Clean up intermediate and output filesexternclean- Clean up external tools
- Variables
- Build options
MODULE- Which module to build (default isengine)engine- Game engineserver- Standalone servereditor- Map editor
CROSS- Cross compilewin32- Windows 2000+ or Windows 98 with KernelExandroid- Androidemscr- Emscriptennxdk- Xbox using the NXDKdc- Dreamcast using KallistiOS
ONLYBIN- Set toyto skip making a disc image.O- Set the optimization level (default is2ifDEBUGis unset orgifDEBUGis set)M32- Set toyto produce a 32-bit binaryNATIVE- Set toyto tune the build for the native systemDEBUG- Enable debug symbols and messages0- Symbols only1- Basic messages2- Advanced messages3- Detailed messages
ASAN- Set toyto enable the address sanitizer (requiresDEBUGto be set)NOSTRIP- Set toyto not strip symbolsNOLTO- Set toyto disable link-time optimization (ignored ifDEBUGis set)NOGCSECTIONS- Set toyto disable-Wl,--gc-sections(ignored ifDEBUGis set)NOFASTMATH- Set toyto disable-ffast-mathNOSIMD- Set toyto not use SIMDNOMT- Set toyto disable multithreading
- Features and backends
USESTDIODS- Set toyto usefopen(),fread(), andfclose()in place ofopen(),read(), andclose()in the datastream codeUSESDLDS- Set toyto use SDL_RWops functions in place ofopen(),read(), andclose()in the datastream codeUSEDISCORDGAMESDK- Set toyto include the Discord Game SDKUSEGL- Set toyto include OpenGL supportUSEGL11- Set toyto include OpenGL 1.1 supportUSEGL33- Set toyto include OpenGL 3.3 supportUSEGLES30- Set toyto include OpenGL ES 3.0 supportUSEGLAD- Set toyto use glad instead of the system's GL library directlyUSEWEAKGL- Set toyto markgl[A-Z]*symbols as weakUSESDL1- Set toyto use SDL 1.2.x instead of SDL 2.xUSESTATICSDL- Set toyto statically link to SDLUSEMINIMP3- Set toyto include MiniMP3 for MP3 supportUSESTBVORBIS- Set toyto include stb_vorbis for OGG Vorbis supportUSESTDTHREAD- Set toyto use C11 threads- Windows
USEWINPTHREAD- Set toyto use winpthread instead of win32 threads
- Toolchain options
CC- C compilerLD- Linker (defaults toCC's value)AR- ArchiverSTRIP- Symbol removerOBJCOPY- Executable editorTOOLCHAIN- Text to prepend to tool namesCFLAGS- Extra C compiler flagsCPPFLAGS- Extra C preprocessor flagsLDFLAGS- Extra linker flagsLDLIBS- Extra linker librariesRUNFLAGS- Flags to pass to the executableEMULATOR- Command used to run the executable or ROMEMUFLAGS- Flags to pass to the emulatorEMUPATHFLAG- Flag used to specify the executable or ROM path- Windows
WINDRES- Windows resource compiler
- Emscripten
EMSCR_SHELL- Path to the shell file
- NXDK
XBE_TITLE- XBE title and XISO name (default isPlatinumSrc)XBE_TITLEID- XBE title ID (default isPQ-001)XBE_VERSION- XBE version (default is taken fromversion.h)XBE_XTIMAGE- Path to XPR image (default isicons/engine.xpr)XISO- Path to write XISO to (default is$(OUTDIR)/$(XBE_TITLE).xiso.iso)XISODIR- Path to make the XISO from (default is$(OUTDIR)/xiso)
- Dreamcast
IP_TITLE- IP.BIN title and CDI name (default isPlatinumSrc)IP_COMPANY- IP.BIN company name (default isPQCraft)IP_MRIMAGE- Path to MR image (default isicons/engine.mr)CDI- Path to write CDI to (default is$(OUTDIR)/$(IP_TITLE).cdi)CDIDIR- Path to make the CDI from (default is$(OUTDIR)/cdi)
- Build options
Examples:
make -j$(nproc)
make -j$(nproc) run
make DEBUG=1 ASAN=y -j$(nproc) run
make CROSS=nxdk DEBUG=0 -j$(nproc) run