R-Type 0.1
Loading...
Searching...
No Matches
Getting started

This page takes you from a fresh clone to a running game, then shows how to build this documentation locally.

Requirements

Tool Notes
C++20 compiler GCC, Clang or MSVC
CMake 3.20 or newer
vcpkg VCPKG_ROOT must point to the installation
Git, curl, zip, unzip, tar, pkg-config Used by vcpkg to fetch dependencies
Vulkan capable GPU and driver Needed to run the client only

On Debian or Ubuntu, the low level system libraries are installed with:

sudo apt install build-essential cmake git curl zip unzip tar pkg-config \
libx11-dev libx11-xcb-dev libxcb1-dev libxrandr-dev libwayland-dev \
libvulkan1 mesa-vulkan-drivers

Every other dependency (Asio, nlohmann/json, GLM, miniaudio, stb, the Vulkan loader, the rtk ECS and the rtk graphical library) is downloaded during the configure step. Nothing is installed system wide.

Building

git clone https://github.com/microsoft/vcpkg.git ~/vcpkg
~/vcpkg/bootstrap-vcpkg.sh
export VCPKG_ROOT=~/vcpkg
git clone git@github.com:Savapitech/R-Type.git
cd R-Type
make

make configures CMake with the vcpkg toolchain and builds in Release mode. The two executables are written to bin/.

Command Effect
make Release build
make debug Debug build
make clean Removes the CMake build directory
make fclean Also removes fetched libraries and binaries
make re Full rebuild
make format Formats the sources with clang-format
make docs Builds this documentation website

The same build without the Makefile:

cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config Release

Running

Both programs load their assets with paths relative to the working directory, so start them from the repository root.

./bin/r-type_server [port] # listens on UDP port 4242 by default
./bin/r-type_client # connects to 127.0.0.1:4242

Start one client per player, up to four. The server waits in a lobby and starts the round as soon as two players are connected, or 30 seconds after the first player joined.

Action Keyboard Gamepad
Move Arrow keys D-pad or left stick
Shoot Space Right trigger
Confirm in menus Enter Cross or A
Quit Escape
Show collision boxes Hold F3 and press B

Building the documentation

The website is generated by Doxygen from the guides in docs/pages and from the comments of the public headers.

sudo apt install doxygen graphviz
make docs

make docs downloads the doxygen-awesome theme into External/ on first use, then writes the website to build/docs/html. Open build/docs/html/index.html in a browser. Warnings, such as a public function without documentation, are written to build/docs/warnings.log.

The website is rebuilt and published automatically for every push on main.