===================================================================================================
Third-Person Sprint Stutter Fix
AUTHOR: Lord Zapharos (www.lordzapharos.com)
DATE: 7 October 2025
===================================================================================================


LICENSE AND CREDITS:
===================================================================================================
Creative Commons Attribution 4.0 International (https://creativecommons.org/licenses/by/4.0/)

You are free to share and transform this work (commercially or otherwise) provided you give proper
credit to Lord Zapharos, provide a link to this license, and indicate if changes were made.


DESCRIPTION:
===================================================================================================

Try this:

 1. In third person, unsheathe your weapons and sprint forward a bit; then stop moving.
 2. Open the tween menu (Skills/Magic/Map/Items) or start sprinting again.
 3. Do you notice how the camera "snaps" briefly to the left when you do either of these actions?

Finally, here is a fix for this annoying snapping/stuttering behavior!

This mod is compatible with any mod that does NOT change sprintbehavior.hkx. If you have a custom
sprintbehavior file, see the instructions below for applying the fix yourself.

FNIS users: please note that running FNIS will ERASE this mod's sprintbehavior.hkx. Every time you
run FNIS, you must replace the missing or regenerated sprintbehavior.hkx with this mod's file. For
your convenience, this mod has a backup file "sprintbehavior.hkx.BAKreplaceAfterRunningFNIS"; just
copy and rename this file to sprintbehavior.hkx every time after you run FNIS.


REQUIREMENTS:
===================================================================================================

Skyrim Legendary Edition


INSTALLATION:
===================================================================================================

1. Copy the "Data" folder from this directory to your main Skyrim directory (this is usually found
   in "C:\Program Files (x86)\Steam\steamapps\Skyrim").
2  That's all you need to do!

To uninstall, just remove all added files.


SKYRIM SPECIAL EDITION USERS:
===================================================================================================

This mod was designed in Skyrim Legendary Edition and WILL NOT WORK with Skyrim Special Edition. If
you decide to convert this mod to work in Skyrim Special Edition, I would be happy to bundle your
converted version with this mod and give you due credit -- just send me your conversion.


BUG EXPLANATION:
===================================================================================================

Whenever a sprint animation begins in third-person, an event is fired to kick off the head-bobbing
and camera sway effects. These effects are achieved via a special bone in the animation skeleton:
AnimObjectA. When active, AnimObjectA overrides the position of the third-person camera. This bone
can be used for many special effects; but for sprinting, it is used only for head bobbing.

When sprinting ends, an "exit event" is fired. If you don't have any weapons out, the event that is
fired is EndAnimatedCamera. This event correctly uncouples AnimObjectA from the third-person camera
and allows the latter to resume its default behavior.

But when you finish sprinting with a weapon out (including your fists), the event that is fired is
instead EndAnimatedCameraDelta. This is the WRONG event, as it does not remove AnimObjectA from the
camera at all.

The infamous wood chopping camera bug is caused by this same basic issue: AnimObjectA gets "stuck"
overriding the camera position when it should have been removed.

Specific to this mod, certain actions such as opening the tween menu set the camera position to the
skeleton center. But AnimObjectA has a default position of -5.0 (off-center). Because the camera is
incorrectly forced to use AnimObjectA, setting camera position to 0.0 causes a brief movement right
i.e. to center, followed by a visible "snap" leftwards i.e. towards AnimObjectA. This is the source
of the stuttering effect when opening the tween menu or when beginning a new sprint.

To fix this bug, all we need to do is change the exit event from EndAnimatedCameraDelta (ID 23) to
the correct event EndAnimatedCamera (ID 25). An illustration of the problem is shown in this mod's
sprintXML.png, which depicts the XML contents of sprintbehavior.hkx.


APPLYING THE FIX YOURSELF:
===================================================================================================

If you use a custom sprintbehavior.hkx, this mod will not work for you, as it overwrites that file.
However, it is very easy to resolve the incompatibility yourself - all you need is a hex editor.

Please refer to this mod's sprintHexEdit.png for visual instructions. The process is as follows:

1. Open your custom sprintbehavior.hkx with a hex editor.
2. Search for the text string "AnimObjectA" (without quotes).
3. At offset 0x30 (48 bytes after the beginning of AnimObjectA), you should see a byte "17". Change
   this byte to "19".
4. Save the file.

That's all you need to do!

Internally, what we are doing is changing the exit event 0x17 (23, EndAnimatedCameraDelta) to exit
event 0x19 (25, EndAnimatedCamera). This ensures that the "anim camera" AnimObjectA does not stick
after the sprint animation ends.
