tweak(gamemessage): Reduce number of MSG_DESTROY_SELECTED_GROUP messages#2668
Merged
xezon merged 7 commits intoJul 13, 2026
Merged
Conversation
|
| Filename | Overview |
|---|---|
| Generals/Code/GameEngine/Source/Common/MessageStream.cpp | Filters destroy-selection messages that are immediately replaced by a new selection operation. |
| GeneralsMD/Code/GameEngine/Source/Common/MessageStream.cpp | Mirrors the Generals message filtering behavior for Zero Hour. |
| Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp | Avoids emitting a destroy-selection message when no drawable was selected. |
| GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp | Mirrors the conditional deselection message behavior for Zero Hour. |
| Core/GameEngine/Source/GameClient/MessageStream/SelectionXlat.cpp | Updates selection paths to use the revised deselection behavior. |
Reviews (12): Last reviewed commit: "Replicated in Generals." | Re-trigger Greptile
xezon
reviewed
Apr 30, 2026
Caball009
commented
May 3, 2026
2a1e6c7 to
fcb6ef1
Compare
xezon
reviewed
May 7, 2026
xezon
left a comment
There was a problem hiding this comment.
How confident are we that this will cause no gameplay issues?
xezon
reviewed
May 8, 2026
xezon
reviewed
May 9, 2026
xezon
reviewed
May 10, 2026
8baab11 to
219fa73
Compare
xezon
reviewed
Jul 1, 2026
xezon
reviewed
Jul 2, 2026
Caball009
commented
Jul 8, 2026
40d5547 to
e4af41b
Compare
|
Needs rebasing. |
xezon
reviewed
Jul 8, 2026
e4af41b to
b642d9a
Compare
Author
I just rebased. I held off on rebasing because I wanted to make it obvious to you (and myself) what the new changes were. |
b642d9a to
78d3981
Compare
xezon
approved these changes
Jul 12, 2026
Author
|
Replicated in Generals. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The client considers primary mouse clicks in the game world as a deselection, and will also update the game logic. This means that
GameMessage::MSG_DESTROY_SELECTED_GROUPmessages are sent frequently, even if no objects are currently selected. There's actually an old EA comment on this issue. It's also unnecessary to send this message prior to the creation or selection of a new group.This PR makes the following two changes:
MSG_DESTROY_SELECTED_GROUPmessage.MSG_DESTROY_SELECTED_GROUPmessages before other messages that already destroy group selection implicitly (MSG_CREATE_SELECTED_GROUPandGameMessage::MSG_SELECT_TEAM).I've tested with two local clients in multiplayer (VS22 debug builds); one had this feature and one didn't, and everything worked fine.
See commits for cleaner diffs.
Results for Golden Replay 1:
MSG_NETWORK_MESSAGES: 56985MSG_LOGIC_CRC: 11601 (doesn't include 1785 for playback)MSG_DO_MOVETO: 6888MSG_AREA_SELECTION_DEPRECATED: 4476MSG_QUEUE_UNIT_CREATE: 2225MSG_DESTROY_SELECTED_GROUP: 17366MSG_CREATE_SELECTED_GROUP_NO_SOUND: 317, new group: 88MSG_CREATE_SELECTED_GROUP: 8299, new group: 8114MSG_DESTROY_SELECTED_GROUPbefore new group creation: 8901 (more than 8114 + 88, because this message is used twice sometimes).Just the
MSG_DESTROY_SELECTED_GROUPmessage before the creation of a new group accounts for 15% (8901 / 56985) of all network game messages in this replay. That doesn't even take into account how many times this message was used when no units were selected.TODO: