Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
07612e0
Replace png++ library with minimal libpng wrapper
KevinHake Mar 21, 2026
41711d6
Fix build for modern boost/protobuf/clang, use devbox dependencies
KevinHake Mar 21, 2026
798b9fd
Upgrade GLSL shaders from version 130 to 150 for macOS compatibility
KevinHake Mar 21, 2026
28f202a
Add missing #include <algorithm> across 31 source files
KevinHake Mar 21, 2026
82ed3fa
Detect repo path change in protobuf build script
KevinHake Mar 21, 2026
ac3f5df
Fix DiscreteRect::bottom() returning y + width instead of y + height
KevinHake Mar 21, 2026
406821c
Generate run.sh for Linux GPU driver discovery, update README
KevinHake Mar 21, 2026
780a519
Replace boost::filesystem with std::filesystem
KevinHake Mar 21, 2026
2d9b597
Replace boost::crc_32_type with standalone CRC32 implementation
KevinHake Mar 21, 2026
6c9b2f4
Replace boost::hash_combine and boost::hash with std::hash and inline…
KevinHake Mar 21, 2026
1eaab26
Replace boost::interprocess::bufferstream with SpanStream
KevinHake Mar 21, 2026
2fad517
Replace boost::program_options with simple OpaqueArgs parser
KevinHake Mar 21, 2026
71c4d2b
Replace spdlog with SimpleLogger, upgrade to C++20
KevinHake Mar 24, 2026
de4a095
Clean up build instructions and add .clangd config
KevinHake Mar 24, 2026
428e653
Replace boost::adaptors with C++20 std::views and structured bindings
KevinHake Mar 24, 2026
bbf43f9
Replace boost::asio with standalone Asio, remove Boost dependency ent…
KevinHake Mar 24, 2026
74a8819
Remove Boost from CI and build instructions
KevinHake Mar 24, 2026
2790950
Upgrade GitHub Actions from v3 to v4
KevinHake Mar 24, 2026
df6d9f4
Upgrade GitHub Actions to latest versions (checkout v6, setup-node v6…
KevinHake Mar 24, 2026
d6810bb
Host MSVC libs bundle on GitHub Releases, drop setup-python from CI
KevinHake Mar 24, 2026
2b0d596
Fix CI: upgrade to ubuntu-24.04/gcc-14/clang-18, add missing includes…
KevinHake Mar 24, 2026
4ad1201
Fix SimpleLogger tests to use temp_directory_path for Windows compati…
KevinHake Mar 24, 2026
0033e1b
Speed up CI: shallow submodule clones, increase parallelism to 4
KevinHake Mar 24, 2026
9b2f6d1
Upgrade Windows CI runners from windows-2022 to windows-2025
KevinHake Mar 24, 2026
8bc7bcd
Switch installer from NSIS to WiX, add PCH and ccache to CI
KevinHake Mar 24, 2026
a9b8b47
Add sccache for MSVC CI builds
KevinHake Mar 24, 2026
be11f4c
Upgrade MSVC CI to VS 2026 on windows-2025-vs2026 runner, add sccache
KevinHake Mar 24, 2026
8dd429c
Update rapidcheck to latest upstream, rename LICENSE for WiX
KevinHake Mar 24, 2026
539585a
Update json (v3.9.1 → v3.12.0) and utfcpp (v4.0.5 → v4.0.9)
KevinHake Mar 24, 2026
3953d86
Upgrade Catch2 from v2.13.10 to v3.13.0
KevinHake Mar 24, 2026
25d27b1
Bump cmake_minimum_required to 3.16, add policy compat for CMake 4.x
KevinHake Mar 24, 2026
0679463
Revert WiX, install NSIS on Windows CI runners
KevinHake Mar 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: build/
112 changes: 66 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,49 @@ jobs:
matrix:
include:
- configuration: Debug
cc: gcc-12
cxx: g++-12
cc: gcc-14
cxx: g++-14
- configuration: Release
cc: gcc-12
cxx: g++-12
cc: gcc-14
cxx: g++-14
- configuration: Debug
cc: clang-15
cxx: clang++-15
cc: clang-18
cxx: clang++-18
- configuration: Release
cc: clang-15
cxx: clang++-15
runs-on: ubuntu-22.04
cc: clang-18
cxx: clang++-18
runs-on: ubuntu-24.04
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: init submodules (shallow)
run: git submodule update --init --recursive --depth 1
- name: update apt package list
run: sudo apt-get update -y
- name: install apt packages
run: sudo apt-get install -y
gcc-12
g++-12
clang-15
libboost-dev
libboost-filesystem-dev
libboost-program-options-dev
gcc-14
g++-14
clang-18
ccache
libsdl2-dev
libsdl2-image-dev
libsdl2-mixer-dev
libglew-dev
zlib1g-dev
libpng-dev
- name: restore ccache
uses: actions/cache@v5
with:
path: ~/.cache/ccache
key: ccache-${{ runner.os }}-${{ env.CC }}-${{ matrix.configuration }}-${{ github.sha }}
restore-keys: ccache-${{ runner.os }}-${{ env.CC }}-${{ matrix.configuration }}-
- name: install node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: 18
cache: npm
Expand All @@ -66,7 +71,7 @@ jobs:
run: npm run package
- name: restore protobuf
id: cache-protobuf-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v5
with:
path: libs/_protobuf-install
key: ${{ runner.os }}-${{ env.CC }}-protobuf
Expand All @@ -75,35 +80,32 @@ jobs:
run: ./build-protobuf.sh
- name: save protobuf
id: cache-protobuf-save
uses: actions/cache/save@v3
uses: actions/cache/save@v5
with:
path: libs/_protobuf-install
key: ${{ steps.cache-protobuf-restore.outputs.cache-primary-key }}
- name: build rwe
run: |
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ..
make -j 2
cmake -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j 4
popd
- name: test rwe
run: ./build/rwe_test
build-windows-msvc:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-2022
runs-on: windows-2025-vs2026
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: install python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: init submodules (shallow)
run: git submodule update --init --recursive --depth 1
- name: install node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: 18
cache: npm
Expand All @@ -121,27 +123,35 @@ jobs:
working-directory: launcher
run: npm run package
- run: python3 fetch-msvc-libs.py
- name: install tools
run: choco install sccache nsis -y
- name: restore sccache
uses: actions/cache@v5
with:
path: ~\AppData\Local\Mozilla\sccache
key: sccache-${{ runner.os }}-msvc-${{ matrix.configuration }}-${{ github.sha }}
restore-keys: sccache-${{ runner.os }}-msvc-${{ matrix.configuration }}-
- name: build rwe
run: |
mkdir build
cd build
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ..
cmake --build . --config ${{ matrix.configuration }} --parallel 2
cmake -G "Visual Studio 18 2026" -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ..
cmake --build . --config ${{ matrix.configuration }} --parallel 4
cd ..
- name: test rwe
working-directory: build
run: .\${{ matrix.configuration }}\rwe_test.exe
- name: package rwe
working-directory: build
run: cmake --build . --target package --config ${{ matrix.configuration }} --parallel 2
run: cmake --build . --target package --config ${{ matrix.configuration }} --parallel 4
- name: upload zip artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: RWE Zip ${{ runner.os }} MSVC ${{ matrix.configuration }}
path: build/dist/RobotWarEngine-*-Windows-${{ matrix.configuration }}.zip
if-no-files-found: error
- name: upload installer artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: RWE Installer ${{ runner.os }} MSVC ${{ matrix.configuration }}
path: build/dist/RobotWarEngine-*-Windows-${{ matrix.configuration }}.exe
Expand All @@ -150,14 +160,15 @@ jobs:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: windows-2022
runs-on: windows-2025
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
with:
fetch-depth: 0
submodules: recursive
- name: init submodules (shallow)
run: git submodule update --init --recursive --depth 1
- name: install node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: 18
cache: npm
Expand All @@ -174,6 +185,8 @@ jobs:
- name: package launcher
working-directory: launcher
run: npm run package
- name: install nsis
run: choco install nsis -y
- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
Expand All @@ -185,18 +198,25 @@ jobs:
make
unzip
mingw-w64-x86_64-toolchain
mingw-w64-x86_64-boost
mingw-w64-x86_64-SDL2
mingw-w64-x86_64-SDL2_image
mingw-w64-x86_64-SDL2_mixer
mingw-w64-x86_64-glew
mingw-w64-x86_64-smpeg2
mingw-w64-x86_64-libmodplug
mingw-w64-x86_64-zlib
mingw-w64-x86_64-libpng
mingw-w64-x86_64-readline
mingw-w64-x86_64-ccache
- name: restore ccache
uses: actions/cache@v5
with:
path: ~/.cache/ccache
key: ccache-${{ runner.os }}-mingw64-${{ matrix.configuration }}-${{ github.sha }}
restore-keys: ccache-${{ runner.os }}-mingw64-${{ matrix.configuration }}-
- name: restore protobuf
id: cache-protobuf-restore
uses: actions/cache/restore@v3
uses: actions/cache/restore@v5
with:
path: libs/_protobuf-install
key: ${{ runner.os }}-mingw64-protobuf-${{ hashFiles('.git/modules/libs/protobuf/HEAD') }}
Expand All @@ -206,16 +226,16 @@ jobs:
shell: msys2 {0}
- name: save protobuf
id: cache-protobuf-save
uses: actions/cache/save@v3
uses: actions/cache/save@v5
with:
path: libs/_protobuf-install
key: ${{ steps.cache-protobuf-restore.outputs.cache-primary-key }}
- name: build rwe
run: |
mkdir build
pushd build
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} ..
make -j 2
cmake -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=${{ matrix.configuration }} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache ..
make -j 4
popd
shell: msys2 {0}
- name: test rwe
Expand All @@ -227,13 +247,13 @@ jobs:
run: make package
shell: msys2 {0}
- name: upload zip artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: RWE Zip ${{ runner.os }} MinGW64 ${{ matrix.configuration }}
path: build/dist/RobotWarEngine-*-Windows-${{ matrix.configuration }}.zip
if-no-files-found: error
- name: upload installer artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v6
with:
name: RWE Installer ${{ runner.os }} MinGW64 ${{ matrix.configuration }}
path: build/dist/RobotWarEngine-*-Windows-${{ matrix.configuration }}.exe
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/libs/_msvc/
/libs/_protobuf-install/

/.cache/
/.idea/
/.vs/
8 changes: 4 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "libs/spdlog"]
path = libs/spdlog
url = https://github.com/gabime/spdlog.git
[submodule "libs/rapidcheck"]
path = libs/rapidcheck
url = https://github.com/MHeasell/rapidcheck.git
url = https://github.com/emil-e/rapidcheck.git
[submodule "libs/protobuf"]
path = libs/protobuf
url = https://github.com/google/protobuf.git
Expand All @@ -19,3 +16,6 @@
[submodule "libs/utfcpp"]
path = libs/utfcpp
url = https://github.com/nemtrif/utfcpp.git
[submodule "libs/asio"]
path = libs/asio
url = https://github.com/chriskohlhoff/asio.git
79 changes: 79 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

Robot War Engine (RWE) is an open-source real-time strategy game engine with high compatibility for Total Annihilation data files. It consists of a C++17 core engine and a TypeScript/Electron launcher application. Active priority is simplifying dependencies and improving new developer onboarding.

## Build Commands

### C++ Engine (from repo root)

```bash
# First time setup (submodules + protobuf)
git submodule update --init --recursive
cd libs && ./build-protobuf.sh && cd ..

# Build (Linux/macOS)
mkdir build && cd build
cmake .. -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=Debug
make -j$(nproc)

# Run unit tests
./build/rwe_test

# Run a single test by name (Catch2 syntax)
./build/rwe_test "test name pattern"
./build/rwe_test "[tag]"
```

### Launcher (from `launcher/` directory)

```bash
npm ci
npm run tsc # Type check
npm test # Jest tests
npm run lint # ESLint
npm run server # Webpack dev server (hot reload)
npm start # Launch Electron app (needs RWE_HOME env var)
npm run master-server # Local multiplayer master server
npm run package # Package for distribution
```

## Architecture

### Core Engine (`src/rwe/`)

The engine is built as a static library `librwe` linked by multiple executables (`rwe`, `rwe_bridge`, `rwe_test`, and various format test tools).

Key subsystems:

- **sim/** - Deterministic game simulation (units, weapons, projectiles, terrain, resources). Uses fixed-point math types (`SimScalar`, `SimVector`, `SimAngle`) for cross-platform determinism.
- **scene/** - Scene state machine: MainMenuScene → LoadingScene → GameScene.
- **render/** - OpenGL 3.0+ rendering pipeline with GLSL shaders (in `shaders/`).
- **cob/** - Virtual machine executing Total Annihilation's COB unit behavior scripts. CobThread runs concurrent script coroutines within CobExecutionContext.
- **io/** - Parsers for TA file formats: HPI (archives), GAF (sprites), TDF (config), 3DO (models), COB (scripts), FBI (units), TNT (terrain), PCX (images), OTA (maps), GUI (layouts).
- **vfs/** - Virtual file system abstracting over HPI archives and directories.
- **pathfinding/** - A* pathfinding with octile distance on grids.
- **proto/** - Protocol buffer networking (defined in `proto/network.proto`).
- **geometry/** / **math/** - Linear algebra and spatial primitives.
- **collections/** - Custom data structures (MinHeap, VectorMap).

### Launcher (`launcher/src/`)

Electron app with React/Redux for the multiplayer lobby. Communicates with the engine via `rwe_bridge` (JSON IPC). Contains `launcher/`, `master-server/`, `game-server/`, and `common/` modules.

## Code Conventions

- All C++ code is in the `rwe::` namespace
- Formatting enforced by `.clang-format`: Allman brace style, 4-space indent, no column limit, C++17 standard
- Test files live alongside source: `src/rwe/[subsystem]/[Component].test.cpp`
- Strong typing via opaque ID types: `UnitId`, `PlayerId`, `ProjectileId` (see `OpaqueId`)
- Variant-based state machines for unit behavior and navigation goals
- Error handling uses `Result<T, E>` types rather than exceptions
- Version derived from git tags (format: `v#.#.#`)

## CI

GitHub Actions runs Linux (gcc-12, clang-15) and Windows (MSVC 2022, MinGW64) builds in both Debug and Release configurations.
Loading
Loading