Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions .devin/wiki.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "GeneralsX Team"
},
{
"content": "Multiplayer strategy: The legacy GameSpy online backend is discontinued and superseded by Next-Gen Multiplayer (NGMP / GeneralsOnline). Singleplayer campaigns, Skirmish (vs AI), and LAN multiplayer must remain fully functional. GameSpy online compatibility is not required and must not block NGMP development. Active client integration lives under GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/ with protocol references in references/GameClient and references/GameServer.",
"content": "Multiplayer strategy: The legacy GameSpy online backend is discontinued and superseded by Next-Gen Multiplayer (NGMP / GeneralsOnline). Singleplayer campaigns, Skirmish (vs AI), and LAN multiplayer must remain fully functional. GameSpy online compatibility is not required and must not block NGMP development. Active client integration lives under GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/ with protocol references in ../references/GameClient and ../references/GameServer.",
"author": "GeneralsX Team"
},
{
Expand All @@ -21,7 +21,7 @@
"author": "GeneralsX Team"
},
{
"content": "Build system uses CMake with presets defined in CMakePresets.json. Active release targets are 'linux64-deploy' and 'macos-vulkan'. Windows modern support is tracked under 'mingw-w64-i686' (Docker cross-compilation) and issue #29. DXVK source of truth is the fork branch generalsx-macos-v2.6 in references/fbraz3-dxvk. Scripts are structured under scripts/build/, scripts/qa/, scripts/env/, and scripts/tooling/.",
"content": "Build system uses CMake with presets defined in CMakePresets.json. Active release targets are 'linux64-deploy' and 'macos-vulkan'. Windows modern support is tracked under 'mingw-w64-i686' (Docker cross-compilation) and issue #29. DXVK source of truth is the fork branch generalsx-macos-v2.6 in generalsx-dxvk. Scripts are structured under scripts/build/, scripts/qa/, scripts/env/, and scripts/tooling/.",
"author": "GeneralsX Team"
}
],
Expand All @@ -33,7 +33,7 @@
},
{
"title": "Repository Structure",
"purpose": "Document the top-level directory layout: GeneralsMD/ (Zero Hour, primary), Generals/ (base game, secondary), Core/ (shared engine), cmake/ (modular build scripts), scripts/ (build, QA, tooling), references/ (fbraz3-dxvk, GameClient, GameServer), resources/, flatpak/, assets/, and docs/.",
"purpose": "Document the top-level directory layout: GeneralsMD/ (Zero Hour, primary), Generals/ (base game, secondary), Core/ (shared engine), cmake/ (modular build scripts), scripts/ (build, QA, tooling), workspace references (../references/: GameClient, GameServer), resources/, flatpak/, assets/, and docs/.",
"parent": "Project Overview"
},
{
Expand All @@ -58,7 +58,7 @@
},
{
"title": "Rendering & DXVK Integration",
"purpose": "Document the W3D rendering engine and DXVK DirectX 8 to Vulkan translation layer across Linux, macOS (via MoltenVK to Metal), and Windows. Explain the fork source-of-truth policy in references/fbraz3-dxvk (branch generalsx-macos-v2.6) and FetchContent build mechanics.",
"purpose": "Document the W3D rendering engine and DXVK DirectX 8 to Vulkan translation layer across Linux, macOS (via MoltenVK to Metal), and Windows. Explain the fork source-of-truth policy in generalsx-dxvk (branch generalsx-macos-v2.6) and FetchContent build mechanics.",
"parent": "Core Engine Architecture"
},
{
Expand All @@ -73,7 +73,7 @@
},
{
"title": "Next-Gen Multiplayer (NGMP / GeneralsOnline)",
"purpose": "Document the Next-Gen Multiplayer (NGMP / GeneralsOnline) client integration under GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/. Explain REST API conventions (/env/dev/contract/1/ prefix, Bearer token auth), WebSocket routing via integer msg_id, room registration, P2P network synchronization, and reference implementations (references/GameClient, references/GameServer).",
"purpose": "Document the Next-Gen Multiplayer (NGMP / GeneralsOnline) client integration under GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/. Explain REST API conventions (/env/dev/contract/1/ prefix, Bearer token auth), WebSocket routing via integer msg_id, room registration, P2P network synchronization, and reference implementations (../references/GameClient, ../references/GameServer).",
"parent": "Core Engine Architecture"
},
{
Expand Down Expand Up @@ -103,7 +103,7 @@
},
{
"title": "Reference Repositories",
"purpose": "Document internal and external reference codebases: local references in references/ (fbraz3-dxvk, GameClient, GameServer) and upstream/historical references (TheSuperHackers upstream baseline, fighter19-dxvk-port for DXVK/SDL3, jmarshall-win64-modern for OpenAL/Win64).",
"purpose": "Document internal and external reference codebases: workspace references in ../references/ (GameClient, GameServer) and upstream/historical references (TheSuperHackers upstream baseline, fighter19-dxvk-port for DXVK/SDL3, jmarshall-win64-modern for OpenAL/Win64).",
"parent": "Cross-Platform Port Strategy"
},
{
Expand Down
2 changes: 1 addition & 1 deletion .github/instructions/build.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cmake --build build/mingw-w64-i686 --target z_generals

## DXVK Source of Truth (macOS)

- DXVK fixes must live in `references/fbraz3-dxvk` and be pushed to the fork branch `generalsx-macos-v2.6`.
- DXVK fixes must live in `generalsx-dxvk` and be pushed to the fork branch `generalsx-macos-v2.6`.
- macOS build tracks that branch via CMake FetchContent (`UPDATE_DISCONNECTED FALSE`).
- Local mode: `-DSAGE_DXVK_USE_LOCAL_FORK=ON` (disables update/fetch).

Expand Down
4 changes: 2 additions & 2 deletions .github/instructions/git-commit.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ docs: update macOS build instructions for Vulkan SDK setup
- PR title should follow the same format as commit messages
- the PR description should provide context and link to related issues
- PR targets must be against main branch of `fbraz3/GeneralsX` repo, unless it's a user instruction to do otherwise (e.g., "Merge to `develop` branch" or "Merge to `feature/xyz` branch")
- There is a subproject called `dxvk-macos` located under `references/fbraz3-dxvk` folder, which is a fork of the original DXVK project. Commits related to that subproject should be made in that repository and follow the same commit message standards.
- `fbraz3-dxvk` subproject PRs should target the `generalsx-macos-v2.6` branch of `generalsx-project/dxvk` repository, and follow the same commit message standards.
- The DXVK fork project is located in `generalsx-dxvk` (`generalsx-project/dxvk`), which is a fork of the original DXVK project. Commits related to DXVK should be made in that repository and follow the same commit message standards.
- `generalsx-dxvk` PRs should target the `generalsx-macos-v2.6` branch of `generalsx-project/dxvk` repository, and follow the same commit message standards.

---

Expand Down
6 changes: 3 additions & 3 deletions .github/instructions/ngmp.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ When a piece of legacy UI code is in the critical path for NGMP but also serves
- Ensure network packet data serialization handles network byte order (`htons`/`ntohs`, `htonl`/`ntohl`) explicitly to support cross-play between x86_64 Linux and ARM64 macOS.

7. **Reference repositories**:
- There are two reference repositories for NGMP, take a look on these to understand the protocol and implementation details:
1. `references/GameClient`: The client-side implementation.
2. `references/GameServer`: The server-side implementation.
- There are two reference repositories for NGMP located at workspace `../references/`, take a look on these to understand the protocol and implementation details:
1. `../references/GameClient`: The client-side implementation.
2. `../references/GameServer`: The server-side implementation.

8. **REST API & Routing Conventions (Lessons Learned)**:
- **Environment/Contract Prefix**: The C# Kestrel backend strictly requires environment and contract version routing. Do **NOT** use `GetServerRESTEndpoint()` directly to build URLs. Always use `NGMP::GetAPIEndpoint("EndpointName")` (e.g. `NGMP::GetAPIEndpoint("Lobbies")`), which appends the required `/env/dev/contract/1/` prefix automatically.
Expand Down
2 changes: 1 addition & 1 deletion .github/instructions/platform-linux.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mkdir -p logs && gdb -batch -ex "run -win" -ex "bt full" -ex "thread apply all b
- **Case-sensitive filesystem**: Include paths must match exact case. Use `scripts/tooling/cpp/maintenance/fixIncludesCase.sh`.
- **DXVK requires Vulkan**: `vulkan-tools`, `mesa-vulkan-drivers`, or proprietary GPU drivers.
- **SDL3**: fetched via CMake FetchContent — no system package needed.
- **DXVK source policy**: fixes go in `references/fbraz3-dxvk`, never in `build/_deps/...`.
- **DXVK source policy**: fixes go in `generalsx-dxvk`, never in `build/_deps/...`.
- **CompatLib**: `GeneralsMD/Code/CompatLib/` provides Win32 API compatibility shims (`windows_compat.h`).
- **No native POSIX calls**: use SDL3 abstractions for timers, threads, file I/O. No raw `pthread_*`, `open()`.
- **`-logToCon`**: only available in debug builds (`RTS_BUILD_OPTION_DEBUG=ON`).
Expand Down
6 changes: 3 additions & 3 deletions .github/instructions/platform-macos.instructions.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
applyTo: 'scripts/build/macos/**,references/fbraz3-dxvk/**'
applyTo: 'scripts/build/macos/**'
---

## macOS Architecture
Expand All @@ -14,7 +14,7 @@ applyTo: 'scripts/build/macos/**,references/fbraz3-dxvk/**'

- DXVK is built via Meson as ExternalProject — must pass `-arch arm64` via `cmake/meson-arm64-native.ini` to avoid Rosetta2 confusion.
- DXVK source of truth: fork branch `generalsx-macos-v2.6`; CMake tracks remote by default.
- Local fork mode: `-DSAGE_DXVK_USE_LOCAL_FORK=ON` (disables update/fetch, uses `references/fbraz3-dxvk`).
- Local fork mode: `-DSAGE_DXVK_USE_LOCAL_FORK=ON` (disables update/fetch, uses workspace `../generalsx-dxvk` repository).
- Vulkan SDK **must** be from LunarG — provides MoltenVK ICD JSON. Not from Homebrew.
- Vulkan SDK path: `~/VulkanSDK/<version>/macOS/` — must contain `libvulkan.dylib` and `libMoltenVK.dylib`.

Expand All @@ -35,4 +35,4 @@ brew install cmake ninja meson
- **Rosetta2 + Meson**: always use `cmake/meson-arm64-native.ini` to force `-arch arm64`.
- **SDL3**: fetched via CMake FetchContent — no system package needed.
- **No Cocoa/Metal calls in game code**: all platform access through SDL3 + DXVK layers.
- **DXVK fixes**: commit/push to `references/fbraz3-dxvk` first; never edit `build/_deps/...`.
- **DXVK fixes**: commit/push to `generalsx-dxvk` repository first; never edit `build/_deps/...`.
10 changes: 0 additions & 10 deletions .gitmodules

This file was deleted.

4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ printf "%s" "$body" | rg '\\n' && echo "HAS_LITERAL_BACKSLASH_N=YES" || echo "HA
- `GeneralsMD/`: Zero Hour.
- `Generals/`: base game.
- `Core/`: shared libraries.
- `references/`: fbraz3-dxvk
- `references/`: workspace reference directory (`../references/` with GameClient, GameServer).
Comment thread
coderabbitai[bot] marked this conversation as resolved.
- `docs/WORKDIR/`: current work docs.
- `docs/HOWTO/`: redirection stubs pointing to the GitHub Wiki (user tutorials, SagePatch config, etc.)
- `logs/`: build/run/debug logs.
Expand All @@ -287,7 +287,7 @@ The `**` at applyTo means all files, you MUST load it everytime.
| [.github/instructions/cpp-conventions.instructions.md](.github/instructions/cpp-conventions.instructions.md) | `**/*.{cpp,h,hpp,c}` | Code style, annotations, platform isolation |
| [.github/instructions/build.instructions.md](.github/instructions/build.instructions.md) | `cmake/**,CMakeLists.txt,CMakePresets.json` | Build presets, DXVK source of truth |
| [.github/instructions/platform-linux.instructions.md](.github/instructions/platform-linux.instructions.md) | `scripts/build/linux/**` | Linux build notes |
| [.github/instructions/platform-macos.instructions.md](.github/instructions/platform-macos.instructions.md) | `scripts/build/macos/**,references/fbraz3-dxvk/**` | macOS/DXVK build notes |
| [.github/instructions/platform-macos.instructions.md](.github/instructions/platform-macos.instructions.md) | `scripts/build/macos/**` | macOS/DXVK build notes |
| [.github/instructions/docs.instructions.md](.github/instructions/docs.instructions.md) | `**/*.md` | Documentation structure and workflow |
| [.github/instructions/scripts.instructions.md](.github/instructions/scripts.instructions.md) | `scripts/**` | Script organization and naming |
| [.github/instructions/ngmp.instructions.md](.github/instructions/ngmp.instructions.md) | `**/GeneralsOnline/**,**/NextGenMP/**` | NGMP cross-platform multiplayer integration guidelines |
Expand Down
13 changes: 11 additions & 2 deletions cmake/dx8.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,17 @@ elseif(APPLE AND SAGE_USE_MOLTENVK)

include(ExternalProject)
# GeneralsX @build BenderAI 13/03/2026 Add explicit source mode to keep remote branch updates deterministic by default.
set(DXVK_LOCAL_FORK_DIR "${CMAKE_SOURCE_DIR}/references/fbraz3-dxvk")
option(SAGE_DXVK_USE_LOCAL_FORK "Build DXVK from local references/fbraz3-dxvk checkout" OFF)
# GeneralsX @build fbraz 25/09/2026 Default local DXVK fork to workspace generalsx-dxvk repository.
if(NOT DEFINED DXVK_LOCAL_FORK_DIR)
if(EXISTS "${CMAKE_SOURCE_DIR}/../generalsx-dxvk/.git")
set(DXVK_LOCAL_FORK_DIR "${CMAKE_SOURCE_DIR}/../generalsx-dxvk")
elseif(EXISTS "${CMAKE_SOURCE_DIR}/references/fbraz3-dxvk/.git")
set(DXVK_LOCAL_FORK_DIR "${CMAKE_SOURCE_DIR}/references/fbraz3-dxvk")
else()
set(DXVK_LOCAL_FORK_DIR "${CMAKE_SOURCE_DIR}/../generalsx-dxvk")
endif()
endif()
option(SAGE_DXVK_USE_LOCAL_FORK "Build DXVK from local generalsx-dxvk checkout" OFF)

if(SAGE_DXVK_USE_LOCAL_FORK AND EXISTS "${DXVK_LOCAL_FORK_DIR}/.git")
set(DXVK_SOURCE_DIR "${DXVK_LOCAL_FORK_DIR}")
Expand Down
3 changes: 3 additions & 0 deletions cmake/ngmp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ if(SAGE_USE_NGMP)
if(EXISTS "${CMAKE_SOURCE_DIR}/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/GameNetworkingSockets.lib")
set(_VNS_DIR "${CMAKE_SOURCE_DIR}/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets")
set(_VNS_INC "${CMAKE_SOURCE_DIR}/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets")
elseif(EXISTS "${CMAKE_SOURCE_DIR}/../references/GameClient/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/GameNetworkingSockets.lib")
set(_VNS_DIR "${CMAKE_SOURCE_DIR}/../references/GameClient/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets")
set(_VNS_INC "${CMAKE_SOURCE_DIR}/../references/GameClient/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets")
elseif(EXISTS "${CMAKE_SOURCE_DIR}/references/GameClient/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets/GameNetworkingSockets.lib")
set(_VNS_DIR "${CMAKE_SOURCE_DIR}/references/GameClient/GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets")
set(_VNS_INC "${CMAKE_SOURCE_DIR}/references/GameClient/GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/Vendor/ValveNetworkingSockets")
Expand Down
Loading
Loading