mcmonkeyprojects / Sentinel

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

Sentinel slow pathing + hitting with shield/not blocking #367

Closed SlyyJacob closed 3 years ago

SlyyJacob commented 3 years ago

Please fill in the three slots below (with EXACT copy-pastes or screenshots!)... -->

The output of command /version on my server is: (PLEASE FILL IN) Paper git-Paper-88 (1.17.1) The output of command /version citizens on my server is: (PLEASE FILL IN) 2.0.28 - snapshot (2341) The output of command /version sentinel on my server is: (PLEASE FILL IN) 2.3.0 - snapshot (416) A pastebin.com link to my (full!) Sentinel/config.yml file is: (PLEASE FILL IN) https://pastebin.com/naJKSrPL

https://pastebin.com/pcn1RH9d https://streamable.com/4ddscf

I have two issues with sentinels - first they move slowly, as seen on the video, when pathing. Second they don't block with shield but instead use it to hit with it.

mcmonkey4eva commented 3 years ago
SlyyJacob commented 3 years ago

2021-07-08 10_34_42 I don't think I have it wrong? Unless shield icon is supposed to indicate main hand and sword off hand. Edit: Just tried switching the slots and didn't help.

mcmonkey4eva commented 3 years ago

Might be a 1.17 bug with the PlayerAnimation class in Citizens? 0.o

SlyyJacob commented 3 years ago

Might be related, sentinels shooting a bow don't play shooting animation either, just punch animation and the arrow flies out.

SlyyJacob commented 3 years ago

To add to the slow pathing, here is a sentinel holding bow and he's moving the same slow-mo walk like an npc with a shield. https://streamable.com/1xulqc

nicoandthe9rs commented 3 years ago

is there a way to fix the shields?

mcmonkey4eva commented 3 years ago

Can't replicate slow movement at all. When the NPC is holding a shield, it slows down to block, when not holding a shield, it moves fast. It goes a little funky if you remove the shield from an NPC while it's aggro, but it's fine again after a respawn. I suspect this the reason you were able to get a video of the NPC moving slow without a shield - you removed the shield just before you started recording - if that's wrong... well idk?

If not the shield thing, it's possible if you update Paper, Citizens, and Sentinel, the slow movement will go away for you. I've also noticed that the default speed value in the config was being misread as 1.0 instead of 1.5, and have corrected that (1.0 = walk speed, 1.5 = sprint speed. Essentially NPCs were meant to be sprinting when attacking, but that was turned off by mistake - this could've been manually enable at any time via /sentinel speed 1.5, just the default was missing). If none of that's it, and an NPC that's never held a shield on updated versions is still slow... I really don't know. That shouldn't happen. Last remaining guesses at that point would be a mixup in the Citizens config or that NPC's configuration or an error in the logs.

Regarding the punching instead of blocking, that turns out to actually be a Citizens issue caused by the 1.17 update, so I've reposted it there: https://github.com/CitizensDev/Citizens2/issues/2633

SlyyJacob commented 3 years ago

@mcmonkey4eva Okay thanks for all the work on this!

I have managed to find the cause of this today after all. For some reason, and maybe you will have more idea of where that comes from, the speedmodifier in navigator was set to speedmodifier: '0.6000000238418579'. Which caused the slow movement even though they had citizen and sentinel movespeed set to 1+. I am not sure if that's something I've messed up early on, because it's a number I would certainly not set myself manually.

mcmonkey4eva commented 3 years ago

0.6 is the value that gets used for shield blocking movement speed. This value shouldn't in theory persist ever, even if you bug it, as it uses the temporary (local) navigator parameters, not the global/default params... however I think it might be possible that the default might get mistakenly modified if pathfinding fails while holding a shield? The above commit will catch and block that from happening if it can/does. I believe if you just /npc speed 1 on that NPC it should set it back.

(Also that extra decimal is just a bug with how java handles numbers sometimes)