Dynamic Characters Tutorial

From HEWIKI
Jump to: navigation, search

Icon 3dsMax.pngHe advanced.png

Contents

This is an advanced level tutorial for artists, explaining how to create Dynamic Characters for HeroEngine. Before working through this page, you may wish to read the Dynamic Character Primer

Overview

HeroEngine has two types of characters:

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. Specific details on how to stay error free for each export mode are here Hero Export Guide.

It is required that character files go inside the Character/Dynamic_2 folder, but you may create subfolders in anyway you like.

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.

Tutorial

This tutorial will walk you through the full creation process of a dynamic character. The example will be the Lightless from Hero's Journey. The Lightless use the parts system as its dynamic component.

Components we will not use in this tutorial are Dynamic Texture Tinting, Texture Blending, or Dynamic Texture Banks.


Dyn char folder.jpg

There is now a Max Script that will create this basic folder structure, as well as the text files needed for a dynamic character. You can still do this all by hand, or you may choose to edit whatever the tool generates, whichever better suits your needs.

For a static character, the tool will create your character's named folder with .dat file, a .dyc file, a template .par file, a maps folder, an animations folder with a template animation agent script in it, and a parts folder.


Resource Files

Are available on the Account Management System download page



Dynamic Character

Build the geometry

Dyn char plan parts.jpg
Next, using 3ds Max, build a piece of geometry that resembles some sort of creature. For this example we are showing the Hero's Journey Manowar.

Name your new creature geometry, and make sure it is clean:

This character does not have vertex paint on it; however feel free to use the vertex paint modifier to get additional detail on your own character.

Dyn char parts.jpg



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 acceptable, 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 setup 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.

Multi Sub-Object Material with 2 HeroMaterials
HeroMaterial for the main texture of all the parts
HeroMaterial for glowing parts


Build the skeleton

Dyn char skeleton rig.jpg
You can use whatever you would like for a character rig. Biped, Max bones and a combination of the two are all viable methods. Programs such as Puppetshop and CAT are also very effective for creating your rig. Some things to keep in mind when building rigs:


Add the SRB

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

Dyn char SRB.jpg

Add Animation Masks

Dyn char anim mask1.jpg
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 on the Animation Mask page.
Dyn char anim mask2.jpg


  1. Select the Mask Editor button at the bottom of the HeroBlade Exporter
  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.


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 the 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.

When dealing with lots of parts, there are two work flows that we have used while working on Hero's Journey:

Monster Torso Part
Robot Torso Part
Scarecrow Torso Part


Export Your Dynamic Character Skeleton

Dyn char skeleton export.jpg
Last but not least, export your asset through the HeroBlade exporter. Set the mode as Skeleton and make sure that post processing is always on. Export unhidden is the most common way of exporting whatever is currently viewable in your view port. Remember to hide any unwanted helper or rigging objects. They will only add weight and confusion to your file.
  1. Hide any unwanted objects/helpers in the background before export
  2. Do not export any Geometry or Parts with the Dynamic Character Skeleton
Dyn char skeleton.jpg


Dyn char part export.jpg

Export Your Dynamic Character Parts

Last but not least, export your asset through the HeroBlade exporter. Set the mode as Character Part and make sure that post processing is always on. Export unhidden is the most common way of exporting what is viewable in your view port. Remember to hide any unwanted helper or rigging objects. They will only add weight and confusion to your file.

  1. Hide any unwanted objects/helpers in the background before export
  2. Export Parts one at a time either by hiding and unhiding unneeded parts, or by keeping them in separate files
  3. Keep the skeleton viewable, it will get stripped out by the post processor

Dyn char robot torso.jpg



Animate your Character

A guide for animating your Character can be found in the Animating Characters Tutorial


Create set up files

Set up a .DAT

A .dat file tells HeroEngine about your Character Specification. It has information such as where the character's skeleton and animations are located. It is usually easiest to just copy one of the sample character's .dat files, and edit it to suit your new character, rather than building a .dat file from scratch.

The .dat file needs to have the same name as the character folder that it resides in. In this example Hero's Journey case, "lightless".

Notice that with a dynamic character, the model line points to a .dyc file instead of the skeleton. This is because dynamic characters can have skeletal morphing which requires the declaration of multiple skeleton files.

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

!
! Character Specification for Character\lightless\lightless.dat
!
!
Version=2
[PARTS]
  Model=lightless.dyc                              
  AnimationSetFolder=Character\lightless\animation\          
  Agent=Character\lightless\animation\lightless.aas            
  Behavior=PlayerCharacter2
  Gender=Male

Set up a .DYC

A .dyc file tells HeroEngine about where the skeleton and parts files are located. The .dyc file becomes more involved when dealing with skeletal morphing and adds a few extra lines in for the additional skeletons.


Version=1
[SETTINGS]
  Skeleton=skeleton.(file extension)
  PartsSpec=lightless.par

Set up a .PAR

Main page: Parts Files

A .par, or Parts File, is used to tell HeroEngine about what parts your character is currently wearing, and what parts could possibly be used as alternatives.

Detailed information on the nuts and bolts of a .par file is located on the Parts Files page


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, .dyc file, .par file, animation files, .aas animation agent script, animationset.dat file, and animation sequence .asq files using the Repository Browser. Then, you can add your asset into HeroEngine.


Start HeroBlade

Register Character Specification

The remainder of the character pipeline takes place in the HeroBlade client. After all the appropriate files have been uploaded, register the character's specification with HeroEngine to let it know that the spec (in this case the Hero's Journey "lightless") exists. After the 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.

Dynchar henpc spec.png

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 HeroEngine.

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

/henpc add spec lightless \character\lightless\


Create an Instance of your Character

DynCharHEnpcCreate.png

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

Enter the following into the chat panel

/henpc create lightless


Change your Character's Parts

Dyn char possess.jpg
Possess your character by using the select tool or the move tool and right-click the character. When the menu appears, select Possess Npc.


Dyn char demo.jpg

Now that you've possessed your character, hold down control+shift and click in the upper left pixel of the viewport. This brings up the Hot Spot Menu, where you can select the No Frills Character Manager, probably under the CCS tab.



Dyn char demo2.jpg

Most of the Dynamic Character options are available here to tamper with.


Additional Dynamic Options

If you would to add any of the following features to your dynamic character, please follow the appropriate links below. Remember any combination of these features can be used for a dynamic character.

  1. Dynamic Texture Tinting with .dtb files
  2. Texture Swapping using Dynamic Texture Banks and Texture Layers
  3. Texture Blending
  4. Morphing and skeletal Morphing using the Facegen pipeline
  5. Facial Morphing using the Facegen pipeline
  6. Specialized Hair Rendering
  7. Working With Dynamic Characters in HSL


See also

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox