Raycast look-ahead for projectiles and weapon collision fixes and optimizations.#2781
Raycast look-ahead for projectiles and weapon collision fixes and optimizations.#2781RedRoryOTheGlen wants to merge 6 commits intoInterkarma:masterfrom
Conversation
…s now excluded from the LayerMask
…yer mask to Touch spell target detection as in PR Interkarma#2770. Removed the aimPosition offset to prevent the player's pre-cast check detecting their own collider as a target.
… with the origin of collision checks. Moved the isArrow offset code into GetAimPosition method so the arrow still spawns in the same place it did before.
…Interkarma#2770 as well as the WeaponManager layer mask fix. Removed the explicit exclusion of IgnoreRaycast layer from the layer mask initialization because DefaultRaycastLayer apparently already excludes it.
…l caster to use the Player-excluding layer mask. Now the Player-excluding layer mask is only assigned if the caster is the Player.
|
Did you get to try it out numidium, or is that from reading the code? I do like that this PR replaces two others, I could probably knock down both, but it would probably help to have people - other than the author - test it |
…lasses to use the appropriate layer mask (and initialize it if it isn't). Applied this new method to the player Touch targeting check in EntityEffectsManager.CastReadySpell to completely prevent self-targeting with Touch spells.
|
I have been focusing on the Touch usage a bit more and last commit is supposed to fix the self-targeting issues still happening while moving and sprinting due to enabling Headbob and the player's SmoothFollower lagging behind the player collider. |
|
Additionally, since this already changes WeaponManager, I would like to try implementing bounding box based player melee attacks with multi-hit in this PR as well, if that would be acceptable? Test footage of bounding box-based weapon collision Even with lots of playtime on DF, I still don't really know how Daggerfall did it, but I attempted to achieve the same feel with just an OverlapBox and Raycasts for a quick LOS check. Then I added some (optional) enhancements like friendly fire protection, radial reach and a complex-LOS check as QOL. |
Implemented raycast-based collision for DaggerfallMissile from PR #2472 by numidium . Revised the layer mask switching and fixed the now-off-center arrow model resulting from the change. Also applies the layer mask to the Touch spell detection and tweaks the GetAimPosition method to prevent the player from targeting themselves with their own Touch spells addressing Issue #2768.
Additionally, incorporated the optimizations to DaggerfallMissile from PR #2770 by DanyilYedelkin, taking into account the new raycast-based collision when needed. Original PR had an issue which applied the Player-excluding layer mask to all projectiles and area-of-effect regardless of caster which has been corrected. Also included the changes to WeaponManager that fixes the player melee attacks being blocked by colliders on the IgnoreRaycast layer (Issue #2767), as well as an optimization.