Skip to content

unify(create): Move Create modules to Core - #3206

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

unify(create): Move Create modules to Core#3206
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/create-modules

Conversation

@Jaredl-Dev

Copy link
Copy Markdown

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

  • CreateModule
  • PreorderCreate
  • SpecialPowerCreate
  • SupplyCenterCreate
  • SupplyWarehouseCreate
  • VeterancyGainCreate

The files are code-identical between both games. All 12 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 12 files match after normalizing the product-name banner.

@Jaredl-Dev
Jaredl-Dev force-pushed the unify/create-modules branch from 2457ff1 to 6a4c98f Compare August 26, 2026 03:03
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Centralize shared Create modules in Core

✨ Enhancement ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Centralizes six identical Create module pairs in the shared Core GameEngine.
• Rewires Generals and Zero Hour builds to consume the Core implementations.
• Records completed moves in the unification script for future consolidation work.
Diagram

graph TD
  G["Generals Build"] --> C["Core GameEngine"] --> M["Create Modules"]
  Z["Zero Hour Build"] --> C
Loading
High-Level Assessment

Moving byte-equivalent implementations into the existing Core GameEngine is the appropriate consolidation strategy. Keeping synchronized product copies or introducing wrappers would retain duplication without providing product-specific behavior, while the reported cross-product and legacy-toolchain builds reduce relocation risk.

Files changed (16) +49 / -36

Refactor (12) +0 / -0
CreateModule.hAdd shared Create module base declarations +0/-0

Add shared Create module base declarations

• Relocates the common CreateModule interface, data type, lifecycle guard, and BehaviorModule integration into Core without behavioral changes.

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

PreorderCreate.hAdd shared preorder creation declarations +0/-0

Add shared preorder creation declarations

• Relocates the PreorderCreate module declaration into Core for reuse by both game variants.

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

SpecialPowerCreate.hAdd shared special-power creation declarations +0/-0

Add shared special-power creation declarations

• Relocates the SpecialPowerCreate lifecycle module declaration into the shared GameEngine include tree.

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

SupplyCenterCreate.hAdd shared supply-center creation declarations +0/-0

Add shared supply-center creation declarations

• Relocates the SupplyCenterCreate declaration into Core, preserving its build-completion callback contract.

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

SupplyWarehouseCreate.hAdd shared supply-warehouse creation declarations +0/-0

Add shared supply-warehouse creation declarations

• Relocates the SupplyWarehouseCreate declaration into Core for common resource-manager registration behavior.

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

VeterancyGainCreate.hAdd shared veterancy creation declarations +0/-0

Add shared veterancy creation declarations

• Relocates veterancy configuration data and the VeterancyGainCreate declaration into Core.

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

CreateModule.cppAdd shared Create module base implementation +0/-0

Add shared Create module base implementation

• Relocates CreateModule construction, serialization, CRC, and post-load behavior into Core unchanged.

Core/GameEngine/Source/GameLogic/Object/Create/CreateModule.cpp

PreorderCreate.cppAdd shared preorder creation behavior +0/-0

Add shared preorder creation behavior

• Relocates the behavior that applies the preorder model condition when construction completes.

Core/GameEngine/Source/GameLogic/Object/Create/PreorderCreate.cpp

SpecialPowerCreate.cppAdd shared special-power initialization behavior +0/-0

Add shared special-power initialization behavior

• Relocates the build-completion behavior that initializes an object's special-power modules exactly once.

Core/GameEngine/Source/GameLogic/Object/Create/SpecialPowerCreate.cpp

SupplyCenterCreate.cppAdd shared supply-center registration behavior +0/-0

Add shared supply-center registration behavior

• Relocates the behavior that registers completed supply centers with every player's resource manager.

Core/GameEngine/Source/GameLogic/Object/Create/SupplyCenterCreate.cpp

SupplyWarehouseCreate.cppAdd shared supply-warehouse registration behavior +0/-0

Add shared supply-warehouse registration behavior

• Relocates creation-time registration of supply warehouses with player resource managers.

Core/GameEngine/Source/GameLogic/Object/Create/SupplyWarehouseCreate.cpp

VeterancyGainCreate.cppAdd shared initial-veterancy behavior +0/-0

Add shared initial-veterancy behavior

• Relocates INI parsing and creation-time veterancy assignment based on required player science.

Core/GameEngine/Source/GameLogic/Object/Create/VeterancyGainCreate.cpp

Other (4) +49 / -36
CMakeLists.txtCompile shared Create modules in Core +12/-12

Compile shared Create modules in Core

• Enables six Create module headers and source files in the Core GameEngine target so both products can consume one implementation.

Core/GameEngine/CMakeLists.txt

CMakeLists.txtUse Core Create modules in Generals +12/-12

Use Core Create modules in Generals

• Disables the twelve product-local Create module entries so the Generals target resolves the shared Core implementations instead.

Generals/Code/GameEngine/CMakeLists.txt

CMakeLists.txtUse Core Create modules in Zero Hour +12/-12

Use Core Create modules in Zero Hour

• Disables the twelve product-local Create module entries so the Zero Hour target uses the shared Core implementations.

GeneralsMD/Code/GameEngine/CMakeLists.txt

unify_move_files.pyRecord completed Create module moves +13/-0

Record completed Create module moves

• Adds commented unification commands documenting the twelve header and source moves from Zero Hour into Core.

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