Game character related questions

Hi!

I have a few questions about creating game characters.

First, some background information. I’m using Panda3D 1.7.0 and 3ds max 2011. I’m currently exporting my models with Pandasoft’s .x exporter. My aim is to create a character editor for my future games. If you know Nintendo Wii’s Mii-characters (or Xbox 360’s Avatars etc.), you’ve got a pretty good idea of what I’m after. My goal is to make it possible to change the following: skin tone, hair, eyebrows, eyes, mouth, shirt/jacket, pants and shoes.

My idea is that the character consists of two models: body and hair. Body model is common to every character (cartoonish and unisex). This way I only have to rig and animate one model. Different hair models are then attached to the body model. So, my first question is how to attach these two parts together? I’ve read about multi-part actors. Is this the proper way to go, although the hair is a static model?

My other question concerns texturing. My current idea is that the skin tone is a simple diffuse color and everything else (eyebrows, eyes, mouth, shirt/jacket, pants and shoes) is done with textures with transparency. So, the question is: is it possible to apply that many textures (currently 6, but could easily be more e.g. facial hair, moles and freckles) to one model/actor or am I hitting a limit here? If I’m indeed hitting a limit, then what are my options? Is this something that demands shaders?

Besides pure solutions, I’m also interested in feedback. Is my approach entirely awkward or overly complicated? Does somebody know a better way to accomplish the above? All ideas and suggestions are highly appreciated.

Thanks in advance.

To the first question:
If you have a rig/skeleton/armature (it has many names…) you can attach things to single bones/joints. The looking and gripping sample shows this very well. So this approach sounds ok.
Using multipart actors is not even necessary. Those are intended for separating single parts of the mesh for e.g. animating the eyes in code or change the head’s heap like in the saple above.

Second question:
You can combine textures on the fly, also generate a solid color one for the skin tone. I’d look into the PNImage class and the texturing section on the manual. Also you’ll probably want either multiple UV sets or otherwise your single texture layers will get quite big (as big as the whole combined texture). You could work with hardcoded UV offset, too, but this could be very confusing and hard to maintain.

Thanks for the tips.

I decided to combine textures at runtime as suggested. So, I now have total of three textures. One for skin tone, one for face (eyebrows, eyes and mouth) and one for clothes (shoes, pants, jacket). Each texture has it’s own uv set.

In 3ds max I have a standard material with a composite map in the diffuse slot. The composite map includes the three textures, each with their own map channel (corresponding the desired uv set). When rendered in 3ds max, everything looks fine.

The problem now is: how to export the model? So far I have achieved best results with autodesk’s own collada exporter (I have also tried Pandasoft’s .x exporter and OpenCOLLADA exporter, but they didn’t recognise the composite map). This exporter recognises the composite map and creates the following entries (to the .dae file):

<texture texture="Skin-image" texcoord="CHANNEL0">
...
<texture texture="Clothes-image" texcoord="CHANNEL1">
...
<texture texture="Face-image" texcoord="CHANNEL2">
...

These entries, when converted (dae2egg), translate to:

<Texture> Skin-image {
  ...
  <Scalar> uv-name { CHANNEL0 }
}
<Texture> Clothes-image {
  ...
  <Scalar> uv-name { CHANNEL1 }
}
<Texture> Face-image {
  ...
  <Scalar> uv-name { CHANNEL2 }
}

Everything fine so far. But after that there is not a single mention about those channels. So the texture-channel relations are introduced, but the channel-vertex relations are never defined. This naturally reflects to the .egg file also, where every vertex looks like this:

      <Vertex> * {
        -0.029054 1.57701 -4.5e-005
        <UV> { 0.494107 0.5 }
        <Normal> { -0.144951 0.989439 0 }
      }

when they should look like this:

      <Vertex> * {
        -0.029054 1.57701 -4.5e-005
        <UV> CHANNEL* { 0.494107 0.5 }
        <Normal> { -0.144951 0.989439 0 }
      }

Sorry for quite a long explanation, but I tried to be as clear as possible. I hope somebody has a solution to this. Different mapping style? Better exporter? Some option I have missed?

Any help is appreciated.

Do the polygons in your egg file reference the textures and materials? Polygons are listed after vertices, btw.

Yes they do. They look like this:

    <Polygon> {
      <TRef> { Skin-image }
      <TRef> { Clothes-image }
      <TRef> { Face-image }
      <MRef> { Character }
      <VertexRef> { 0 1 2 <Ref> { Character-lib } }
    }

There just isn’t any reference to those uv channels.

I never used Max, but how about multiple materials one for each UV set and texture?

Is that even applicable within Max?

I have used 3ds max for some time, but I’m by no means an expert, so I may be completely wrong. Here’s what I know:

In 3ds max it’s possible to assign different material IDs for groups of faces. Using a material called Multi/Sub-Object it’s possible to assign a different material for each material ID. This way it’s e.g. possible to have a cube with different material on each side/face. However, a face can only have one material ID.

In my case skin-texture’s uv set and clothes-texture’s uv set share mutual faces. Same goes for skin-texture’s uv set and face-texture’s uv set. So, I can’t have individual material IDs for each uv set.

That’s why I’m using one material with composite map. In composite map, every map can have an individual map channel. In Unwrap UVW and UVW Map modifiers there’s a possibility to set the desired map channel. That way 3ds max is able to match textures and uv sets.

As I said everything works fine inside 3ds max. Problem is how to export my model to Panda3D.

Any 3ds max gurus out there? I know that many here use Blender, but there must be some 3ds max users around.