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
-
Dependencies
- Compiling natively on Unix-like systems
- GNU Make
- GCC with GNU Binutils or Clang with LLVM
- Pass
PREFIX=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
- SDL 2.x or 1.2.x
- Compiling for Windows
- Compiling on Windows with MSYS2
- MSYS2
- GNU Make
- GCC with GNU Binutils or Clang with LLVM
- Pass
PREFIX=llvm- CC=clang
to the Makefile to use Clang
- Pass
- MinGW SDL 2.x or 1.2.x
- Compiling on Windows without MSYS2
- Git bash
- Make for Windows
- MinGW
- MinGW SDL 2.x or 1.2.x
- Cross-compiling on Unix-like platforms
- GNU Make
- MinGW
- MinGW SDL 2.x or 1.2.x
- Compiling on Windows with MSYS2
- Compiling for Windows 2000 or Windows 98 with KernelEx
- Cross-compiling on Unix-like platforms
- Wine
- Cross-compiling on Unix-like platforms and compiling on Windows
- MinGW 7.1.0 win32 sjlj
- 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
- psrc-sdl2 MinGW 7.1.0 build
- MinGW 7.1.0 win32 sjlj
- Cross-compiling on Unix-like platforms
- Compiling for web browsers using Emscripten
- GNU Make
- Emscripten
- Compiling for the Xbox using the NXDK
- Compiling for the Dreamcast using KallistiOS
- KallistiOS
- See this wiki page for a tutorial
- img4dc
- Go into the KallistiOS directory
- Go into
utils/
- Git clone
https://github.com/Kazade/img4dc
- Enter
img4dc/
and build it
- KallistiOS
- Compiling natively on Unix-like systems
-
Setup
- Xbox using the NXDK
- Create a directory called
xiso
- Copy (or symlink) the
engine
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
- Dreamcast using KallistiOS
- Create a directory called
cdi
- Copy (or symlink) the
engine
directory intocdi/
- Copy (or symlink) the games and/or mods you want to include in the disc image
- Create a directory called
- Windows 2000 or Windows 98 with KernelEx
- Download MinGW 7.1.0 win32 sjlj
- On Linux, use Wine and add MinGW's bin folder to the
PATH
(can be done using regedit to modifyHKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
) - On Windows, add MinGW's bin folder to the
PATH
(can be done using the environment variable editor)
- On Linux, use Wine and add MinGW's bin folder to the
- Download the MinGW 7.1.0 build of psrc-sdl2, and extract it to
external/Windows_i686
- When using the Makefile, ensure that it uses the correct tools
- On Linux, pass
M32=y PREFIX='wine ' CC='wine i686-w64-mingw32-gcc' inc.null=NUL
to the Makefile - On Windows, pass
M32=y PREFIX= CC=i686-w64-mingw32-gcc
to the Makefile
- On Linux, pass
- Download MinGW 7.1.0 win32 sjlj
- Xbox using the NXDK
-
Using the Makefile
- Makefile 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
- Makefile 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 NXDK
dc
- Dreamcast using KallistiOS
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 build for 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
USEDISCORDGAMESDK
- Set toy
to use 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
CC
- C compilerLD
- Linker (defaults toCC
's value)AR
- ArchiverSTRIP
- Symbol removerOBJCOPY
- Executable editorPREFIX
- 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
- 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
- Makefile rules
-
Dependencies
- Running the engine or editor on Unix-like platforms
- SDL 2.x or 1.2.x
- Running the engine or editor on Unix-like platforms
-
Running 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 inengine/config/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/config.cfg
inengine/
or in the game's local data directory (usually located in~/.local/share/
under Linux and other Unix-like systems, and%AppData%\Roaming\
under Windows) - Mods are listed as comma-separated values without spaces between values
- You can use
- Run the executable
- Supported
- Linux
- Windows 2000+
- Windows 98 with KernelEx
- MacOS
- HaikuOS
- Emscripten
- Xbox (NXDK)
- Dreamcast
- Untested
- FreeBSD
- NetBSD
- OpenBSD
- Windows 9x no KernelEx
- Wanted
- Android
- Need to finish the touch UI
- Need to figure out how to build directly from the Makefile
- UWP?
- Requires D3D or can use ANGLE for OpenGL ES 3.0
- Xbox (XDK)?
- No OpenGL
- Uses MSVC
- PS2
- ps2gl is not OpenGL
- PSP
- PS Vita
- 3DS
- GameCube?
- SDL 1.2 instead of 2.x
- OpenGX is not OpenGL and gl2gx is unmaintained
- Wii?
- SDL 1.2 instead of 2.x
- OpenGX is not OpenGL and gl2gx is unmaintained
- MSDOS?
- Requires low-level tomfoolery
- Android