Modding: Creating a Skinned Model for the game
In order to work with models Planetfall, you will need to be able to work with the Collada file format.
Information on the Collada format can be found here: https://www.khronos.org/collada/
The correct plugin for Maya is here: https://github.com/KhronosGroup/OpenCOLLADA/wiki/OpenCOLLADA-Tools
The correct plugin for Blender is here: http://www.godotengine.org/projects/godot-engine/documents
Collada is an open source plugin that exist for Maya, 3DS Max and Blender, as well as other modeling packages. During the writing of this document we used Maya, but the process will be roughly the same while using other 3D programs.
Import the premade skinned model
We have provided a number of FBX files containing pre-skinned models using the animation rigs that we used to make the game. To begin with you must import one of these files to use as a starting point. In this example, we will be using “Humanoid_Rig.fbx”, it contains a skeleton that we can build a new model around. Your scene will now contain 2 items, “_F_MOTION”, and “TemplateMesh”. _F_MOTION is the actual skeleton you will skin your character to. Now that you have your template, you can start building your new character or adjusting an existing character to the skeleton. Try to build the character into one mesh, to reduce the render calls code needs to calculate. When you use more than one material on a character, the mesh will be broken up by material during your export. So to minimize confusion later on, we’d advise you to make the model 1 mesh, 1 material.
In this example, we will use the Vanguard Liberator as a base, and make a captain version of him.
Notice I just did a recolor of the main clothing, and used parts of an Assembly unit to make him more badass, and battle-hardened (also no helmet). It can be skinned to the same bones the original liberator uses.
Bind your mesh to the skeleton
If a unit more or less matches the source object (like in the example), you can use our script (source copyskin.mel) to really easily transfer the skinning from the source to the target, without selecting any bones. NOTE: make sure you place the model on the origin, and in the bindpose, before you do any skinning/copy skin weights (search on the internet to see how to do skinning). Once that’s done, you might want to clean up skinning when you see weird deforming vertices when he’s animated.
If you want to skin the bones yourself, select the source mesh, in the main menu, go to Window/Hypergraph: connections.
Select all the bones in the list, and skin them to your target model. Be sure to have the following settings correct before skinning:
After this, do the weight painting so that the model properly deforms as the skeleton animates.
Export the skinned model
Once you are finished with painting the skin weights, it’s time to export the model. Select the mesh and “_F_MOTION”, and go to file/export selection(options), and choose the (OPEN)Collada export format (.dae):
Use the same settings as provided in the screenshot above, otherwise you’ll run into an import error later on in Content Ed.
Importing the Skinned Model into the Content Editor
It’s now time to import your model into the Content Editor!
- Start the Content Editor and load your CLB file (the one in your mod’s folder).
- Click on the “Meshes” tab (IMPORTANT! If you forget this step, the editor will not know what you’re trying to import!)
- In the meshes tab, click on the top middle button ‘Import’, and select your exported .dae file in the file window.
Once the import has succeeded, there will be new meshes in the list, as you can see on the screenshot below in slot 0, 1 and 2 (outlined in red).
The first part of the mesh name (LiberatorUpdate) is the actual name you gave it in your 3D program, and the second part (_LiberatorMAT, etc..) is the material name it has been given (in your 3D application). So if your character consisted of multiple materials, it will have been split up into multiple meshes, each with the same mesh name, but with different material names (as in this example). Note: the stuff outlined in green shows you where the maya file is located you used for the export, and where the exported .dae is located, in case you need it for something. The names outlined in blue are the bones skinned to all the selected meshes
In the next screenshot, the system will have automatically created a new Model for your meshes (go to the model tab). A model is a collection of meshes (blue outline) and materials (red outline), linked to an animation skeleton or Rig (green outline). Before we can use the new model in game, we need to link the correct animation rig to it (if your model isn’t animated, this step can be skipped). Since the example uses the Humanoid rig, this is the one we’ll be linking.
First, we need to make sure that the CLB file containing the correct rig is linked to the pack. If you’re editing an existing clb/pack instead of creating a new one, this might already have been done.
- In the main menu, choose Options/Dependencies
- In the dialog that opens, click “Add”, browse to “..\Content\Title\Libraries\Figure_Rig\”, and select Humanoid_Rig.clb.
- In the example case, we’re using materials from the Vanguard, and Assembly, so add those .clb files to the dependencies as well “..\Content\Title\Libraries\Figure_Skin\Human_Species.clb” and “..\Content\Title\Libraries\Figure_Skin\Assembly_Species.clb”
- Click OK to close the dialog. Now all content from the clb files will be available to you in your custom CLB file!
- Select the “Models” tab, and find the model that was created when you imported your collada file.
- Select your model, and link the Humanoid rig to the Rig in the model’s settings (green outline)
The model is now setup and can be used in game, it’s just missing textures!
As mentioned before, in the example we’re using materials and textures from existing clbs (Vanguard and Assembly). The only thing that is different, is the color texture for the Vanguard material. So the first thing you want to do (in the example), is link the existing materials to the head and assembly parts (first select the mesh (1), than the material library (2), and then the material (3):
For the modded Vanguard material, we’re going to have to copy an existing material from Vanguard_species.clb to your custom clb. Select the material you want to copy, then press ctrl-c
Texture naming conventions
First you need to import your custom texture(s). It is important that you use the proper naming conventions for your texture(s), or they will not be treated correctly by the engine. Below is a list of things to keep in mind when saving textures from Photoshop (or Substance painter, Paint.net, etc):
We are using a P(hysical)B(ased)R(endering) engine, and therefore for best results, minimize shading information in your color textures
As opposed to the AoW3 editor, ContentEditor now supports several file formats (.DDS, .PSD, .TGA, .PNG), which will be compiled internally to a .dds file. For the engine to know what each texture is used for, we use the following suffixes between the brackets ‘_[ ]’:
Diffuse: texturename_[DIFF_DXT1] (without alpha or 1-bit alpha for AlphaTest), and texturename_[DIFF_DXT5] (gradient alpha)
Mask: texturename_[MASK_DXT1] (without emissive or 1-bit emissive), and texturename_[MASK_DXT5] (gradient emissive)
r=roughness channel g=metallic channel b=ambient occlusion a=emissive
Material and finalizing
Next, go back to your custom clb, and paste the material you just copied in an empty material tab slot (ctrl-v). Next, select the textures tab, and import your custom color texture (specifications on how to name your textures correctly is described in the previous topic): select an empty slot, and press the big yellow import button in the top middle.
Go to the material tab, and select the material you just copied. Replace the Diffuse texture (outlined in red) with the custom one. The textures outlined in green are linking to existing clbs :
Go back to the Models tab, and link your new material to the Vanguard outfit mesh: