Game Character Optimization

A project I am working on requires players to wear various different pieces of armor/clothing & have various animations. My current working solution seems extremely inefficient, so I’m wondering if there’s a “right way” to do it.

Currently I’m cloning the model with all of the equipment meshes already attached and just modifying the submeshs/submaterials based on what the character is wearing. If you’re not wearing that piece it would basically make that submesh have a transparent material (terrible, I know).

I imagine there is a solution where I could create individual new meshes for each piece of armor as needed, and parent it to the character model. The problem is, I’ve tried this many times and haven’t been able to get the animations to work with it.

My hope is someone else on here has had a similar problem and can offer some advice.

Thanks for any help in advance!

I guess each type of equipment is to be parented to a particular bone of the armature with an particular location/rotation offset:

  • left glove is attached to left hand bone with an offset A
  • sword can be attached to left hand bone with an offset B
  • left shoe is attached to left foot bone with an offset C
  • etc…

So for each piece of equipment you need to attritube them a type (i.e. glove, weapon, shield, trousers).
Then for each type of equipment you need to store:

  • to which bone or bones it needs to be parented
  • what location/rotation offset from the default location/rotation you need to add once attached to its parent bone

For rigid objects (i.e. not the trousers), you can simply have an transform node (or empty node in blender) that is already parented to the bone with the specific offset, and so you just need to parent your object to it. For instance, you would have an empty node left_weapon_slot already attached to the left hand with the right location/rotation offset, and you would just need to parent the weapon you want to it.

For soft object, such as trousers, which needs to follow the shape deformation of the character, you would need to parent them directly to the bones they relate to, I think…

1 Like