refactor: Split preserve retail behavior flags#2691
refactor: Split preserve retail behavior flags#2691Stubbjax wants to merge 6 commits intoTheSuperHackers:mainfrom
Conversation
|
| Filename | Overview |
|---|---|
| Core/GameEngine/Include/Common/GameDefines.h | Core change: replaces PRESERVE_RETAIL_BEHAVIOR with 13 specific PRESERVE_* flags and adds ALLOW_MONEY_PER_MINUTE_FOR_PLAYER; PRESERVE_OCCUPANT_DETECTION_VIA_DRAG_SELECTION is now present but placed out of alphabetical order relative to the other flags |
| Core/GameEngine/Source/GameClient/SelectionInfo.cpp | Replaces PRESERVE_RETAIL_BEHAVIOR with PRESERVE_OCCUPANT_DETECTION_VIA_DRAG_SELECTION at both usage sites; macro is now defined in GameDefines.h |
| Generals/Code/GameEngine/Include/Common/TunnelTracker.h | Swaps PRESERVE_RETAIL_BEHAVIOR for PRESERVE_TUNNEL_HEAL_STACKING in header-conditional method signature; correct replacement |
| Generals/Code/GameEngine/Source/Common/GlobalData.cpp | Replaces !PRESERVE_RETAIL_BEHAVIOR guard with ALLOW_MONEY_PER_MINUTE_FOR_PLAYER (both default to disabled); semantic behavior preserved |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/UndeadBody.cpp | Replaces PRESERVE_RETAIL_BEHAVIOR with PRESERVE_PREMATURE_BATTLE_BUS_DEATH for Battle Bus lethal damage condition; correct replacement |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/StealthUpdate.cpp | Replaces PRESERVE_RETAIL_BEHAVIOR with PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR in stealth-during-healing guard; no equivalent change needed in Generals version |
| GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | Replaces PRESERVE_RETAIL_BEHAVIOR with PRESERVE_UNRELIABLE_FIRESTORMS at both sites for trimOldHistoricDamage and processHistoricDamage; correct replacement |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[PRESERVE_RETAIL_BEHAVIOR] -->|split into| B[PRESERVE_BUILDING_RESUMPTION_DELAY default: 0]
A -->|split into| C[PRESERVE_CHINOOK_PASSENGER_DUMPING default: 1]
A -->|split into| D[PRESERVE_HARDCODED_BLACK_LOTUS_CASH_HACK default: 1]
A -->|split into| E[PRESERVE_MULTI_CRATE_PICKUP default: 0]
A -->|split into| F[PRESERVE_NO_XP_FROM_FLAME_KILLS default: 0]
A -->|split into| G[PRESERVE_NO_XP_FROM_OCL_KILLS default: 1]
A -->|split into| H[PRESERVE_NO_XP_FROM_POISON_KILLS default: 1]
A -->|split into| I[PRESERVE_OCCUPANT_DETECTION_VIA_DRAG_SELECTION default: 1]
A -->|split into| J[PRESERVE_PERPETUAL_HORDE_BONUS default: 1]
A -->|split into| K[PRESERVE_PREMATURE_BATTLE_BUS_DEATH default: 1]
A -->|split into| L[PRESERVE_RADAR_WARNING_SUPPRESSION default: 1]
A -->|split into| M[PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR default: 0]
A -->|split into| N[PRESERVE_TUNNEL_HEAL_STACKING default: 1]
A -->|split into| O[PRESERVE_UNRELIABLE_FIRESTORMS default: 0]
P[!PRESERVE_RETAIL_BEHAVIOR] -->|renamed| Q[ALLOW_MONEY_PER_MINUTE_FOR_PLAYER default: 0]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
Core/GameEngine/Include/Common/GameDefines.h:74-80
All other flags in this block are defined in alphabetical order, but `PRESERVE_OCCUPANT_DETECTION_VIA_DRAG_SELECTION` (O) is placed after `PRESERVE_UNRELIABLE_FIRESTORMS` (U). It should sit between `PRESERVE_NO_XP_FROM_POISON_KILLS` and `PRESERVE_PERPETUAL_HORDE_BONUS` to maintain the established ordering.
```suggestion
#ifndef PRESERVE_OCCUPANT_DETECTION_VIA_DRAG_SELECTION
#define PRESERVE_OCCUPANT_DETECTION_VIA_DRAG_SELECTION (1)
#endif
#ifndef PRESERVE_UNRELIABLE_FIRESTORMS
#define PRESERVE_UNRELIABLE_FIRESTORMS (0) // The fix for this unfavorable behavior was approved by the Game Design Committee.
#endif
```
Reviews (3): Last reviewed commit: "docs: Add comments" | Re-trigger Greptile
|
I think it would be better to split these defines out into their own file of GameplayFixDefines or something similar But keep preserve retail behaviour as an encompassing switch. |
| #endif | ||
|
|
||
| #ifndef PRESERVE_UNRELIABLE_FIRESTORMS | ||
| #define PRESERVE_UNRELIABLE_FIRESTORMS (1) |
There was a problem hiding this comment.
Maybe set those to 0 that where already approved by the Committee?
How useful do you think a master flag would be? Does it outweigh the additional maintenance burden? |
| #endif | ||
|
|
||
| #ifndef PRESERVE_UNRELIABLE_FIRESTORMS | ||
| #define PRESERVE_UNRELIABLE_FIRESTORMS (0) |
There was a problem hiding this comment.
I suggest also add comments that these are approved by Committee, to understand why they are default 0 while others are still 1.
There was a problem hiding this comment.
How should that look? A // TheSuperHackers @info Approved by the Design Committee. comment at the end of each (0)?
There was a problem hiding this comment.
Maybe
// Fix for this unfavourable behavior was approved by the Game Design Committee
TheSuperHackers @info is not necessary because the file is ours.
|
I think after this change, we need to discuss what the workflow would be for controversial features or bug fixes that alter retail behaviour. Do we keep the default as what the author and reviewer think is correct? Or keep the original retail experience as default? Or wait for committee decision and input and implement that as the default? The cons of the first and third options are that balance changes a lot, has many talks, takes time and many people will disagree. Over time. This repo was for building the game, not publishing and shipping it. I think it is better to keep the retail behaviour as the default. And let the publishers decide what to enable or not, and whether to follow the committee. This will be helpful too for modders who prefer the retail experience for their mods. |
|
Much more fun to write it this way: This _MSC_VER Macro is very powerful, it symbolizes a specific match, one frozen in time. None may touch this. :) We have the long rumored Retail 1.0 someday. With this Macro style spread across the codebase we might even get to play with the classic Fork with he new tools as well. Like Tracy/SDL3 getting in nowadays. |
This change splits the
PRESERVE_RETAIL_BEHAVIORflag into a separate, dedicated flag for each fix. This allows publishers to more easily toggle controversial fixes without having to manually look through the code and figure out how particular fixes work or are implemented.