Search Unity

procedural character generation

Discussion in 'Works In Progress' started by FernandoRibeiro, Oct 5, 2012.

Thread Status:
Not open for further replies.
  1. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    What shader are you using on the UMA character on your website's video: Video Tutorial of the Voxel/Housing Tool DevBuild V1.0? Or did you swap textures (I can't tell from behind). I really like it.
     
  2. E2R_Ben

    E2R_Ben

    Joined:
    Oct 30, 2009
    Posts:
    143
    Is it ok to weight verts to the normal bones as well as the adjust bones? Or do they have to be just weighted to the adjust bones?
    Nice tree elf guy cook :)
     
  3. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Really amazing work! =D Hope we have UMA on AssetStore soon.
     
  4. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    No problem at all, it´s usually a good strategy using the parent bone if you don´t wan´t the adjusts having full influence over an vertice. Just keep an eye how well they deform together with body. :)
     
  5. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    727
    That shader does not have the normal map working on it on the website, had some problems with the UMA shader export which Fernando fixed for us on last update. But we haven't updated the build yet. We also have done new body textures for the UMA characters for our game Neos Land.
     
  6. cookimage

    cookimage

    Joined:
    Sep 10, 2012
    Posts:
    727

    The characters we release on the asset store will have armor sets to swap out yes. Although we are only using this wood elves as bad guys in our game so just mobs.
     
  7. E2R_Ben

    E2R_Ben

    Joined:
    Oct 30, 2009
    Posts:
    143
    Yeah thats what I was hoping.
    Is it possible that the upperlegAdjust bone is very slightly a different rotation to the upperleg bone? It may be something ive done, but im getting weird results when scaling.
     
  8. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    If you could add separate adjusts for the calves the thighs that'd be cool.
     
  9. E2R_Ben

    E2R_Ben

    Joined:
    Oct 30, 2009
    Posts:
    143
    Yeah I might do. Is it a good idea to add more bones? Don't I want to keep to the ones that are there?
    I think now I'll make the base mesh very thin then use the adjust bones to add fat and muscle. Areas of the body that are close to the bone will be Rigged to the non adjust bones.
     
  10. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    I'm not sure but I think it's a matter of adding a new DNA entry for the calves, or rather two for the calves. That was really, of all the DNA Fernando created, the only one I'd like to see that wasn't there.

    On second thought I don't think it bring enough easily noticeable variance to change Fernando's DNA setup...and it's cause to much trouble...

    Sorry about that.
     
  11. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    Actually, after more thought, I need to ask Fernando or Unlogick: guys if a mesh was extended from the UMA base mesh such that we needed extra DNA adjusts and such could we inherit the UMA base classes to extend those classes and avoid changing the base classes? I think that's the primary motivation from using C# and such OO things to begin with but I want to confirm that.

    Thanks.
     
  12. sagron6015

    sagron6015

    Joined:
    Apr 19, 2010
    Posts:
    32
    Very very cool project - a LOT of people have been waiting for something similar to this. Thanks!
     
  13. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    If I understood correctly, yes. It´s possible to add extra bones and access those by code using a custom DNAConverter.
     
  14. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Thanks! Happy this can be useful :) There are already some big games using it.
     
  15. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    Thanks.
     
  16. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    Hey guys,

    I was trying to figure out an algorithm to correct place avatars in a pattern like bowling pins and it's been a long time since I had math.

    The formula goes like this:

    T_1 = 1
    T_2 = 3
    T_3 = 6
    T_4 = 10
    ...
    T_n = n(n+1)/2

    n = (-1 + Mathf.Sqrt(1 + 8*T_n))/2

    where in this case T_n would be the total T_<total number of rows needed to make a triangular layout with number of pins in each row = 1 to t_n>

    e.g. bowling:

    1
    2 2
    3 3 3
    4 4 4 4

    In my case, if I'm given a crowd size of 16 for the avatars, I want 1 avatar in row 1, 2 in row 2, ..., i in row i, 5 in rows 5, 1 in row 6 (because 16 isn't a triangular number)

    http://en.wikipedia.org/wiki/Triangular_number

    Thanks.
     
  17. cynel

    cynel

    Joined:
    Apr 18, 2012
    Posts:
    734
    so what dose that mean.
     
  18. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
  19. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Fernando i have just read documentation, one thing i am not sure of. Can we use custom shader for skin, like Skyshop shader?

    Also i dont think i will be able to get pluses from overlaying becouse i am not sure if it would make sense to use it as i dont plan to use 2 textures (head+body) but rather 4 of them becouse thats how character will be split. Do you think its still ok to take advantage of overlaying? I am just thinking that i will need to use 2048x2048 textures then otherwise it would be very quick drop in quallity on lower textures, and having them spread over 4 textures with 512x512 will use less video memory and there is no need to reduce such textures.
    Sorry if i am a but unclear here i will post my whole prototype character so that you can see what i mean.

    Also Fernando how did you hide seam of detached objects that are part of body, did you edit normals how they face?





    *EDIT: Found out that adjusting normals does hide seams of detached objects.

    I have imported example base mesh into max and done some thinking so here is what i have as question:

    Can i use different shader for metal armor, if that armor is under Body UV layout that already uses Skin shader (if i use overlaying method).

    Also Fernando does UMA hides part of character mesh that is being swaped with armor (to reduce triangle rendering), for example if you use chest armor, does chest part of body mesh gets hiden (if no skin has to be visible)?

    And is it better for performance to have whole characters texture including armor parts under single texture atlas of 2048x2048 instead of using split textures with lower texture resolutions (more draw calls). So on one had more memory usage and on other more draw calls. Whats better?

    For normal maps baking from high poly model do you import whole lower resolution mesh into baking application and bake it at once, or do you bake maps for head separate and then body separate. Mostly asking this if either solution creates normal map seams between both parts later.


    Another thing does it makes sense to only use 1 side of mesh unwraped and then just mirror it to save UV space for better resolution of texture? For example only model 1 hand unwrap it and place into atlas of body texture, and then just mirror it on other side to save texture space.


    If it is not possible to use two different shaders one for skin and one for armor, how do you suggest me to separate whole UV layout. Maybe 1 for body (skin) 1024x1024 texture and one for armor where overlayed function can be used, problem here might be that 1024x1024 might be too little, so 2048 will have to be used, increasing load on memory usage.


    *Edit 2: I have now made prototype character with textures and it seems like 2k texture for body+armor parts is good enough as i get enough detail. So its all now up to that if i can use different shaders for skin and armor parts, considering that they are part of single UV layout.



    Also where do you suggest me to put helmet UV space ,into main body part or in head UV part, or to put it into separate UV space shared with hair which makes most sense?

    You are using 2 UV spaces parts (2 textures) for whole character, would it still stay on 1 drawcall if i use 3 instead - (additional one is for hair). By the way do you use hair in head UV layout?

    Hope you can answer all of those.
     
    Last edited: Dec 10, 2013
  20. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    615
    It sounds like Fernando is gone for a couple days but the short answer is that UMA has built-in atlas support so it will merge the textures for each set of parts that share a common shader.

    So something like a helmet would have its own texture but probably share a shader with the armor and get atlases with that when the character was combined by UMA.
     
    Last edited: Dec 10, 2013
  21. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there, Thanks @ecurtz
    I´ll be off until tomorrow night, we lost a family member this morning : ((( .
    The adjusts for UMA AssetStore version already started, I´ll be back in time to help Joen and Caitlyn on final steps.
     
  22. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,323
    Fernando,

    Sorry to hear about the sad news.. Hope everything is Ok.
     
  23. derf

    derf

    Joined:
    Aug 14, 2011
    Posts:
    346
    My condolences to you and your family FernandoRibeiro.
     
  24. GD.Darren

    GD.Darren

    Joined:
    Jan 12, 2013
    Posts:
    53
    Sorry to hear Fernando, my condolences for your family.

    I have just started UMA and I'm having a problem with the generated UMA's being too dark in contrast to the environment. If I go to the generated UMA and go to it's gameobject which has the shader and change it from UMA->Bumped Specular, to UMA->AtlasShaderNew it becomes good with lighting.

    Also everytime I generate an UMA it says atlas resolution is too small, textures will be reduced, is this normal? Thanks in advance, I will PM you images with the dark issue I'm having.
     
  25. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there everyone, thanks for the kind words. I´m sorry the time I´ve been away.

    @GD.Darren, please be sure you´re working on UMA latest version available at http://fernandoribeirogames.wix.com/umabeta
    The atlas shader you´re using don´t consider light influence at all, and is not supposed being used on avatars.
    Please write again in case you still have the same problem working on the project available at above link.
    Cheers,
    Fernando R.
     
  26. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Sorry to hear Fernando, could you please answer my questions above?
     
  27. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Can i use different shader for metal armor, if that armor is under Body UV layout that already uses Skin shader (if i use overlaying method).

    Yes, you can have any shader for UMA, but it need to be setup to use proper texture channels.
    If armor is being applied as a body overlay, I would suggest those areas being a separated body mesh piece, so that this slot can receive a different sample material.

    Also Fernando does UMA hides part of character mesh that is being swaped with armor (to reduce triangle rendering), for example if you use chest armor, does chest part of body mesh gets hiden (if no skin has to be visible)?

    You can implement your own Hidden Surface Removal solution to handle that. On example scenes I simply don´t include Legs if wearing jeans mesh, but more robust and complex solutions can be used.

    And is it better for performance to have whole characters texture including armor parts under single texture atlas of 2048x2048 instead of using split textures with lower texture resolutions (more draw calls). So on one had more memory usage and on other more draw calls. Whats better?

    I recommend separating all textures, as I handle atlas creation in real time, so we can get the entire avatar using a single drawcall depending on material/shader. In your case, using shared UV of basemesh body is recommended to save memory. Even textures used as overlay for body can be cropped and separated.

    Also where do you suggest me to put helmet UV space ,into main body part or in head UV part, or to put it into separate UV space shared with hair which makes most sense?

    I would recommend a separated texture, or using head uv, if it works well for you and helmet cover the corresponding head area.

    You are using 2 UV spaces parts (2 textures) for whole character, would it still stay on 1 drawcall if i use 3 instead - (additional one is for hair). By the way do you use hair in head UV layout?

    Yes, because we generate an atlas. But multiple materials will require extra drawcalls.


    Please let me know if I missed something.
     
  28. cynel

    cynel

    Joined:
    Apr 18, 2012
    Posts:
    734
    wow i know what it feels to loose a relative. i wont be able to do any work im chating on a note book due to my PC being in the shop.
     
  29. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there guys!
    I´ve got permission to show some images of UMA content integrated :) (Right click for full size)







     
  30. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Thanks a lot for answers Fernando.

    Just one thing :
    Alright that means that i will use skin shader and metal shader for all characters, which means that i have to use 2 materials (as i dont have generalized shader for both togetehr) which means instead 1 drawcall i will have 2 drawcalls per char right?
     
  31. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Yes, that would be the case. Also, female avatars on demo scene uses a extra drawcall for transparent eyelashes :) (an example of multiple material usage)
     
  32. cynel

    cynel

    Joined:
    Apr 18, 2012
    Posts:
    734
    the only thing missing are Pig noses and Elf ears then again im taking it slow when i got my computer back.
     
  33. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    If you are interested in PlayMaker support you can upvote UMA on the Trello board for PlayMaker Add-on To-Do's. Public voting should work now.

    https://trello.com/c/dWN4VczC/32-uma
     
  34. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Thanks! Those are great news =)
     
  35. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,621
    A screenshot of UMA in action, using the fantastic "Steampunk: Clockwork" demo scene as the setting. There is nine visible UMA characters in this screenshot! You may have to right click to really see them.


    I also want to announce that I'm working hard on my "UMA Power Pack" coming to the Asset Store "soon(tm)".

    Key features:

    • Threaded UMAGenerator: Similar to the UMAGenerator except it uses a worker thread for baking indie atlas textures.
    • Reduce Skeleton: After receiving the UMA adjustments reduce the skeleton down to raw Mecanim humanoid or whatever constellation you want.
    • Save to prefabs: Save the finished UMA characters to prefabs, use just like any other skinned mesh model.
    • UMA in the Editor: Show the UMA Characters, even when not in play mode.
    • Dynamic spawn/destroy: Spawn the UMA characters automatically when in range.
    Cheers,
    Joen Joensen, UnLogick
     
  36. mateodon

    mateodon

    Joined:
    Oct 1, 2013
    Posts:
    39
    Epic! Will that armor be available on the asset store or is it for someone's private project?
     
  37. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there!
    As far I know, it will be available as soon UMA itself is at AssetStore =) I need to be clear I just worked on the armor mesh/skinning as freelancer a couple months ago, and there had been amazing artists working on the textures and details.
    The environment I used on those shots is already at AssetStore =)
    Cheers!
     
  38. Matro

    Matro

    Joined:
    Mar 15, 2013
    Posts:
    38
    Hello,
    I am going through the UMA cloth creation Part 02 and looking for the Slot Element where you copy the male torso and apply it to the shirt but I do not seem to have a Slot Element on the male torso.

    But I also want to say thank you for a great tool and hope for more tutorials.

    Matro
     
  39. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    Very cool! : D!
     
  40. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Thank you Matro!
    As soon UMA is on AssetStore, I´ll record new video tutorials to match changes from latest version. If you´re using UMA latest version from Git, you can now simply create a new slot on "create" at Project window.
    Cheers
     
  41. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  42. CaptainChristian

    CaptainChristian

    Joined:
    Apr 3, 2013
    Posts:
    97
    Dang, I am really looking forward to this!
     
  43. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Both of us =)
     
  44. GD.Darren

    GD.Darren

    Joined:
    Jan 12, 2013
    Posts:
    53
    Hi Fernando, I am finally integrating UMA into my project and it's coming along amazing.

    I do have some questions though,

    1) How do I decide what the generated characters consists of (rigidbody, colliders, scripts etc). I tried opening UMAGenerator to modify it but it doesn't load a script file in monobehaviour.

    2) I have a character creation screen and working wonderfully, however I can't seem to find how to change skin color in the example. Do I have to recalculate all overlays etc each time I change the skin color? Thanks in advance.
     
  45. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,007
    This sounds great! I'm very much looking forward to all the UMA-based assets we might see in the store. UMA is wonderful, but I need it to be more developed, so I'm glad folks are out there working to expand the editor controls for it and add features. I'm definitely going to need tools like this one.

    One request I'd like to repeat ... I'd still like to see a means of controlling overall body proportion based on head size, so I can specify the distance from the top of the head downward for a character or group of characters. For instance, I might want 9 heads for an adult, 7.5 heads for a teen, 6 heads for a child, or 4 heads for a baby. Or, maybe I want a very heavy looking adult character that has a proportion of 5 heads, or perhaps cartoonish characters with abnormally large heads where the proportion is 3 heads (the head makes up 1/3 the height). After the general proportion is set, then the rest of the individual parameters can be adjusted.

    My understanding is that right now a proportion control is already sort of embedded with the assumption of something like 8 heads, and then off of that you make your individual adjustments. If you wanted to use UMA to make children, simply making them smaller would not work, the proportions would be off, and you'd end up having to make a lot of adjustments by hand and eye. If it was possible to set overall proportions first in the body generating process, the act of individualizing characters according to age (or possibly fantasy race, like dwarf) could be eased.

    Once the proportion is set, if the head size is entered then the editor should be able to generate a toon based on vertical proportion. The overall vertical height will be known and can be displayed. If the user wishes, they can then adjust the head height slider to change the overall height of the toon to whatever height is desired. Or, alternatively, the body height can be input and the calculations worked backward to establish the length of the head.

    Horizontal proportion is also based on the length of the head, and again there may be some assumptions baked into UMA that users might want to fiddle with. Normally the distance between the nipples is one head, for example, and the width of the shoulders is 2 to 2.66 heads. Those wanting to create a group of characters with distinct body proportions could customize these values at the start, so that, say, the body could be 1 head length wide (for an unusually slender body), or 3 heads wide (for a squat body).

    An example of rules governing realistic proportion can be found here: http://www.realcolorwheel.com/human.htm
     
    Last edited: Dec 20, 2013
  46. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there!
    1- You can directly adjust the prefabs being instantiated at UMAAssets/Races, or include extra componentes/changes after their creation. Take a look at UMACrowd, umaData.OnUpdated += myColliderUpdateMethod; is responsible to trigger the myColliderUpdateMethod() when the avatar is created/updated.

    2- After you have any changes to overlay colors, you need to trigger texture as dirty, so atlas can be updated.

    Feel free to write if there are any other questions.
     
  47. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there! =)
    The way we change body shape is open, you can actually write your own dnaConverter to properly handle the exact proportions you need based on different parameters :)
     
  48. UnLogick

    UnLogick

    Joined:
    Jun 11, 2011
    Posts:
    1,621
    Let me know what other editor controls you need for UMA. I'm committed to making UMA a first grade package, so if I hear a suggestion that would benefit many then I'll see if I can find the time to implement it.

    Right now I'm still working on the UMA Power Pack as well as the actual UMA release with Fernando and Caitlyn. Also there is some last minute changes that will be helpful to making NPC creator tools happening in a separate branch that might make it in time for the first asset store release.

    Well while Fernando's reply is true, you can write your own HumanoidDNA with the ratio sliders you're talking about. You still need to translate those values into positions and scales that makes the character obtain the results you're looking for. Making your suggestion non trivial.

    I know ecurtz played around with an alternate way of designing DNA where you blend between different positions. I'd imagine that an easier way to make customization than going hardcore and coding the DNA converters yourself.

    Regardless I doubt anyone will make this change in the near future, so if it's important to you I'd recommend joining us on skype in the UMA Beta chat. And we'll help you as best we can.
     
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,007
    I appreciate the offer for me to join the Skype group, but I don't have anything to contribute aside from a suggestion or two. I'm working solo, I'm new to all of this, and I'm not a programmer, so setting up a proportions system would be impossible for me, and I'm swamped with so many other things to do anyway.

    If there was no easy way of setting proportions in the editor, I think I would take another path to my goal, which would present some drawbacks.

    First off, I would need to be using a toolset like the one you're making. What I could do then is create a sample toon of each proportion that I'm seeking, like a realistic human adult, teen, and child (or whatever), and save those samples as prototypes. Then when I want to make a new adult, teen, or child according to this set of proportions, I take the appropriate prototype, copy it, make individual adjustments, detail it, and go.

    The difference in approach is that in the 2nd method I would wind up stuck with needing to craft each toon by hand rather than being able stuff in some parameters and have the engine generate adult, teen, and child characters with randomized traits. So while it would be a fine way of creating specific characters - which I will need to do anyway - I would not be able to make randomly generated characters. Probably the best I could do would be to have randomly generated collections of pre-made characters.

    Drawbacks to this approach are that I'd have to create a large collection of characters, which takes time and takes up space, and I'd have to re-use characters, so players would see a lot of clones. But I'm familiar with this approach and could do it.

    Ideally what I would want from UMA is to be able to use it not only as a handy way of creating and saving customized characters who would play specific roles in my game - and as a way of allowing my players to create their own custom characters from a library of parts - but I would also want to be able to input a profile for a type of character and get out however many unique characters I ask for that are randomly generated according to this profile. This way, if I want to add some street thugs to a scene I input the profile for either "Sharks" or "Jets" and I get one or more unique characters that are made based upon my profiles for Sharks and Jets. Like, maybe Sharks all have black tshirts and some have leather jackets, while all Jets have white tshirts and some have denim jackets. All Sharks and Jets would be male, adults or teens, and have randomly generated facial details, random hair styles (type A, B, or bald), and so on. I'm sure you get the picture.

    Of course, I'm not saying this is what you need to make. I'm just saying that this is the type of tool that would fulfill what I'm ideally looking for, and part of generating characters like this would entail working in some way with body proportions (like "proportion adult 8x2.3 + teen 7.5x2, sex male, skincolor allnatural, body thin + fit + fat, hair A + B + Z, chest tshirt black, chest leatherjacket 33%") as part of a character profile.
     
  50. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    Maybe a metre stick beside an avatar that's being edited would be sufficient.

    If you find and put into a clear labeled text file the typical proportions (the percentage multipliers) from infancy to old age and clearly mark them for each group I will add something like that in the next few weeks. I might not look quite realistic though unless you not only do length breath percentages but also fat musculature. eg. Babies have chubby cheeks and elderly often have a raw boned appearance due to both fat muscle loss. And of course there are variances but we're only talking about general impression and statistical means.

    If you don't I suppose I could do it myself eventually...
     
Thread Status:
Not open for further replies.