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

Convert QuantizeFacing to WAngle. #18067

Merged
merged 2 commits into from May 28, 2020
Merged

Conversation

pchote
Copy link
Member

@pchote pchote commented May 10, 2020

This PR follows up #18058 with another small step towards converting facings to WAngle. The facing quantization code is particularly fiddly, so this PR focuses just on getting that right.

In addition to converting to WAngle, this also fixes a long-standing bug that nobody had noticed - we were accounting for the non-linear mapping when calculating the sprite frame, but not when converting this back to a facing. This caused a small misalignment in muzzle angle at diagonal facings:

Before:

After:

@pchote
Copy link
Member Author

pchote commented May 10, 2020

Updated to also include BodyOrientation.QuantizeFacing.

OpenRA.Mods.Cnc/Util.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Cnc/Util.cs Show resolved Hide resolved
@pchote pchote force-pushed the quantize-facings branch 2 times, most recently from deeeeb1 to cf72140 Compare May 25, 2020 12:59
@pchote
Copy link
Member Author

pchote commented May 25, 2020

Rebased and fixed comment.

@pchote
Copy link
Member Author

pchote commented May 25, 2020

Fixed.

@pchote
Copy link
Member Author

pchote commented May 27, 2020

Rebased and fixed comment.

Copy link
Contributor

@reaperrr reaperrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me and didn't spot any regressions vs. bleed on RA shellmap, so LGTM.

@reaperrr reaperrr merged commit c999b2d into OpenRA:bleed May 28, 2020
@reaperrr
Copy link
Contributor

Just pointing this out: Either the table fron Chronoshift isn't fully accurate (note how the 'east' facings aren't symmetric to 'west' facings in terms of mapping), or our movement code messes things up, maybe a bit of both. For example, on the RA shellmap, when the harvester moves to its initial harvest point, its harvest anim facing and regular sprite body facing are misaligned again.

This isn't a regression vs. bleed though (only from taking the Chronoshift table), and we're probably better off waiting for the C&C Remaster source code to become available before tackling this, rather than trying to fix this on our own through guesswork or trial-and-error.

@pchote
Copy link
Member Author

pchote commented May 28, 2020

I may have introduced a bug when converting the facing tables...

@pchote pchote deleted the quantize-facings branch July 18, 2020 12:03
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.

None yet

4 participants