Microsoft Visual Studio Code is the recommended code editor for this project. Please install the extensions listed in extensions.json
clangd
is the recommended language server. The settings in settings.json
configure it for code completion, diagnostics, go-to-definition, and formatting
A debug launch configuration is provided in launch.json
. This, along with the CMake Tools extension, allows you to debug the engine.
For example, to debug a game running as a client in the client-server mode
- Click the CMake icon in the activity bar
- In the Project Status group under the CMake side bar, click Delete Cache and Reconfigure
- In the Project Outline group under the CMake side bar, right-click the game you want to debug, and select Set as Launch/Debug Target
- Edit the
args
property inlaunch.json
to configure the client in the client-server mode
"args": ["--mode", "cs", "--role", "client"]
- Click the Run and Debug icon in the activity bar
- In the Run and Debug side bar, select the Debug Game configuration
- Click the green play button to start debugging
- This will build the game in the debug configuration and launch a debugger
- The client will wait until it can establish a connection with a server, so start the game server in another shell
- You can now set breakpoints and debug the engine
- For GCC based platforms, set
MIMode
inlaunch.json
togdb
- On Windows with MSVC, set
type
inlaunch.json
tocppvsdbg
Memory leaks and thread race conditions can be detected by configuring the build with appropriate sanitizers
This is supported only on Clang and GCC compilers, and can be enabled by running
make configure SANITIZER=<thread | address | ...>
Set the SANITIZER
variable to thread
, address
, or another supported sanitizer
Running the sanitized game build will display detected errors in the shell
To build a profiled version that streams Tracy profiling data, configure the project with PROFILE=ON
make configure PROFILE=ON # Ubuntu or macOS
.\scripts\configure.ps1 -PROFILE ON # Windows 11
By default, profiling data is streamed over port 9000
. If running multiple network endpoints or games on the same machine, specify a different port when launching a new process. Use the TRACY_PORT
argument to set a custom port.
make play GAME=<game> ARGS="<game_args>" TRACY_PORT=<port> # Ubuntu or macOS
.\scripts\play.ps1 -GAME <game> -GAME_ARGS "<game_args>" -TRACY_PORT <port> # Windows 11