Page 1 of 1

Archery hit detection needs some tinkering

Posted: Sun Aug 11, 2019 1:19 am
by Feiros
My experience on Archery with a level 16 bosmer woodland paladin(fancy I know).

Just cleared a big dungeon with 60% of the enemies being Liches and Ancient Liches while using only a Daedric short bow. It broke near the end but luckily I had another on my cart. Anyways, my point is that a bow and arrow playstyle is super reliable in Daggerfall but the hit detection is a little bit troublesome in two ways.

1) hitting the 2d sprite while its turned in a 3/4 view(side view) is 100% missing shot. Hitting it directly from the front or directly from the back works perfectly.

2) hitting it in close distance(almost touching) is again, 100% missing shot untill you backtrack a little.

Re: Archery hit detection needs some tinkering

Posted: Sun Aug 11, 2019 1:42 am
by Interkarma
Feiros wrote: Sun Aug 11, 2019 1:19 am 1) hitting the 2d sprite while its turned in a 3/4 view(side view) is 100% missing shot. Hitting it directly from the front or directly from the back works perfectly.
Hits aren't checked again the sprite, rather a capsule collider the sprite is inside of. Like a hit-box except pill-shaped. This capsule has the same radius and surface area facing player no matter which way the enemy is facing. The two aren't dependent on each other. Screenshot below to help demonstrate. Green capsule around lich is the collider.

capsule.png
capsule.png (796.5 KiB) Viewed 1508 times

If you'd like to play with this more, use "tai" to disable enemy AI from console. Then you can safely plink away at them from any angle. Let me know how you go.

Feiros wrote: Sun Aug 11, 2019 1:19 am 2) hitting it in close distance(almost touching) is again, 100% missing shot untill you backtrack a little.
This could likely be improved. It's a side-effect of how collision detection works. While basically touching the enemy, the raycast for your arrow starts inside of their capsule and the hit doesn't register. I've encountered this before (and already fixed same issue for melee attacks) but of two minds for bows. They're supposed to be ranged weapons and it seems appropriate for them to be unreliable at melee distances. Open to conversation around this one of course. :)

Re: Archery hit detection needs some tinkering

Posted: Sun Aug 11, 2019 4:23 am
by Ommamar
They're supposed to be ranged weapons and it seems appropriate for them to be unreliable at melee distances. Open to conversation around this one of course. :)-interkarma

That makes sense and it mirrors how a lot of games deal with close use of a range weapon, I could see a defense reduction being applied to but that is probably a bit of work. I would have no problem with just leaving the hit penalty as is forces an archer to use his bow from range then switch to melee if the target closes.

Re: Archery hit detection needs some tinkering

Posted: Sun Aug 11, 2019 8:37 am
by Feiros
Interkarma wrote: Sun Aug 11, 2019 1:42 am

Hits aren't checked again the sprite, rather a capsule collider the sprite is inside of. Like a hit-box except pill-shaped. This capsule has the same radius and surface area facing player no matter which way the enemy is facing. The two aren't dependent on each other. Screenshot below to help demonstrate. Green capsule around lich is the collider.
Sorry Interkarma, poor choice of words from my part. Bow shots while the sprite is in 3/4 angle are not actually missing like they do in touching distance. According to the sound effect they do connect with the collision capsule but it's like the enemy shrug them off.

Very strange. I swear I can spend 130 arrows trying to damage an enemy in that angle but as soon as their sprite gives me a clear front or a clear back, poof, they are dead. :shock:

Re: Archery hit detection needs some tinkering

Posted: Sun Aug 11, 2019 8:50 am
by Interkarma
Thanks for additional information, I will have a play with this when I can. Wondering if others can reproduce this also?