Search Unity

procedural character generation

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

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

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Sure, just make a new base mesh with only arms and hands and im pretty sure it should work.
     
  2. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    Also the camera should cull the rest of the mesh if it's not visible or you can just instantiate the arms hands.
     
  3. mateodon

    mateodon

    Joined:
    Oct 1, 2013
    Posts:
    39
    Great, I'll have to give this a try, thanks.

    I should say that I want to keep the customization linked to a full body for use in third person perspective, but I don't want to use the whole body in first person. I need the arms as independent meshes, perhaps the lower body could also be used to simulate full body awareness, but I'm not quite that ambitious.
     
  4. EmeralLotus

    EmeralLotus

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

    Mucho Thanks for such INCREDIBLY AWESOME WORK. !!!
     
  5. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there! Base meshes are already on their final stage, so I don´t plan changing their skinning data again. Every time I review those base meshes I find something I would like to change, but it wouldn´t be wise to keep changing those, as content creators depend on a stable reference.
    The future of UMA mostly depends on content creators and developers. As an open source project, makes no sense I would try to keep all it´s development for myself. There´s plenty of space for development and improvement on UMA, and I´m happy not being alone on those.
     
  6. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Sure! Just comment the extra code that includes the rest of the body. Usually I keep arms and torso together, but you can simply remove torso mesh and create a new slot.
    Cheers :)

    PS: Just saw Virror´s answer Sorry
     
  7. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Happy this can help you =)
     
  8. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  9. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Looking good!
     
  10. mikezenox

    mikezenox

    Joined:
    Oct 18, 2012
    Posts:
    55
    @goat, That sounds very promising, I will see how it works with my data when I get home and let you know
     
  11. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    I finally decided to give this a whirl and see what I could do with it, but 4.3 Mecanim changes seem to have borked some code up. I commented it out but the agents just keep trying to follow the mouse around or something and end up just falling off the grid so I decided to put it down for the time being.

    I don't really know if I have the latest version, I got it from the top of the website's download list but it seems the runtime editor controls are very downgraded from one of the webplayers I just used here. I also got an error when I had RageSpline also in the project that I'm certain was not there just after I upgraded to 4.3.

    How do you store or save these generated avatars? Is it a matter of storing the resulting manipulator data and recreating the avatar at runtime? If so, can any of that be done in the editor or does it need to be designed during runtime and saved? Is a save button planned? I like it so far, and want to get into making some additional assets for it that I can inject into the generator.

    The controls are really extreme and its difficult to make small changes. Small changes are critical to making characters non-stupid looking. Perhaps the controls are too variable - would anyone actually use the values over under 10/20 or over 80/90? I think the vast majority of people are going to try to use this for custom character creating for unique player characters like how Bioware does character startups in their games rather than random crowd generation.

    Please choose an idle animation that does not turn the head since it breaks the angle the user is trying keep the face on, and disable right clicking in the webplayer.

    Also, are there any plans for blending textures for the character skin? The skin is very ripped, shiny, muscular and unnatural for regular female characters. A slider for blending in a soft texture would really improve the skin quality on females.

    Incredible work so far, I know you've got a lot on your list but I suppose feedback is always useful.
     
  12. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Hey zerobounds, the version at the webpage is pretty old by now, you can get the latest and greatest version here: https://github.com/huika/UMA
    This one will work very well with latest Unity version except for a crash on exit when using standalone windows player, but Unity team is working on a fix for that.

    The controls are just an example, and if you want to use it in a game you probably want to remake them anyway.
    Saving is really easy and good examples exist for that, basically the configuration is serialized to a string that you save how you want.
    Regarding texture you are free to use any texture you want, look at page 58 to see an example when Fernando is using human scanned textures with UMA, looks incredible!

    You can pm me or Fernando if you wish to join our Skype channel were we discuss all kinds of stuff related to UMA, good place to get some help!
     
  13. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    6,458
    Thanks for the info! Sending you a PM.
     
  14. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hey =) Thanks for the feedback, hope the Git version worked for you.
    I´ll update the beta test webpage to link it.
    Cheers!
     
  15. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  16. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,323

    I cloned the repo onto my local hard drive and opened the project with Unity 4.3 pro. The scene runs and the characters all show up but the sliders do not change the character features.

    Do you know what could be the cause of this.

    Cheers.
     
  17. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there =)
    Are you right clicking the avatars on the game windows?
    Cheers
     
  18. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,323
    Dumb me. I forgot. That was the problem.
    Thanks.
     
  19. goat

    goat

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

    OK, I have spent the entire day pulling the 'public const' declaration out of my code and putting them into their own class. I've also added a lot more constants to help me keep what indexes what correct and more importantly so that information can be saved as a character. I've decided to make many changes in order that the random generated characters from Fernando's code can be named and saved.

    So anyway, the last constants I need to declare have been declared but it seems C# doesn't like what I've done: which is basically declare a list of public const string definitions and the declared a public const string[] array which is initialized with the previous public const string definitions, e.g.

    error message in Unity (Visual Studio 2013 isn't complaining for whatever reason): Assets/UMA/Example/Scripts/UMAUIConstants.cs(414,27): error CS0134: A constant `UMAUI.UMAUIConstants.slotsMale' of reference type `string[]' can only be initialized with null

    Example offending code: it's the array definition Unity is complaining about.

    Suggestions? I have a feeling I am going to have to make the array of public const string[] slotsMale as a variable public string slotsMale in my other code rather than keep it as a public const string[]. I save the indexes into the string[] slotsMale array as identifying the particular slots each character can use in their 'pseudo DNA' so the reference array should be constant.

    P.S. I just checked and public string[] slotsMale works although it 'violates' being 'constant'. How would you do what I'm trying to do in C#?

    Thanks.

    Ciao

    Code (csharp):
    1.  
    2. namespace UMAUI
    3. {
    4. public class UMAUIConstants
    5.     {
    6.     //
    7.     // MOUSE BUTTONS
    8.     //
    9.     public const int LMB = 0;
    10.     public const int RMB = 1;
    11.     public const int MMB = 2;
    12.    
    13.     //
    14.     // Crowd Control
    15.     //
    16.     public const int CROWDMAX = 16;
    17.     public const int CROWDMIN = 0;
    18.  
    19.     //
    20.     // String Constants for UMA Human Male Slots
    21.     //
    22.     public const string SMALEEYES = "MaleEyes";
    23.     public const string SMALEHEAD0H = "MaleFace";
    24.     public const string SMALEINNERMOUTH = "MaleInnerMouth";
    25.     public const string SMALETORSO = "MaleTorso";
    26.     public const string SMALEHANDS = "MaleHands";
    27.     public const string SMALELEGS = "MaleLegs";
    28.     public const string SMALEJEANS01 = "MaleJeans01";
    29.     public const string SMALEFEET = "MaleFeet";
    30.     public const string SMALEHEAD1H = "MaleHead_Head";
    31.     public const string SMALEEYELIDS1H = "MaleHead_Eyes";
    32.     public const string SMALEMOUT1H = "MaleHead_Mouth";
    33.     public const string SMALENOSE1H = "MaleHead_Nose";
    34.     public const string SMALEORCNOSE1H = "MaleHead_PigNose";
    35.     public const string SMALEARS1H = "MaleHead_Ears";
    36.     public const string SMALEELFEARS1H = "MaleHead_ElvenEars";
    37.     public const string SMALEEYELASHES = "MaleEyelash"; // DNE
    38.     public const string SMALESHORTHAIR0H = "MaleShortHair01"; // DNE
    39.     public const string SMALELONGHAIR1H = "MaleLongHair01"; // DNE
    40.     public const string SMALEPONYTAIL1H = "MaleLongHair01_Module"; // DNE
    41.     public const string SMALEHAT = "MaleHat"; // DNE
    42.  
    43.     public const int ISMALEEYES = 0;
    44.     public const int ISMALEHEAD0H = 1;
    45.     public const int ISMALEINNERMOUTH = 2;
    46.     public const int ISMALETORSO = 3;
    47.     public const int ISMALEHANDS = 4;
    48.     public const int ISMALELEGS = 5;
    49.     public const int ISMALEJEANS01 = 6;
    50.     public const int ISMALEFEET = 7;
    51.     public const int ISMALEHEAD1H = 8;
    52.     public const int ISMALEEYELIDS1H = 9;
    53.     public const int ISMALEMOUT1H = 10;
    54.     public const int ISMALENOSE1H = 11;
    55.     public const int ISMALEORCNOSE1H = 12;
    56.     public const int ISMALEARS1H = 13;
    57.     public const int ISMALEELFEARS1H = 14;
    58.     public const int ISMALEEYELASHES = 15; // DNE
    59.     public const int ISMALESHORTHAIR0H = 16; // DNE
    60.     public const int ISMALELONGHAIR1H = 17; // DNE
    61.     public const int ISMALEPONYTAIL1H = 18; // DNE
    62.     public const int ISMALEHAT = 19; // DNE
    63.  
    64.     public const string[] slotsMale =
    65.         {
    66.        
    67.         SMALEEYES, SMALEHEAD0H, SMALEINNERMOUTH, SMALETORSO,
    68.         SMALEHANDS, SMALELEGS, SMALEJEANS01, SMALEFEET,
    69.         SMALEHEAD1H, SMALEEYELIDS1H, SMALEMOUT1H, SMALENOSE1H,
    70.         SMALEORCNOSE1H, SMALEARS1H, SMALEELFEARS1H, SMALEEYELASHES,
    71.         SMALESHORTHAIR0H, SMALELONGHAIR1H, SMALEPONYTAIL1H, SMALEHAT
    72.         }; // slotsMale
    73.     }// UMAUIConstants
    74. }// UMAUI
    75.  
     
  20. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  21. mikezenox

    mikezenox

    Joined:
    Oct 18, 2012
    Posts:
    55
    @goat, It sounds like you should declare all the strings in slotsMale[] in another function, after you've initialized it. And sorry for the delay but I had trouble setting up the newest version of UMA, which are you working with?
     
  22. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    What problem did you got mike? May I help you?
     
  23. goat

    goat

    Joined:
    Aug 24, 2009
    Posts:
    5,177
    Thanks, for now I've left those string[] maleSlots and femaleSlots in the UIConstants file because that's what I want the to be functionally even though technically they are not (e.g. you can add new slots later if you develop new meshes for those slots).

    I have the newest version from Fernando's Website or GitHub. I will update to the 'official Unity version' when available to be sure of compatibility.

    It you are working using the UI code I am building I made many changes from what you see on GitHub and won't commit to GitHub until default characters of each of human, orc, elf, male female are possible. The characters you see in the png I posted earlier are auto-generated by checking the generate Lots UMA in the Unity editor (and press play) and you can then play around with the UI code by right clicking one of those avatars and modifying the avatar. You can't save anything yet, not until I get the UI code settled then I will add save/restore. Fernando have provided a script for that too.

    If you send me a private message with your email I will upload the zip of my current work to my SkyDrive to download. I don't think you'll have trouble seeing where I am going with the code. Note, the code on my HD is still broken. The code on my GitHub is partially functional: you need Fernando's latest (with will be the same in GitHub Unity Asset Store). I would create a new project rather than import overwrite an earlier version of UMA.

    I am working on the last two 'organization' parts now before I get into the interesting part (for me at least).

    I should have something working well enough (but not complete!) to post to GitHub this evening (EST).

    Ciao.
     
    Last edited: Nov 20, 2013
  24. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,009
    One thing I've been curious about regarding UMA is setting general body proportions. I see that users can alter a variety of physical parameters, but has anyone discussed making a facility for creating characters of varying standard proportions?

    Like something along the lines of an age progression?

    $Neoteny_body_proportion_heterochrony_human.png

    I'm sure the people working with creating humanoids of various ages, fantasy races, groups, and possibly art styles might find some form of standard proportion guide / constraint tool helpful.

    I'm guessing this is not excluded under the current framework, but I notice in the demo scene there is no means of adjusting the dimensions of the torso except by using the overall body height slider. There is, for example, no way of adjusting the horizontal dimensions of the torso in relation to the height, such as a shoulder breadth slider or a chest depth slider. Probably the capability to make these adjustments exists, but is not fully exposed in the demo ...?

    What I envision is a system that allows me - when creating a single custom character - to select a standard human proportion (or fantasy racial profile) first, then raise or lower the character to desired height, and then refine individual dimensions as needed.

    For random generation, a standard proportion would be part of a constraint used in a character profile.

    EDIT: I've seen that goat is working on creating a form of fantasy racial profile, but I guess what I'm asking is if there is any formal, general method of doing this that is being discussed, or are we all expected to go off on our own with our own specific solutions?
     
    Last edited: Nov 21, 2013
  26. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362

    Hi there! Great feedback =)
    Those sliders are just example code. You have full access to all bone adjusts by code, so you can implement a very precise solution to handle age progression, and the best part: clothes would still adapt to it.

    Cheers! =D
     
  27. mikezenox

    mikezenox

    Joined:
    Oct 18, 2012
    Posts:
    55
    @Fernando, hurray for the new doc! And no, it was nothing on your side causing my problems. Thanks though :)
     
  28. CaptainChristian

    CaptainChristian

    Joined:
    Apr 3, 2013
    Posts:
    97
    How much do you charge for the final product?
     
  29. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Its free! : )
     
  30. CaptainChristian

    CaptainChristian

    Joined:
    Apr 3, 2013
    Posts:
    97
    Jeez, that's awesome. Thank you.
     
  31. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Fernando sadly i cannot open documentation you provided, my web browser freezes if i open it. Do you have any other suggestion to see it?
     
  32. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there Janpec! Sorry about that!
    Have you tried "right click + save to file"?
    Cheers
     
  33. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Oh ofcourse that should work. Hehe. Thanks.
     
  34. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Great to see you´re taking a look on UMA. I´ve been following your posts on art content, really amazing stuff!
     
  35. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    I am certainly very serious about your character system. I dont think there is any way around for me. I need plenty different character heads, heights, muscle definitions, races and it would just be a lot of work to do this manually not to mention getting UV seams correct once everything is so dispatched which i tried already and it was a pain. So yeh i can be thankful that your timing on character system release was perfect for project i am working on.

    Just one question Fernando, what is performance gain for example if there is locked pickable characters (still made with your system) or the ones that can player modify. For example if i make characters ahead with your system and i do not give player ability to edit them will that save any performance?
     
  36. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    The biggest benefit I can see pre calculating the avatar is avoiding the extra processing time on it´s creation, but if you use Unity PRO, it´s a matter of one or two frames.
    Also, one big strategy would be removing the extra adjusts bones on the finalized character, this would reduce bone count and skinning calculations.
    But for most games, having the ability to change the avatar at any moment overcomes above benefits.
    It´s aways possible to share the body mesh and atlas textures between multiple avatars, and still be able to have unique shapes. That´s usually very useful for crowd or standard soldiers.
     
  37. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hey everyone! The guys at the BetaTest channel just noticed something HUGE!
    Can you guys using Unity free confirm we can actually have usePRO checked on UMAGenerator and use RenderTextures???
    Not sure if this is intentional or will be changed on next Unity update.

    Cheers : OOO
     
  38. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Thanks for clarification.
     
  39. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
    So i was doing some testing with a combining script i modified as you can see in the screenshots, the performance is awesome:
    Without combining script:
    $shot_131121_163834.png
    With combining script:
    $shot_131121_165054.png

    And the animations etc works perfectly.

    PD: The render to texture works on indie.
     
    Last edited: Nov 21, 2013
  40. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    This is really amazing =D
    Specially when shadows are enabled, this has a huge impact!
     
  41. Kirbyrawr

    Kirbyrawr

    Joined:
    Jul 23, 2012
    Posts:
    935
  42. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,323
    Very Cool Discoveries.

    Would be awesome to incorporate the new combine features with the official version.

    Cheers.
     
  43. mikezenox

    mikezenox

    Joined:
    Oct 18, 2012
    Posts:
    55
    The page at http://unity3d.com/unity/whats-new says :
    Save on textures with automatic atlas generation (Pro preview)

    But it would be awesome if indie users were able to use this feature. How can I confirm this? I am an indie user.
     
  44. jaaaaaaan

    jaaaaaaan

    Joined:
    Nov 22, 2013
    Posts:
    10
    About the Atlassing in non-pro: I've noticed this earlier. It works in non-pro editor, but if I run the exported project, textures come out all black (only tried iOS Android so far, though).

    I came here for a question though: I'm evaluating the options for doing lip-sync with UMA's.

    It's for a small research project, so budget is really tight. Right now I'm considering Tagarela and Speecher.

    Am I right in assuming that bone based would be preferable for UMA? It seems like this way I could use Mecanim and have a Lip-Sync layer (override) for the lip sync animation, and an Emotion layer (additive) to mix in some hand made facial expression poses. Sadly, the open-source Tagarela works only with blend shapes. On the other hand, looking at the demos of Speecher, the quality doesn't seem to nearly justify the 100$.

    I'd really prefer the flexibility of real time lip-sync through audio analysis, but I could live with an "offline" option in a third tool, too. I've looked at this blender tutorial, but it also seems to be based on blend-shapes/shape-keys and not just bones, which seems like a lot of work to add to the UMA base avatars.

    (Please correct me if I'm wrong anywhere, as I'm pretty new to this whole topic and I'm still trying to get a complete picture!).
     
    Last edited: Nov 22, 2013
  45. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Fernando how many bones is in head controling speech (with mouth)? I am thinking not including them beouse with 50 characters on screen that could be quite an save on FPS.
     
  46. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Hi there! My main experience with facial expressions was using FaceShift.
     
  47. FernandoRibeiro

    FernandoRibeiro

    Joined:
    Sep 23, 2009
    Posts:
    1,362
    Face uses 74 bones (37 pairs), most of those are responsible for the head shape variation as well.
     
  48. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Fernando thanks for answer. 74 bones is for sure a lot i dont think i will be able to keep that much bones and 50 characters on screen. Is it possible to decrease bone size in head only to three (for mouth speech), so one bone for eyes and two bones for mouth (1 for upper and 1 for bottom lip).
    One more thing is is it possible to change main body with complete different sets if player changes armor? I am asking this becouse for performance it would be best if i dont use skiny body part bellow armor to render not needed triangles and texture, and just rather switch body with actual armor that will be used- if player use it. I hope you understand what i mean to say. This would mean that sine you have 2 UV sets for whole character the main body UV set along with body mesh would get replaced with whichever armor set player uses. This would help me with rigging and saving draw calls and polys.
     
  49. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Yes, you can use and mesh/rig you want, would be easy to edit the current one and just remove the bones you don't need. But UMA can run many characters on screen at the same time, i think Fernando has tried with 100 UMAs without any problems, also you can share the textures to save memory and drawcalls.

    The body consists of separate parts, so you can just swap the legs for leg armor and body for body armor, this is the best way of doing it as you say because it saves a lot of tris. Same when adding helmet as an example then you can remove ears and hair.
     
  50. jaaaaaaan

    jaaaaaaan

    Joined:
    Nov 22, 2013
    Posts:
    10
    Looks cool, could you maybe write a few lines about the pipeline? So what would I need to do to get something I created with FaceShift to work with the default UMA avatars in Unity?
     
Thread Status:
Not open for further replies.