TheAfroOfDoom / omega-flowey-minecraft-remastered

MIT License
3 stars 1 forks source link

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

Open TheAfroOfDoom opened 8 months ago

TheAfroOfDoom commented 8 months ago

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:


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 commented 6 months ago

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 https://github.com/TheAfroOfDoom/omega-flowey-minecraft-remastered/commit/245ef6e57c8c136cd13ebb6fe4d4d5a86e421cb8

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)