Jump to content
  • Advertisement
Sign in to follow this  
Butabee

Mix and match armor

This topic is 3034 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make a game where a player can wear a variety of different armor pieces in 3D, but I'm not sure how to handle the armor.

Will I have to make the animations for the armor separate from the character models and just play the animations on the character and the armor pieces?

so the character would have animation walk1 and the armor pieces would have the same animation?

How is it typically done?

Share this post


Link to post
Share on other sites
Advertisement
I'm not an expert on the subject, but...

You'd need a way to position armor relative to the model you're placing it on (anchor point for lack of a better word), and then the armor model's vertices would need to be weighted properly to the person's skeleton so that when you pose the armor it moves correctly with the posed player.

As long as the armor vertices are weighted properly to the skeleton you should only need the one set of animations. Just pose the armor like you'd pose the player and render.

There are bigger problems if you have different sized characters or characters with different animation sets.

Share this post


Link to post
Share on other sites
Combine ALL skinned meshes (armor, charachter,weapons, etc.. ALL items that your game has and can be worn by player) to one mesh.
Then just use textures/vertex attr. to index and maskin/out parts
that you want.

Advantage complete charachter with items can be drawn with one drawcall

/Tyrian

Share this post


Link to post
Share on other sites
I wouldn't combine meshes. That's a lot of unnecessary manipulation. As dashurc mentions, you can animate your armor as you would any part of the character, using one (or more) of the character's bones (matrices), probably "chest" or "hip," and use the character animation sequence.

Share this post


Link to post
Share on other sites
I'm curious how the Bethesda did it with Morrowind and Oblivion? The character mesh is separate from the clothing and armor meshes. To add to that, the clothing meshes are, in fact, separate meshes. For instance, boots are separate from pants that are separate from, say, gloves. The same applies to the armor meshes (which replace the clothing meshes). Each individual mesh is a single model and each can be applied separately.

I know this doesn't help you all that much, but both of those games have massive modding communities and there are dozens of body, clothing and armor mods. Maybe by researching the mods, you'll gain insight into how it is performed?

Share this post


Link to post
Share on other sites
Quote:
Original post by MarkS
I'm curious how the Bethesda did it with Morrowind and Oblivion? The character mesh is separate from the clothing and armor meshes. To add to that, the clothing meshes are, in fact, separate meshes. For instance, boots are separate from pants that are separate from, say, gloves. The same applies to the armor meshes (which replace the clothing meshes). Each individual mesh is a single model and each can be applied separately.

I know this doesn't help you all that much, but both of those games have massive modding communities and there are dozens of body, clothing and armor mods. Maybe by researching the mods, you'll gain insight into how it is performed?


The Oblivion/Morrowind community is incredibly mod heavy, I'm sure if he asked at TESnexus he'd have no problems finding someone who could tell him the answer.

Share this post


Link to post
Share on other sites
Quote:
Original post by Crioca
The Oblivion/Morrowind community is incredibly mod heavy, I'm sure if he asked at TESnexus he'd have no problems finding someone who could tell him the answer.


If, what I remember is correct (it has been several years since I have attempted a mod), each different type of armor or clothing type is skinned to its part of the character's mesh. The model for the armor is modeled at the rest location of the character mesh. For instance, gloves would be modeled around the actual hands of the character mesh in a 3D modeling program, but saved separate of the character mesh. Once the gloves are assigned to the character in the game, the character's mesh is skinned, followed by the gloves. When the arms move, the gloves move as well. Of course, this means that the character's mesh is drawn at all times, even if a piece of clothing or armor is occluding it, but it allows for a near infinite number of clothing and armor changes, without requiring a a massive amount of character meshes.

Share this post


Link to post
Share on other sites
The trick is to use a common skeleton (bone hierarchy) when building both your character mesh and your armor mesh. Typically you'll have ones for male humanoids, female humanoids, orcs, trolls, etc. This lets you save all the meshes individually, but since the character and armor both share the same skeleton you can merge them together into the same model on load and have them animate together perfectly.

Share this post


Link to post
Share on other sites
Quote:
Original post by Zipster
The trick is to use a common skeleton (bone hierarchy) when building both your character mesh and your armor mesh. Typically you'll have ones for male humanoids, female humanoids, orcs, trolls, etc. This lets you save all the meshes individually, but since the character and armor both share the same skeleton you can merge them together into the same model on load and have them animate together perfectly.


Thank you. That is what I was trying to say, but you worded it much better.

Share this post


Link to post
Share on other sites
What's typically done is that you have a named "attach point" which stores a position/orientation relative to a specific bone. Your armor/weapons take their coordinate system from the attach point, whose coordinate system is in turn calculate from the parent bone in the current pose.

Taking the position/orientation directly from the bone often isn't useful, as the different pieces may need to attach at slightly offset positions. You may also need more attach points than you have bones. Store the transformations for the attach points in a hash table indexed by name for easy/fast access.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!