Creating a character animation

Requirements

How to animate MIR animations

In this document, I will explain the contents of the Blender file, how to use it to create proper in-game MIR animations, and finally, how to export those animations into the game. I’m assuming you already know the basics of Blender and its controls, so I won’t go into detail on that unless there are controls that are outside the norm.

If something is explained poorly let me know in the comments below and subsricve ring it beL. 🔔

What is this Blender file?

This is the Blender file I use to animate all of the in-game animations for MIR. Some examples of in-game animations include death animations, melee animations, and jumping animations. Note that in-game animations exclude cutscenes, which are MP4 files. You can animate these in any program as long as they are exported in MP4 format.

When you open the file, you should see this: screensnot_1

What is what

In the viewport, you're currently in the camera view. In the center, you’ll see our little grunt. As you can see, they don't have feet. You don’t need to animate the feet ever, these will be added and procedurally animated in the game. The pose they're in right now is the default pose, like a T-pose but not a T-pose.

Beneath the grunt is a blue line, which represents the floor for death animations. When animating, remember that the Y-axis is up and down movement, while the X-axis is left to right.

To the right of the viewport, you'll see a text editor that seems to contain some hacking-like text. You don’t need to worry about programming, this will be used later when exporting. I'll explain later.

Animating with weird origin points

The grunt in the middle has very specific origin points, do not change these points as they are used in this way in the game. The center of the head is in the bottom left and is marked by a red cross on the texture. The head is parented to the body, do not change this either. The body's origin point is all the way at the bottom, since this is extremely weird to animate with I added an empty called Use for body as pivot point at the center of the body. This empty can be used to rotate the body at that point.

To do this, first select the body, then the empty. By selecting the empty last, it becomes the "Active Element". Next, go to the "Transform Pivot Point" setting and select "Active Element". Now, when you rotate the body and the empty, it will rotate around the correct pivot point.

screensnot_2

There are several empties hidden as you can see in the outliner, these empties exist and are hidden for a very good reason. Do not move, rotate or scale these. Every visible object is very specifically placed relative to these empties.

When you want to create another animation, you can just copy the empty collection. (This will create an exact copy of the meshes used in the collection, which isn't very clean. To keep things tidy, simply replace the new mesh with the old one and then purge the unused data.)

Exporting to anim files

The game interpolates animation frames linearly, so when you're ready to export, make sure you know what the animation will look like with linear interpolation. Also, the game interpolates only between integer keyframes. While Blender allows keyframes to be placed between frames, this is not possible in the game. So, when you're done animating, ensure that all keyframes are placed directly on the frames.

When you've finished your animation, you'll need to export it into the game. This process is weird but straightforward. To do this, you'll need to use Blender's console. You can open the console by going to the Window menu and selecting the Toggle System Console option.

screensnot_3

To the right of the viewport, you should see a text editor. At the top of that editor, there's a small play button. If you select a body part and press the play button, text will be generated in the console. This text contains the animation data for the selected body part in MIR.

screensnot_4

The console would look something like this:

screensnot_5

WARNING, IF TEXT IS SELECTED AND THE PLAY BUTTON IS PRESSED, BLENDER WILL CRASH IMMEDIATELY

.anim files are animation files for MIR that look like this:

screensnot_5

At the top, you'll see some variables. There’s an FPS setting that should match the FPS of the animation in the Blender file, the default is set to 24 FPS. Then there’s the scale, which should absolutely stay at 1, even if you’re animating a mag agent. Speed is self-explanatory.

Below those variables are the body parts and their corresponding animation data. These start with the name of the body part. The first column is the frame number, and the remaining columns represent the XY positions in pixels and the rotation in degrees.

So, all you have to do is copy the generated text from the console into the .anim file in the correct spot. You’ll notice that HAND shows up twice. To differentiate them, in the Blender file, the hands are named Hand First and Hand Second. It should be pretty clear which one goes where.

Animation constraints and hand poses

You might have noticed that it's impossible to animate the hands in Blender, this is because it needs to be done in the .anim file.

All of the possible hand poses are: fist, open, pistol, point, rifle, stock, and finally underside. If you want a hand to change to a pose, just write the specific pose into the frame of the hand you want to change. For example, if you want the hand to change to an open pose at frame 10, you write the word open into that frame in the .anim file, after the position and rotation.

The default hand pose, if no other pose is specified, is fist.

Some animations like jumping animations, must prevent the actor from performing certain actions. For example, a jumping animation needs to prevent the actor from punching, since these animation will interrupt each other. This is why animation constraints exist. You need to add the correct animation constraint depending on the specific action the actor is perfoming when your animation is played. These constraints can be placed at any body part in the .anim file.

Here are all of the animation constraints that you can use:

AllowAll Character can do anything.

PreventAll Character can't do anything.

PreventDying Makes the character immortal.

PreventWalking Prevents the character from walking in any direction.

PreventAiming Prevents the character from aiming their weapon around. The aiming direction will stay as it was before the constraint was set.

PreventDodge Prevents the character from dodging.

PreventShooting Prevents the character from shooting their weapon.

PreventMelee Prevents the character from performing a melee attack.

PreventBeingShot Prevents the character from being shot.

PreventBeingMeleed Prevents the character from being hit with a melee attack.

PreventRagdoll If this character was about to ragdoll, it'll simply not do so.

PreventWorldInteraction Character cannot pick anything up or interact with the environment.

PreventThrowing Character can't throw.

PreventIronSight Character can't look through their iron sights / block. Identical to PreventBlock.

PreventBlock Character can't block / look through their iron sights. Identical to PreventIronSight.

PreventMixTransition The animation should blend between ANIMATED and NON-ANIMATED states immediately, without a transition. Used for looping animations, entrance animations, and exit animations.

PreventFlip Prevent the character from flipping around. flipping it!!

FaceForwards Force the character to look forwards. This is different from PreventAiming in that it doesn't "freeze" the aiming direction to what it was prior to setting the constraint, it simply forces a certain aiming direction.

PreventDeathAnimation This character can die but they will not perform a death animation.

COMBO TIME

PreventAllAttacking = PreventMelee | PreventShooting | PreventThrowing

PreventAllMovement = PreventWalking | PreventAiming | PreventFlip

PreventAllDamage = PreventBeingShot | PreventBeingMeleed

Melee sequences

Melee sequences are stored as .seq files, which define a series of animations to be played in order. Each sequence contains both right and left variants of the animations, along with two important frame types: transition frames and hit frames.

A transition frame is the specific frame within an animation where the next animation in the sequence should begin. A hit frame marks the point where the actor lands a hit during the melee attack. These melee sequences are responsible for the animations flowing smoothly from one to the next, and that hits are registered at the correct moment during combat.

Here's an example of the blunt melee sequence file: blunt.seq

THE END!!

Tank you for listeing to my presentation are there any quesiotn?s make sure to land them bolow the hut button.