Obsolete. This documentation refers to either a deprecated system or an unsupported function or feature.
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.
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:
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).
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.
To make the model work correctly in the game, ensure the following:
Head's pivot position at 0/0/0
Preparation
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:
On 64-bit operating systems, Crytek recommends using PolyBumpApplication64.exe. It can handle many more polygons during the calculation process.
You can access the Computation Settings panel under Document > Computation Settings.
Follow these steps to set up the calculation:
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.
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.
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.
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:
For a detailed description, refer to the Ragdoll reference document.
For a detailed description, refer to the Create mtl File tutorial.
Once you have exported your base character you will want to refer to the Animation Startup Guide for more information.
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:
Make use of thin/fat variations to alter the model.
Level Of Detail Objects (LODs)
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:
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.
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:
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
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:
For exporting morphs, you only need to add a morph modifier onto the model, and then add all the morphs into its list.
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.