Search Unity

Advice for modeling interchangeable hair and clothing

Discussion in 'Formats & External Tools' started by Wyldfire, Oct 12, 2010.

  1. Wyldfire

    Wyldfire

    Joined:
    Apr 5, 2006
    Posts:
    51
    Not completely sure this falls under "External Tools", though I am using Cheetah 3D :D

    Anyway, I have a character model already, who's bald and other than some hastily scribbled texture, nude. I'm planning to have several different models for the various characters in my game who will all be created quite similarly, and I'd like for various "costume pieces" to be interchangeable between them. IE: Different combinations of hairstyle and clothing.

    So, I'm looking for advice on how to create models for these things. Here's what I think I know, but feel free to correct me:
    1) Simple clothing like shirts, pants, gloves are best done via texture since for numerous reasons, including simplicity and avoidance of clipping when animating two objects close together.
    2) More complex pieces like jackets, boots, and hair itself should be a different model which would be attached to the main model as a child at run-time in Unity (via script)

    Things I don't know and am looking for tips/advice/examples/tutorials on:
    * How do I model the pieces, do I build them onto one of the base models, as a separate object but then ultimately save them into a separate file to import into Unity?
    * How is attachment done, via bones only?
    * If I make say, a jacket, what do I need to do to make it adhere to the character's animation? (follow his/her bones I guess) Same would apply to boots, as my characters move their feet/bend their toes in various animations.
    * If I model a pony tail for hair, and make the dangling part have bones, can I turn that into say... "cloth" in Unity to get some nice motion out of it for free?

    I appreciate any input!

    -Chris Backas
     
  2. Exitus

    Exitus

    Joined:
    Oct 12, 2010
    Posts:
    19
    I would suggest doing this, as it's most probably a simple matter to replace the mesh at runtime. Simple models (like hats) could probably just be made a child of the head, and placed on top, so you could have any head with any hat, which would save you making a lot of combinations in 3D.

    I think if you base the jackets/boots on your base objects that have already been rigged, it should be a simple matter of just replacing them, or making them a child of the 'area.' However, if you wish for the character to have multiple items (objects- because one object could comprise a jacket and shirt, etc) of clothing on one part of the body, it would be very unwise to create a million different combinations, so I'm not sure about that.

    I'm not sure if cloth would be a good idea- it seems a little tricky to work with in such confined areas. However, you could remove the renderer object on a small strip of cloth and use it to deform the ponytail somehow?

    I really have no idea, so somebody please correct me before someone dies.
     
  3. Wyldfire

    Wyldfire

    Joined:
    Apr 5, 2006
    Posts:
    51
    That's sort of what I'm thinking really, treat the hair like a hat on a bald person. I'm just wondering about how the child relationship is done, through bones? And if so, is the model suddenly gaining a bone or two going to make it upset that the animations don't include that bone?

    Yeah, I'm not going to have a million combinations. Just a few different outfits per character - this won't be an MMO with infinite combinations, just an action game with something more like "Alternate costumes". I'll probably share hair models amongst different characters though in some cases. I'd also like to use this to add new outfits in the future by having downloadable asset bundles.

    What do you mean by "Child of the area"? How would that actually look in Unity? I could see attaching a jacket to a bone somehow, but it's not clear to me that it would deform when the mesh animates since the Jacket itself won't have been weighted to those bones.

    Maybe you fake it a little by only adding geometry at certain areas, like lower arms where the sleeves would be evident or near the neck for the collar - do the rest by texture? That way you wouldn't really have to worry much about deformation, the pieces would be 'along for the ride'. Sounds hard to blend seamlessly though.

    I haven't played with the Cloth thing yet at all, but it seems like there should be some way to do that! I hope so, because I wouldn't want anyone to die! ;)
     
  4. Exitus

    Exitus

    Joined:
    Oct 12, 2010
    Posts:
    19
    I was thinking that once you've rigged a certain part, you could just duplicate it and then modify it to suit your needs- because generally adding a jacket won't change the structure too much, and should really animate the same.
    Sorry for my crappy terminology ("Child of the area")! What I meant was that if you made 'hat' a child of the 'head' object, then the hat would follow the translation and rotation of the head. All you'd need to do was correctly position it initially. Kinda like the camera in the first person controller.

    That sounds alright, although the quality you can achieve (in terms of "sticky outy bits") would be quite low. I think that modeling a jacket over a rigged torso or whatnot (where do you do the rigging?) would be the best option, as you only have to modify a single mesh, and get to keep all of its properties.

    You should know that I have absolutely no experience in this field, so if what I'm saying is nonsense, please ignore it.
     
  5. sonicviz

    sonicviz

    Joined:
    May 19, 2009
    Posts:
    1,051
  6. Wyldfire

    Wyldfire

    Joined:
    Apr 5, 2006
    Posts:
    51
    I have, and I was disappointed by it when I looked into it. Basically, their character model contains all the geometry for all the hair, jacket, pant, and boot shapes it can ever wear, and they seem to be swapping textures on and off the pieces as needed to make them show. That means that say, new hairstyles can't be added through an asset bundle unless you can pull them off entirely by texturing. I'm hoping for something more flexible than that if possible. I guess really along the lines of what MMOs manage in character creation, except that I don't intend to have anywhere close to that many options and they won't be free-form for the player to mix and match.
     
  7. CrossGuard-Games

    CrossGuard-Games

    Joined:
    Jan 12, 2010
    Posts:
    226
    I still have allot to learn, but I thought I heard you could put all the clothes on him and only have the ones you want to show visible, and have all the rest hidden. It seams like it would work in theory, but it feels like it would slow stuff down too much.
     
  8. Wyldfire

    Wyldfire

    Joined:
    Apr 5, 2006
    Posts:
    51
    That appears to be what the above example does. Except they're all built into the base model. The problem with that is it doesn't allow you to add new geometry pieces through downloaded assetbundles, and like you say, it does make me wonder about the performance implications of characters running around with all that extra geometry all the time.
     
  9. jedy

    jedy

    Joined:
    Aug 1, 2010
    Posts:
    579
    Well adding geometry isn't allowed but creating a child of the object is.
    You could use a script to create the new geometry witch is separated off the model.
    It should be a child to the part you want to change. Then just turn the visibility of the former part off.