Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aircraft jittering #20841

Merged
merged 1 commit into from Aug 5, 2023
Merged

Fix aircraft jittering #20841

merged 1 commit into from Aug 5, 2023

Conversation

PunkPun
Copy link
Member

@PunkPun PunkPun commented May 3, 2023

Closes #4824

For context, the fact the facing can jitter is expected and intentional. What we want to prevent is visual jitter, and here we fix it by not acting on facing discrepancy if the difference between the current and desired facing is below angle 2

Mailaender
Mailaender previously approved these changes May 3, 2023
@pchote
Copy link
Member

pchote commented May 6, 2023

I'm not a huge fan of this approach. It would be a lot cleaner if Fly did this instead.

@PunkPun
Copy link
Member Author

PunkPun commented May 6, 2023

How would that work? Fly is functioning as intended, do you want to hardcode Fly in SpriteSequences?

@pchote
Copy link
Member

pchote commented May 6, 2023

There is no need to have the underlying facing (with a 1/1024 resolution) varying by +/- 1 between ticks. The hysteresis can be applied there and/or hook up with BodyOrientation.QuantizedFacings

@PunkPun
Copy link
Member Author

PunkPun commented May 6, 2023

Badger.mp4

That doesn't eliminate jitter completely. There's a reason why it needs to jitter, and applying hysteresis at that level won't fix it

@PunkPun PunkPun added this to the Next Release milestone May 6, 2023
@pchote
Copy link
Member

pchote commented May 13, 2023

I'm personally not convinced (and what about the mismatch between the sprite and contrail/weapon positions which are controlled by BodyOrientation?), but if you do want to push forward with this approach please at least encapsulate it within a WithAircraftFacingSpriteBody so its not forced on all actors and mods.

@penev92
Copy link
Member

penev92 commented May 13, 2023

Those sound like major issues.

@PunkPun
Copy link
Member Author

PunkPun commented May 14, 2023

Contrail works correctly, as for weapon offsets it seems they are using the raw IFacing interface

@PunkPun
Copy link
Member Author

PunkPun commented Jun 21, 2023

I localised the jitter prevention inside Fly activity. With a deadzone of 2 there's very little jitter, to a point that if you aren't playing attention you are not likely to notice.

@pchote
Copy link
Member

pchote commented Jun 21, 2023

IMO it would make sense to expose the 2 value on AircraftInfo rather than having it hardcoded as a magic value?

@PunkPun
Copy link
Member Author

PunkPun commented Jun 21, 2023

What's the benefit to exposing it? I could make the range a const

@Mailaender
Copy link
Member

What's the benefit to exposing it?

Mods have different amounts of facings for their aircraft. I would welcome a configuration option for @OpenHV. It also avoids a magic number.

@Mailaender Mailaender merged commit d686634 into OpenRA:bleed Aug 5, 2023
3 checks passed
@Mailaender
Copy link
Member

Changelog

@Mailaender
Copy link
Member

cfc026a

@PunkPun PunkPun deleted the fix-jitter branch August 5, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aircraft facing jittery in some directions
5 participants