Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Jan 4, 2026

This change decouples various drawable physics calculations and visual fade effects from the render update. This way they always run at the same speed regardless of frame rate.

Physics timing fixes:

  • Spring-damper pitch/roll rate dynamics (hover, wings, treads, wheels, motorcycle)
  • Position integration for pitch/roll
  • Acceleration pitch/roll rates
  • Wheel suspension offset and compression dampening
  • Wheel angle smoothing
  • Overlap Z velocity and position
  • Vehicle bounce kick
  • Missile wobble and thrust roll
  • Rudder/elevator correction modulator rates (Zero Hour only)
  • Weapon recoil and hit recoil
  • Airborne frame counter (affects wheel rotation on landing)

Visual timing fixes:

  • Decal opacity fade
  • Drawable fade in/out (required type change from UnsignedInt to Real)

@Caball009
Copy link

Can you show a video how it looks before and after?

I'd recommend replicating to Generals as the very last thing you do for any PR. It's easier for the PR creator and reviewer(s).

@xezon
Copy link

xezon commented Jan 5, 2026

I remember I worked on this before and it was difficult to get perfectly right and then paused this. I still have the WIP branch. I would be surprised if this change fixed it with no problems at all.

For easy test, take a GLA Buggy and compare its physics with Retail at different FPS. If it is not matching, then there is work left to do.

@bobtista
Copy link
Author

bobtista commented Jan 5, 2026

I remember I worked on this before and it was difficult to get perfectly right and then paused this. I still have the WIP branch. I would be surprised if this change fixed it with no problems at all.

For easy test, take a GLA Buggy and compare its physics with Retail at different FPS. If it is not matching, then there is work left to do.

Oh that's right, I remember watching this, there's some buggy jank addressed is in episode 0844. I was just trying to apply changes similar to your decouple stealth fade one for remaining frame based logic, hadn't started testing yet. I'll convert to draft and assume there's more to do

@bobtista bobtista marked this pull request as draft January 5, 2026 20:46
@bobtista
Copy link
Author

bobtista commented Jan 5, 2026

I remember I worked on this before and it was difficult to get perfectly right and then paused this. I still have the WIP branch. I would be surprised if this change fixed it with no problems at all.

For easy test, take a GLA Buggy and compare its physics with Retail at different FPS. If it is not matching, then there is work left to do.

Can you push the latest to your WIP branch?

@xezon
Copy link

xezon commented Jan 5, 2026

@bobtista bobtista force-pushed the bobtista/fix-drawable-physics-timing branch from 2751da9 to 2bb1cb5 Compare January 6, 2026 01:01
@bobtista
Copy link
Author

bobtista commented Jan 6, 2026

When I increase render FPS and update physics every render, the buggy doesn't wabble or wheelie as much. At higher render FPS we're getting effectively like a higher resolution of the damped spring math, so less overshoots, less wobble, but same total force is applied. Claude says it's called the Euler integration of a damped spring.

I think it makes sense to only calculate it at logic frames, and we interpolate so it's smoother visually. Otherwise we're messing with the spring math to approximate the overshoots from before, and it's purely visual right? Anyway - I just tested, and it looks right to me.

Note the other changes in this PR don't have this overshoot feedback kind of issue, so they all should work with calculations on render frames. Eg Linear fades like opacity

I've implemented this approach and restored the Generals changes (can replicate once this is approved).

@bobtista bobtista marked this pull request as ready for review January 6, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants