Variable parts for game models?

Started by
4 comments, last by MessageBox 20 years, 1 month ago
I was wondering are there any methods out there for having models made of variable parts in a game. Like in a character customization screen, you could give the character a certain nose, arms, torso, etc.... Basically you model loads of different parts and stick them together in whatever combination the player desires. Does anyone have any ideas how this could be implemented in a game?
Advertisement
You would probably want to go with a skeletally animated system for the main body parts, and attach various positional "tags", or information (could actually even be "bones" themselves), about where non-skeletal parts (nose, etc...) are attached. Arms, legs, torso, etc... can be composed of separate meshes which have a reference to the bone(s) of the standard skeleton which deform them.

From there, it''s a simple matter of building your bone matrix palette, then drawing each body part or component in sequence, as you would with a non-component based model. Each component you draw is drawn as a mesh which can reference the matrix palette.

Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller
So the ideal way to do it would be to create the main model as normal and give it tags for the customizable features?
BTW, are you talking about having customizable arms, legs etc.... that would be even better. But would the deformations look realistic, using tags for these main body parts.
i dont know much of the material but maybe you should search for ''facial animation'' at altavista.com or so, and you should find the same things you need...
I''m not really worried about the facial animation side, it''s having customizable parts that I''m interested in.
In standard skeletal animation, you have a mesh and a skeleton. Each vertex has a Bone attribute (or set of attributes, if you use weighting) which indicates which bone(s) in the hierarchy affects that vertex. You construct a palette of bone matrices, and iterate through all vertices in the mesh, transforming each by the appropriate bone and rendering.

In a component-based system, it is exactly the same except that instead of having a single solid mesh, you have a collection of smaller separate meshes, which can be independently swapped with different meshes for different components.

Say a certain character has a skeleton with uniquely named bones: Head, Torso, LeftBicep, RightBicep, etc...

A wide variety of components and pieces are created for characters that can fit this skeleton. Different head meshes, for instance, (bald, tatooted, green with big ears) are all modified by the Head bone. Chainmail or platemail are made as separate meshes, designated to be modified by the Torso bone. Gloves are designated to be modified by either the LeftHand bone or the RightHand bone (and can be further constructed to designate fingers as well, if such is necessary).

So, a character model will consist of a set of component pointers for each of the body part divisions: Head, Torso, Legs, Feet, Arms, Bracers, Gloves, etc... Also, additional bones can provide "tags" or hooks into the skeleton for transformation of things such as weaponry and shields.

Now, to draw the character, you simply iterate through each of the components and draw each mesh. Each mesh is drawn in the same manner as drawing a solid (non-component-based, that is) single character mesh: each vertex is transformed by the appropriate bone matrices. So, when you draw the head, you pass the Head matrix to the shader or transformation code, and each vertex of the head mesh that is drawn is transformed by the Head bone matrix. For the armor, you pass the Torso bone, which transforms each vertex of the armor mesh. And so on.

In your animation data, things such as weapon tags can consist simply of extra bones parented to the skeleton to represent the currently held weapon, the currently held shield, and so forth. Different tags might be represented for different stances and weapon/shield combinations-- a character holding a spear will stand and animate differently than a character holding a sword and shield, and the animated positions of the various "Weapon" and "Shield" type tags will reflect this. But in the end, these tags are simply just more bones added to the skeleton.

You'll want to make sure you have a firm understanding of basic skeletal animation before you complicate it with a component system, but in reality it is not that difficult.

Golem
Blender--The Gimp--Python--Lua--SDL
Nethack--Crawl--ADOM--Angband--Dungeondweller

[edited by - VertexNormal on February 29, 2004 10:43:21 PM]

This topic is closed to new replies.

Advertisement