Skip to content

Use accumulated movement when possible

Mads Buvik Sandvei requested to merge madsbuvi/openmw:figure-skaters into master

Closes #5062 (closed)

When "turn to movement direction" is enabled, the movement returned by runAnimation makes little sense because it is not rotated based on the leg yaw being applied to the animation. This MR fixes that by applying the yaw before returning the accumulated movement.

This condition will always pass for most movement animations, effectively disabling animation based movement. Vanilla seems to always apply animation based movement when not flying/falling. For actors, the difference is not visually significant, but for some creatures the difference is highly noticeable (see #5062 (closed)).

Based on the comment in the code, my guess is the intent is to compare directions, but that isn't what it accomplishes. Instead it'll squash animation based movement because most of the time one of movement.x or movement.y will be 0, while this is practically never the case for most movement animations as the accumulating node will be bobbing slighly up/down/side-to-side. It also makes the comparison based on per-frame accumulated movement, which is also bad because it would mean some frames of the same animation moves by the animation and some not, but this badness is hidden by the fact that no movement ever fails the check.

This MR fixes this by replacing the condition block, with one that compares the direction of the movement variable to the general direction of the animation. The latter can be deduced by the current state of the character. It then rotates the accumulated movement by the difference if they are different.

In addition to fixing #5062 (closed), this causes actor movement to more closely match vanilla in general. This unintentionally introduces camera bobbing along with the animation in third person, same as vanilla, and some movement glitches present in vanilla caused by glitchy beast race animations. I personally dislike that, primarily due to the glitchy beast races, so i've added a setting to disable animation based movement for the player only.

Merge request reports

Loading