Static Characters Tutorial

From HeroWiki
Jump to: navigation, search

File:Icon 3dsMax.pngTemplate:Tocright Template:Advanced


This is an advanced level tutorial for artists, explaining how to create static characters for HeroEngine.

Overview

There are two types of characters in HeroEngine, Static Character and Dynamic Characters.

  • Static Characters can be considered as 'fixed' characters as they have no swappable parts and are exported with the geometry and skeleton together.
  • Dynamic Characters can be considered as 'modular' characters as they have some combination of swappable parts, tintable textures, and/or swappable textures banks. Their skeleton is exported separately from the geometric parts.

Both Character Types can be initially setup using the Hero Character Tools within 3ds Max or Maya, then have updates exported using Hero Export.

This tutorial will walk you through the full creation process of a static character. The Manowar from Hero's Journey will be used for the 3ds Max example, while a generic human will be used for the Maya example.

Specific details on how to stay error free for each export mode are here Hero Export Guide

First you need to decide where all of your character files are going to go. By default there is a character branch in clean engine. It is required that character files go inside the Character folder. However, you can place them into subfolders of your liking. Some users will put their character folders under the required Dynamic_2 folder to keep things organized.

When using the Hero Character Tools, each character will get a set of folders in a folder based on the Character name.

For Static Characters, the tool creates a .dat file, the character's mesh and skeleton file, a maps folder with any applied textures copied over, and an animation folder with a template animation agent script in it, as well as a placeholder idle animation file.

For Dynamic Characters, a parts folder will also be created and the selected mesh exported there as a mesh file in addition to the Static Characters setup. with the skeleton file containing just the skeleton and no mesh. Meshes for Dynamic Characters should be exported as parts and saved in the parts folder.


Template:Break

Static Character

Build the geometry

First thing to do is to build yourself a piece of geometry that resembles some sort of critter in 3ds Max. For this example we'll be using the Manowar. Remember to name it and to make sure it is clean.
  • transforms and scale should be reset
  • Polys are single sided
  • Pivot point should be placed where you want it relative to the object, for characters this means origin (0,0,0)
  • Object should be 1 single mesh

This character has vertex paint on it, feel free to use the vertex paint modifier to get additional detail on your character.. Template:Break

Use a HeroMaterial

Next add a HeroMaterial to your Geometry. Materials are added within 3ds Max using a custom material, The HeroMaterial. If you need more than one HeroMaterial that is fine, you can assign a multi-sub object material with as many hero sub materials as you want or you can just assign individual HeroMaterials directly to the appropriate polygons. This is a common set up for a static creature. It uses a diffuse .dds texture as well as a normal map .dds with the specular derived from the alpha channel.

400px


Build the skeleton

You can use whatever you would like for a character rig. Biped, Max bones and a combination of the two are all viable methods. Some things to keep in mind when building rigs.

  • Rig should be placed on top and at the origin to ensure ease of use as files pile up.
  • Rig should face the -Y axis in 3ds Max (the default direction of biped) or +Z in Maya.
  • Rig's root node should be named Bip01 and its local X axis should face the world -Y(forward) for 3ds Max, and +Z in Maya.
  • Create any needed animation masks using the "Mask editor" on the export panel.
  • Biped nubs and footsteps node should be hidden.
  • Skeleton is a single root hierarchy. Bones must be parented to other bones. No broken hierarchy(bone to helper to bone)

Template:Break

Add the SRB

The SRB (Synthetic Root Bone) is used by the engine to keep track of a character location as well as syncing animation. Detailed information on the SRB can be found on the SRB page.

300px


Add Animation Masks

Animation Masks are used if you want to play a second animation on part of the rig. A good example is if a character is running and needs to play an impact animation. Since you won't want to stop the character from running, you can play the impact on the upper torso of the character while the lower half continues to run by adding an impact animation mask. Additional information can be found here on the Animation Mask page.

Template:Break

  1. Select the Mask Editor button at the bottom of the Hero Export
  2. Type a name into the input field - Impact in this example - and click add
  3. Select the channel from the now created list in the same window and click apply to all.
  4. Close Mask Editor
  5. Select each bone and adjust to the desired weight. Values are between 0 and 1 with 1 being 100% of the channel on and 0 being completely off.
  • Note Animation Masks only need to be created in the initial character export, not the animation files them selves

Template:Break

Skin the Geometry to the Skeleton

Make sure all bones have had their scales reset to be uniform 100%. Non uniform scaled bones can cause eventual animation problems in engine. With your character geometry selected either use the Skin Modifier or Physique. Only add the bones you actually need to drive geometry to the modifier. The reason for this is because GPU cards can only handle 73 bones per mesh. You must have at least 2 bones added in the envelope list. Leave the Skin or Physique modifier uncollapsed at the top of the stack.

Template:Break

Export Your Character

Last but not least, export your asset through the Hero Export. Set the mode as Character and make sure that post processing is always on. Export unhidden is the most common way of exporting whats viewable in your view port. Remember to hide any unwanted helper or rigging objects. They will only add weight and confusion to your file.
  • Export using the *Static Character* setting on Hero Export
  1. Hide any unwanted objects/helpers in the background before export


Animate your Character

A guide for animating your Character resides on Animating Characters Tutorial


Set up a .DAT

A .DAT file tells the engine about your Character Specification. It has information such as where the Characters skeleton and animations are located. It's easiest to just copy one of the sample characters .dat files and edit it to suit your new character. The .dat file needs to have the same name as the character folder that it resides in. In this case, Manowar.

More information on the .DAT can be found on the Character Spec page.

!
! Character Specification for Character\manowar\manowar.dat
!
!
Version=2
[PARTS]
  Model=manowar_skeleton.(file extension)
  AnimationSetFolder=Character\manowar\animation\
  Agent=Character\manowar\animation\manowar.aas
  Behavior=PlayerCharacter2
  Gender=Male


Upload

Until you've gone through the Animating Characters Tutorial and done all the appropriate work you will not be able to move on. Once you have done all the appropriate animations and associated files, continue forward.

Now that your Character is exported and your animations are all done, it's time to upload your resulting character_skeleton file,.dds textures, .dat file, animation files, .aas file, animationset.dat file, and animation sequence .asq files using the Repository Browser and then add your asset into HeroEngine.


Start Heroblade

Register Character Specification

The remainder of the character pipeline takes place in Heroblade. After all the appropriate files have been uploaded, we now must register the characters specification with the engine to let it know that the Manowar exists. After our Character Specification is created, you can make as many instances of that character as you like or use whatever systems your scripters come up with to move characters around.

After you enter an area (any area will do), open up the chat panel within Heroblade. We will use two /henpc commands to get us going. All /henpc commands are given through the chat panel.

Since we need to register the character first, we will add a specification to the engine.

Enter the following into the chat panel. spec is short for specification.

/henpc add spec manowar \character\manowar\

Template:Break

Create an Instance of your Character

Now that the character is registered with the engine, you can make an instance of it in the world.

Enter the following into the chat panel

/henpc create manowar

400px


See also