3d character customization (body parts)

Started by
5 comments, last by matttai 15 years, 5 months ago
Hi! Does anyone have any idea on how to go about creating this? I would like to give players the ability to swap body parts when creating their character by sticking together various 3d model aka Mr Potato head style and then use their final choice as a player model. I don't have any idea on how to proceed on doing this though. Any thoughts will be much appreciated. Edit: Forgot to add I am developing on XNA but conceptually a solution shouldn't matter I don't think?
Advertisement
The approach I've taken (and this is possibly not the best or easiest, but it's one that works for me) is to create character models with all the different Potato Head parts included as separate groups or submeshes of the overall model. For example there would be a group for each head, for each weapon, for each distinct item of clothing. They are attached to the skeleton and animated as any other part of the model.

When loading the models I also load a file of masks for each group so for example, the group for a sword might be given the mask '001', for a dagger '010' and a shield '100' (obviously the real masks are a bit longer and more complex than this in order to cover all possible parts). Then each character in the game is given an equivalent mask so that a sword and shield carrrying character would have the mask '101'. The drawing algorithm (which was already drawing by group) then does a bitwise check to see which groups to animate and draw and which to ignore for each character.

Combine this with similar handling for the textures (red shirt '001', green shirt '010', ...) and you very quickly get lots of variation.

Jon.
_______________________________________
Legends from the Lost Realms
The easiest format that I can think of is something similar to the MD3 Model format. Take a look here The actual MD3 format is binary, but you could easily make it into something more easy to use/read (such as XML).

The basic idea is that each part of the body has tags that connect to other body parts. So for the body, there are tags for the legs, arms, and head (and any more tags if you want). Then you just place the appropriate model at the tags and apply the orientation of the tag to the attached model.

I don't know if you could directly use the MD3 format, (since it only supports arms, legs, torsos, and heads) but you could easily extend this to make your own format with the extra tags.
I've seen several approaches to this, each has its pros/cons:
1. The one davek20 spoke about, having the custom parts in seperate files:
+ little memory used
+ no need to adapt the player models for it.
- some customizations might fit on one character, but on another they look bad, for example if you have a thin and a thick character, a vest from a seperate model file won't fit both models.

2. Having the customizations inside the model, by either:
* Show/Hide meshes based on their index or name,
* Or change texture of a mesh using skin files, and having a nodraw texture.
When that texture is set, the mesh won't be drawn.
Quake4 was using the skin approach to add items like a scope to guns.
+ fitting customization parts no matter what model you have.
- more memory used
- more work for the artist, as each model needs to be adapted.

If your characters are very similar and customizations would fit all of them, use the first approach, otherwise the second.
thanks guys for the replies!
so say if i was to use something like the MD3 approach, would creating seperate sets of items for each body type solve the fitment issue?
eg. fat armour for fat ppl and skinny armour for skinny people and restricting their usage to each type?
might work, you gotta try.. could fail though.
thanks TTK, i'll give it a go then and see how it goes.

This topic is closed to new replies.

Advertisement