bugfix(camera): Advance scripted camera moves by elapsed logic time - #3143
Draft
bobtista wants to merge 1 commit into
Draft
bugfix(camera): Advance scripted camera moves by elapsed logic time#3143bobtista wants to merge 1 commit into
bobtista wants to merge 1 commit into
Conversation
bobtista
force-pushed
the
bobtista/bugfix/scripted-camera-render-rate
branch
from
August 26, 2026 14:25
905681b to
f1acf6f
Compare
bobtista
force-pushed
the
bobtista/bugfix/scripted-camera-render-rate
branch
from
August 27, 2026 16:30
f1acf6f to
c9b6157
Compare
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 #3142.
rotateCamera,zoomCameraandpitchCameraconvert their authored duration into a count of 33.33 ms frames, then advance one step per render frame, so a scripted camera move completesrenderFps / logicFpstimes faster than the mission scripter intended. Network games hit this without any special setup, becauseFramePacer::getActualLogicTimeScaleFps()returnsTheNetwork->getFrameRate()and pins the logic rate near 30 while the render rate follows the player's limit.Now advances the three movements by the elapsed logic time instead of by one render frame, so they take the authored duration at any render frame rate.
curFramebecomes aRealand accumulatesmilliseconds / TheW3DFrameLengthInMsec, which leaves the easing, the hold frames, and the remaining-time maths used bySet Final Zoom/Set Final Pitchworking on the same quantities as before.Measured with a "1 rotation over 2.00 seconds" move, logic time scale pinned at 30 FPS, varying only the max render FPS:
This mirrors the fix already applied to the fourth scripted camera movement in the same file: #1451 converted
moveAlongWaypointPathto accumulate elapsed milliseconds fed byTheFramePacer->getLogicTimeStepMilliseconds(FramePacer::IgnoreFrozenTime), and rotate, zoom and pitch were left on the old frame-counting form. The call sites here now pass the same value.W3DViewlives inCore, so this covers both games.Also measured on a shipped campaign cutscene, the
MD_CHI02intro, which uses a waypoint pan and arotation along with a zoom and a pitch. Logic time scale pinned at 30, render at 125, comparing this
branch against its parent commit. The metric is how fast
curFrameadvances, which does not dependon how long the mission holds each shot:
Before the change all three advance at the render rate, so the rotation completes in 1.23s instead
of its authored 5.00s. After the change all three advance at the logic rate and the rotation takes
4.98s.
One note on where this is reachable. Every campaign intro I sampled sets its own frame rate cap
through the
SET_FPS_LIMITscript action, always below 30 (MD_USA0120,MD_GLA0124,MD_CHI0224,MD_CHI0325), so single player cutscenes render slower than the logic rate and donot show the fault. It shows up where the logic rate is pinned below the render rate, which is the
network case described above.
Todo: