mcmonkeyprojects / Sentinel

Combat NPCs for Spigot!
MIT License
165 stars 85 forks source link

Players not taking knockback against Sentinels #261

Closed Ferocimo closed 6 years ago

Ferocimo commented 6 years ago

Versions : http://www.noelshack.com/2018-35-7-1535879690-2018-09-02-11-14-21.png

Hello,

I don't know for how long this issue has been there (maybe forever) but we only noticed recently : players don't take knockback at all from being hit by Sentinels (melee or ranged).

Thank you for looking into this.

mcmonkey4eva commented 6 years ago

Luckily I've interacted with your group recently enough to remember:

You have a wildly non-standard config, and that issue is definitely caused by that weird config.

Can you please pastebin your current config file?

mcmonkey4eva commented 6 years ago

I suspect you have workaround damage false and enforce damage true. I've applied an update to Sentinel @ https://github.com/mcmonkey4eva/Sentinel/commit/31caf160c61ba9a3c7c64a873e5e1d9ea19de692 that adds pseudo-knockback in that case. Build DEV-182+ on http://ci.citizensnpcs.co/job/Sentinel/ contains this fix.

Ferocimo commented 6 years ago

This is correct, we have these options set like you described, out of necessity against other issues. We'll update and test again, thank you for your reply.

Ferocimo commented 6 years ago

Sooo... We did some testing, and I can confirm with an outmost certainty, that we DO take knockback... And what knockback ! The fix you did works fine when attacked by one Sentinel. But when multiple Sentinels hit you, the knockback you take is multiplied by the number of Sentinels attacking. Four sentinels hitting you means you take massive knockback, as demonstrated :

https://cdn-b-east.streamable.com/video/mp4/sjgsf.mp4?token=_s3RvM-qevKtn2OErlxz-Q&expires=1535905144

mcmonkey4eva commented 6 years ago

Build DEV-186+ contains a fix.

I should have seen that coming, lol. The knockback code was a bit loose.

The new version will apply less knockback force the faster a target is already moving (So multiple knockbacks in a row will do significantly less movement speed). I also applied a loose damping effect to the existing velocity, which is similar to what Minecraft does natively.

I think the actual native Minecraft knockback algorithm entirely removes any existing motion force, which is pretty meh. I think this code should be very similar in result (to native Minecraft knockback), but a bit nicer in some edge cases.

Ferocimo commented 6 years ago

Seems to work fine now indeed, thank you very much for the quick answers !