Fat Thin Variations

Obsolete. This documentation refers to either a deprecated system or an unsupported function or feature.

CryENGINE Character Modeling

This document is a general overview of the topics that need to be taken care of when modeling a character for the CryENGINE.

It also contains links to more detailed sections in the documentation.

A character is a combination of geometry data that is attached to a skeletal hierarchy. Examples include a human body, a shark, an alien, a horse, or a rope. The information below is mainly for humans, but can often be implemented in other types as well.

Bodies

What is most important about the low-poly model?

The most important part of the low-poly model is the outer shape. It should follow the shape of the high-res model as much as possible. The normalmap will take care of all the details that are inside of this boundary.

To make the body model work correctly in the game, ensure the following:

  • The characters geometry is connected to a skeleton and is exported in the .chr format.
  • If the character is used as an AI, make sure that the physics settings and IK Limits are correctly set up.
  • The character geometry is facing the positive y-direction in 3ds Max or the positive z-axis in XSI and Maya. The rotation values must be 0/0/0.
  • The character geometry's pivot position is at 0/0/0.

Although it is not vital for the character to work properly, it is a good rule of thumb to avoid possible downstream problems (animations, attachments).

Additional Advice for a Clean Character Model

  • Make sure that the geometry matches the existing skeleton, from the big shapes down to the details (fingers).
  • Choose a pose that suits the range of motions that the character needs to achieve.
  • To improve the general deformation of the model, make sure that all the joints (arms, shoulders, legs) are slightly angled.
  • It is good to choose angles that are the average of the most used poses. A joint should never be stretched or angled to its maximum, but always kept in a natural in-between pose.
  • It is also important that the pose looks natural and comfortable. This is just a thumb rule and can't be nailed down as it always differs with the requirements of the character.

  • Add enough polygons to the joints to ensure a soft deformation.

General Modeling Workflow Tips

  • Start with a rough model to test the shapes and volumes in the game. The goal should be to identify and define the look of the gameplay-relevant visual components early on.
  • Make a mid-poly model.
  • Rig it roughly and do some test runs in the game. Note: Don't worry about the polygon count at this stage.
  • Don't start with the high poly before you are satisfied with the shape and volumes.
  • After the high-poly model is done, it is good to start using the mid-poly model as a base for the low-poly.
    If you are using Mudbox/Zbrush, you can use low iterations (1,2, or 3) as a base for the low-poly model.
  • Shapes are very important: Modeling details, which do not define the shape of the overall silhouette, are most likely a waste of time. Normalmaps will be more efficient in 90% of the cases. Use the polygons for keeping the model's shape interesting and detailed.

Setup in Sandbox

Human character bodies should be loaded in the Character Editor and fitted with various attachments (bags, head, helmets).

Please read more about it in the description of the Character Editor.

Debugging

  • p_drawhelpers 1 displays the physics mesh of the object

Heads

To make the model work correctly in the game, ensure the following:

  • The head geometry is placed on the body and does not clip through the neck or other geometry.
  • The head geometry is connected to a skeleton and is exported in the .chr format.
  • The head geometry is exported without errors (Multiple Vertex Colors and Degenerated UVW messages can be ignored, however); otherwise, the morphs will not be displayed.
  • The head geometry is facing the positive y-direction in 3ds Max or the positive z-axis in XSI.
  • The head geometry's pivot position is at 0,0,0 and its rotation is at 0/0/0 (refer to the image below). Although this is not vital, it helps to avoid possible downstream problems (animations, attachments).
  • All morph targets need to have their pivot point at the same relative position. Note: If all the morphs behave correctly after Reset Xform has been applied, they will also behave correctly in the game.


Head's pivot position at 0/0/0

General Modeling Workflow Tips

  • Use good edgeloops for better facial animation results (refer to the image below).

  • Do not model spiky lips. Use edgeloops to construct nice lips to make sure that the deformation looks good, even when the mouth is wide open.

  • Make sure that the lip volumes inside the mouth are also right. This is vital for good and realistic deformation.
  • Make sure that the eyelids perfectly fit the eyeballs. Unclean eyelids can result in clipping and crossed eyes.
  • An Eye-Overlay layer is a very good way to improve the shading of the eyes, but it is optional:
    • The Eye-Overlay technique is based on an overlay polygonal layer, with an alpha-masked area to fake soft shadows onto the eyeballs.
    • The Eye-Overlay geometry is usually the same as the eye leashes, to save draw calls.

High-Resolution Asset Calculation with the Standalone Polybump Application

Preparation

  • All models need to be exported in the .OBJ file format.
  • If you want to make calculations from separate materials, the low-poly model needs be exported with materials.

Note: You can split the high-poly geometry into as many parts as you need to.

You can fine the PolyBump application in these folders of the SDK installation/build:

  • \Tools\PolyBumpApplication.exe
  • \Tools\PolyBumpApplication64.exe

On 64-bit operating systems, Crytek recommends using PolyBumpApplication64.exe. It can handle many more polygons during the calculation process.

Setting Up the Calculation

You can access the Computation Settings panel under Document > Computation Settings.

Follow these steps to set up the calculation:

  1. Load the low-poly model: After loading the model, a dialog box will be displayed. Using this dialog box, you can limit the calculation to certain polygon IDs.
  2. Select the material IDs that you want to calculate.
  3. Load a single or multiple high-poly models into the calculation.
  4. Use this option to apply soft normals to the high-res mesh. Zbrush usually does not export smooth normals, so this option can be helpful in the case of rough calculation results.
  5. Load a cagemesh: The cagemesh will block the rays in the calculation and make it much easier to create clean normalmaps of nearby polygons such as fingers or certain folds.
  6. Select a Raycasting method.
  7. Occlusionmap quality settings: High settings will lead to long calculation times. To speed up the process, Crytek recommends using the Low settings and calculating the normalmap at twice the needed size.
  8. Use the Antialiasing settings: This option allows you to antialias the normalmap. Turn it off for draft processing to speed up the process. Use full 3x3 for the final calculations.
  9. Set the raylangth of the calculation: If you see holes in the normalmap, increase this value. If rays are hitting unwanted areas (for example, parts of the right legs being rendered on the left one or ears being rendered on the area behind the ears), decrease this value.
  10. Set the resolution of the calculation.
  11. Set the computation priority of the process. Use higher values for focusing the CPU on only this process. Use lower values to work, while calculating the normalmap in the background.
  12. Preview Input: Use this function to preview a wireframe version of the high-poly model and low-poly model, to check whether both are aligned or not.


Preview Image

After setting up the computation, you can start the process under Document > Start Computation (create SRF).

The tool generates a preview of the normalmap.

After the calculation is done, a preview will be displayed.

This preview shows the rendered normal-map, the ambient occlusion-map, and the displacement-map.

Save the data as an .srf file and use Document > Export SRF to TIF to export the image data in the CryTIF texture format.

Saving the calculation data as an SRF file allows you to recreate the textures with different settings without going through the whole calculation process. This data is stored in a 16-bit format, opposed to the standard 8-bit output formats.

For further information on using the PolyBump Application, refer to the Polybump Tool Reference, Polybump 3ds Max Plugin, Polybump Standalone Tutorial, and the Chamfering Edges tutorial.

Exporting a Character to the Sandbox Editor

Bodies

Exporting the Model

A model can be exported as a character only when it is weighted to at least a single Bone using the Skin modifier.

You can also use Physique, but it is not recommended (Skin is better than Physique inside 3ds Max as the weights can be transferred much more easily).

When exporting a character, make sure that you select the .chr export option in the exporter settings.

Setting Up the Material

This is necessary to ensure that the character will be displayed correctly and that all the physical attributes behave correctly.

The material of a character underlies the usual restrictions of the material system.

By default, the in game model will look for an .mtl (material file) with the same name as the material that it got assigned in 3ds Max. It should have the same name as the model to make it easier to identify.

  • Name of the object's default material: You need to name the material file, Marine.mtl in order to automatically load it with the object in Sandbox.
  • 11 is the minimum number of materials for a standard character using the Biped.
  • The first 10 materials are reserved for the skeletal information.
  • The last material is the material actually displayed in the game.

Refer to the DCC Setup (animated) for more information.

An attachment-based system usually contains an empty (no draw) .chr, including a physicalized skeleton. Onto this skeleton-model, various other .chr or .cgf files (potentially with a different set of materials) can be attached as desired and saved as a .cdf file.

The same material displayed in the Sandbox Material Editor:

  • Materials reserved for the skeleton
  • Actual material of the rendered model itself
Character Physics Authoring

For a detailed description, refer to the Ragdoll reference document.

Creating a Material

For a detailed description, refer to the Create mtl File tutorial.

Preparing character for Animation

Once you have exported your base character you will want to refer to the Animation Startup Guide for more information.

Setting Up a Simple .CDF File

CDF - Character Definition File
This is not necessary, but allows you to modify and vary the characters.

Note: Attaching character models to each other through skin attachment works only if both models have been exported based on the same skeleton. This means that the skeletal hierarchy and the bone naming of both models needs to be identical. However, objects that will be attached to each other are allowed to have less bones then the base model.


Based on the picture above:

  1. This is the initial bone system, containing 4 bones.
  2. This is the base model, skinned to the initial bone system.
  3. The branch has been removed from this bone system; the naming remains the same (this model could be attached to either 1 or 2).
  4. This bone system has another branch. The naming of the base and the first branch is the same as in 1. As it has more bones than 1, 2, or 3, it cannot be attached to any of those. On the other hand, using 4 as the base will allow 2 and 3 to be used as attachments.

  1. Attachment list: This is the list of all the attachments that are being attached to the base model.
  2. The objects and material slot: Loads attachments; the mtl slot allow the assigning of custom materials to the attachments.
  3. Attachment styles: Lets you select the way you want to attach the attachment.
    1. Bone attachment: The attachment can be placed wherever you want and will be stuck to the selected bone. Do not attach a .chr as a bone attachment, as attaching one skeleton to another will consume unnecessary memory. This works well for hats, glasses, and everything that needs to stay 100% in place.
    2. Face attachment: The attachment will look for the next and closest Polygon. It will be stuck to this polygon and always be woven along with it. This can be tricky in areas with strong deformation such as armpits or the belly area. It works well for pouches, external pockets, holsters, and everything that just stick to the surface.
    3. Skin attachment: Use this to attach one .chr file to another. You won't be able to move the model anywhere as the deformation is limited by the skin weights. It works well for heads, hand, exchangeable body parts, and everything that needs to be very accurately placed.
  4. Position tools: Use these tools to position the bone and face attachments.
  5. Character slot: This allows you to assign a custom material to the base model.
  6. Shape deformation slot: This slot allows you to alter the size of vertex color-coded areas. Use the Wireframe check box to display the assigned colors and the bar or the text field to vary the model to the required size. The natural value goes from -1 to +1, but those values can be exaggerated up to -2/+2.

Make use of thin/fat variations to alter the model.

Level Of Detail Objects (LODs)

  • LODs are an important part of the asset creation process; they are needed to ensure a high level of performance in the game.
  • LODs for characters can be created by using the same guidelines as for static/hard body objects.

Setting up LODs: If the model is called Bigfatmonster.chr, the LODs should be named as given below and contain these polycounts:

LOD0 {{ Bigfatmonster.chr }} 100%
LOD1 {{ Bigfatmonster_LOD1.chr }} 50% of LOD0
LOD2 {{ Bigfatmonster_LOD2.chr }} 25% of LOD0

Try to keep as much of the initial shape as possible. Don't forget to leave enough polygons for good deformation around the joints.

LODs can be created by using the optimization tools (multires, optimize, and Polycruncher™), but it's better to manually create them for important assets.
Ensure that you don't over optimize the joints, UV borders, or character unique aspects.

For more information about LODs in the CryENGINE, refer to the Creating LODs tutorial.

Thin/Fat Variations

Thin and fat variations are based on two morph targets of a base model. In the game, those morph targets can be accessed from the Character Editor, and used to create body shape variations as thinner and fatter characters. To control and define the different areas of morphing, you can use vertex colors. This will allow you to assign separate values to the head, hands, legs, and so on.

Note: Thin/Fat variations will be stored as sparse morphs in the engine. This means that they will be lighter in memory then all the three .chrs combined.

Limitations:

  • The difference between the variation models should be based only on differently positioned vertices.
  • The vertex count of all the variations needs to be identical.
  • The vertex-IDs count of all the variations needs to be identical.
  • The normals count of all the variations needs to be identical.
  • If you use thin/fat variations, you will need both a thin and a fat model to work.
  • LODs also need _thin.chr/_fat.chr files.

Note: For testing, it is enough to copy the base LOD model and rename it. This won't produce any visual difference, but also won't create any errors and will allow you to track down possible issues.

Creating Thin/Fat Variations


Exaggerated Variations for Demonstration Purposes

To make use of thin/fat variations, two new models need to be exported. These models need the _fat.chr and _thin.chr suffixes. Therefore, if the base model is called Bigfatmonster.chr, you need the following files:

Bigfatmonster.chr
Bigfatmonster_thin.chr
Bigfatmonster_fat.chr

Color Coding Thin/Fat Variations

Only 8-bit vertex colors can be used. This means that you have to set the vertex color values to 255,255,0 for yellow; 0,0,255 for blue, and so on.

The available vertex colors are:
Black: R0, G0, B0
Red: R255, G0 ,B0
Green: R0, G255, B0
Blue: R0, G0, B255
Yellow: R255, G255, B0
Mangenta: R255, G0, B255
Cyan: R0, G255, B255
White: R255, G255, B255

Once the colors are set and the model is being exported, you can make use of this feature.

Creating Thin/Fat LODs

LODs of thin/fat variations can be a bit tricky. You can model and fit them all manually, but here is a simple solution which should make this less of a problem:


The LOD2_fat is still missing

This technique is based on the 3ds Max Skin Wrap modifier.

You need:

  1. An existing set of LODs for the base model
  2. An existing set of thin/fat variations

Make sure that both the models are in the same place and share the same world space.

First, align both the models.

Take the LOD1 model and assign a Skin Wrap modifier to it.

Now pick the LOD0 base model as a reference object.

If you are unfamiliar with the Skin Wrap modifier, please check the 3ds Max manual. This modifier is actually fairly easy to use and shouldn't cause any serious problem.

Now, assign a Morph modifier to the LOD0 base model and pick the thin and fat variations as morphs. This is also a nice test to check whether the thin/fat variations actually work.

Now the LOD model is linked to the base model. When you start morphing the base model to its thin/fat variations, the LOD model will also change.

Set the morph values to the extreme of the fat variation and take a snapshot (3ds Max: Tools > Snapshot) of the LOD1 model and call it Bigfatmonster_fat_LOD1. Repeat the same procedure with the thin variation and call it Bigfatmonster_thin_LOD0.


LOD2_fat Model

Creating a Character with Exchangeable Parts

It is also possible to create a character whose parts are 100% exchangeable. For the base character, you can use a simple object like a box, which should have a no draw material assigned. This will make sure that you won't have to deal with any visual glitches later in the game. This model contains the skeleton and all the necessary information.

All other parts can now be attached to this model using the Character Editor.

Heads
Creating and Exporting Morphs
Morphs are stored as sparse morphs. This means that only the distance of the actual, different vertices will be stored. This saves a lot of memory. A side effect can be that the *.max files can become quite large (150 Megs), while the *.chr file, including all these morphs, stays small (1.3 Megs). The file size heavily depends on the vertex count and the amount of morphs you use.

When you create morphs, you have to ensure that the base mesh and all the morphs:

  • Share the same vertex count.
  • Share the same vertex IDs.
  • Have their pivots in the same relative space.

For exporting morphs, you only need to add a morph modifier onto the model, and then add all the morphs into its list.

  1. The Morph modifier is applied beneath the skin modifier.
  2. The Exporter will export only whatever is stored in the Morph modifier. Make sure that you click Reload All Morph Targets before you export any morphs. Optionally, you can use the auto refresh option of the Morph modifier. However, it may become slow and jerky when the Morph modifier fills up.

A character equipped with morphs exports like every other character.

Note: Ensure that the morph offset is set to 0.0001. The morph offset culls unnecessary data from the morphs. The number will set the maximum number of decimals that can be used for vertex coordinates within a morph target. Values too low (0.00000001) can produce gigantic files. Also, high values (1) will cull all the morphs and no morphs will show up in the game.

This value is very important.

By default, 3ds Max displays only 2 decimal points (0.01). If you want to see what you set up, in 3ds Max, go to Customize > Preferences > Spinners > Precision and raise the decimal count.


This value will set the spinner accuracy.