Skip to content
Open
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
14 changes: 7 additions & 7 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ This is the **GeneralsGameCode** project - a community-driven effort to fix and
## Build System

### CMake Presets (Critical)
- **vc6**: Visual Studio 6 compatible build (retail compatibility required)
- **win32**: Modern Visual Studio 2022 build
- **vc6-debug/vc6-profile**: Debug/profiling variants
- **windows-x86-vc6**: Visual Studio 6 compatible build (retail compatibility required)
- **windows-x86-msvc19**: Modern Visual Studio 2022 build
- **windows-x86-vc6-debug/windows-x86-vc6-profile**: Debug/profiling variants
- Use `cmake --preset <preset-name>` followed by `cmake --build build/<preset>`

### Build Commands
```bash
# Configure with specific preset
cmake --preset vc6
cmake --preset windows-x86-vc6

# Build (from project root)
cmake --build build/vc6
cmake --build build/windows-x86-vc6

# Build with tools and extras
cmake --build build/vc6 --target <game>_tools <game>_extras
cmake --build build/windows-x86-vc6 --target <game>_tools <game>_extras
```

### Retail Compatibility
Expand Down Expand Up @@ -77,7 +77,7 @@ generalszh.exe -jobs 4 -headless -replay subfolder/*.rep
- CI automatically tests GeneralsMD builds against known replays

### Build Validation
- CI tests multiple presets: vc6, vc6-profile, vc6-debug, win32 variants
- CI tests multiple presets: windows-x86-vc6, windows-x86-msvc19 and their variants
- Path-based change detection triggers relevant builds
- Tools and extras are built with `+t+e` flags

Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/build-historical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,17 @@ jobs:
"-DRTS_BUILD_CORE_TOOLS=ON",
"-DRTS_BUILD_${{ matrix.game == 'Generals' && 'GENERALS' || 'ZEROHOUR' }}_TOOLS=ON"
)
cmake --preset vc6 $buildFlags
cmake --preset windows-x86-vc6 $buildFlags

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Older commits cannot build

The workflow checks out the requested commit, then always configures with windows-x86-vc6. Commits from before this rename—including this PR's base—only have the vc6 preset, so historical builds now fail before compilation.

Select the preset supported by the checked-out commit, then use that name for building and its output directory for collecting artifacts.

Knowledge Base Used:


- name: Build with CMake
shell: pwsh
run: |
cmake --build --preset vc6
cmake --build --preset windows-x86-vc6

- name: Collect Artifacts
shell: pwsh
run: |
$buildDir = "build\vc6"
$buildDir = "build\windows-x86-vc6"
$artifactsDir = New-Item -ItemType Directory -Force -Path "$buildDir\${{ matrix.game }}\artifacts"

$files = Get-ChildItem -Path "$buildDir\Core","$buildDir\${{ matrix.game }}" -File |
Expand All @@ -206,8 +206,8 @@ jobs:
- name: Upload Artifact
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: ${{ matrix.game }}-vc6-${{ needs.prepare.outputs.short_sha }}
path: build\vc6\${{ matrix.game }}\artifacts
name: ${{ matrix.game }}-windows-x86-vc6-${{ needs.prepare.outputs.short_sha }}
path: build\windows-x86-vc6\${{ matrix.game }}\artifacts
retention-days: 90

create-release:
Expand All @@ -222,14 +222,14 @@ jobs:
if: ${{ github.event.inputs.game == 'Generals' || github.event.inputs.game == 'Both' }}
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: Generals-vc6-${{ needs.prepare.outputs.short_sha }}
name: Generals-windows-x86-vc6-${{ needs.prepare.outputs.short_sha }}
path: generals-artifacts

- name: Download GeneralsMD Artifact
if: ${{ github.event.inputs.game == 'GeneralsMD' || github.event.inputs.game == 'Both' }}
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0
with:
name: GeneralsMD-vc6-${{ needs.prepare.outputs.short_sha }}
name: GeneralsMD-windows-x86-vc6-${{ needs.prepare.outputs.short_sha }}
path: generalsmd-artifacts

- name: Prepare Release Archives
Expand Down
64 changes: 39 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,37 @@ jobs:
strategy:
matrix:
include:
- preset: "vc6"
- preset: "windows-x86-vc6"
tools: true
extras: true
- preset: "vc6-profile"
- preset: "windows-x86-vc6-profile"
tools: true
extras: true
- preset: "vc6-debug"
- preset: "windows-x86-vc6-debug"
tools: true
extras: true
- preset: "win32"
- preset: "windows-x86-msvc19"
tools: true
extras: true
- preset: "win32-profile"
vcpkg: true
- preset: "windows-x86-msvc19-profile"
tools: true
extras: true
- preset: "win32-debug"
vcpkg: true
- preset: "windows-x86-msvc19-debug"
tools: true
extras: true
- preset: "win32-vcpkg"
vcpkg: true
- preset: "windows-x86-msvc19"
tools: true
extras: true
- preset: "win32-vcpkg-profile"
- preset: "windows-x86-msvc19-profile"
tools: true
extras: true
- preset: "win32-vcpkg-debug"
- preset: "windows-x86-msvc19-debug"
tools: true
extras: true
- preset: "windows-x86-msvc19-nonretail"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume "nonretail" stands for the full wrath of fixes? That needs a different name, because the msvc19 builds are not retail compatible regardless.

Maybe call it "gameplay-fixed" ? I do not have better name in mind right now.

tools: true
extras: true
fail-fast: false
Expand All @@ -101,8 +107,9 @@ jobs:
preset: ${{ matrix.preset }}
tools: ${{ matrix.tools }}
extras: ${{ matrix.extras }}
tests: ${{ startsWith(matrix.preset, 'win32') }}
benchmarks: ${{ matrix.preset == 'win32' }}
vcpkg: ${{ matrix.vcpkg || false }}
tests: ${{ startsWith(matrix.preset, 'windows-x86-msvc19') }}
benchmarks: ${{ matrix.preset == 'windows-x86-msvc19' && !matrix.vcpkg }}
secrets: inherit

# Note build-generalsmd is split into two jobs for vc6 and win32 because replaycheck-generalsmd
Expand All @@ -116,16 +123,16 @@ jobs:
strategy:
matrix:
include:
- preset: "vc6"
- preset: "windows-x86-vc6"
tools: true
extras: true
- preset: "vc6-profile"
- preset: "windows-x86-vc6-profile"
tools: true
extras: true
- preset: "vc6-debug"
- preset: "windows-x86-vc6-debug"
tools: true
extras: true
- preset: "vc6-releaselog"
- preset: "windows-x86-vc6-releaselog"
tools: true
extras: true
fail-fast: false
Expand All @@ -147,23 +154,29 @@ jobs:
strategy:
matrix:
include:
- preset: "win32"
- preset: "windows-x86-msvc19"
tools: true
extras: true
vcpkg: true
ffmpeg: true
- preset: "windows-x86-msvc19-profile"
tools: true
extras: true
- preset: "win32-profile"
vcpkg: true
- preset: "windows-x86-msvc19-debug"
tools: true
extras: true
- preset: "win32-debug"
vcpkg: true
- preset: "windows-x86-msvc19"
tools: true
extras: true
- preset: "win32-vcpkg"
- preset: "windows-x86-msvc19-profile"
tools: true
extras: true
ffmpeg: true
- preset: "win32-vcpkg-profile"
- preset: "windows-x86-msvc19-debug"
tools: true
extras: true
- preset: "win32-vcpkg-debug"
- preset: "windows-x86-msvc19-nonretail"
tools: true
extras: true
fail-fast: false
Expand All @@ -173,9 +186,10 @@ jobs:
preset: ${{ matrix.preset }}
tools: ${{ matrix.tools }}
extras: ${{ matrix.extras }}
vcpkg: ${{ matrix.vcpkg || false }}
ffmpeg: ${{ matrix.ffmpeg || false}}
tests: true
benchmarks: ${{ matrix.preset == 'win32' }}
benchmarks: ${{ matrix.preset == 'windows-x86-msvc19' && !matrix.vcpkg }}
secrets: inherit

replaycheck-generalsmd:
Expand All @@ -187,8 +201,8 @@ jobs:
strategy:
matrix:
include:
- preset: "vc6+t+e"
- preset: "vc6-releaselog+t+e" # optimized build with logging and crashing enabled should be compatible, so we test that here.
- preset: "windows-x86-vc6+t+e"
- preset: "windows-x86-vc6-releaselog+t+e" # optimized build with logging and crashing enabled should be compatible, so we test that here.
fail-fast: false
uses: ./.github/workflows/reusable-check-replays.yml
with:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/msvc-readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
WARNING: This is a MSVC weekly build. It expects the data from
GeneralsGamePatch2 (https://github.com/TheSuperHackers/GeneralsGamePatch2).
Install it before playing, or the game may misbehave.

All players must use the same weekly version. This build cannot play
multiplayer against the VC6 or retail builds.

SAVE GAMES: Saves are not compatible with the VC6 or retail builds, and are only
guaranteed to load in the same weekly version they were made with.
Saves made with this build may not load there, and saves from those builds may
not load here. Back up your save games before using this build.

--------------------------------------------------------------------------------

警告:这是 MSVC 版每周构建。它需要 GeneralsGamePatch2
(https://github.com/TheSuperHackers/GeneralsGamePatch2)中的数据。
请在游玩前安装,否则游戏可能出现异常。

所有玩家必须使用同一每周版本。此版本无法与 VC6 版或零售版进行多人联机。

存档:存档与 VC6 版或零售版不兼容,并且仅保证在创建它们的同一每周版本中可以读取。使用此版本创建的存档可能无法在
那些版本中读取,那些版本的存档也可能无法在此版本中读取。使用此版本前请备份您的存档。

--------------------------------------------------------------------------------

ВНИМАНИЕ: это еженедельная сборка MSVC. Ей требуются данные из
GeneralsGamePatch2 (https://github.com/TheSuperHackers/GeneralsGamePatch2).
Установите его перед игрой, иначе игра может работать некорректно.

Все игроки должны использовать одну и ту же еженедельную версию. Эта сборка
несовместима по сетевой игре со сборками VC6 и розничными версиями.

СОХРАНЕНИЯ: сохранения несовместимы со сборками VC6 и розничными
версиями и гарантированно загружаются только в той же еженедельной версии,
в которой были созданы. Сохранения, созданные в этой сборке, могут не загрузиться там, а
сохранения из тех сборок могут не загрузиться здесь. Сделайте резервную копию
сохранений перед использованием этой сборки.

--------------------------------------------------------------------------------

تحذير: هذا إصدار أسبوعي مبني بـ MSVC. يتطلب بيانات GeneralsGamePatch2
(https://github.com/TheSuperHackers/GeneralsGamePatch2).
قم بتثبيته قبل اللعب، وإلا فقد لا تعمل اللعبة بشكل صحيح.

يجب على جميع اللاعبين استخدام الإصدار الأسبوعي نفسه. هذا الإصدار غير متوافق مع اللعب الجماعي مع إصدارات VC6 أو الإصدارات التجارية.

الحفظ: ملفات الحفظ غير متوافقة مع إصدارات VC6 أو الإصدارات التجارية، ولا يُضمن تحميلها إلا في نفس الإصدار الأسبوعي الذي أُنشئت به.
قد لا تُحمَّل ملفات الحفظ المنشأة بهذا الإصدار هناك، وقد لا تُحمَّل ملفات الحفظ من تلك الإصدارات هنا.
يرجى عمل نسخة احتياطية من ملفات الحفظ قبل استخدام هذا الإصدار.
Loading
Loading