Kids with Wigs [SOLVED]

I’ve gotten to the part of creating my game that I’m actually schooled in, the art. I decided to throw myself right in the fire and make the most complicated pieces of art first, the actors. Since my game takes place in a school, I’m planning on having 2 base body shapes, one for male kids and one for female kids, and then modifying that base appearance with various normal maps to add necessary details. However, that really won’t do for making different hairstyles.

Since the kids will be viewed from a distance most of the time, I need to rely on coloration and hairstyle to help the player differentiate between them. That means I need to have a library with a good variety of noticeably different hairstyles.

To achieve this, I was planning on having the hair be separate models from the base bodies. That way I’m not loading redundant bodies for each hairstyle. (I’m assuming that if an egg contained some of the same data as another egg, but the two eggs had different names and some different components, Panda3D wouldn’t recognize it and would fully load both eggs. I know I wouldn’t put that level of data optimization into an engine.)

To make this work I was planning on using the multi-part actors I discovered in the manual. My plan is to make a file in my modeling/animating software that contains all the animations for the base body (one file for each base body) and convert that to an egg. Then I’ll go through and add hair objects to that file, in each case deleting everything except the “head” joint or whatever I call it so that the hair has an appropriate joint to glue to.

Does this sound like a good plan? Also, should I leave any animation I apply to the “head” joint in the hair file, or would I only need it in the body file?

i’m no expert, but the approach sounds good to me, except some details.
You don’t need multipart actors for that. You can simply expose the head joint and attach every hair model to it. The Looking and Gripping sample explains that very well. If your hair doesn’t need any animations, you only need to animate the head joint of the body.

You might also want to play around with the option in eggs:

<File> { filename }

  This includes a copy of the referenced egg file at the current
  point.  This is usually placed under an <Instance> node, so that the
  current transform will apply to the geometry in the external file.
  The extension ".egg" is implied if it is omitted.

  As with texture filenames, the filename may be a relative path, in
  which case the current egg file's directory is searched first, and
  then the model-path is searched.

taken from panda3d.cvs.sourceforge.net/view … ision=1.41.
This way you could have one body egg and include it in every extended model so you only need to call loadModel once for loading both body and hair. But on the other side, you’d have to export all extended models every time you change something on your body that is head related (e.g. make the whole body smaller or bigger).

I took your advice and used the technique in the looking and gripping tutorial to attach the hair. Thanks for the heads up on that one.

I have another question in another post that the file tag you mentioned might relate to. Would you mind looking at that for me?

https://discourse.panda3d.org/viewtopic.php?t=8240

First of all: most people here are reading all new posts, so you don’t need to point anybody from one to another post.

To your question: answered in the appropriate thread