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

update homing-vines bullet hitbox with custom volume function #40

Open
TheAfroOfDoom opened this issue Dec 22, 2023 · 1 comment
Open
Labels
bug Something isn't working datapack Issues pertaining to the datapack help wanted Extra attention is needed -- usually higher-lift tickets / onces we're not yet sure how to do

Comments

@TheAfroOfDoom
Copy link
Owner

TheAfroOfDoom commented Dec 22, 2023

currently the homing-vines bullet just checks in a small (1 block) radius around the bullet-head entity (the front of the vine).

this is a very inaccurate hitbox since that means the actual vines don't damage you (the long green parts), only the head (front) does

(TODO add visuals/GIFs so this is more clear)

https://github.com/TheAfroOfDoom/omega-flowey-minecraft-remastered/blob/afb1cc943424e4145c365b8503f9b30655effa6f/datapacks/omega-flowey/data/entity/functions/hostile/omega-flowey/attack/homing-vines/bullet/loop.mcfunction#L4-L7


it's a pretty high lift to actually make this check a non-axis aligned rectangular volume. see:

so from above we'd need to:

  • add a cross product function in utils:math/vector
  • use the cross product function we created to implement the above stack overflow answer

alternatively (and probably better/more easily) we could instead use a cylindrical volume check. this looks like it'd be easier than a rectangular volume: https://math.stackexchange.com/a/3518553.

we would still need a cross product function though


there's a good chance we just straight up don't do either option above though, in which case we should delete the utils:math/vector/dot function (assuming it doesn't get used later by other things)

https://github.com/TheAfroOfDoom/omega-flowey-minecraft-remastered/blob/afb1cc943424e4145c365b8503f9b30655effa6f/datapacks/omega-flowey/data/utils/functions/math/vector/dot.mcfunction#L1-L7

@TheAfroOfDoom TheAfroOfDoom added bug Something isn't working help wanted Extra attention is needed -- usually higher-lift tickets / onces we're not yet sure how to do datapack Issues pertaining to the datapack labels Dec 22, 2023
TheAfroOfDoom added a commit that referenced this issue Dec 22, 2023
@TheAfroOfDoom
Copy link
Owner Author

TheAfroOfDoom commented Feb 24, 2024

we can actually probably just use AJ's locators spread out throughout the homing vine model, and do a bunch of radius checks around them?

a bunch of spheres concatenated along an axis is practically close enough to a long non-axis-aligned bounding volume anyway


first test using locators for hitboxes was done for the soul-0 event in 245ef6e

satisfactory with the quality of it esp when considering ease of development and performance concerns for many model hitboxes.

important to keep in mind its good to go for minimal locators on model to avoid lagging the server. even 3 locators on the soul_sword model compared to 2 was a lot more laggy (since there's ~50 total soul swords rotating around the soul arena during the soul-0 event)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datapack Issues pertaining to the datapack help wanted Extra attention is needed -- usually higher-lift tickets / onces we're not yet sure how to do
Projects
None yet
Development

No branches or pull requests

1 participant