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
In progress
- Xbox (NXDK)
- Needs an XGU renderer
- Dreamcast
- Needs a PowerVR renderer
- 3DS
- Needs a Citro3D renderer
- GameCube
- Needs an OpenGX renderer
- Wii
- Needs an OpenGX renderer
- PS2
- Needs a GSKit renderer
Wanted
- Android
- Need to finish the touch UI
- Need to figure out how to build directly from the Makefile
- UWP/GameSDK
- Needs a D3D 9 renderer
- Xbox (XDK)
- Needs a D3D 7/8 renderer
- PSP
- PS Vita
The engine
- Download a game (the engine will not run without a game)
- Drop the game into a directory called
games
and use the-game
option, or ensure thedefaultgame
variable ininternal/config.cfg
is set to the game's directory name - Put any mods into a directory called
mods
and use the-mods
option, or ensure they are listed in themods
variable in one of the configs- You can use
config.cfg
ininternal/
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
When 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=clang
to the Makefile to use Clang - On 32-bit HaikuOS, pass
CC=gcc-x86
to the Makefile to use the correct GCC executable
- Pass
- Install SDL 2.x or 1.2.x
- If building the dedicated server, pass
MODULE=server
to the Makefile, or if building the editor, passMODULE=editor
When 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=win32
to 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=clang
to 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=server
to the Makefile, or if building the editor, passMODULE=editor
When 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_func
from msvcrt.dll orAddVectoredExceptionHandler
from 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=y
to 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=server
to the Makefile, or if building the editor, passMODULE=editor
When building for web browsers using Emscripten
- Install GNU Make
- Install Emscripten
- Pass
CROSS=emscr
to the Makefile
When 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
xiso
directory- Create a directory called
xiso
- Copy (or symlink) the
internal
directory 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=nxdk
to the Makefile
When 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
cdi
directory- Create a directory called
cdi
- Copy (or symlink) the
internal
directory intocdi/
- Copy (or symlink) the games and/or mods you want to include in the disc image
- Create a directory called
- Pass
CROSS=dc
to 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 KernelExemscr
- Emscriptennxdk
- Xbox using NXDKdc
- Dreamcast using KallistiOS
ONLYBIN
- Set toy
to skip making a disc image.O
- Set the optimization level (default is2
ifDEBUG
is unset org
ifDEBUG
is set)M32
- Set toy
to produce a 32-bit binaryNATIVE
- Set toy
to tune the build for the native systemDEBUG
- Enable debug symbols and messages0
- Symbols only1
- Basic messages2
- Advanced messages3
- Detailed messages
ASAN
- Set toy
to enable the address sanitizer (requiresDEBUG
to be set)NOSTRIP
- Set toy
to not strip symbolsNOLTO
- Set toy
to disable link-time optimization (ignored ifDEBUG
is set)NOFASTMATH
- Set toy
to disable-ffast-math
NOSIMD
- Set toy
to not use SIMDNOMT
- Set toy
to disable multithreading
- Features and backends
USESTDIODS
- Set toy
to use fopen(), fread(), and fclose() in place of open(), read(), and close() in the datastream codeUSEDISCORDGAMESDK
- Set toy
to include the Discord Game SDKUSEGL
- Set toy
to include OpenGL supportUSEGL11
- Set toy
to include OpenGL 1.1 supportUSEGL33
- Set toy
to include OpenGL 3.3 supportUSEGLES30
- Set toy
to include OpenGL ES 3.0 supportUSEGLAD
- Set toy
to use glad instead of the system's GL library directlyUSEWEAKGL
- Set toy
to markgl[A-Z]*
symbols as weakUSEMINIMP3
- Set toy
to include MiniMP3 for MP3 supportUSESTDTHREAD
- Set toy
to use C11 threads- Windows
USEWINPTHREAD
- Set toy
to 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