Difference between revisions of "Custom Characters"

From Wolfire Games Wiki
Jump to: navigation, search
(Blender: Removed "step x:" from headings.)
m (Fur Fins)
 
(47 intermediate revisions by 4 users not shown)
Line 1: Line 1:
''based on [http://forums.wolfire.com/viewtopic.php?f=16&t=24827 this] forum post by member Markuss.''
+
{{About||custom character scripts|Character_Scripting}}
 +
'''TODO''': Put this link graciously provided by Markuss in its appropriate section:<br />
 +
https://cdn.wolfire.com/techsupport/ExampleMan.zip<br />
  
There are two linked .zip file attached to the forum post. they can be found here:
+
'''TODO''': Write introduction
  
http://www.markstockton.com/misc/Guide2/ExampleMan.zip
+
== Overview ==
 +
[[Image:custom_character_file_structure.png|right|thumb|caption|All required files and what they contain]]
  
http://www.markstockton.com/misc/Guide2/Blender-Overgrowth-Win.zip
+
Characters in overgrowth consist of the following files.
  
This guide assumes you are familiar with [[3D Objects]].
+
{| class="wikitable"
 +
|-
 +
! Name !! File format !! Description
 +
|-
 +
! Script
 +
| XML || Links the character xml with an AI script
 +
|-
 +
! Character
 +
| XML || Links an object xml with rigging data, animations and attacks
 +
|-
 +
! Object
 +
| XML || A regular object xml file, links to a model and textures
 +
|-
 +
! Rigging data
 +
| XML || Links a model and a skeleton together so the model can be animated
 +
|-
 +
! Textures
 +
| TGA || The textures used by the character
 +
|-
 +
! Model
 +
| OBJ || The 3D mesh used by the character
 +
|-
 +
! Hulls
 +
| OBJ || The simplified collision to use for the character
 +
|-
 +
! Skeleton
 +
| PHXBN || The bone structure used by the character for animation
 +
|-
 +
! Ragdoll collision
 +
| FZX || Convex hulls used for ragdoll physics
 +
|}
  
==Basics==
+
To create a character for Overgrowth you need to...
 +
# Model and texture the character ([[#Model_and_Texture_Considerations|Guidelines]])
 +
# Create an ''object XML'' linking the model and the texture ([[#Object_XML|Instructions]])
 +
# Rig the character using one of the included skeletons and export ''.phxbn'', ''.fzx'' and ''.obj'' ([[#Rigging_the_Character|Instructions]])
 +
# Create a ''rigging data XML'' linking the model and the skeleton ([[#Rigging_data_XML|Instructions]])
 +
# Create a ''character XML'' linking the rigging data XML and the object XML with a set of attacks and animations the character should use ([[#Character_XML|Instructions]])
 +
# Create a script XML linking the character XML with an AI script ([[#Script_XML|Instructions]])
 +
# Create a _hulls.obj model to allow for thrown weapons to hit the character
  
Characters in overgrowth consist of 4 .XML files, an .OBJ file and a .PHXBN file. The .PHXBN file is created in Blender and contains the skeleton and skin weighting info. The XML files just contain links to themselves and other files. They contain the following:
+
The script XML file is the file that's loaded in the game to create the character. This article goes through all the above steps.
  
1 - Links to the .OBJ and .PHXBN files that the engine needs to rig the character.
+
== Model and Texture Considerations ==
 +
It's extra important for characters that the model is centered to the middle of the scene, standing on the grid floor with location and rotation set to zero, and scale set to one. It should loosely match the pose and proportions of the Overgrowth characters, you can use the following file for pose and size reference: ''../Overgrowth/Data/Models/Characters/Rabbit/rabbit.obj''.
 +
 
 +
There is no character shader that supports tangent space normal maps. If you want to use a tangent space normal map anyway, the cubemap shader can be used. Though doing so will make the object look a bit different in the engine. More information about these shaders can be found in the [[3D_Objects#Shaders|3D Objects]] article.
 +
 
 +
The model and textures for the character have the same requirements as when creating any other [[3D Objects|3D Object]], but with a few extra considerations.
 +
<div><ul>
 +
<li style="display: inline-block;">[[Image:ExampleMan_mesh.jpg|thumb|Character Model Faces Z-axis and has unaltered translation, scale and rotation]]</li>
 +
<li style="display: inline-block;">[[Image:ExampleMan_Norm.jpg|thumb|This is what a Blank/Flat object-space normal map might look like]]</li>
 +
</ul></div>
 +
=== Character texture channels ===
 +
[[Image:Character_textures.png|480px|thumb|This is what all the texture channels for a character look like]]
 +
==== Color texture channels ====
 +
<ul>
 +
<li>'''Red, Green, Blue''': They do what you'd expect - Albedo channels. It is the base "diffuse" texture. It doesn't seem to get gamma corrected in the shader source, so it may be assumed to be linear.
 +
Ambient occlusion can be baked in, since the engine doesn't enable screen space AO by default, nor supports a separate AO channel.</li>
 +
<li>'''Alpha''': This maps to "smoothness". It is basically an inverse of the typical "roughness" channel you might use in a physically-based-rendering workflow. It gets gamma corrected in the shader, so you might have to change your curves to accommodate this.</li>
 +
</ul>
 +
==== Normal map texture channels ====
 +
<ul>
 +
<li>'''Red''': The character's left-hand side is red</li>
 +
<li>'''Green''': The character's front side is green</li>
 +
<li>'''Blue''': The character's top side is blue</li>
 +
<li>'''Alpha''': The rim light that gets applied when the character is in silhouette is masked by the alpha channel. If the alpha channel is 1.0 (white), then the rim light is at full strength. If the alpha channel is at 0.0, then the rim light is disabled for that part of the model. Grey is somewhere between those. It gets gamma corrected in the shader, so you might have to change your curves to accommodate this.</li>
 +
</ul>
 +
<br clear=all>
 +
=== Fur Fins ===
 +
'''TODO:''' Write about how fur fins work
 +
 
 +
'''TODO:''' The fur fin is just another model, triangulated, etc. The alpha channel for the fur fins is actual transparency.
 +
 
 +
'''TODO:''' Are fur fins rigged? Not sure...
 +
 
 +
== Object XML ==
 +
This is a regular object file as described in the [[3D_Objects#Basics | 3D reference guide]]. Note that the ShaderName flags (like #TANGENT for instance) don't make any difference for characters since they use a pre-detemined path through the uber shader.
 +
<pre>
 +
<?xml version="1.0"?>
 +
<Object>
 +
    <Model>Data/Custom/Markuss/ExampleMan/Models/ExampleMan.obj</Model>
 +
    <ColorMap>Data/Custom/Markuss/ExampleMan/Textures/ExampleMan_Color.TGA</ColorMap>
 +
    <NormalMap>Data/Custom/Markuss/ExampleMan/Textures/ExampleMan_Norm.TGA</NormalMap>
 +
    <ShaderName>envobject</ShaderName>
 +
</Object>
 +
</pre>
 +
 
 +
Once you have created this file for your character it's a good idea to see if everything is working so far by loading the ''object XML'' in the editor.
 +
 
 +
== Rigging the Character ==
 +
Overgrowth uses one of the custom [[Binary_File_Formats|binary file formats]], namely the [[Binary_File_Formats#PHXBN|PHXBN (Phoenix Bones) format]] to store skeletons. To export a skeleton to a PHXBN file you need to use Wolfire's custom export addon for Blender. A repackaged version of Blender for Windows with the export addons and with the UI set up for this task can be downloaded [https://cdn.wolfire.com/techsupport/Blender-Overgrowth-Win.zip here]. You may need to restart the program once to get the export options to show up.
 +
 
 +
'''TODO''': How do you set this up yourself, if you're not using Windows for instance?
 +
 
 +
This article won't teach you how to use Blender, it only gives the information essential to get a character into the game. If you need to learn the basics of Blender, [https://cgcookie.com CG Cookie] has a good free video tutorial series that introduces you to the software.
 +
 
 +
Here are the steps you need to take in Blender to create the .phxbn, .fzx and .obj files:
 +
 
 +
# Open '''Data\BlendFiles\rabbit_rig.blend''' in Blender 2.55 with the PHXBN-add-on installed
 +
:::'''Note:''' If you download Blender from the link provided at the top of this page, the right file is already loaded.
 +
# Replace the rabbit model in the scene with your own character
 +
#* Press '''File > Import > Wavefront (.obj)''' to import an obj file.
 +
# Bind your own mesh to the rig
 +
## Select the mesh, then shift-select the rig to add it to your selection before you press Ctrl + P and select '''Armature Deform → With Empty Groups/With Envelope Weights/With Automatic Weights''' depending on how you want
 +
##* It's recommended to test your character in engine with automatic weights to check that you have no  other errors before you start working on a final weight paint. It won’t look pretty, but will let you know early on how the character is going to work in the engine
 +
## Unassign all vertices in your model from any bone in the rig that doesn't have ''DEF'' in the name
 +
### Go into editor mode on the model and select all vertices
 +
### In the ''Properties editor'', go to the ''Object Data'' tab and expand the ''Vertex Groups'' menu
 +
### Select a vertex group that doesn't have ''DEF'' in its name, click ''Remove'', then select the next vertex group that doesn't have ''DEF'' in its name, click ''Remove'' again and so on until there are no groups assigned that doesn't have ''DEF'' in their name
 +
## Edit the weight painting for your character if you need to
 +
# Export your files
 +
#* With rig selected and in rest mode in object mode, export as .PHXBN
 +
#* With mesh selected in object mode and with the rig in rest mode, export as .OBJ, replace the .OBJ you imported if you want, since it's no longer needed
 +
#* '''TODO''': how to create and export FZX? What is FZX actually used for? Is FZX required?
 +
 
 +
As long as everything went smoothly your character is now ready to be integrated into the game engine! The next step is to create the rigging data XML.
 +
 
 +
== Rigging data XML ==
 +
Links to the .OBJ and .PHXBN files that the engine needs to rig the character.
 
<pre>
 
<pre>
 
<?xml version="1.0" ?>
 
<?xml version="1.0" ?>
Line 20: Line 136:
 
</pre>
 
</pre>
  
2 - A regular object file as described in the [[3D_Objects#Basics | 3D reference guide]].
+
== Character XML ==
<pre>
+
Links to the object XML and rigging data XML files as well as the animations and attacks the character will use.
<?xml version="1.0"?>
 
<Object>
 
<Model>Data/Custom/Markuss/ExampleMan/Models/ExampleMan.obj</Model>
 
<ColorMap>Data/Custom/Markuss/ExampleMan/Textures/ExampleMan_Color.TGA</ColorMap>
 
<NormalMap>Data/Custom/Markuss/ExampleMan/Textures/ExampleMan_Norm.TGA</NormalMap>
 
<ShaderName>cubemapobjchar</ShaderName>
 
</Object>
 
</pre>
 
  
3 - Links to the first 2 files, and a load of animation files for each action.
 
 
<pre>
 
<pre>
 
<?xml version="1.0" ?>
 
<?xml version="1.0" ?>
Line 60: Line 167:
 
</pre>
 
</pre>
  
4 - Links to the third file and an AI script, this is the file you choose when loading a character.
+
'''TODO''': How do you decide what animations to use?
 +
'''TODO''': How do you decide what attacks to use?
 +
 
 +
== Script XML ==
 +
Links to the character XML file and an AI script, this is the file you choose when loading a character.
 +
 
 
<pre>
 
<pre>
 
<?xml version="1.0" ?>
 
<?xml version="1.0" ?>
 
<Actor>
 
<Actor>
<Character>Data/Custom/Markuss/ExampleMan/XMLFiles/ExampleMan_AnimList.xml</Character>
+
    <Character>Data/Custom/Markuss/ExampleMan/XMLFiles/ExampleMan_AnimList.xml</Character>
 
     <ControlScript>enemycontrol.as</ControlScript>
 
     <ControlScript>enemycontrol.as</ControlScript>
 
</Actor>
 
</Actor>
 
</pre>
 
</pre>
  
 +
Now you have everything you need to load the character into the game, so try loading this ''script XML'' file in the editor and see if it works!
 +
 +
At this point the character loads, but we are not finished yet! For the character to be able to be hit by thrown weapons you need to create a _hulls.obj model. This is covered in the next section.
 +
 +
=== Hulls ===
 +
To enable your character to be hit by thrown objects you need to create a _hulls.obj file for it. The _hulls.obj file is a simplified collision representationis used for checking when thrown weapons hit the character.
 +
 +
You might want to use one of the existing _hulls.obj files as a base for creating your own. These can be found in the same folder as the model they are for, so for instance, in "Overgrowth/Data/Models/Characters/IGF_Turner" there is a IGF_Turner_hulls.obj file that you can use.
  
==Model and Texture Requirements==
+
Here are the steps for creating your _hulls.obj file:
[[Image:ExampleMan_mesh.jpg|thumb|Character Model Faces Z-axis]]
 
Models have to be triangles only and centered to the middle of the scene with location, rotation and scale set to zero. It should loosely match the pose and proportions of the Overgrowth characters, you can use the following file: ''../Overgrowth/Data/Models/Characters/Rabbit/rabbit.obj''.
 
  
If your character is not symmetrical, ignore the center line in the geometry, it has to be the "true" the center of the model, otherwise you will get errors.
+
# Import or create a single mesh object in Blender with several individual convex hulls in it, you might want to keep your model in the same scene to see how everything overlaps
 +
# '''TODO''': Do the convex hulls need to be weight painted to the bones?
 +
# Export the object as an .obj file into the same folder as the character's obj file, with the following naming convention: model_hulls.obj
  
There is no character shader that supports tangent space normal maps. If you want to use a tangent space normal map anyway, the cubemap shader can be used. Though doing so will make the object look a bit different in the engine. More information about these shaders can be found in the [[3D_Objects#Shaders|3D Objects]] article.
+
So if the name of the character's model is "rabbit.obj", then the hulls.obj file needs to be named "rabbit_hulls.obj" to work.
  
[[Image:ExampleMan_Norm.jpg|thumb|This is what a Blank/Flat object-space normal map looks like]]
+
To test out if your hull works, load up your character in the game and try throwing some weapons into them.
  
==Blender==
+
If you want to add your character to the spawner menu to make it easier for others to access, read the next section.
A repackaged version of Blender with the export addons and with the UI set up for making characters can be downloaded at the top of this article. It does not require an install and can be run from its folder. You may need to restart it once to get the export options to show up.
 
  
This article is not intended to teach how to use Blender, it only gives the information essential to get a character into the game. If you would like to learn more about Blender, the website cgcookie.com has a good free tutorial video series that will introduce you to the software. With that in mind, here are the basic camera controls in Blender:
+
== Adding Characters to the spawner menu ==
{| class="wikitable"
+
Short version:
|-
+
* You must add it in a mod.
! Control !! Function
+
* You can add as many characters to the spawner menu as you want in a single mod, you just need to follow the below instructions for each, and add multiple <code><Item></code> tags to your mod.xml file.
|-
 
! Middle mouse
 
| Orbit
 
|-
 
! Shift + middle mouse
 
| Pan
 
|-
 
! Ctrl + middle mouse or scroll wheel
 
| Zoom
 
|}
 
  
===Replace the white rabbit===
+
In your mod.xml file, add this xml tag:
{| class="wikitable"
+
'''TODO''': Make these paths more specific to characters
|-
 
! Control !! Function
 
|-
 
! Right click
 
| Select object
 
|-
 
! Delete or X
 
| Remove selection
 
|}
 
Press '''File > Import > Wavefront (.obj)''' to import an obj file.
 
  
===Bind your own mesh to the skeleton===
+
<pre><Item category="My Custom Mod Characters"
 +
      title="Some Character To Spawn"
 +
      path="Data/Objects/example_item_pack/mod_item_example.xml"
 +
      thumbnail="Data/UI/example_item_pack/thumbs/mod_item_example.png" /></pre>
  
Shift + right-click = select more then 1 object<br/>
+
* '''<code>category</code>''' is the top level category where the character will show up, in the '''Load''' menu.
Ctrl+P = bind selected mesh to selected skeleton (armature deform)
+
* '''<code>title</code>''' is the name of the character, as it will show up in the spawner menu.
 +
* '''<code>path</code>''' is the path to the character XML that will get spawned. See [[#How_to_create_a_character|the '''How to create a character''' section]] for which XML file to target (either the character XML itself, or a version you saved off that has modified default parameters).  '''TODO''': Be careful to advise ''which'' character XML to add to the spawner - there are multiple character XML files!
 +
* '''<code>thumbnail</code>''' is the image that will be used for a tooltip when you hover over your character in the spawner menu.
  
You need to select the mesh, then the skeleton, before you press Ctrl+P
+
See '''<code>GameInstallDir/Data/ExampleMods/mod_xml_specification.txt</code>''' for full information.
  
===Paint weights===
+
== See also ==
 +
* [[Custom Animations]]
 +
* [[Custom Attacks]]
  
Drop down box near file menu = switches between editing modes<br/>
+
== TODOs ==
TAB = switches between last 2 editing modes
+
'''TODO: Make sure all these headings are covered in this or some other article that we link to'''
  
You may want to go to YouTube and look up a tutorial on painting weights in blender.
+
=== File path conventions ===
 +
'''TODO''': Description of where to add files in mods so they don't conflict. Ala [[Hotspot_Scripting#File_path_conventions]]
  
===Export your files===
+
=== Morph targets ===
 +
'''TODO''': Links to or docs on morph target animations for hands, face, etc
  
With skeleton selected in object mode, export as .PHXBN, same for mesh but as .OBJ, needs to be in rest position.
+
=== Eyes ===
 +
'''TODO''': Links to or docs on morph target animations for eyes (might roll this up into other sections/other pages?)
  
It is recommended that you test your character in engine with automatic weights to check that you have no errors before you start working on a final weight paint. It won’t look pretty, but will let you know early on if the character is going to work in the engine.
+
=== Custom Sounds ===
 +
'''TODO''': Links to or doocs on how to use custom character sounds for attacks/deaths etc.

Latest revision as of 09:24, 6 September 2018

TODO: Put this link graciously provided by Markuss in its appropriate section:
https://cdn.wolfire.com/techsupport/ExampleMan.zip

TODO: Write introduction

Overview

All required files and what they contain

Characters in overgrowth consist of the following files.

Name File format Description
Script XML Links the character xml with an AI script
Character XML Links an object xml with rigging data, animations and attacks
Object XML A regular object xml file, links to a model and textures
Rigging data XML Links a model and a skeleton together so the model can be animated
Textures TGA The textures used by the character
Model OBJ The 3D mesh used by the character
Hulls OBJ The simplified collision to use for the character
Skeleton PHXBN The bone structure used by the character for animation
Ragdoll collision FZX Convex hulls used for ragdoll physics

To create a character for Overgrowth you need to...

  1. Model and texture the character (Guidelines)
  2. Create an object XML linking the model and the texture (Instructions)
  3. Rig the character using one of the included skeletons and export .phxbn, .fzx and .obj (Instructions)
  4. Create a rigging data XML linking the model and the skeleton (Instructions)
  5. Create a character XML linking the rigging data XML and the object XML with a set of attacks and animations the character should use (Instructions)
  6. Create a script XML linking the character XML with an AI script (Instructions)
  7. Create a _hulls.obj model to allow for thrown weapons to hit the character

The script XML file is the file that's loaded in the game to create the character. This article goes through all the above steps.

Model and Texture Considerations

It's extra important for characters that the model is centered to the middle of the scene, standing on the grid floor with location and rotation set to zero, and scale set to one. It should loosely match the pose and proportions of the Overgrowth characters, you can use the following file for pose and size reference: ../Overgrowth/Data/Models/Characters/Rabbit/rabbit.obj.

There is no character shader that supports tangent space normal maps. If you want to use a tangent space normal map anyway, the cubemap shader can be used. Though doing so will make the object look a bit different in the engine. More information about these shaders can be found in the 3D Objects article.

The model and textures for the character have the same requirements as when creating any other 3D Object, but with a few extra considerations.

  • Character Model Faces Z-axis and has unaltered translation, scale and rotation
  • This is what a Blank/Flat object-space normal map might look like

Character texture channels

This is what all the texture channels for a character look like

Color texture channels

  • Red, Green, Blue: They do what you'd expect - Albedo channels. It is the base "diffuse" texture. It doesn't seem to get gamma corrected in the shader source, so it may be assumed to be linear. Ambient occlusion can be baked in, since the engine doesn't enable screen space AO by default, nor supports a separate AO channel.
  • Alpha: This maps to "smoothness". It is basically an inverse of the typical "roughness" channel you might use in a physically-based-rendering workflow. It gets gamma corrected in the shader, so you might have to change your curves to accommodate this.

Normal map texture channels

  • Red: The character's left-hand side is red
  • Green: The character's front side is green
  • Blue: The character's top side is blue
  • Alpha: The rim light that gets applied when the character is in silhouette is masked by the alpha channel. If the alpha channel is 1.0 (white), then the rim light is at full strength. If the alpha channel is at 0.0, then the rim light is disabled for that part of the model. Grey is somewhere between those. It gets gamma corrected in the shader, so you might have to change your curves to accommodate this.


Fur Fins

TODO: Write about how fur fins work

TODO: The fur fin is just another model, triangulated, etc. The alpha channel for the fur fins is actual transparency.

TODO: Are fur fins rigged? Not sure...

Object XML

This is a regular object file as described in the 3D reference guide. Note that the ShaderName flags (like #TANGENT for instance) don't make any difference for characters since they use a pre-detemined path through the uber shader.

<?xml version="1.0"?>
<Object>
    <Model>Data/Custom/Markuss/ExampleMan/Models/ExampleMan.obj</Model>
    <ColorMap>Data/Custom/Markuss/ExampleMan/Textures/ExampleMan_Color.TGA</ColorMap>
    <NormalMap>Data/Custom/Markuss/ExampleMan/Textures/ExampleMan_Norm.TGA</NormalMap>
    <ShaderName>envobject</ShaderName>
</Object>

Once you have created this file for your character it's a good idea to see if everything is working so far by loading the object XML in the editor.

Rigging the Character

Overgrowth uses one of the custom binary file formats, namely the PHXBN (Phoenix Bones) format to store skeletons. To export a skeleton to a PHXBN file you need to use Wolfire's custom export addon for Blender. A repackaged version of Blender for Windows with the export addons and with the UI set up for this task can be downloaded here. You may need to restart the program once to get the export options to show up.

TODO: How do you set this up yourself, if you're not using Windows for instance?

This article won't teach you how to use Blender, it only gives the information essential to get a character into the game. If you need to learn the basics of Blender, CG Cookie has a good free video tutorial series that introduces you to the software.

Here are the steps you need to take in Blender to create the .phxbn, .fzx and .obj files:

  1. Open Data\BlendFiles\rabbit_rig.blend in Blender 2.55 with the PHXBN-add-on installed
Note: If you download Blender from the link provided at the top of this page, the right file is already loaded.
  1. Replace the rabbit model in the scene with your own character
    • Press File > Import > Wavefront (.obj) to import an obj file.
  2. Bind your own mesh to the rig
    1. Select the mesh, then shift-select the rig to add it to your selection before you press Ctrl + P and select Armature Deform → With Empty Groups/With Envelope Weights/With Automatic Weights depending on how you want
      • It's recommended to test your character in engine with automatic weights to check that you have no other errors before you start working on a final weight paint. It won’t look pretty, but will let you know early on how the character is going to work in the engine
    2. Unassign all vertices in your model from any bone in the rig that doesn't have DEF in the name
      1. Go into editor mode on the model and select all vertices
      2. In the Properties editor, go to the Object Data tab and expand the Vertex Groups menu
      3. Select a vertex group that doesn't have DEF in its name, click Remove, then select the next vertex group that doesn't have DEF in its name, click Remove again and so on until there are no groups assigned that doesn't have DEF in their name
    3. Edit the weight painting for your character if you need to
  3. Export your files
    • With rig selected and in rest mode in object mode, export as .PHXBN
    • With mesh selected in object mode and with the rig in rest mode, export as .OBJ, replace the .OBJ you imported if you want, since it's no longer needed
    • TODO: how to create and export FZX? What is FZX actually used for? Is FZX required?

As long as everything went smoothly your character is now ready to be integrated into the game engine! The next step is to create the rigging data XML.

Rigging data XML

Links to the .OBJ and .PHXBN files that the engine needs to rig the character.

<?xml version="1.0" ?>
<rig bone_path = "Data/Custom/Markuss/ExampleMan/Models/ExampleMan.phxbn"
     model_path = "Data/Custom/Markuss/ExampleMan/Models/ExampleMan.obj"/>

Character XML

Links to the object XML and rigging data XML files as well as the animations and attacks the character will use.

<?xml version="1.0" ?>
<character>
    <appearance obj_path = "Data/Custom/Markuss/ExampleMan/XMLFiles/ExampleMan_Object.xml"
                skeleton = "Data/Custom/Markuss/ExampleMan/XMLFiles/ExampleMan_RigFiles.xml"/>
    <animations idle = "Data/Animations/r_idle2.xml"
                jump = "Data/Animations/r_jump.xml"
                roll = "Data/Animations/r_roll.xml"
                movement = "Data/Animations/r_movement.xml"
                wall = "Data/Animations/r_wall.xml"
                ledge = "Data/Animations/r_ledge.anm"
                medrightblock = "Data/Animations/r_activeblockmedright.anm"
                medleftblock = "Data/Animations/r_activeblockmedleft.anm"
                highrightblock = "Data/Animations/r_activeblockhighright.anm"
                highleftblock = "Data/Animations/r_activeblockhighleft.anm"
                lowrightblock = "Data/Animations/r_activeblocklowright.anm"
                lowleftblock = "Data/Animations/r_activeblocklowleft.anm"
                blockflinch = "Data/Animations/r_activeblockflinch.anm"/>
    <attacks moving_close = "Data/Attacks/haymaker.xml"
             stationary_close = "Data/Attacks/thrustpunch.xml"
             moving = "Data/Attacks/spinkick.xml"
             stationary = "Data/Attacks/frontkick.xml"
             moving_low = "Data/Attacks/soccerkick.xml"
             low = "Data/Attacks/sweep.xml"
             air = "Data/Attacks/legcannon.xml" />
 </character>

TODO: How do you decide what animations to use? TODO: How do you decide what attacks to use?

Script XML

Links to the character XML file and an AI script, this is the file you choose when loading a character.

<?xml version="1.0" ?>
<Actor>
    <Character>Data/Custom/Markuss/ExampleMan/XMLFiles/ExampleMan_AnimList.xml</Character>
    <ControlScript>enemycontrol.as</ControlScript>
</Actor>

Now you have everything you need to load the character into the game, so try loading this script XML file in the editor and see if it works!

At this point the character loads, but we are not finished yet! For the character to be able to be hit by thrown weapons you need to create a _hulls.obj model. This is covered in the next section.

Hulls

To enable your character to be hit by thrown objects you need to create a _hulls.obj file for it. The _hulls.obj file is a simplified collision representationis used for checking when thrown weapons hit the character.

You might want to use one of the existing _hulls.obj files as a base for creating your own. These can be found in the same folder as the model they are for, so for instance, in "Overgrowth/Data/Models/Characters/IGF_Turner" there is a IGF_Turner_hulls.obj file that you can use.

Here are the steps for creating your _hulls.obj file:

  1. Import or create a single mesh object in Blender with several individual convex hulls in it, you might want to keep your model in the same scene to see how everything overlaps
  2. TODO: Do the convex hulls need to be weight painted to the bones?
  3. Export the object as an .obj file into the same folder as the character's obj file, with the following naming convention: model_hulls.obj

So if the name of the character's model is "rabbit.obj", then the hulls.obj file needs to be named "rabbit_hulls.obj" to work.

To test out if your hull works, load up your character in the game and try throwing some weapons into them.

If you want to add your character to the spawner menu to make it easier for others to access, read the next section.

Adding Characters to the spawner menu

Short version:

  • You must add it in a mod.
  • You can add as many characters to the spawner menu as you want in a single mod, you just need to follow the below instructions for each, and add multiple <Item> tags to your mod.xml file.

In your mod.xml file, add this xml tag: TODO: Make these paths more specific to characters

<Item category="My Custom Mod Characters"
      title="Some Character To Spawn"
      path="Data/Objects/example_item_pack/mod_item_example.xml"
      thumbnail="Data/UI/example_item_pack/thumbs/mod_item_example.png" />
  • category is the top level category where the character will show up, in the Load menu.
  • title is the name of the character, as it will show up in the spawner menu.
  • path is the path to the character XML that will get spawned. See the How to create a character section for which XML file to target (either the character XML itself, or a version you saved off that has modified default parameters). TODO: Be careful to advise which character XML to add to the spawner - there are multiple character XML files!
  • thumbnail is the image that will be used for a tooltip when you hover over your character in the spawner menu.

See GameInstallDir/Data/ExampleMods/mod_xml_specification.txt for full information.

See also

TODOs

TODO: Make sure all these headings are covered in this or some other article that we link to

File path conventions

TODO: Description of where to add files in mods so they don't conflict. Ala Hotspot_Scripting#File_path_conventions

Morph targets

TODO: Links to or docs on morph target animations for hands, face, etc

Eyes

TODO: Links to or docs on morph target animations for eyes (might roll this up into other sections/other pages?)

Custom Sounds

TODO: Links to or doocs on how to use custom character sounds for attacks/deaths etc.