bugfix(gui): Convert MessageDelayMS to logic frames so the setting takes effect - #3133
Draft
bobtista wants to merge 2 commits into
Draft
bugfix(gui): Convert MessageDelayMS to logic frames so the setting takes effect#3133bobtista wants to merge 2 commits into
bobtista wants to merge 2 commits into
Conversation
…kes effect 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.
Fixes #3131.
InGameUI::updatecomputed the message timeout asm_messageDelayMS / LOGICFRAMES_PER_SECOND / 1000, dividing by both instead of converting milliseconds to logic frames. For positive values that reduces tofloor(MessageDelayMS / 30000), which is wrong by a factor of about 900 and has no practical effect at any realistic setting. The same function already does the conversion correctly for military subtitles atInGameUI.cpp:4434.Now converts through
ConvertDurationFromMsecsToFrames, rounding partial frames up as that helper documents, so the timeout is the configured delay expressed in logic frames.The game data has a matching error —
MessageDelayMS = 75000where 7500 was presumably intended — so that needs fixing in https://github.com/TheSuperHackers/GeneralsGamePatch2 when this lands, or the fade will be 75 seconds.Predicted total message lifetime at 30 render / 30 logic FPS, including the existing alpha drain:
Measured on MD_CHI01 with the shipped
MessageDelayMS = 75000, posting a message at logic frame 300 and logging the computed timeout and the message's age when it is removed:Verified in game by instrumenting the message alpha and setting the delay to 3400 ms, which converts to 103 logic frames. The message stayed at full alpha through age 100 and only began draining after the timeout:
Age 100 is the telling one: the existing fade amount becomes non-zero there, so on current
main(where the timeout evaluates to 2 frames) the message is already draining by then. Holding to 103 shows the configured delay is what gates the fade.Todo:
MessageDelayMSchange in GeneralsGamePatch2