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

[Suggestion] Add hitbox knockback angle to hixbox cylinder #12

Open
tupfold opened this issue Jun 27, 2024 · 1 comment
Open

[Suggestion] Add hitbox knockback angle to hixbox cylinder #12

tupfold opened this issue Jun 27, 2024 · 1 comment

Comments

@tupfold
Copy link

tupfold commented Jun 27, 2024

I think it'd be really neat to have the hitbox display also show the knockback angle the hitbox has similar to what Ultimate hitbox displayers currently do:

image

I had a bit of a poke around, and from what I can see, the angle is already generated on the webpage in rukaidata as part of the fighter_renderer. It also looks like it'd require edits here within brawllib_rs/src/renderer/draw.rs, but I'm not sure if the data used in the table generation is available at the point the hitbox cylinders are created.

There's also probably some cases to check with how this would appear when the fighter is rotated, perhaps it should be limited to fixed perspective on the gifs to maintain clarity? Oddly shaped hitboxes/interpolated hitboxes may also look a little goofy and need checking/special case handling for it

@tupfold tupfold changed the title Suggestion: Add hitbox knockback angle to hixbox cylinder [Suggestion] Add hitbox knockback angle to hixbox cylinder Jun 27, 2024
@rukai
Copy link
Owner

rukai commented Jun 27, 2024

thats a good idea!
In case you or someone else is interested in implementing this the steps to implement this would look like:

  1. Add a field to HighLevelHitbox called next_angle.
  2. At the place where the compiler error complains that you havent set the next_angle field, set next_angle to the angle from the next hitbox.
    1. Add a method to CollisionBoxValues called fn angle(&self) -> Option<i32> that will return the angle when one exists (grabs have no angle)
  3. As you said, alter draw.rs to render a line representing the angle.
    1. use the next_ fields to get the required coordinates.
    2. Look at how we render the ECB for a reference of how to draw rectangles.
    3. Lets try and put all the vertices in one buffer to avoid having too many draw calls. (performance is important when I need to render 999999 gifs to update the site) But I would also accept a PR that just rendered one angle at a time. I can always improve it later.

I really like the idea of only rendering it when the camera is at default coordinates and with perspective off. Nice!

However, I'm not sure how we should deal with AngleFlip.
The tables on the site will display the angle flip when its not AngleFlip::AttackerPosition and we will need to convey this in some way here too.
Maybe we just dont display the angle when its not AttackerPosition?
Maybe we render some symbol next to the angle?
Maybe we color it differently?
I would be fine with any of these, but they are all a bit awkward from a UX perspective.
Fetching it is easy and should be done in the same we get the angle.

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

No branches or pull requests

2 participants