Author Archive

Open Outcast character variations

We want to have many, many talans on the streets so it would be cool if they are a bit different from each other, no? Here goes what I did to make that happen. First let me list features that cryengine offers to bring some variability to characters.

  • putting different meshes together in character editor
  • thin and fat mesh variations (for any mesh)
  • mesh decals
  • texture decals
  • material variations and diffuse texture coloring by decals

Putting different meshes together is used in OOC quite a lot, we have different heads, eyes, clothing, hats, belts and other accessories.

Thin and fat mesh variations – this comes in two flavors. Generally thin/fat mesh variations mean that you can morph a body into it’s fat version or thin version with slider, so you may have 50% of the fat body or even 150%. The flavors I mentioned means that you can supply a fat body mesh and thin body mesh, but you don’t have to. If you supply them, they are used as the morph target. If you don’t supply them, cryengine pushes the vertexes outwards to simulate some fatness, or pulling them inside to simulate thinness. This is similar to using Push modifier in 3dsmax. Of course the result is much better when you supply thin/fat meshes, because you have more control over the shape.

Because we are also using mesh decals I have decided that for the general body which most talans should use we will use the “automatic” cryengine fatness/thinness. For some variation it does good job, even though the result is probably more of a thick/slim variation then fat/thin. Later we may introduce a fat body for specific talans, but generally this simpler version will be used (which also saves a bit of memory because no real fat and thin mesh data have to be hold in memory). Also a real fat stomach could be achieved through “fat” clothing (under which body without torso may be used).

Here are a few examples of thin/fat body using the simple engine push/pull vertexes:

(thin – normal – fat)

On the picture the whole body gets thicker, but we have control over which parts should get thick/thin (like legs, torso or hands). Also on the picture head changes, but it wouldn’t have to. Another thing to note is that body doesn’t have muscles painted int the diffuse and normal map. This is because it would spoil the fat or very thin character. We still have textures and materials for the normal/muscular talans of course. Heads can also use thin/fat variations, but for OOC I have decided that for these thin and fat variations we will use different head altogether and that way we can generate lot of heads variations.

Mesh decals are small pieces of mesh which are textured with some decal like a tattoo, scar or some other distinctive feature. To optimize for drawcals, more decals are placed on the same texture (512×512) and then they are “selected” by changingn uv tiles and offset parameters inside sandbox. Mesh decals have their own material and their mesh is “skinned” on the skeleton so that they move and deform same as the body underneath.

Then we have texture decals. These are applied in the same material as the face texture. Advantage is that head diffuse texture can be in higher resolution, for example 1024×1024 and the tattoo decal can be as low as 256×256. This saves memory because the hi-res diffuse texture is shared among many talans (682 kB) and the head tattoo adds only 85kB on top of that. Of course borders of the tattoo will have a bit jaggy edges, but still they are worth the saved memory.

The same technique can be used for body dirt. Body diffuse texture which is shared among talans can be in much higher resolution that a few dirt decal textures. Diffuse body texture takes 1.33MB, while 5 different dirt decal textures for the whole body take only 853kB (even though there is visually no dirt on a particular body part, dirt decal is there too).

Here is an example – clean – dirty hands – dirty feet – dirty hands and feet – fully dirty :)

Next are the material variations like different skin brightness (tweaking melanin parameter with the same diffuse texture) or diffuse texture coloring. Coloring can happen through diffuse color in sandbox material editor. This is great feature for tweaking colors, but less great when we would want to color a greyscale texture completely by diffuse color. One of the reasons is rather obvious, we couldn’t have diferent colors on a more complex clothing, for simple skirt it could do, but something like Lora’s or Shamaaz robe which have different colors in different parts would break it completely. Another reason but much less visible is that if we color plain surface with only one color then it’s not very natural, even solid color in real life varies on hue a bit.
Here coloring (in cloth shader) by a decal comes to help. First we have to break the diffuse texture to it’s shading component and color component. Shading component can be higher res (contains all the detail) like 1024×1024 and the color component can be as low as 128×128. Let’s have a look at an example:

Try to find two same talan :) . What you see on the picture should be further enhanced so that any of the two same colors except the short skirt version should be at least slightly different hues and the dirt you see on the cloth has no variation. Now interesting facts about memory usage:

  • main diffuse texture is 1024×1024 large, has opacity included (for short skirt) and takes 1.33MB of memory
  • everything else is made by small textures in resolution 128×128 and they all take only 300kB of memory

This is how the big diffuse and all other small coloring decal textures look like:

They say eyes are important, so here are our talan eyes using simple diffuse coloring for the cornea of the eye to bring different colored eyes, example:

The smaller pupil on the middle image is different eye texture similar as this “damaged eye” which could and should be a bit better

and yo mama, someone said high, but how high?

That’s all folks. Let me know if something needs some more explanation.

Open Outcast character system

While talking about ooc character system, I will have talans in mind, but the same system will be used for humans or any other animals.

With characters there are usually two approaches, one where the whole character is exported from 3D application and later only a weapon or other asset is “linked” to his hand. This is very common for older games and simpler characters as animals. Another approach is to have different parts of the characters exported as separate pieces. These pieces are then glued together in some form of character editor.

Cryengine2 goes the more advanced options. Crysis characters have usually heads, hands, eyes and all the small accessories as separate objects glued together in sub-editor called “Character editor” inside Sanbox editor. Character editor also allows to select specific material for the piece of chracter. One could more or less ignore this system and just have a character consisting of one mesh, but this takes away the flexibility.

For OOC I have decided to make as good use of Cryengine2 character system as I was able to figure out :) . As far as I know, for now and for the most common talan characters I have ignored (on purpose) only one available feature and that is thin and fat meshes of the body and abused the same system for heads, but I will talk about this in second article that will go online soon.

I will start my explanation with what is happening in 3dsmax. There I took the dual-skeleton approach. Dual-skeleton approach means that there are two skeletons. The first skeleton is the one that is supposed to be animated, therefor called “animation skeleton”, “anim skeleton” or “anim rig”. The other skeleton is the “export skeleton”. Export skeleton as the name hints is meant to be exported and is meant for both, export with character meshes and for animation. Now the important part is that this export skeleton is constrained to the animation skeleton, so any motion on the animation skeleton moves the export skeleton too.

This approach has a few advantages, for example:

  • Cryengine is using skeleton geometry as physical ragdoll and hit detection geometry and therefor the skeleton has to be shaped to fit that purpose. Such a shaped skeleton may not be very animation friendly, so using dual-skeleton approach, export skeleton may be shaped wildly and it doesn’t matter for the animation skeleton.
  • Using dual-skeleton is much more flexible when we get to the point of making the rig more complex with some fancy features. This is because cryengine and other game engines may be expecting certain standards from the incoming skeleton like hierarchies, names. When we have two skeletons, export skeleton can be build with the engine rules in mind, whereas animation skeleton may be build with animator in mind.
  • Another advantage is that export skeleton may be simpler in terms of different helper bones and helpers. Animation skeleton may have many different helper objects which may not be required for the export skeleton.
  • Surely some more advantages :)

Now a bit about optimizations. For characters to move in game, vertexes of the character’s mesh have to be assigned to the bones. This process is called skinning. In cryengine up to 4 bone may influence the motion of one vertex. For example Loras has around 8000 vertexes as a complete character and as far as i know those 8000 vertexes have to be transformed to bone motion many times each second. So that may be lot of math running in the background. Usually these days all that math is done on GPU (hardware skinning), but could be running on CPU too.  As far as I know CE is using hardware skinning (please correct me in comments if I’m wrong). Either way, it’s always good to optimize how many vertexes will be transformed and this is even more important in games with many characters and we all know we would love to have really crowded streets in Open Outcast.

So to do a bit of optimizations for our characters, we have a few different body meshes, one is full naked body (don’t worry, they always will have some clothing :) ), then we have a few versions with parts of body cut away – body without the whole torso, body with hands and feet only and a few other. We are also using LOD’s for the bodies.

And back to Character editor. When character is glued together in editor, it is saved out as a definition file with .def extension which is actually a xml file. When creating a new character one has to start with some mesh. Usually this would be the naked body or some simplified version (part’s cut away) of it. I wanted to have this a bit simpler and a bit more flexible. Therefor we are using one extra mesh for our talans that ties them all together. This is a file/mesh called TalanSkeleton. This mesh contains only the bones from the export skeleton and a little triangle mesh. This triangle mesh serves for the exporter to export the skeleton at all :) . In character editor we then open this TalanSkeleton and start attaching different meshes including the body, head, clothing, accessories and decals. We also have to assign different material variations.

Hope you enjoyed reading and if there is anything not so clear, let me know and i may update the article or make a new one if there is more to talk about.

Return top