Skip to content

Latest commit

 

History

History
52 lines (42 loc) · 2.82 KB

Development.md

File metadata and controls

52 lines (42 loc) · 2.82 KB

Development

Editor

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

Debugging

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

  1. Click the CMake icon in the activity bar
  2. In the Project Status group under the CMake side bar, click Delete Cache and Reconfigure
  3. 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
  4. Edit the args property in launch.json to configure the client in the client-server mode
"args": ["--mode", "cs", "--role", "client"]
  1. Click the Run and Debug icon in the activity bar
  2. In the Run and Debug side bar, select the Debug Game configuration
  3. Click the green play button to start debugging
  4. This will build the game in the debug configuration and launch a debugger
  5. The client will wait until it can establish a connection with a server, so start the game server in another shell
  6. You can now set breakpoints and debug the engine

Platform-Specific Notes

  • For GCC based platforms, set MIMode in launch.json to gdb
  • On Windows with MSVC, set type in launch.json to cppvsdbg

Sanitized builds

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

Profiling

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