Tutorial:Mount Animation Editor

From Total War Modding

A Beginner’s Guide to The Mount Animation Editor

by calm&normaltime


Sections

  1. Intro
  2. Packfile
  3. Preview
  4. Tweaks and Settings
  5. Generating your animpack
  6. Editing your Fragment
  7. RPFM
  8. Tips and Troubleshooting


Intro

Who is this guide for?

This guide assumes you’ve never modded animations before but you want to start putting units on crazy mounts using Asset Editor.


So what is the Mount Animation Editor? (Hitherto referred to as MAE)

MAE is a tool included within Asset Editor. Normally, if you try sticking a human with horse rider animations on a tomb scorpion, the rider will float above or be sunken in the scorpion.

MAE let’s you fix that.

MAE will also allow you to tweak and swap out rider animations. You may have noticed that many riders just sit there doing nothing while their mount does all the work attacking.

MAE lets you fix that.


If you’ve never used Asset Editor Before

Link to latest version of Asset Editor

The kitbash editor is more accessible for beginners. Play around with it for a few hours before attempting animations. Get used to navigating the UI, importing models, controlling the camera etc.

Some examples of mounts created with the editor:





AssetEditor - Mount animation editor

The above is a link to a video of a damsel on a carnosaur.

Packfile Setup

It’s always better to start a fresh and empty pack for saving animations. This will reduce the chance of a memory error which might happen if you try saving animations in a pack that already holds models, textures, db stuff.

I highly recommend you save regularly.

Opening the Mount Animation Editor

The kitbash editor is active by default.

To switch to the mount animation editor, simply click Tools and select it

You can have kitbash windows open while you have mount animation windows open. This might be useful if you notice your rider is clipping through the mount, and you want to quickly edit part of the model and reimport it. However, as I’ve warned, you should not save models in the same pack you’re saving animations, so make sure to switch active packs.

The more windows you have open the likelier you are to incur a memory error, so make sure you save regularly.

Cheat Sheet

This is a guide for absolute beginners, so I’m going to proceed step by step with a lot of detail and instruction.

If you want to a short and to the point summary, find it here: https://tw-modding.com/index.php/Tutorial:AssetEditor

Setting up your preview

You may not want to jump straight into creating an animpack. You may only want to look at different combinations of rider and mount to decide what looks good.

But before the editor will allow you to render an animated preview of your mounted model, there’s a few thing you need to set up first.

Handily, the UI is arranged so the menus and steps we’ll take are stacked in the same order (more or less). So let’s start at the very top with the rider.

Rider

Click browse to open the CA pack and search for your rider’s mesh (model).

Or search an open mod pack and pick a custom model.

Notice, you can pick a variantmeshdefinition to get the whole model, rather than importing the parts one by one.

No need to to touch Skeleton or Animation. Those will fill automatically once we fill a lower menu.

Mount

Same as above. Simply pick a mesh from a packfile.

At this stage you should untick the box beside Rider to make them invisible. A 2nd rider mesh will appear for animations, and the t-posing mannequin idiot will only be in the way.

We won’t need the Rider and Mount menu’s again moving forward, so feel free to collapse them for space.

Rider Attachment

Leave rider root bone alone. We want to pick a vertex in the mount mesh for the rider to stick to.

Select the mount by clicking its model in the preview window. Press fn+f3 or just f3 to enter vertex view mode, and click a vertex to select it.

Once you hit set you’ll see ‘1 vertex selected’.

Collapse the menu when done.

Animation Settings

Skip for the moment. It’s better to come back once we can see a visual preview of the changes before changing things.

Mount Link shortcut

The mount link shortcut is far simpler than it seems.

The first 2 boxes are the respective animation sets your rider and mount will use.

The Tags are individual animations from those sets. Whatever tags are selected are what will play in the preview window.

You can narrow the available options by typing in the bar, like I have above with ‘stag’.

Then the Tags:

If you pick Stand as a tag for the mount, the rider tag should automatically fill with Rider_Stand

Stand is a good neutral pose to work with.

Once we have a tag for both, your preview is ready. Well done.

Recap

  1. Pick a rider mesh
  2. Pick a mount mesh
  3. Set a mount attachment point
  4. Pick animation sets for the mount and rider
  5. Pick a tag for the mount and rider

Tweaks and Settings

Now let’s get to the exciting part. Animations

Click animation beneath the preview window to finally get a glimpse of your rider sitting on your mount.

Still lots over overlays. Get rid of the skeleton under visualisation help. If you haven’t already, feel free to go back up to Rider and Mount and untick the skeletons.

There. Lovely. You may notice the model freezes after 30 or so frames and stays that way until the animation restarts after frame 150 or so. That’s because main animation is set to Rider.

Set it to Mount, or New Anim, and you’ll see the number of frames lower to the appropriate amount. The rider animation will also now loop as many times as necessary for the mount to complete its full animation.

At this point, you could start going through different tags to see different animations.

But often, you’ll want to adjust the scale and position of the rider first.

For that we return to a menu we skipped past earlier.

Animation Settings

Scale is our first stop. I’ve doubled it here. Remember, you’ll always need to hit the Refresh Tool to update the preview after making changes.

But updating has revealed a problem. Our rider is looking awful sunken with this mount scale.

To fix this, we use the Trans offsets. There’s 3 and they move the rider along the X, Y or Z axis.

I want to raise my rider higher, so I use the middle one. Positive numbers move her up. Negative move her down. 1.13 seems like a good fit to get her sitting right.

Rot Offset is for rotating her. You need this less often. Usually only for individual animations.

Keep rider rotatation will serve you in 90% of cases. I’ll cover when to turn it off further on.

Fit Animation keep this checked unless you have a clear reason and you really know what you’re doing.

Oh no another problem. What looked good in an idle animation now looks bad for an attack.

It’s always good to try out a range before settling on anything. But all you need are settings that look good for most animations. Problem animations can be tweaked individually with their own unique settings later. I’ll cover some examples in the last section of this guide, Tips and Troubleshooting.

Before we go any further though. Please do yourself a favour and screenshot your settings.

God fobid, we have a crash. There’s no reloading your settings. You’ll need to re-enter them.

Also Very Important. You’ll need to know the Exact Scale of your mount for RPFM later.

Recap

  1. switch the tags to see different animations
  2. Switch main animation from Rider to Mount.
  3. Use animation settings to find a scale you’re happy with
  4. Use trans and Rot offsets if necessary
  5. Screenshot these settings to spare you grief down the line

Generating an Animpack

The highlighted packfile is what will be saved to. Right click your packfile and select ‘set as editable pack’, if it isn’t already highlighted.

To generate an animpack, just click Batch process based on selected Mount/Rider fragment

You’ll be given the option to name your files. The autogenerated names are very longwinded so I recommend shortening them. Just don’t change the .animpack or .bin suffixes.

Hit Create. Your packfile will turn red. Right click to save it. Congratulations.

You’ve just created a new rider animation set.

Editing your Fragment

When you hit create, you will have seen a list like this pop up.

The tags in red are missing. The editor couldn’t find matching rider animations to pair with every animation the mount uses. Feel free to close this list, you don’t have to memorize the gaps, as the editor will highlight what needs fixing where we’ll be fixing it.

Under Save and Preview, in Selected fragment, you’ll see there’s just one option you can select. That’s the fragment you just created.

In selected slot, you’ll see the missing Tags highlighted in red. Select the first.

With your fragment and slot selected, go back up to Mount link shortcut

Choose a Mount Tag that matches the missing Tag.

You’ll see that for this one, the Rider tag doesn’t autofill. You’ll have to choose a Rider Tag yourself.

Type rider to narrow the list to just rider animations. You can select one and preview how it looks before trying out another. Once you have a rider animation that looks good paired with that mount animation, go back down to Save and Preview, and hit Add to fragment.

The new mount/rider animation you just created will automatically be entered to fill the missing gap within the .frag file. Your packfile will turn red. Right click and save it.

Now it’s as easy as repeating these steps for every missing Tag.

Recap

  1. In Selected fragment, choose your new custom fragment
  2. In Selected slot, choose a red missing tag.
  3. In Mount Tag, choose the tag that matches the missing one.
  4. In Rider Tag, choose a tag that looks good.
  5. Hit Add to Fragment and save.
  6. Rinse Repeat

Note: Nothing says you only have to fill missing slots. You can also replace autogenerated ones and even add new slots. You’ll probably find that some of the automatched ones are wonky anyway, or could be cooler. I’ll cover some examples of fixing wonky animations in the last section.

For now let’s move on to getting your newly created animations in game.

RPFM

I’ve created template you can download below. This packfile contains the bare minimum tables needed to test a mounted unit in custom battles.

https://drive.google.com/file/d/1UZk1yJrPBqS4Ca5LvmjbXjCMQK_O3zsH/view?usp=sharing

Hooking up your new animations within the template

Start by opening the template and importing the animations folder from the pack you saved in asset editor

You’ll see you’ve added an animpack, but the fragment we’ve been editing in asset editor isn’t visible.

That’s because the fragment is still packed inside the animpack.

To unpack it, right click your animpack.

This window will open on the right. Notice how RPFM has included an explanation of how to unpack and repack contents. Double click the bin and the frg on the right to unpack them.

Fragment

When you click on your unpacked frg, it looks like the above. A spreadsheet with an animation file assigned to each slot. Scrolling down there shouldn’t be any gaps, since you filled them back in asset editor. However…

Scroll to the right to find the Weapon Bone columns. Notice how they’re ticked for some rows and not others.

You’ll want to fix this. Ticked means the rider will hold their weapon during that animation. Unticked means they’ll put the weapon away while that animation plays. If your unit’s weapons are constanly flipping back and forth between between being wielded and stowed in the game, it’s likely you need to fix up these columns.

Bin

When you click on the bin, you’ll see the above. The key under Unknown1 is your animation key. This is what you’ll copy paste into land_units, battle_animations, and culture_to_battle_animations table, just as you would if giving a unit a vanilla animation from a different race.

Unknown 3 is very important. Why I’m giving it its own paragraph. Asset editor generates the bin with a placeholder value here that you need to change. If you load your unit in game and the rider is t-posing inside the mount, you’ve probably forgotten to change this.

Paste the animation key of the mount here. The same key you’ll use in mounts_table.

And we’re done.

Repacking the Animpack

The bin. and frg. in the animpack right now are the unedited versions. You need to replace them with your edited versions. However…

You need to save your packfile before doing this.

RPFM will repack your last saved version of the bin and frg, not the currently displayed versions, so save each time before you repack.

Once saved, follow RPFM’s instructions for adding stuff from the Packfile to the Animpack.

You can delete the versions open in the packfile then.

If you’re paranoid or troubleshooting, you unpack them again to check that the versions in the animpack are the edited versions. Before deleting again.

And the Rest

Modifying the remaining tables.

Mispellings in table names are CA’s and not mine.

Battle_animations_table_tables

Key, enter the key taken from your bin.

Skeleton, enter your rider’s skeleton.

Culture_to_battle_animation_tables_tables

Culture Pack, enter the culture key of the race the unit is for.  

Battle Animations Table, enter the same key from your bin used above.

Note you will also need an entry for your mount’s animation if it isn’t already used by the race.

Land_units_tables

Man Entity, change this to an entity with a flying speed if your mount can fly.

Man Animation, enter the same bin key from your bin.

Num Mounts: No need to change for testing. Just adding a reminder to make sure it matches the Num Men you give in main_units_table if and when you change that.

Main_units_tables

Just a reminder to change the Unique Index when you’re adding this stuff to your final mod.  

Mounts_tables

Animation, enter your mount’s animation. You may also want to change the entity.

Unit_variants_tables and units_custom_battle_permissions_tables

Changing these is unnecessary if all you want is to test in game. The template is set up for the main wood elves faction in custom battles.

Variants_tables

Very Important because it’s easy to forget.

Change the Mount Scale to the scale you used in asset editor.

Remember I asked you to screenshot the exact scale used.

Varientmeshes

The template uses Aranessa’s VMD for Test_rider and the giant wolf VMD for Test_mount.

Copy paste VMD info appropriate to your rider and mount.

And We’re Done

That’s enough to get your mounted unit to appear in custom battles. They’ll be the mystery question mark unit in the cavalry section for Wood Elves.

Test them out. Watch them cycle through idle animations. Order them to walk, run, and charge. Leave them stuck in battle with zombies. I made the unit 24 entities to increase the chances of problem animations playing.

If you spot one, try and memorize what the mount is doing. You’ll have to visually identify the animation by playing it in asset editor to know which slot needs a replacement animation.

Recap.

  1. Recap it yourself by doing it. Just kidding. But seriously go away and make some animations now.

Tips and Troubleshooting

My game crashes when loading custom battles

You may have empty slots in your frag

My rider is t-posing inside the mount

You may have forgotten to enter the mount’s animation key into your bin

Fixed it. still t-posing

You may have forgotten to save before repacking the bin, in which case you re-repacked the pre-fixed version

My mount isn’t moving

You may have forgotten to add its animation for this race in Culture_to_battle_animation_tables

My rider is floating or sunken and doesn’t look like in asset editor

You may have the wrong mount scale in variants_table

Still doing that

You may be using a slightly different mount animation than the one you used in asset ed. There are 14 vanilla animation sets with wolf in the name, for example.

My rider is separating from the mount for just like 1 or 2 short animations

Some mounts have 2 identically named slots that each play a mirror flipped version of the same animation. Your rider animation has no way of knowing which is which so will move through space the same for both. I recommend creating a custom mount animation set with the mirror versions of the animations deleted.

My rider spins around 360° sometimes

The bastard. I’ll explain how to fix this in tips below

My rider’s weapon is gone mad

You may have unticked boxes under the weapon bones in your fragment

My rider is spaghetified.

You may be using a model with the wrong skeleton for these animations.

How? Who? Why come could this happen

You may have different numbers for num-men and num_mounts

If not, find an unused modding tech channel on the modding den and explain your issue and what you’ve tried already and someone will very likely help you (no DM’s please).

Tips

  • Scale and position your rider with some space between their legs and the mount. Anticipate that the mount is going to bulge and twist and contort and contract during its more lively animations.
  • Skirts and saddles are great. They will provide lots of cover for having your rider float slightly above the mount, to minimize clipping elsewhere. Notice I deliberately picked a rider and mount that has neither, because I’m a masochist.
  • If clipping legs has you frustrated and you don’t want to reduce the scale of the mount any further, edit the model instead. You can squeeze in the ribcage or neck of your mount to make space for legs, or raise a hump, ridge or armour plate to create a seat. Remember the rider is going to be covering whatever it’s sitting on, so it’s alright if the mount looks a little mishapen when riderless.
  • You can use different rot and trans settings for individual animations. The rider won’t teleport, but will simply slide between the two positions. This isn’t noticeable especially when its the craziest mount animations that usually cause a need for it. Nobody’s paying attention to the rider when the mount is doing some mad acrobatic matched kill animation.

I use this quite a bit for flying mounts where the mount adopts a completely different posture in the air than on the ground. Have the rider rotate to stay upright as the mount switches stances.

  • Weapons may clip through the head of your mount when your rider attacks. Find a rider attack animation that swings at the right angle, and use it to replace the attacks in the slots that cause clipping. Or you can play with rotating the rider so the swing clears the head. Or if your mount is huge and its attack involves rearing up, lifting the rider high in the air (making the rider swing at nothing), you can replace the rider’s attack with a non-attack animation. Pointing ahead with or thrusting their weapon skyward is always cool.
  • If clipping legs are really a problem, there is another workaround. You can use the kitbash editor to play a rider animation with your rider model, and convert the desired pose to a static mesh. Then convert this static mesh to a weighted mesh and map the whole thing to root. You could then delete everything slightly below the waist of your animated mesh, and everything slightly above the waist for your static mesh. I say slightly because we want the parts of the animated mesh mapped to the hips (root) to overlap while sticking to the static legs. You now have a rider who is animated above the waist but who’s legs will never move.

I did this for one of the animal keepers. The hawk keeper. She uses hawk rider animations while on the back of a griffon, but hawk rider animations involve the feet rising and falling in time with the bobbing of the hawk. So her feet kept dipping inside the griffon. You may find another creative use for it.

FYI, the great stag rider animations splay the riders legs very wide, perfect for gigantic mounts where you don’t want to involve a saddle or throne.

  • The spinning rider problem

For an example of this: See the TURN_RIGHT_90 and TURN_RIGHT_180 mount tags belonging to all 3 of the great stag rider animation sets. The rider spins in place at the end of the turn. A quick solution is to replace these animations with ones that don’t spin. TURN_RIGHT_45 works for both without issue.

However, say the animation that causes spinning is otherwise extremely very cool. And you want to salvage it. You can. What you need to do is untick Keep rider rot

As soon as you do this, this will happen:

So you may think you need to keep it ticked. But the above can be corrected by using Rot offsets. 90 in the first box and 90 in the last will correct the rider’s position.

Now this rider won’t spin and you can save your busted but otherwise cool looking animation.

That’s all I can think of for now. I may come back and add to this section.

I hope the guide was useful and look forward to seeing your work on the workshop.