Teardown

Teardown

Not enough ratings
How to make a character animation mod
By Malario
In this guide we will step-by-step replace the animations of Sven Lagom (the default character) with our own. No more, no less.

IMPORTANT
since the update, it is now possible to make your own character mod without overriding existing ones.
THIS IS NOT WHAT WE WILL BE DOING
This guide might still be helpful for some parts of the process but no promises

You should also read this[docs.google.com] very helpful document from the developers, that explains a lot of things in more detail, and answers such questions as "what the heck is a bonemap?"

WORKS AS OF VERSION 1.6.0 EXPERIMENTAL
This is the 1st version of the guide, please tell me if you spot any errors or encounter problems
All content is subject to change, and may not work in future updates. I will do my best to keep it updated though.
   
Award
Favorite
Favorited
Unfavorite
0: Prerequisites
For this guide you will need:
Teardown (1.6.0 experimental branch)
Magicavoxel (v. 0.99.7.1 or newer)
VoxTool (v. 0.83.0 or newer)
For the animations we will be using mixamo.com, so you'll need an account for that

You will need a bonemap file which maps bones or something. For this we will be using a modified version of the the example bonemap.xml file provided by the developers. You should save it as a .xml file:
<bonemap global_offset="0.5 -0.5 0.0"> <bone rig_name="mixamorig" name=""/> <bone rig_name="mixamorig:Head" name="head" offset="0 -0.5 -0.5"/> <bone rig_name="mixamorig:Neck" name="neck" offset="-0.5 0 0"/> <bone rig_name="mixamorig:Spine1" name="chest"> <shape name="hood" offset="0.5 0.0 0.0"/> </bone> <bone rig_name="mixamorig:Spine2" name=""/> <bone rig_name="mixamorig:HeadTop_End" name=""/> <bone rig_name="mixamorig:Spine" name="stomach"/> <bone rig_name="mixamorig:Hips" name="pelvis"/> <bone rig_name="mixamorig:LeftShoulder" name="shoulder_l"/> <bone rig_name="mixamorig:LeftArm" name="arm_upper_l" offset="0.0 -0.5 -0.5"/> <bone rig_name="mixamorig:LeftForeArm" name="arm_lower_l" offset="0.0 -1.0 -0.5"/> <bone rig_name="mixamorig:LeftHand" name="hand_l" offset="0.0 -1.0 -0.5"/> <bone rig_name="mixamorig:RightShoulder" name="shoulder_r"/> <bone rig_name="mixamorig:RightArm" name="arm_upper_r" offset="0.0 -0.5 -0.5"/> <bone rig_name="mixamorig:RightForeArm" name="arm_lower_r" offset="0.0 -1.0 -0.5"/> <bone rig_name="mixamorig:RightHand" name="hand_r" offset="0.0 -1.0 -0.5"/> <bone rig_name="mixamorig:LeftUpLeg" name="leg_upper_l" offset="-0.75 0 0"> <shape name="radio" offset="0.0 0.5 0.0"/> </bone> <bone rig_name="mixamorig:LeftLeg" name="leg_lower_l" offset="-0.25 0.5 0.0"/> <bone rig_name="mixamorig:LeftFoot" name="foot_l" offset="-0.25 0.5 0.0"/> <bone rig_name="mixamorig:LeftToeBase" name="toes_l" offset="-0.25 0.5 0.0"/> <bone rig_name="mixamorig:RightUpLeg" name="leg_upper_r" offset="-0.25 0 0"/> <bone rig_name="mixamorig:RightLeg" name="leg_lower_r" offset="0.25 0.5 0.0"/> <bone rig_name="mixamorig:RightFoot" name="foot_r" offset="0.25 0.5 0.0"/> <bone rig_name="mixamorig:RightToeBase" name="toes_r" offset="0.25 0.5 0.0"/> <bone rig_name="mixamorig:RightToe_End" name=""/> <bone rig_name="mixamorig:LeftToe_End" name=""/> </bonemap>

And finally we need a node template for the joints. You can get one from the developers here[teardowngame.com]
(this one doesnt seem to work properly but it doesnt really affect us. to be fixed when i update this next time)
1: Vox to Fbx
1. Go to the folder Steam\steamapps\common\Teardown\data\vox\player and copy "player_sven_lagom.vox" somewhere you can access it. DO NOT modify the original one.
(you could use another vox model, but you'd have to make your own bonemap for it)

2. Open the vox file with Magicavoxel and delete the contents of the layers $LOCKED and $REF, as these will make voxtool not like us
You should also rename them to "14" and "15" so its like they were never there

3. Creating the Fbx.
Open VoxTool and navigate to the Fbx Tab and
  • Insert the newly edited vox file.
  • Type a name for the new file.
  • Insert the bonemap provided by this guide
  • DON'T FORGET to change the axis convention to Y, since we'll be using Mixamo
Then you may press the "Vox to Fbx" button to convert the vox to an fbx file

2. Rigging + getting animations
Now that we have our Fbx model, we can finally start getting animations. We will be using Mixamo for most of this

1. go to mixamo.com and make an account if you haven't already. Then press "Upload character" and open the .Fbx file we created in the last step


2. The model should be facing the right way by default, but if it's not, make sure it looks like the picture. After that, line up the circles to roughly match this picture.
Finally MAKE SURE to set the skeleton LOD to "No Fingers (25)" !!!!


3. Now we're finally ready to download some animations.
First press the download button with no animations selected to get the T-pose, which we will need later.
Then you're free to get any animation you wish. Just make sure to download all animations as "FBX Binary"
3. Putting it all together
Now that we have rigged our model and got some animations, we can convert them into a Teardown-readable form with VoxTool

Go to the VoxTool's "Animation" tab and
  • Insert the T-pose FBX file you downloaded from mixamo
  • Insert the edited vox file
  • MAKE SURE BONE DIRECTION IS SET TO "Y"
  • Set the name to "sven_lagom" and mode to "Player"
  • Insert the node template file provided in the "prerequisites" section
  • Insert the same bonemap file as last time
(ignore the "generate from mesh" tab, since we're not doing that)
If all is done correctly, you should be looking at something like this

Now to the animations
Press "Add sequence" to add one of your downloaded animations.
To get the character to actually play that animation, you'll have to give it a name from this list
crouch_bwd crouch_bwd_l crouch_bwd_r crouch_fwd crouch_fwd_l crouch_fwd_r crouch_idle crouch_l crouch_r crouch_turn_l crouch_turn_r emote_1 idle_1 idle_2 idle_3 idle_4 idle_5 idle_6 idle_menu jump_loop run_bwd run_bwd_l run_bwd_r run_fwd run_fwd_l run_fwd_r run_l run_r swim turn_l turn_r ik_pose_a ik_pose_drive ik_pose_horse ik_pose_t ik_pose_y jump_end jump_land jump_start

Here's the fun part. Since we're replacing the whole animation file, you'll have to individually add 39 animations to cover all 39 of these cases. (unless you're fine with T-posing sometimes) You can use the same animation for several of these so thats nice.
Good luck

When all is done, press "Generate Assets", which should create a folder called "sven_lagom" with these here files
DO NOT RENAME THESE OR IT WILL NOT WORK
4. Actually making the mod
Finally it all comes back to Teardown

Open Teardown and make a new Global mod

Navigate to your newly made mod's folder
Now you'll need to add some new folders and add the files from the last step into here (you can ignore animation.lua)

The final file structure should look something like this (Folder names are exact, dont change them)
  • Global Mod
    • info.txt
    • preview.jpg
    • data
      • animation
        • playeranims_sven_lagom.bin
      • prefab
        • player
          • player_sven_lagom.xml
      • vox
        • player
          • player_sven_lagom.vox

And there you have it. Just enable the mod, select Sven Lagom from the character select and go into a map, and you should see your beautiful new animations come to life.

Finally here is a mod to give you inspiration on all the things possible with this technology
https://steamproxy.net/sharedfiles/filedetails/?id=3271578842
6 Comments
Malario  [author] 12 Oct @ 12:39pm 
I'm not sure that step is necessary actually but just do it to be cautious :steamhappy:
Malario  [author] 12 Oct @ 12:39pm 
Not a stupid question actually, I worded it kinda bad lol

What you need to do is just rename the layers to 14 and 15 respectively, like they were never used at all.
gibsonman2 12 Oct @ 10:23am 
Look, I'm sorry for the dumb question, but I can't find any documentation on this anywhere.

How do you delete layers in Magicavoxel?
legodragonfly2013 15 Jul @ 2:02pm 
If i was smart i would make this.
Malario  [author] 6 Jul @ 1:26pm 
you're welcome bongle
Bingle 6 Jul @ 12:03pm 
thanks mario