Skip to content

tweak(camera): Use logic time for scripted camera movement - #3143

Draft
bobtista wants to merge 4 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/scripted-camera-render-rate
Draft

bobtista wants to merge 4 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/scripted-camera-render-rate

Conversation

@bobtista

@bobtista bobtista commented Aug 14, 2026 •

Copy link
Copy Markdown

Fixes #3142.

Scripted rotation, zoom and pitch advance once per render frame, so they run too fast when rendering outpaces game logic. This is reachable in network games, where the logic rate is set by the network while rendering follows the player's limit.

Now they use the same logic-time step as waypoint camera movement from #1451, keeping fractional progress in W3D-frame units. Rotation also applies its final time multiplier before any tracking hold begins. This covers both games through Core. It fixes the high-FPS speedup; low-FPS timing and duration rounding are unchanged.

To reproduce:

  1. Script one camera rotation over two seconds, without the Freeze Time modifier.
  2. Set max render FPS to 60, then pin logic time scale to 30.
  3. Trigger the rotation at 60 and 120 render FPS. Before this change it speeds up as render FPS increases.

Measurements from the original timing change, with logic pinned at 30 FPS:

max render FPS before after
30 1960 ms 1967 ms
60 986 ms 1987 ms
120 525 ms 2000 ms

The MD_CHI02 intro mixes a waypoint pan with rotation, zoom and pitch. With logic pinned at 30 and the render limit overridden to 125, measured frame progress was:

movement authored expected before after
rotate 5.00s 30.0 /s 120.0 /s 30.0 /s
zoom 10.00s 30.0 /s 120.0 /s 30.0 /s
pitch 10.00s 30.0 /s 120.0 /s 30.0 /s

The rotation took 1.23s before and 4.98s after. This used an overridden cap: the sampled campaign intros set their own caps below 30 and do not normally show the high-FPS speedup.

The endpoint follow-up was checked separately with an isolated C++98 harness using the camera update functions and easing implementation. It covers fractional steps, tracking holds, easing, disabled movement, and zoom/pitch endpoints. The in-game timings above were not rerun for that follow-up.

Related: #2909, an earlier closed approach using whole-frame accumulators.

Note

Use elapsed logic time for scripted camera rotation, pitch, and zoom

  • Changes scripted camera rotation, pitch, and zoom in W3DView to advance by elapsed logic-time milliseconds instead of one integer frame per call.
  • Progress fields in TRotateCameraInfo, TPitchCameraInfo, and TZoomCameraInfo (W3DView.h) are now real-valued, so movement can progress by fractional frames.
  • W3DView::updateCameraMovements reads the ignored-frozen-time logic timestep once and passes it to all scripted movement helpers, including waypoint-path movement.
  • Tracked rotations recalculate the target angle on each update before completion handling, and the ending time multiplier applies when rotation progress reaches the duration.
  • Behavioral Change: scripted camera speeds now depend on the logic timestep rather than call frequency; check rotateCameraOneFrame, zoomCameraOneFrame, and pitchCameraOneFrame in W3DView.cpp if any scripted camera moves look faster or slower.

Macroscope summarized dd63380.

@bobtista bobtista self-assigned this Aug 14, 2026
@bobtista bobtista added Bug Something is not working right, typically is user facing Rendering Is Rendering related labels Aug 14, 2026
@bobtista
bobtista force-pushed the bobtista/bugfix/scripted-camera-render-rate branch 2 times, most recently from f1acf6f to c9b6157 Compare August 27, 2026 16:30
@bobtista
bobtista force-pushed the bobtista/bugfix/scripted-camera-render-rate branch from c9b6157 to 6f5adf3 Compare September 14, 2026 21:07
@bobtista bobtista changed the title bugfix(camera): Advance scripted camera moves by elapsed logic time bugfix(camera): Prevent scripted camera speedup at high FPS Sep 14, 2026
@bobtista bobtista changed the title bugfix(camera): Prevent scripted camera speedup at high FPS tweak(camera): Use logic time for scripted camera movement Sep 24, 2026
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9a4f798c-92c5-420f-b97f-32a51a8c9d53

📥 Commits

Reviewing files that changed from the base of the PR and between dcf54d2 and dd63380.

📒 Files selected for processing (1)
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.


Walkthrough

Scripted camera rotation, zoom, and pitch now advance according to elapsed logic time. Their progress uses real-valued frame units, and tracking rotation sets the target angle after progress exceeds its configured duration.

Changes

Scripted camera movement

Layer / File(s) Summary
Advance camera movements by elapsed logic time
Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h, Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
The camera progress fields use Real, and the rotation, zoom, and pitch update methods accept elapsed milliseconds. updateCameraMovements passes elapsed logic time to those methods and to waypoint-path updates. The methods advance progress by elapsed milliseconds divided by the frame length. Tracking rotation applies the target angle when progress exceeds numFrames.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to dd633

Scripted camera movement now follows the configured logic-time rate at high render FPS. No outstanding issue identified here prevents merging after normal checks.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: scripted camera movement now uses logic time.
Description check ✅ Passed The description directly explains the high-FPS timing issue, the logic-time fix, affected camera movements, validation results, and related issues.
Linked Issues check ✅ Passed The PR meets the coding objective in issue [#3142]. W3DView::updateCameraMovements uses a logic-time step for scripted rotation, zoom, pitch, and waypoint updates. The three movement methods preserv…
Out of Scope Changes check ✅ Passed The changes are limited to W3DView declarations and implementation. They change scripted camera timing and tracked-rotation endpoint handling. These changes support issue [#3142]. No unrelated chang…

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 6c9b4a1c-59ee-47ad-a976-729e8ca3b2f4

📥 Commits

Reviewing files that changed from the base of the PR and between bfa3bbf and dcf54d2.

📒 Files selected for processing (2)
  • Core/GameEngineDevice/Include/W3DDevice/GameClient/W3DView.h
  • Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Comment thread Core/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Rendering Is Rendering related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scripted camera rotate, zoom and pitch speed changes with framerate

1 participant