unify(map): Merge and move GameLogic map headers and implementations to Core - #3189
unify(map): Merge and move GameLogic map headers and implementations to Core#3189OmarAglan wants to merge 2 commits into
Conversation
PR Summary by QodoUnify map: merge GameLogic map implementations
AI Description
Diagram
High-Level Assessment
Files changed (6)
|
Code Review by Qodo
1. Retail parser reads v2 dictionaries
|
59b40a9 to
21a5be6
Compare
|
You missed the other instances of |
|
/agentic_review |
ok, this is bad, well im working on it, maybe im still lacking, well get them all. |
|
Code review by qodo was updated up to the latest commit 21a5be6 |
21a5be6 to
82d9f62
Compare
i think i chnaged them all, hope so. |
|
You should try to minimize these guards, only add as needed. Consider when it may affect the CRC and when it doesn’t. For example deleting polygon triggers you would expect impacts CRC, but adding a function or class member or define generally doesn’t. |
One of the finer nuances here that determines if it affects the CRC is how the data is handled for the CRC. There are some instances where a whole object get's CRC'ed instead of its portion of the CRC being generated from the objects specific CRC function. But what you mentioned is true as long as the above is not a problem. |
well, yes that make sense, will look into it, but how can i test if my chnage will impact CRC, like replays or something, a general question? |
There is no standardized vgenerals replay testing right now but you could create a new replay in a map that has polygon triggers (or add them yourself, and make sure the trigger affects the game somehow) with AI's and then replay check them with |
82d9f62 to
7177417
Compare
|
updated and cleaned up the merge, it now has less guards, and now the behavior is:
ready for review |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 7177417 |
|
Note that "merge with rebase" is the same as "squash merge" when you only have one commit. Perhaps close #3190 and put the move in here? Right now it's also confusing for people to review because of the depends on |
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Source/GameLogic/Map/PolygonTrigger.cpp | Adds target-conditioned trigger validation and map-format serialization while moving the implementation into Core. |
| Core/GameEngine/Source/GameLogic/Map/SidesList.cpp | Moves the shared side and player-data implementation into Core without a substantive content change. |
| Core/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp | Moves the terrain implementation into Core while retaining the existing crater functionality. |
| Core/GameEngine/CMakeLists.txt | Enables the consolidated map headers and implementations in the shared GameEngine source set. |
| Generals/Code/GameEngine/CMakeLists.txt | Removes the now-shared map files from the Generals-local source set. |
| GeneralsMD/Code/GameEngine/CMakeLists.txt | Removes the now-shared map files from the Zero Hour-local source set. |
| scripts/cpp/unify_move_files.py | Records the completed map-file unification operations as inactive script entries. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
C[Core GameEngine map sources] --> G[Generals GameEngine]
C --> Z[Zero Hour GameEngine]
G --> D{Retail-compatible data?}
D -->|Yes| V3[Write PolygonTriggers v3]
D -->|No| V4[Write PolygonTriggers v4]
Z --> V4
Reviews (11): Last reviewed commit: "unify(map): Move GameLogic map headers a..." | Re-trigger Greptile
75e2c2c to
2ca07b0
Compare
2927607 to
06043e6
Compare
06043e6 to
ce08503
Compare
|
what is left for this pr to be merged? |
ce08503 to
55934be
Compare
|
Added RETAIL_COMPATIBLE_DATA and used it for the PolygonTrigger output version and layer fields. I kept malformed trigger removal under RETAIL_COMPATIBLE_CRC because it changes the loaded game state, while the reader remains version driven guard. |
55934be to
b842115
Compare
b842115 to
6547d97
Compare
| @@ -177,6 +186,14 @@ Bool PolygonTrigger::ParsePolygonTriggersDataChunk(DataChunkInput &file, DataChu | |||
| loc.z = file.readInt(); | |||
| pTrig->addPoint(loc); | |||
| } | |||
| #if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC) | |||
There was a problem hiding this comment.
Does the Polygon Trigger do anything if it is a single point? How will it change the CRC then?
There was a problem hiding this comment.
well for my understanding that a single point trigger cannot contain a point through pointInTrigger(), sript and AI paths such as attack and guard area actions and the supplies within perimeter condition use a trigger’s center and radius.
i suspect that deleting the trigger changes those lookups from a valid trigger to nullptr (Could be wrong, but this is probably the case here) so script or AI behavior can diverge and indirectly change the game CRC.
I think this is why retail Generals keeps its original load behavior here.
There was a problem hiding this comment.
Can you verify that CRC mismatches when this is added or removed?
There was a problem hiding this comment.
i will try, and will share the finding here!
There was a problem hiding this comment.
Can you verify that CRC mismatches when this is added or removed?
after some testing, it didnt trigger a CRC mismatches, but im not 100% percent sure of that, i would like to keep it, what do you think?
There was a problem hiding this comment.
Yes it does look a bit risky, but if this is provably not CRC relevant, then it would be nice to not classify it as such. Maybe someone else has an additional opinion on that.
6547d97 to
9190d17
Compare
|
i suppose this now can be merged, let me know if there is anything i missed! |
| * | ||
| */ | ||
| #define K_PLAYERS_NAMES_FOR_SCRIPTS_VERSION_1 1 | ||
| #define K_PLAYERS_NAMES_FOR_SCRIPTS_VERSION_2 2 |
|
This change can be finalized. |
9190d17 to
d0148eb
Compare
Merge with Rebase
This merges and moves
MapReaderWriterInfo.h,PolygonTrigger,SidesList, andTerrainLogictogether with their matching headers.Target conditions preserve retail compatibility while sharing isolated Zero Hour improvements that do not affect the Generals CRC path:
Testing
git diff --check