Skip to content

Fix: nuke jitter / rubber banding during flight #4910

Description

@JB940

Describe the bug
When launching nukes (especially Hydrogen Bombs or multiple nukes simultaneously):
Mid-flight Micro-Jitter: Nukes jitter or slide 1 tile backwards on every tick during normal flight.
Lag-Spike Rubber-Banding: After a lag spike (e.g a CPU spike or RAM paging disk), nukes jump forward, then rubber-band backwards along their trajectory before resuming forward motion.

To Reproduce

  1. Fire a hydrogen bomb (easier to see due to bigger in flight)
  2. Closely zoom in, you can see the bomb jitter slightly.
  3. Have a hardware hiccup (e.g use chrome to simulate the cpu freezing)
  4. the bomb will shoot backwards, then forwards and rubber band

Expected behavior
For the warhead to follow it's trajectory as cleanly as possible. Speed up to catch up due to lag is unpreventable, but it shouldn't bounce

Additional context
The motion plan stays 1 tick behind engine position throughout the entire flight, this causes tick jitter. This is even more obvious during lag spikes causing an UnitUpdate from setTrajectoryIndex, advcanceMotionPlannedUnits does the same through Motion Plan (which is 1 tick out of sync already), during a spike the UnitPass interpolates the old position, so it gets updated fast-forward, then gets updated backwards, then the next tick properly fast forwards again.

Assignment

  • I'd like to be assigned to this issue and work on it myself

Metadata

Metadata

Assignees

Labels

approvedApproved for a PR, if you assigned to the issue.

Type

No type

Projects

Status
Triage

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions