Step 1 - Preperations

To begin swapping animations, you first need to understand what the files and their names represent, and what this can tell you about how to use them effectively.

PREFIX

A_ Single Animation
AM_ Multi Animation

TYPE

_Ac_ Action
_Bt_ Battle
_Cs_ Cutscene

SUFFIX

_St Start
_Lp Loop
_Ed End

About AnimMontages:
AnimMontages tell the game what animations to play and how. They often reference a start (_St), loop (_Lp), and end (_Ed) animation. To explain how these work, imagine your character is running, the start animation contains the frames from his idle posture to the moment he begins to run, the loop animation contains the frames of each step you take without stopping, and as soon as you begin to stop the end animation comes into play. While it is completely possible to rename a single-animation AnimMontage to replace one with several tracks, if you don't have a start or and end your character will snap from idle to the loop anim. In the case of the running example, he would instantly snap from standing still to running at full speed, so be mindful of this, the game typically will have a start and end animation to reference for whatever you're trying to swap. In the case that there is no suitable start or end, perhaps something similar from elsewhere in game could be used as a substitute.

Step 2 - Swapping Strings

The first and simplest step of this process. We're going to create a folder to package our mod. This is going directly in the pak directory for simplicity's sake, you can do it anywhere you like, though. We're also going to open a new window at the AssetEditor, wherever that is saved on your PC.

Inside our new folder, which I have named "PAK - Animation Swap Tutorial", we're going to place a copy of u4pak_dq11_v2_packer.exe. I always do this for my mods so it's easier to open it up, make adjustments, bugfixes etc when necessary and pack it straight away without worrying: "where's the packer exe". Your method may vary, I'm not going to stop you if you want to do this differently.

Alongside our packer exe, we're going to create a folder named JackGame, this is very important. And inside JackGame, we're going to recreate the entire path to the file we want to modify. For this tutorial, that file is AM_P002_Ac_Emote_Dance (the photo mode dance animation for Erik) and the path to it is Content/Characters/Human/P002/Animation/Ac.

Pro tip: if you can't remember where an animation is supposed to go the file name usually tells you i.e. A_XXXX_Bt_Swd_Blabla goes in "Content/Characters/Human/XXXX/Animation/Bt/Swd"

You probably guessed the next step was to copy the files you want from your extracted game to your mod folder. You'd be right of course!

Generally it's the AnimMontage (AM_) file you want to edit, not the A_ file.

Just please remember never to move files from your backups or you will lose them.

OK, now we're gonna go look for our source animation. The one we want to have, not the one we want to edit. In our exmaple, there is only one animation (or animation segment), but you may have two or three. Remember we explained earlier about the different animation types? If you're editing a three-part animation , drag all three A_ type .uassets in AssetEditor.exe. If you're editing a single-part animation, you probably only want the loop anim (_Lp). In our case we're going to replace all three parts of a three-part animation with one loop animation, because I want to and because we can. I sincerely hope this paragraph makes sense.

With the two AssetWindows open, one A_ and one AM_, navigate to Header List on both, and copy the full path from the A_ to the AM_. Our example is clearly a three-part animation, so there's three paths here to overwrite.


Further down in the file is the name of these animations, without the full path, copy and paste them over here and you're good to go. Strings successfully swapped! It really was that easy.

Step 3 - Adjusting Timing, Setting up Loop Points

At this point, saving the file and packing it will already work in game, but as it's expecting different animations, the timing and the loop points will not adhere to the length of the new animation, leading to some in-game wackiness. So this step will be required 90% of the time.

First let's go back to our chosen animation A_N015_Ac_BunnyDance1_Lp in AssetEditor and let's expand Code Blocks, and click on the block named AnimSequence, this won't always be block 2.

AnimSequence should have a property named SequenceLength, this is the full length of the animation.

Moving on over to our original AnimMontage, AM_P002_Ac_Emote_Dance in our other AssetEditor window, we need to expand Code Blocks, and the block named AnimMontage. Inside AnimMontage will be two headings, CompositeSections and SlotAnimTracks.

First let's open CompositeSections and click the first section, this is usually the start animation (_St) but in our case all the animations are loop anims.

In this CompositeSection, we need to change the property named SegmentLength to match the new animation length from the previous step.

Now we have to do the same for the second CompositeSection, except this time there are two new fields, SegmentBeginTime and LinkValue. In every animation I've seen, both of these fields refer to the start time of the loop animation segment.

Since the first segment, which would usually be the starting animation (_St) was 8.333etc, this would be the start time of the second segment.

Then, just as before, SegmentLength needs to reflect the timing of the second segment, which in our case, as it is the exact same animation as before, will also be the same length. If you're swapping an animation with 3 segments with another segmented animation, this length would need to be the same as the SequenceLength of the LOOP animation, not the start or end animation.

This is the part where you'll need a calculator, digital or otherwise. We're going to do the exact same process as we did for the last step in the third CompositeSection, but this time, since this is meant to be the ending segment, it starts after the loop segment, so we need to add the length of the start animation to the length of the loop animation. Our result is the number you'd put into SegmentBeginTime and LinkValue.

Segment length is the length of the third segment in the animation, for you it might be different but for me as I'm only using one animation source, it is yet again 8.33.

This is extremely important, now that we've edited the timing of the CompositeSections, we also need to alter the timings of the AnimSegments. The process is more or less exactly the same and the numbers you use should be exactly the same. The only difference with this part is that instead of LinkValue and SegmentBeginTime, you only have StartPos. And instead of SegmentLength you have AnimEndTime. The values for these should be the same as above e.g. if the second segment starts at 8.33 and has a length of 8.33, the StartPos should be 8.33 and the AnimEndTime should be 8.33.

Finally we need to back out of these parts, and click directly on the AnimMontage block. The SequenceLength value here should be the total runtime of the animation. If the animation has three segments, and they all have a length of 8.33, the total runtime should be 24.99, as my calculator shows.

With that done, all the necessary modifications are done and we're ready to move onto the final stage of packaging the mod and testing it out.


Hit File -> Save and join me in Step 4!

Step 4 - Packing your mod!

If saved correctly, the new files should have the same name as the ones we want to replace, in our case, AM_P002_Ac_Emote_Dance, and the Date modified column should show the current date and time.

From here we just need to back out of the current subfolder, all the way to the very first folder we created "PAK - Animation Swap Tutorial", and drag JackGame onto u4pak_dq11_v2_packer.exe.

This will create a new pak named by default as packchunk0-WindowsNoEditor_P_My_Mod_Name_v0.0.1.pak. We can go ahead and rename this to make sure it loads later in the boot, giving it a higher priority if we want.

Then all that's left is to move the new pak file into the main pak folder for organisation's sake and boot the game. If all has gone according to plan, your new animation should play in game instead of the original!

Look at him go!

Additional Tips

  • The AnimTrack property AnimPlayRate seems to control animation speed, at 1 it is real time, and at 2 it plays twice as fast, I'm not sure if this requires additional timing edits.

  • In certain AnimMontage files you may come across a property named EAnimInterpolationType::Step, changing it to EAnimInterpolationType::Linear will fix janky interpolation.

  • I think the tutorial covers this pretty well, but nevertheless, if you edit a three-part animation, make sure you edit ALL segments, or it will loop forever or not loop at all.

  • The inner paths in AM_ files can link anywhere else in game, if you want the Hero to use Erik's anims for something, go for it. Just make sure the whole path is correct.

  • The A_ and AM_ files have internal paths that point to their own location. Don't change these unless you're swapping one complete animation with another.

  • At present, swapping animations from one character to another only works well if the characters have similar body proportions. Hopefully I can update this to fix that one day.

  • CompositeSections have two NameProperties: SectionName and NextSectionName, they control how the sequence is played, their acceptable values are as follows:

Default (usually _St anims) - This section is played immediately, and leads into the next section
Loop (usually _Lp anims) - This section is looped indefinitely or until cancelled in-game
End (usually _Ed anims) - This section is played after the final loop and stops the animation
Be wary, if the Loop is 24 seconds long and you cancel it immediately, you're going to be waiting that whole time for the End animation to play...