Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cc48d39
ci(vcpkg): Repair the vcpkg CI path and move the binary cache to GitH…
bobtista Aug 29, 2026
f7fc4b7
refactor(ww3d2): Implement first bits for IRenderBackend interface (#…
bobtista Aug 29, 2026
a7f7499
Revert previous crash fixes when Troop Crawler is destroyed before re…
Caball009 Aug 17, 2026
2a98a2d
bugfix(object): Avoid potential crash when Troop Crawler is destroyed…
Caball009 Aug 27, 2026
21aa508
fix(heightmapedit): Fix undefined behaviors in WorldHeightMapEdit::re…
CryoTheRenegade Aug 29, 2026
171701e
bugfix(update): Resolve mismatch in Generals caused by updating Assis…
Stubbjax Aug 29, 2026
5a41adc
chore: Add override keywords to virtual function overrides (#3221)
CryoTheRenegade Aug 29, 2026
e3ed89e
fix(scorch): Early return if scorch does not fit in buffer (#3186)
stephanmeesters Aug 29, 2026
6be60df
tweak(scorch): Increase scorch buffer limits to 16-bit maximum (#3186)
stephanmeesters Aug 29, 2026
ccff285
refactor: Fix unnecessary copy initializations (#3202)
CryoTheRenegade Aug 30, 2026
c1f3703
chore: Accept both path slashes for clang tidy (#3225)
CryoTheRenegade Aug 30, 2026
b8756d3
bugfix(particlesys): Delay particle system destruction to prevent orp…
Mauller Aug 31, 2026
aecf13b
ci(vcpkg): Disable vcpkg metrics to stop random link failures (#3244)
bobtista Sep 1, 2026
a2f633e
unify(gui): Merge game window files (#3197)
Jaredl-Dev Aug 25, 2026
19041ab
unify(gui): Move game window files to Core (#3197)
Jaredl-Dev Aug 25, 2026
3d7b15f
fix(htree): Reject invalid W3D hierarchy pivot counts (#3195)
CryoTheRenegade Sep 1, 2026
dcf0d77
build(vcpkg): Define FFmpeg as VCPKG feature, disabled by default (#3…
tsunamistate Sep 2, 2026
e2ad13b
bugfix(audio): Apply configured volume to Bink movie audio (#3083)
CryoTheRenegade Sep 2, 2026
af10d57
tweak(gamestate): Support loading save files from absolute paths (#3226)
bobtista Sep 2, 2026
d59ae33
bugfix(tunnel): Restore retail compatibility after changes to TunnelT…
Caball009 Sep 3, 2026
4655078
fix(gameaudio): Remove the has3DSensitiveStreamsPlaying volume hack (…
xezon Sep 3, 2026
61d4465
tweak(gameaudio): Only update sound volumes if the volume has really …
xezon Sep 3, 2026
5035ffd
chore(lib): Implement Usp10Loader class (#3241)
OmarAglan Sep 4, 2026
548f4e3
ci(release): Fix weekly release workflow permissions (#3256)
OmarAglan Sep 5, 2026
e6f1d06
docs: Update the AI code guidelines (#3249)
stephanmeesters Sep 5, 2026
de20ae0
perf(particlesys): Batch same type particles to reduce cost of partic…
Mauller Sep 6, 2026
5ee251d
bugfix(aiupdate): Contact weapons are no longer blocked by obstacles …
Stubbjax Sep 8, 2026
d60deb4
ci(release): Protect weekly-release against commit-subject injection …
tintinhamans Sep 8, 2026
689a09a
bugfix(productionupdate): Prevent cancelling and refunding a single p…
tintinhamans Sep 8, 2026
cf5e2c5
chore(sync): merge thesuperhackers/main into thesuperhackers-sync-09-…
fbraz3 Sep 8, 2026
ece3a2d
fix(video): remove obsolete BinkVideoPlayer copies in GeneralsMD
fbraz3 Sep 8, 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
7 changes: 5 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ Checks: >
# Treat warnings as errors for CI/CD
WarningsAsErrors: false

# Header filter to include project headers
HeaderFilterRegex: '(Core|Generals|GeneralsMD|Dependencies)/.*\.(h|hpp)$'
# Header filter to include project headers.
# Match relative paths (Core/Foo.h, Core\Foo.h) and absolute ones (.../Core/Foo.h).
# Accept both / and \ so Windows diagnostics are not dropped.
HeaderFilterRegex: '(^|[/\\])(Core|GeneralsMD|Generals|Dependencies)[/\\].*\.(h|hpp)$'
ExcludeHeaderFilterRegex: '(^|[/\\])(MaxSDK|_deps)[/\\]'

# Check options for specific rules
CheckOptions:
Expand Down
55 changes: 55 additions & 0 deletions AI_POLICY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# AI Contribution Policy

Today, artificial intelligence (AI) tools are being deployed in many coding environments. In this policy, **AI-assisted** refers to the broader development workflow, including AI coding assistants, agentic development tools, and related services. **LLM-generated** refers specifically to content produced by the large language models (LLMs) used by many of these tools. Some of the "lower-end" features like keyword-driven code completion can be useful aids; other LLM-based tools make it very easy to generate contributions without the submitter fully understanding how the code works, or the consequences of specific implementation choices. These latter forms of AI assistance cause major overhead for project maintainers.

To protect the quality of the project and the sanity of our contributors, we have adopted the following policy regarding AI-generated content.

## 1. Accountability

**The human contributor is the sole party responsible for the contribution.**

If you submit a pull request that includes LLM-generated code, documentation, or comments:

- You must fully understand every line of code in the submission.
- You must be able to explain the "why" behind the implementation during the review process.
- You are responsible for verifying that the code is human-readable, maintainable and logically correct.
- All code needs to be tested and verified.

"The AI generated it and it works for me" is never an acceptable answer to a reviewer's question. You must write review responses yourself. AI tools may assist with translation, meaning-preserving edits, or formatting, but you must verify the final wording. If unsure of an answer, say so rather than presenting an AI tool's output as your own.

Autonomous AI agents may not submit pull requests, nor comments in other pull requests, issues or discussions.

## 2. Disclosure

If an LLM was used to generate a significant portion of your contribution, we require you to **disclose it** in the pull request description. You must clarify to what extent the generated content was polished by human intervention.

You must not use AI to create the pull request description itself (unless you’ve used it for translation) - as discussed above, we expect pull requests to be submitted by humans.

## 3. Intentionality

We do not accept pull requests and issues that result from running an AI tool over the codebase to find improvements without prior context or alignment with the project.

- **Focused changes:** Do not submit pull requests that perform broad refactoring or cleanup suggested by AI unless a maintainer specifically requests it.
- **Design First:** For any non-trivial change, we strongly recommend opening an **Issue** or **Discussion** first, or reach out to the **Discord**. Pull requests that arrive out of the blue with significant AI-generated logic that doesn't align with our roadmap or architecture will be closed.
- **Quality over Quantity:** We value one thoughtful, manually crafted pull request over ten AI-assisted fixes for nonexistent or trivial issues.

New contributors are discouraged from submitting pull requests with thousands of lines changed or added with the help of AI, because human code reviewers cannot attend such volumes at the risk of wasting precious time with potentially poor LLM-generated code.

## 4. Prohibited Uses

The following are strictly prohibited and will result in immediate closure of a pull request or issue and potentially a block from the organization:

- **Automated Pull Request Description:** Using AI to write the entire pull request description. The description the AI generates is often vague, overly elaborate, or fails to accurately describe the technical changes. We want to hear from *you* - the developer - why this change matters (see points 1 & 2).
- **Unvetted Boilerplate:** Submitting large blocks of LLM-generated boilerplate that haven't been trimmed to what's actually necessary. If you don't understand what the code does, don't submit the pull request.
- **Hallucinated Features:** Submitting pull requests for features or bug fixes that don't exist, based on AI hallucinations about the project's capabilities.

## 5. Enforcement

TheSuperHackers project maintainers reserve the right to close any pull request that appears to be a low-effort AI contribution, without providing a detailed technical critique. If a maintainer suspects you do not understand your pull request, it will be closed immediately.

Cases of repeated violations of these (or any of our other contributor guidelines) could result in a ban from our repositories.

### Acknowledgement

This policy was written by humans, based on the work in the [Mastodon AI Policy](https://github.com/mastodon/.github/blob/main/AI_POLICY.md), the [CloudNativePG AI Policy](https://github.com/cloudnative-pg/governance/blob/main/AI_POLICY.md), the [Ghostty AI Policy](https://github.com/ghostty-org/ghostty/blob/main/AI_POLICY.md), and the Linux Foundation's [Generative AI Policy](https://www.linuxfoundation.org/legal/generative-ai).

4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
endif()

# Define VCPKG feature before the project block
# since they need to be initialized before the toolchain is
include(cmake/config-vcpkg.cmake)

# Top level project, doesn't really affect anything.
project(genzh LANGUAGES C CXX)

Expand Down
3 changes: 1 addition & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT": "$<$<CONFIG:Release,Debug,RelWithDebInfo>:Embedded>",
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL",
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/triplets"
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
},
{
Expand Down
8 changes: 2 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ To contribute, fork this repository to create your own copy that you can clone l
Prefer opening fewer high quality Pull Requests over many low quality ones. Prioritize polishing existing Pull Requests instead of creating new ones. Do not open Pull Requests as draft unless there are specific requirements that justify it, because draft Pull Requests are generally not looked at and pollute the Pull Request section.


## AI code generation guidelines
## AI contribution policy

Creating changes with LLM generated code is generally allowed. The author is responsible for verifying that all generated code is human readable, maintainable and logically correct. Furthermore, all generated code needs to be tested and verified. The author is not allowed to outsource the polishing of the generated code to the human code reviewers. In a Pull Request, generated code needs to be announced as such and to what extent it was polished by human intervention.

### New code contributors and AI generated code

New contributors are discouraged from submitting Pull Requests with thousands of lines changed or added with the help of LLMs, because human code reviewers cannot attend such volumes at the risk of wasting precious time with potentially poorly generated code.
Ensure that you have read and understood the [AI Contribution Policy](AI_POLICY.md).


## Code guidelines
Expand Down
14 changes: 7 additions & 7 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ set(GAMEENGINE_SRC
Include/Common/XferLoad.h
Include/Common/XferSave.h
Include/GameClient/Anim2D.h
# Include/GameClient/AnimateWindowManager.h
Include/GameClient/AnimateWindowManager.h
# Include/GameClient/CampaignManager.h
Include/GameClient/ChallengeGenerals.h
Include/GameClient/ClientInstance.h
Expand Down Expand Up @@ -184,8 +184,8 @@ set(GAMEENGINE_SRC
Include/GameClient/GameText.h
Include/GameClient/GameWindow.h
Include/GameClient/GameWindowGlobal.h
# Include/GameClient/GameWindowID.h
# Include/GameClient/GameWindowManager.h
Include/GameClient/GameWindowID.h
Include/GameClient/GameWindowManager.h
Include/GameClient/GameWindowTransitions.h
Include/GameClient/GlobalLanguage.h
Include/GameClient/GraphDraw.h
Expand Down Expand Up @@ -711,7 +711,7 @@ set(GAMEENGINE_SRC
Source/GameClient/GameText.cpp
Source/GameClient/GlobalLanguage.cpp
Source/GameClient/GraphDraw.cpp
# Source/GameClient/GUI/AnimateWindowManager.cpp
Source/GameClient/GUI/AnimateWindowManager.cpp
Source/GameClient/GUI/ChallengeGenerals.cpp
Source/GameClient/GUI/ControlBar/ControlBar.cpp
Source/GameClient/GUI/ControlBar/ControlBarBeacon.cpp
Expand Down Expand Up @@ -741,10 +741,10 @@ set(GAMEENGINE_SRC
Source/GameClient/GUI/GameFont.cpp
Source/GameClient/GUI/GameWindow.cpp
Source/GameClient/GUI/GameWindowGlobal.cpp
# Source/GameClient/GUI/GameWindowManager.cpp
# Source/GameClient/GUI/GameWindowManagerScript.cpp
Source/GameClient/GUI/GameWindowManager.cpp
Source/GameClient/GUI/GameWindowManagerScript.cpp
Source/GameClient/GUI/GameWindowTransitions.cpp
# Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
Source/GameClient/GUI/GameWindowTransitionsStyles.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarCallback.cpp
Source/GameClient/GUI/GUICallbacks/ControlBarPopupDescription.cpp
Source/GameClient/GUI/GUICallbacks/Diplomacy.cpp
Expand Down
2 changes: 0 additions & 2 deletions Core/GameEngine/Include/Common/GameAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,6 @@ class AudioManager : public SubsystemInterface
// on zoom.
virtual void set3DVolumeAdjustment( Real volumeAdjustment );

virtual Bool has3DSensitiveStreamsPlaying() const = 0;

virtual void *getHandleForBink() = 0;
virtual void releaseHandleForBink() = 0;

Expand Down
17 changes: 9 additions & 8 deletions Core/GameEngine/Include/GameClient/ParticleSys.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ class ParticleSystemTemplate : public MemoryPoolObject, protected ParticleSystem

void validate();

AsciiString getName() const { return m_name; }
const AsciiString& getName() const { return m_name; }

// This function was made const because of update modules' module data being all const.
ParticleSystem *createSlaveSystem( Bool createSlaves = TRUE ) const ; ///< if returns non-null, it is a slave system for use
Expand Down Expand Up @@ -607,15 +607,16 @@ class ParticleSystem : public MemoryPoolObject,
void setInitialDelay( UnsignedInt delay ) { m_delayLeft = delay; }

const AsciiString& getParticleTypeName() const { return m_particleTypeName; } ///< return the name of the particles
const Bool isUsingDrawables() const { return m_particleType == DRAWABLE; }
const Bool isUsingStreak() const { return m_particleType == STREAK; }
const Bool isUsingSmudge() const { return m_particleType == SMUDGE; }
const Bool isUsingVolumeParticles() const { return m_particleType == VOLUME_PARTICLE; }
const UnsignedInt getVolumeParticleDepth() const { return m_volumeParticleDepth; }
Bool isUsingParticles() const { return m_particleType == PARTICLE; }
Bool isUsingDrawables() const { return m_particleType == DRAWABLE; }
Bool isUsingStreak() const { return m_particleType == STREAK; }
Bool isUsingSmudge() const { return m_particleType == SMUDGE; }
Bool isUsingVolumeParticles() const { return m_particleType == VOLUME_PARTICLE; }
UnsignedInt getVolumeParticleDepth() const { return m_volumeParticleDepth; }

Bool shouldBillboard() { return !m_isGroundAligned; }
Bool shouldBillboard() const { return !m_isGroundAligned; }

ParticleShaderType getShaderType() { return m_shaderType; }
ParticleShaderType getShaderType() const { return m_shaderType; }

void setSlave( ParticleSystem *slave ); ///< set a slave system for us
ParticleSystem *getSlave() { return m_slaveSystem; }
Expand Down
9 changes: 9 additions & 0 deletions Core/GameEngine/Include/GameClient/VideoPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ class VideoPlayerInterface : public SubsystemInterface
virtual const FieldParse *getFieldParse() const = 0; ///< Return the field parse info

virtual void notifyVideoPlayerOfNewProvider( Bool nowHasValid ) = 0; ///< Notify the video player that they can now ask for an audio handle, or they need to give theirs up.

virtual void setVolume( Real volume ) = 0; ///< Push a new speech volume to the video player's audio output
};


Expand Down Expand Up @@ -299,6 +301,13 @@ class VideoPlayer : public VideoPlayerInterface

};

class NullVideoPlayer : public VideoPlayer
{
public:

virtual void setVolume( Real ) override { }
};

extern VideoPlayerInterface *TheVideoPlayer;

//----------------------------------------------------------------------------
Expand Down
48 changes: 32 additions & 16 deletions Core/GameEngine/Source/Common/Audio/GameAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,12 @@ void AudioManager::setVolume( Real volume, AudioAffect whichToAffect )
m_scriptMusicVolume = volume;
}

m_musicVolume = m_scriptMusicVolume * m_systemMusicVolume;
const Real newVolume = m_scriptMusicVolume * m_systemMusicVolume;
if (m_musicVolume != newVolume)
{
m_musicVolume = newVolume;
m_volumeHasChanged = true;
}
}

if (whichToAffect & AudioAffect_Sound) {
Expand All @@ -718,7 +723,12 @@ void AudioManager::setVolume( Real volume, AudioAffect whichToAffect )
m_scriptSoundVolume = volume;
}

m_soundVolume = m_scriptSoundVolume * m_systemSoundVolume;
const Real newVolume = m_scriptSoundVolume * m_systemSoundVolume;
if (m_soundVolume != newVolume)
{
m_soundVolume = newVolume;
m_volumeHasChanged = true;
}
}

if (whichToAffect & AudioAffect_Sound3D) {
Expand All @@ -727,7 +737,13 @@ void AudioManager::setVolume( Real volume, AudioAffect whichToAffect )
} else {
m_scriptSound3DVolume = volume;
}
m_sound3DVolume = m_scriptSound3DVolume * m_systemSound3DVolume;

const Real newVolume = m_scriptSound3DVolume * m_systemSound3DVolume;
if (m_sound3DVolume != newVolume)
{
m_sound3DVolume = newVolume;
m_volumeHasChanged = true;
}
}

if (whichToAffect & AudioAffect_Speech) {
Expand All @@ -736,10 +752,14 @@ void AudioManager::setVolume( Real volume, AudioAffect whichToAffect )
} else {
m_scriptSpeechVolume = volume;
}
m_speechVolume = m_scriptSpeechVolume * m_systemSpeechVolume;
}

m_volumeHasChanged = true;
const Real newVolume = m_scriptSpeechVolume * m_systemSpeechVolume;
if (m_speechVolume != newVolume)
{
m_speechVolume = newVolume;
m_volumeHasChanged = true;
}
}
}

//-------------------------------------------------------------------------------------------------
Expand All @@ -760,17 +780,13 @@ Real AudioManager::getVolume( AudioAffect whichToGet )
//-------------------------------------------------------------------------------------------------
void AudioManager::set3DVolumeAdjustment( Real volumeAdjustment )
{
m_sound3DVolume = volumeAdjustment * m_scriptSound3DVolume * m_systemSound3DVolume;

// clamp
if (m_sound3DVolume < 0.0f)
m_sound3DVolume = 0.0f;
const Real newVolume = clamp(0.0f, volumeAdjustment * m_scriptSound3DVolume * m_systemSound3DVolume, 1.0f);

if (m_sound3DVolume > 1.0f)
m_sound3DVolume = 1.0f;

if ( ! has3DSensitiveStreamsPlaying() )
m_volumeHasChanged = TRUE;
if (m_sound3DVolume != newVolume)
{
m_sound3DVolume = newVolume;
m_volumeHasChanged = true;
}
}

//-------------------------------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion Core/GameEngine/Source/Common/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,10 @@ Int parseLoadSave(char *args[], int num)
TheWritableGlobalData->m_shellMapOn = FALSE;
TheWritableGlobalData->m_playIntro = FALSE;
TheWritableGlobalData->m_playSizzle = FALSE;

return 2;
}
return 2;
return 1;
}

//=============================================================================
Expand Down
2 changes: 1 addition & 1 deletion Core/GameEngine/Source/Common/ReplaySimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int ReplaySimulation::simulateReplaysInThisProcess(const std::vector<AsciiString
DWORD totalStartTimeMillis = GetTickCount();
for (size_t i = 0; i < filenames.size(); i++)
{
AsciiString filename = filenames[i];
const AsciiString &filename = filenames[i];
printf("Simulating Replay \"%s\"\n", filename.str());
fflush(stdout);
DWORD startTimeMillis = GetTickCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void ControlBar::populatePurchaseScience( Player* player )

setControlCommand( m_sciencePurchaseWindowsRank3[ i ], commandButton );
ScienceType st = SCIENCE_INVALID;
ScienceVec sv = commandButton->getScienceVec();
const ScienceVec &sv = commandButton->getScienceVec();
if (! sv.empty())
{
st = sv[ 0 ];
Expand Down
Loading
Loading