Skip to content

tweak(gui): Move animated GUI window smoothly at higher than 30 frames per second - #3061

Merged
xezon merged 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/tweak/smooth-window-move-animation
Aug 12, 2026
Merged

tweak(gui): Move animated GUI window smoothly at higher than 30 frames per second#3061
xezon merged 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/tweak/smooth-window-move-animation

Conversation

@bobtista

@bobtista bobtista commented Aug 5, 2026

Copy link
Copy Markdown

#2833 decoupled GUI window-move animations from the render frame rate, but
AnimateWindowManager still accumulates fractional base-rate time and advances the
animations only in whole steps. Window positions therefore change about 30 times per
second even when the game renders faster.

Now the manager passes fractional base-frame deltas to the movement processors, animated
positions keep subpixel precision, and coordinates are rounded only when applied to a
GameWindow. The subpixel precision is required because velocity clamps to
1 pixel per base frame near the rest position, which is 0.25 pixel per render frame at
120 fps and truncates to no movement at all with the previous integer position. Velocity
ratios are adjusted for the fractional delta with powf, which keeps the duration
approximately constant across frame rates rather than exactly equal, since the position
is still integrated once per render frame.

Every completion path now applies its terminal position. SlideFromRight, SlideFromLeft
and SlideFromRightFast marked the animation finished without ever writing the end
position, leaving the window short of its rest position by up to one update of travel.

On the in-game control bar, movement increased from 24 position updates in 744 ms at
30 fps to 85 updates in 736 ms at 120 fps.

ProcessAnimateWindow.cpp is shared Core code compiled into both games, so the Generals
manager and header change with it.

This only affects client-side GUI state and does not touch game logic, replays, or CRC
calculations.

Todo:

  • Measure the Zero Hour control-bar animation at 30 and 120 render fps
  • [s] Replicate to generals

@bobtista bobtista self-assigned this Aug 5, 2026
@bobtista bobtista added the Enhancement Is new feature or request label Aug 5, 2026

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Makes sense.

Was this already tested in game?

Comment thread Core/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp Outdated
Comment thread Core/GameEngine/Include/GameClient/ProcessAnimateWindow.h Outdated
Comment thread Core/GameEngine/Source/GameClient/GUI/ProcessAnimateWindow.cpp Outdated
@xezon xezon added GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker labels Aug 8, 2026
@xezon xezon added this to the Decouple logic and rendering milestone Aug 8, 2026
@bobtista
bobtista force-pushed the bobtista/tweak/smooth-window-move-animation branch from abd53de to fac6a74 Compare August 8, 2026 18:37

@xezon xezon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested and looked good.

@xezon xezon changed the title tweak(gui): Animate GUI window moves fluently on high render frame rates tweak(gui): Move animated GUI window smoothly at higher than 30 frames per second Aug 12, 2026
@xezon
xezon merged commit d17c18f into TheSuperHackers:main Aug 12, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request GUI For graphical user interface Minor Severity: Minor < Major < Critical < Blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants