OldCombatMechanics

OldCombatMechanics

46.1k Downloads

Inaccurate 1.8 Knockback

Akzentfrei opened this issue ยท 12 comments

commented

I'd like to have the 1.8 knockback in 1.12.2. There are some changes in de velocity of the player being hit. Y-Axis and combos are not like in 1.8

Add a feature ode module to enable that

commented

i'm pretty sure this has been requested before, but I can't seem to find the original issue for it. oh well.

the problem with things like this is I have yet to find any documentation anywhere of how these things have changed. people usually just say they "feel different" in newer versions, but without something like a description of how the formula has changed for knockback, it's really hard to implement this :\

do you happen to have any low-level knowledge or know of where we could find documentation about the actual changes to the knockback formula?

commented

maybe this helps you:
image

commented

hmmmm, that's definitely halfway there... maybe we can dig around in the NMS and find how much the Y axis speed of flying/falling mobs was originally changed in 1.8 and below. @I-Al-Istannen you're good at that kinda thing, wanna take a stab at it?

commented

I stumbeled upon a plugin called KnockbackMaster (paid tho) which brings back pretty accuratly 1.8 Knockback back.

Here is the config, it may help with setting accurate values. https://hastebin.com/agelewuseq.yaml

commented

@Oberfail are the values you set different from the default ones for that plugin?

commented

Nope, those are the default values and they try to recreate 1.8 knockback.

commented

I made a free and open source plugin meant to do this, don't use KnockbackMaster: https://www.spigotmc.org/resources/kohikb.86080/

It's not exactly 1.8 knockback since it fixes a login order bug since the 1.8 login order fix introduced a new bug. The vanilla formula is there though. Eventually I'd like turn the plugin into a module and PR it into OCM.

commented

I made a free and open source plugin meant to do this, don't use KnockbackMaster: https://www.spigotmc.org/resources/kohikb.86080/

It's not exactly 1.8 knockback since it fixes a login order bug since the 1.8 login order fix introduced a new bug. The vanilla formula is there though. Eventually I'd like turn the plugin into a module and PR it into OCM.

That's great to hear, KnockbackMaster wasn't very useful as the plugin code is not open-source and is obfuscated. I was just wondering, is ProtocolLib necessary or can it be done just through reflection? We would be glad to include this in OCM when it's ready.

commented

In 1.8+ it doesn't seem necessary to use ProtocolLib. In 1.7.10 it is needed to avoid the relog order bug where players take friction after taking knockback, meaning they take less knockback. Knockback velocity is sent to the player immediately after taking damage in 1.8 to fix the relog order issue, so I could just listen to PlayerVelocityEvent and set that instead. I have to retest whether getting player velocities at the beginning of the tick is needed because I believe the relog order bug isn't fully fixed in that the velocity packet sets the player velocity and is not relative, so previous velocities may may or may not be reduced by friction when velocities are sent immediately in 1.8 and not at the end of the tick like in 1.7, so getting velocities at the beginning of ticks avoids this potential issue.

commented

how about a setting, where you can try multiple values to find one that is at close to 1.8 combat as possible?

commented

Sorry but we can't really do much with this without having some frame of reference of what the original code did. Otherwise it would just be a complete shot in the dark!

commented

yeah umm https://hypixel.net/threads/exact-horizontal-knockback-values-in-vanilla-1-8.2360655/
or just decompile the 1.8 server jar and see what they look like.