PlatinumSrc
PlatinumSrc copied to clipboard
A WIP 3D retro game engine inspired by GoldSrc and Quake
PlatinumSrc
A WIP retro 3D game engine inspired by GoldSrc and Quake
Progress can be found here
- Building
- Running
- Platforms
Demo video
Using H-74, and test_model.p3m in games/test/
https://github.com/PQCraft/PQCraft/assets/58464017/c68cb59c-4f7d-460d-b744-8eee5044fe3e
Building
-
Dependencies
- Compiling natively on Unix-like systems
- GNU Make
- 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
- 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
TOOLCHAIN=llvm- CC=clangto 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_funcfrom msvcrt.dll orAddVectoredExceptionHandlerfrom 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
enginedirectory 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
enginedirectory 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 TOOLCHAIN='wine ' CC='wine i686-w64-mingw32-gcc' inc.null=NULto the Makefile - On Windows, pass
M32=y TOOLCHAIN= CC=i686-w64-mingw32-gccto 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 is2ifDEBUGis unset orgifDEBUGis set)M32- Set toyto produce a 32-bit binaryNATIVE- Set toyto tune build for 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)NOFASTMATH- Set toyto disable-ffast-mathNOSIMD- Set toyto not use SIMDNOMT- Set toyto disable multithreading
- Features
USEDISCORDGAMESDK- Set toyto use 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 weakUSEMINIMP3- Set toyto include MiniMP3 for MP3 supportUSESTDTHREAD- Set toyto use C11 threads- Windows
USEWINPTHREAD- Set toyto use winpthread instead of win32 threads
- Toolchain
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) runmake DEBUG=1 ASAN=y -j$(nproc) runmake CROSS=nxdk DEBUG=0 -j$(nproc) run - Makefile rules
Running
-
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
gamesand use the-gameoption, or ensure thedefaultgamevariable inengine/config/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/config.cfginengine/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
Platforms
- Supported
- Linux
- Windows 2000+
- Windows 98 with KernelEx
- MacOS
- HaikuOS
- Emscripten
- Xbox (NXDK)
- Dreamcast
- Untested
- FreeBSD
- NetBSD
- OpenBSD
- Windows 9x no KernelEx
- In progress
- 3DS
- Needs a Citro3D renderer
- GameCube
- Needs an OpenGX renderer
- Wii
- Needs an OpenGX renderer
- PS2
- Needs a GSKit renderer
- 3DS
- 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
- PSP
- PS Vita
- MSDOS?
- Requires low-level tomfoolery
- Android