Skip to content

unify(upgrade): Move Upgrade modules to Core - #3204

Draft
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/upgrade-modules
Draft

unify(upgrade): Move Upgrade modules to Core#3204
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/upgrade-modules

Conversation

@Jaredl-Dev

Copy link
Copy Markdown

This moves thirteen Upgrade module header/source pairs shared by Generals and Zero Hour into Core:

  • ActiveShroudUpgrade
  • CostModifierUpgrade
  • ExperienceScalarUpgrade
  • LocomotorSetUpgrade
  • MaxHealthUpgrade
  • ObjectCreationUpgrade
  • PowerPlantUpgrade
  • RadarUpgrade
  • StatusBitsUpgrade
  • SubObjectsUpgrade
  • UnpauseSpecialPowerUpgrade
  • WeaponBonusUpgrade
  • WeaponSetUpgrade

The files are code-identical between both games. All 26 files differ only in the product-name banner inside the opening license comment.

Validation

  • Win32 Release builds succeed for both Generals and Zero Hour.
  • VC6 Release builds succeed for both Generals and Zero Hour.
  • Verified all 26 files match after normalizing the product-name banner.

@Jaredl-Dev
Jaredl-Dev force-pushed the unify/upgrade-modules branch from 0abee15 to 5876f52 Compare August 26, 2026 02:25
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Centralize shared upgrade modules in Core

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Centralizes thirteen identical upgrade module pairs in Core for both game variants.
• Rewires CMake source ownership while preserving existing upgrade behavior.
• Records reproducible unification commands for future maintenance.
Diagram

graph TD
  S["Core Source List"] --> U["Shared Upgrades"]
  U --> G["Generals Build"]
  U --> Z["Zero Hour Build"]
Loading
High-Level Assessment

Centralizing byte-equivalent cross-product modules in Core is the appropriate approach. Keeping synchronized product-local copies would preserve unnecessary duplication and divergence risk, while introducing wrappers or generated copies would add indirection without supporting any current product-specific behavior.

Files changed (30) +105 / -78

Refactor (26) +0 / -0
ActiveShroudUpgrade.hCentralize active shroud upgrade declarations +0/-0

Centralize active shroud upgrade declarations

• Adds the shared ActiveShroudUpgrade module and configuration declarations to Core without changing its public behavior.

Core/GameEngine/Include/GameLogic/Module/ActiveShroudUpgrade.h

CostModifierUpgrade.hCentralize cost modifier upgrade declarations +0/-0

Centralize cost modifier upgrade declarations

• Adds the shared CostModifierUpgrade data and lifecycle declarations to Core.

Core/GameEngine/Include/GameLogic/Module/CostModifierUpgrade.h

ExperienceScalarUpgrade.hCentralize experience scalar upgrade declarations +0/-0

Centralize experience scalar upgrade declarations

• Adds the shared experience-scaling upgrade declarations and parsed module data to Core.

Core/GameEngine/Include/GameLogic/Module/ExperienceScalarUpgrade.h

LocomotorSetUpgrade.hCentralize locomotor set upgrade declarations +0/-0

Centralize locomotor set upgrade declarations

• Adds the shared LocomotorSetUpgrade module declaration to Core.

Core/GameEngine/Include/GameLogic/Module/LocomotorSetUpgrade.h

MaxHealthUpgrade.hCentralize maximum health upgrade declarations +0/-0

Centralize maximum health upgrade declarations

• Adds the shared MaxHealthUpgrade declarations and health-change configuration to Core.

Core/GameEngine/Include/GameLogic/Module/MaxHealthUpgrade.h

ObjectCreationUpgrade.hCentralize object creation upgrade declarations +0/-0

Centralize object creation upgrade declarations

• Adds the shared ObjectCreationUpgrade declarations and object-creation-list configuration to Core.

Core/GameEngine/Include/GameLogic/Module/ObjectCreationUpgrade.h

PowerPlantUpgrade.hCentralize power plant upgrade declarations +0/-0

Centralize power plant upgrade declarations

• Adds the shared PowerPlantUpgrade lifecycle and execution declarations to Core.

Core/GameEngine/Include/GameLogic/Module/PowerPlantUpgrade.h

RadarUpgrade.hCentralize radar upgrade declarations +0/-0

Centralize radar upgrade declarations

• Adds the shared RadarUpgrade declarations, including disable-proof configuration and ownership hooks, to Core.

Core/GameEngine/Include/GameLogic/Module/RadarUpgrade.h

StatusBitsUpgrade.hCentralize status bits upgrade declarations +0/-0

Centralize status bits upgrade declarations

• Adds the shared StatusBitsUpgrade declarations and status-mask configuration to Core.

Core/GameEngine/Include/GameLogic/Module/StatusBitsUpgrade.h

SubObjectsUpgrade.hCentralize subobject upgrade declarations +0/-0

Centralize subobject upgrade declarations

• Adds the shared SubObjectsUpgrade declarations and show/hide name lists to Core.

Core/GameEngine/Include/GameLogic/Module/SubObjectsUpgrade.h

UnpauseSpecialPowerUpgrade.hCentralize special power upgrade declarations +0/-0

Centralize special power upgrade declarations

• Adds the shared UnpauseSpecialPowerUpgrade declarations and special-power template configuration to Core.

Core/GameEngine/Include/GameLogic/Module/UnpauseSpecialPowerUpgrade.h

WeaponBonusUpgrade.hCentralize weapon bonus upgrade declarations +0/-0

Centralize weapon bonus upgrade declarations

• Adds the shared WeaponBonusUpgrade module declaration to Core.

Core/GameEngine/Include/GameLogic/Module/WeaponBonusUpgrade.h

WeaponSetUpgrade.hCentralize weapon set upgrade declarations +0/-0

Centralize weapon set upgrade declarations

• Adds the shared WeaponSetUpgrade module declaration to Core.

Core/GameEngine/Include/GameLogic/Module/WeaponSetUpgrade.h

ActiveShroudUpgrade.cppCentralize active shroud upgrade implementation +0/-0

Centralize active shroud upgrade implementation

• Moves the unchanged shroud-range update, persistence, and load handling into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/ActiveShroudUpgrade.cpp

CostModifierUpgrade.cppCentralize cost modifier upgrade implementation +0/-0

Centralize cost modifier upgrade implementation

• Moves unchanged production-cost adjustment and ownership lifecycle behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/CostModifierUpgrade.cpp

ExperienceScalarUpgrade.cppCentralize experience scalar upgrade implementation +0/-0

Centralize experience scalar upgrade implementation

• Moves unchanged experience-tracker scalar adjustment and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/ExperienceScalarUpgrade.cpp

LocomotorSetUpgrade.cppCentralize locomotor set upgrade implementation +0/-0

Centralize locomotor set upgrade implementation

• Moves unchanged AI locomotor upgrade activation and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/LocomotorSetUpgrade.cpp

MaxHealthUpgrade.cppCentralize maximum health upgrade implementation +0/-0

Centralize maximum health upgrade implementation

• Moves unchanged body maximum-health adjustment and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/MaxHealthUpgrade.cpp

ObjectCreationUpgrade.cppCentralize object creation upgrade implementation +0/-0

Centralize object creation upgrade implementation

• Moves unchanged object-creation-list spawning and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/ObjectCreationUpgrade.cpp

PowerPlantUpgrade.cppCentralize power plant upgrade implementation +0/-0

Centralize power plant upgrade implementation

• Moves unchanged power bonus, capture, visual rod, and load restoration behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/PowerPlantUpgrade.cpp

RadarUpgrade.cppCentralize radar upgrade implementation +0/-0

Centralize radar upgrade implementation

• Moves unchanged radar ownership, disable-proof handling, extension animation, and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/RadarUpgrade.cpp

StatusBitsUpgrade.cppCentralize status bits upgrade implementation +0/-0

Centralize status bits upgrade implementation

• Moves unchanged object status setting, clearing, and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/StatusBitsUpgrade.cpp

SubObjectsUpgrade.cppCentralize subobject upgrade implementation +0/-0

Centralize subobject upgrade implementation

• Moves unchanged conflict checks, drawable subobject visibility changes, and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/SubObjectsUpgrade.cpp

UnpauseSpecialPowerUpgrade.cppCentralize special power upgrade implementation +0/-0

Centralize special power upgrade implementation

• Moves unchanged matching special-power countdown activation and readiness handling into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/UnpauseSpecialPowerUpgrade.cpp

WeaponBonusUpgrade.cppCentralize weapon bonus upgrade implementation +0/-0

Centralize weapon bonus upgrade implementation

• Moves unchanged player-upgrade weapon bonus condition activation and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/WeaponBonusUpgrade.cpp

WeaponSetUpgrade.cppCentralize weapon set upgrade implementation +0/-0

Centralize weapon set upgrade implementation

• Moves unchanged player-upgrade weapon-set flag activation and persistence behavior into Core.

Core/GameEngine/Source/GameLogic/Object/Upgrade/WeaponSetUpgrade.cpp

Other (4) +105 / -78
CMakeLists.txtCompile shared upgrade modules from Core +26/-26

Compile shared upgrade modules from Core

• Activates all thirteen shared upgrade headers and implementations in the Core GameEngine source list, transferring build ownership from the product trees.

Core/GameEngine/CMakeLists.txt

CMakeLists.txtConsume Core upgrade modules in Generals +26/-26

Consume Core upgrade modules in Generals

• Disables the thirteen product-local header/source entries so Generals uses the implementations now compiled by Core.

Generals/Code/GameEngine/CMakeLists.txt

CMakeLists.txtConsume Core upgrade modules in Zero Hour +26/-26

Consume Core upgrade modules in Zero Hour

• Disables the thirteen product-local header/source entries so Zero Hour uses the implementations now compiled by Core.

GeneralsMD/Code/GameEngine/CMakeLists.txt

unify_move_files.pyRecord upgrade module unification commands +27/-0

Record upgrade module unification commands

• Adds commented unification calls for all thirteen header/source pairs, preserving the migration recipe for future reuse or auditing.

scripts/cpp/unify_move_files.py

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@Jaredl-Dev
Jaredl-Dev marked this pull request as draft August 26, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant