Skip to content

unify(common-rts): Move Common/RTS to Core - #3048

Open
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/common-rts
Open

unify(common-rts): Move Common/RTS to Core#3048
Jaredl-Dev wants to merge 1 commit into
TheSuperHackers:mainfrom
Jaredl-Dev:unify/common-rts

Conversation

@Jaredl-Dev

@Jaredl-Dev Jaredl-Dev commented Aug 2, 2026

Copy link
Copy Markdown

This moves the remaining shared low-risk Common RTS files into Core:

  • Handicap.h / Handicap.cpp
  • MissionStats.h / MissionStats.cpp
  • PlayerList.h / PlayerList.cpp
  • ResourceGatheringManager.h / ResourceGatheringManager.cpp
  • Science.h / Science.cpp
  • ScoreKeeper.h / ScoreKeeper.cpp

The moved files are code-identical between both games except for the product-name license banner. ResourceGatheringManager.cpp also corrects a comment spelling.

Verification

  • Verified all Core files byte-match their Zero Hour sources.
  • Win32 Release build succeeds.
  • VC6 Release build succeeds.

@Skyaero42

Copy link
Copy Markdown

ResourceGatheringManager.cpp needs to have a merge first (separate commit) before being merged.

@xezon

xezon commented Aug 2, 2026

Copy link
Copy Markdown

How about merge all the Common/RTS files first, then move them all?

@Jaredl-Dev

Copy link
Copy Markdown
Author

How about merge all the Common/RTS files first, then move them all?

I will revise this PR when I have the opportunity.

@Jaredl-Dev
Jaredl-Dev marked this pull request as draft August 3, 2026 17:23
@Jaredl-Dev Jaredl-Dev changed the title unify(common-rts): Move low-risk Common RTS files to Core unify(common-rts): Move Common/RTS to Core Aug 8, 2026
@Jaredl-Dev

Copy link
Copy Markdown
Author

How about merge all the Common/RTS files first, then move them all?

I’ve rebuilt this PR, and for now there’s only one commit. The first commit simply merges the files so that Generals and Zero Hour use the same code.

What I’m unsure about is whether I’ve implemented the CRC gating correctly, or if I’m even heading in the right direction with it. (I doubt it)

I’ve also put comments and dead code behind CRC gates to at least distinguish which source they came from. That should make a later cleanup easier, although I know that cleanup is out of scope for this PR.

I’ll do the actual unification commit and update the PR body once I get some direction on whether I’m heading in the right direction.

@Jaredl-Dev
Jaredl-Dev marked this pull request as ready for review August 8, 2026 03:26
/// Build a building near a supply dump with at least cash. Gets passed to aiPlayer.
void buildBySupplies(Int minimumCash, const AsciiString &thingName);

#if RTS_ZEROHOUR

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Definitely the wrong direction. Look at existing use cases of RTS_GENERALS and RTS_ZEROHOUR to understand when they are used.

Merging Zero Hour to Generals mostly needs considerations for INI/game data compatibility and CRC/Xfer compatibility. Maybe it helps to look at previous merges that did touch such areas. It is easy to make mistakes. I don't know whether LLM will make it slop. We did it by hand so far.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I may just stick to the easy files for now, because I'm not really confident in my ability to not get this wrong.

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.

3 participants