Announcement

Collapse
No announcement yet.

Custom Character Tutorial - Custom Rig, Animations, *.ini and UTFamilyInfo

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Custom Character Tutorial - Custom Rig, Animations, *.ini and UTFamilyInfo

    Here is my custom character tutorial. Im sorry there are no images, and it is not neatly arranged on a website... I am so busy lately I just dont have the time. Once I have more free time I will tidy this up. However I thought getting it out there in its current state is better than nothing.

    Hopefully it will help someone...

    For the last few months I have been trying to figure out how to get a custom character into Unreal 3, now I have here is my tutorial explaining how I did it. You will need basic knowledge of the packages.

    I use Maya, I havent seen much documentation on character creation from Maya for Unreal 3 so I hope this helps.

    This tutorial isnt going to cover the artistic side of character creation... its just going to use box models and simple textures. I am currently working on a character for the Make Something Unreal Comp but I dont want to show it just yet.

    ----------------------------------------------------------------------

    MAYA

    Your mesh needs to be broken down into 5 parts, arms, torso, boots, head, legs. You can get your mesh into Unreal as one object, but through trial and error I found this method gave me less of a headache : )

    In my case my mesh parts ill be called:

    TutChar_arms
    TutChar_torso
    TutChar_boots
    TutChar_head
    TutChar_legs

    As I am not following Epics rig it doesnt really matter which parts of your mesh are the arms, head etc etc but if you are creating a creature with a head, arms etc it makes sense to name it accordingly.

    My rig is your standard Maya bone set up, nothing special... as I am not following Epics rig so your character can pretty much be anything you want.

    I always start with the Root, but depending on your character you should name your bones accordingly. I have named my bones TutChar_Root for example. Attach your Meshs to your Skeleton and sort out the weighting. As I am just going through the processes I am not that bothered about weighting but you should be : )

    Feel free to add any controls, IK etc etc to your rig to help with animating.

    Once that is done im going to animate 4 basic animations so once it is in game you can tell its working. Once it does work you can then go back and animate all 100+ animations, but for now 4 will do.

    run_fwd_rif
    run_bwd_rif
    crouch_fwd_rif
    CC_TutChar_Male_Idle

    fwd = forward, bwd = backwards, rif = these are the animations your character will use when holding a rifle or similar weapon. As for the Idle, replace TutChar with whatever your character is called.

    Once all 4 animations are done you need to export. I saved off my character into separate files so I could animate Run, Idle and crouch separatly. For this tutorial Run backwards will just be Run forward reversed.

    To start with lets export the mesh. Once ActorX is installed type 'axmain' into your script editor and press numpad Enter. Browse the output folder to a sensible place. I would recommend:

    /Documents/MyGames/Unreal Tournament 3/UTGame/Unpublished/CookedPC/CustomChars/CH_TutChar

    ... as this is were you will eventually save your *.upk, *.psa files exported from Unreal.

    Under 'mesh file name' inside the ActorX plugin, give your character a sensible name. Now the way I do the next part might not be the correct way, but it works for me. Delete arms, torso, legs and boots leaving TutChar_head remaining.

    Under mesh file name type 'TutChar_head' and click Save mesh/refpose. It will write off a *.psk. Undo your mass delete and do the same for the other body parts.This makes sure each part gets exported separatly yet still skinned to your skeleton.

    Next we need to export your animations. For Idle I will just use frame 1 of my run animation, but I hope yours is a lot more interesting. My run animation is 20 frames long, however depending on your character you will have to increase or decrease the timeline to get a good sense of motion when your character runs.

    Open up ActorX one more time, under animation file type 'RunF', under animation sequence name type 'run_fwd_rif' and under animation range type whatever your animation range is... in my case 00-20. Go ahead and Digest the animation.

    Do the same for all your animations... once your last animation has been digested open up the 'Animation manager'. Select all your animations and move them across to 'Output Package'

    'Save As' and again call it something sensible, I called mine TurCharAni. Save the file in the same location as your exported mesh, the newly created folder under CustomChars. Dont worry if, once you hit save it calls your *.psa one of your animation names instead of what you specified. When I created mine, it said I had saved it as Crouch.PSA. Its lieing to you... go to the folder where you saved it and you will see it has been saved under the name you specified.

    ----------------------------------------------------------------------

    UNREAL EDITOR

    For now we are pretty much done with Maya... so go ahead and open up Unreal Editor.

    ... takes a while doesnt it...

    Open the 'Generic' window, if it has not opened automatically. File - Import, then go find the files you have just exported. For now we only need the meshs, TutChar_arms, head, legs etc etc so go ahead and import all of them in one go.

    The import screen will appear.. this is important. Under Package... this is the overall name of your character, for this mine will be called CH_TutChar. CH_ for character. Under group, you want to import your meshs into a Mesh group, so type Mesh. Leave name alone and press Ok to All. It might take a few minutes:

    Scrowl down to find your Package.

    Next we need to import your animation file. Double click on any one of your meshs, I normally always use TutChar_head... dont know why just do. A new window will appear, File - New Animset.

    A similar import window will appear. Your package will already be correct, however you will need to change the Group. Animations need to go in a Anim group, so type Anim... make sure its Anim, not Anims. Under Name type something sensible, such as TutCharAni.

    Now your AnimSet group has been created you can import your animations. File - Import PSA. Go locate your *.psa file and open it. If you click on any of your animations and hit play, it will show you the animations working on that mesh part of your character.

    When you close the AnimSet Editor you will notice under your CH_ package, a Mesh and Anim group has appeared.

    A good idea, at times through this is to save your work. Right click on your CH_ package and click 'Save' Save your *.upk file in the CustomChars folder under CookedPC. CH_TutChar will do.

    The first time you close Unreal Ed while doing this it will ask you to save your packages, click yes and go save them under your custom character folder un CustomChars. In my case CustomChars/CH_TutChar.

    Next we need a physics set, right click on one of your meshs, I like to choose the piece that animates the most but I dont think it really matters. Select one mesh, for example TutChar_head. Right click, Create New Physics Asset.

    Another window will appear. Leave the package name alone, it should be correct... the group name should be correct, Mesh, the Name should be acceptable aswell. Press ok, twice it seems : ) and the PhaT window will appear. You can have a play but for now close it. A physics asset file will have appeared in under Mesh in your package.

    Next we need a texture.

    Import in your texture map, for this tutorial all im going to use is a bog standard difuse map but the principle will work for normal, spec etc etc.
    File - Import... go find your texture. Unreal textures need to be *.tga files. When the import window appears, scrowl down slightly to find the LODGroup option. Change this to TextureGroup_Character.

    The group file needs to be labed Materials, similar to your Mesh and Anim groups... all materials and textures go in Materials

    Next create a New MaterialInstanceConstant. Give it a sensible name, as it is a Material Instance Constant, how about mic... so in my case TutChar_mic. A new window will appear. We need to go find a parent material, I dont fully understand this bit... however it seems to work so just go with the flow : )

    Click the magnify glass next to Parent, under FontParameteValues. Navigate to CH_All package and find 'M_CH_All_Base_02' Once highlighted you can close this window.

    Click the green arrow and after a few seconds the sphere should turn black.
    Expand TextureParameterValues. In the appropiate slots, go find your texture by clicking on the mag glass and apply using the green arrow. Oh, dont forget to tick the tick box or nothing will happen : )

    Right.. next we need to apply that texture to each mesh piece of your model, the model parts wont work unless every part has a texture applied to it. If you need to create more than one texture for different body parts, thats fine... every part needs a texture though.

    To apply a texture, double click on, for example the TutChar_head.
    You can apply the material in the same way you just made your material, the mag class, highlight it and click the green arrow. Do this for arms, torso, legs etc etc etc.

    Probably best to save your work at this point so right click the package and save...

    The last thing we need to do in the editor is Sockets. This tells unreal which bones to attach the weapons too etc etc. Double click on one of your character meshs, for example the TutChar_head. Go to Mesh, Socket Manager.

    Click 'New Socket' You will hen be given a list of your characters bones, you need to pick the approatiate bone for the appriopiate socket.

    Mesh Bone Socket Name Discription
    Arms b_RightWeapon WeaponPoint where to attack the weapon to the right hand

    Arms b_LeftWeapon DualWeaponPoint where to attack a secondary weapon for dual weild
    Torso b_Neck HeadShotGoreSocket where the gore comes out when your head is shot off
    Boots b_LeftAnkle L_JB where the effect for the jump boots are for the left foot
    Boots b_RightAnkle R_JB same as above but for the right foot

    Select the bone, press ok.. type in the socket name. It needs to be exactly what is above, capital letters... the works other wise it wont work. Hit ok and it will apply it. You need to do each socket for each part / mesh of your character. It will take a while but it needs doing!

    You can close the Unreal Editor, for now we are done with it but be sure to save your work!

    ------------------------------------------------------------------------

    WINDOWS


    Next we need to make a UTCustomChar *ini file. You can find Unreals UTCustomChar.ini under:

    Documents/MyGames/Unreal Tournament 3/UTGame/Config

    Make a copy of this file and paste it in:

    Documents/MyGames/Unreal Tournament 3/UTGame/Unpublished/CookedPC/CustomChars... and in my case ... CH_TutChar

    Inside your UTCustomChar.ini you will need the following:

    -------------------------------------------------------------------------

    [UTGame.UTCustomChar_Data]

    +Parts= (Part=PART_Head,ObjectName="CH_TutChar.Mesh.TutChar_head",PartID="TutChar_head",FamilyID="CHT")

    +Parts= (Part=PART_Torso,ObjectName="CH_TutChar.Mesh.TutChar_torso",PartID="TutChar_torso",FamilyID="CHT")

    +Parts= (Part=PART_Arms,ObjectName="CH_TutChar.Mesh.TutChar_arms",PartID="TutChar_arms",FamilyID="CHT")

    +Parts= (Part=PART_Thighs,ObjectName="CH_CharTest.Mesh.CharTest_legs",PartID="TutChar_legs",FamilyID="CHT")

    +Parts= (Part=PART_Boots,ObjectName="CH_TutChar.Mesh.TutChar_boots",PartID="TutChar_boots",FamilyID="CHT")

    +Characters=(CharName="TutChar",Description="Custom Character",CharID="TutChar",Faction="IronGuard", PreviewImageMarkup="<Images:UI_Portrait.Character. UI_Portrait_Character_TwinSouls_Male_Head03>", CharData=(FamilyID="CHT",HeadID="TutChar_head",TorsoID="TutChar_torso",bHasLeftShoPad=false, bHasRightShoPad=false, ArmsID="TutChar_arms", ThighsID="TutChar_legs", BootsID="TutChar_boots") , AIData=(Jumpiness=-0.4,StrafingAbility=-0.2,CombatStyle=0.5,FavoriteWeapon="UTGame.UTWeap_ RocketLauncher"))

    +ModFamilies=TutChar.UTFamilyInfo_CH_TutChar

    -------------------------------------------------------------------

    Everything in bold you need to change... let me take you through it.

    +Parts= Part=PART_Head,ObjectName="CH_TutChar.Mesh.TutChar_head",PartID="TutChar_head",FamilyID="CHT")

    CH_TutChar.Mesh.TutChar_head - CH_TutChar is your package name, .Mesh. , when you imported your mesh into Unreal Editor, you placed them in a Mesh group inside your package... this is what this is refereing to. TutChar_head this is the name of your head mesh. CHT, this is the family name of your character.. we will be using this again later on.

    You need to add a +ModFamilies to the bottom of your UTCustomChar.ini file, this talks to another file which I will explain later on. At the moment, change the TutChar and CH_TutChar to whatever your versions are.

    Once this file has been saved we need to open the UTEditor file which can be found here:

    Documents/MyGames/Unreal Tournament 3/UTGame/Config

    All we need to do here is scrowl down until we find the ModPackages. It will look something like this:

    [ModPackages]
    ModPackagesInPath=..\UTGame\Src
    ModOutputDir=..\UTGame\Unpublished\CookedPC\Script


    We need to add in a new line, ModPackages=TutChar

    So...

    [ModPackages]
    ModPackagesInPath=..\UTGame\Src
    ModPackages=TutChar
    ModOutputDir=..\UTGame\Unpublished\CookedPC\Script


    Again, change TutChar to whatever your character is called.

    Next we need to create a new folder, in my case... TutChar... you should be getting the hang of this now : ) Under here:

    Documents/MyGames/Unreal Tournament 3/UTGame/Src

    Create a new folder tree like this, Src/TutChar/classes

    Inside this folder we need to create our very own UTFamilyInfo file. God did this give me some long nights : )

    Open up Unreal Editor again, then in the generic browser click the actors tab. File - Export All scripts. This might take a while : )

    Unreal will export them all to:

    My Documents\My Games\Unreal Tournament 3\UTGame\ExportedScript

    Within those files track down 'UTFamilyInfo' Make a copy of it and paste it into:

    Src/TutChar/classes

    At this point rename it to something like this, UTFamilyInfo_CH_TutChar. The same as the ModFamilies line within our custom *.ini file.

    Right... here is what my UTFamilyInfo_CH_TutChar file looks like:

    ---------------------------------------

    class UTFamilyInfo_CH_TutChar extends UTFamilyInfo_Human
    abstract;
    defaultproperties
    {
    Faction="Ironguard"
    NonTeamEmissiveColor=(R=10.000000,G=0.200000,B=2.0 00000,A=1.000000)
    NonTeamTintColor=(R=3.000000,G=2.000000,B=1.000000 ,A=1.000000)
    FamilyID="CHT"

    ArmMeshPackageName="CH_IronGuard_Male"
    ArmMeshName="CH_IronGuard_Male.Mesh.SK_CH_IronG_Ma le_Arms01"
    ArmSkinPackageName="CH_IronGuard_Male"

    NeckStumpName="SK_CH_IronG_Male_NeckStump01"

    PhysAsset=PHysicsAsset'CH_TutChar.Mesh.TutChar_head_Physics'
    AnimSets(0)=AnimSet'CH_TutChar.Anim.TutCharAni'

    BaseMICParent=MaterialInstanceConstant'CH_All.Mate rials.MI_CH_ALL_IronG_Base'
    BioDeathMICParent=MaterialInstanceConstant'CH_All. Materials.MI_CH_ALL_IronG_BioDeath'

    MasterSkeleton=SkeletalMesh'CH_TutChar.Mesh.TutChar_head'
    CharEditorIdleAnimName="CC_TutChar_Male_Idle"
    }

    ----------------------------

    The parts in bold need to be changed to suit your model. I hope by now youve learnt enough to know what you should change the various parts to.

    AnimSets(0)=AnimSet'CH_TutChar.Anim.TutCharAni'

    For the AnimSet, CH_TutChar needs to be your characters package name .Anim. is the group you imported your animation file into, inside Unreal Editor. TutCharAni is the name of your *.psa file.

    The only slightly unique part of this is the last line, this needs to be the name of your Idle animation. In my case, CC_TutChar_Male_Idle.

    So, now you should have the following...

    Within Unpublished/CookedPC/CustomChars... and in my case.. CH_TutChar you should have your mesh files, TutChar_torso, TutChar_head etc etc. You should have your animation file, TutCharAni.psa. You should also have your UTCustomChar.ini

    Within Src/TutChar/classes... you should have your UTFamilyInfo_CH_TutChar.

    You should have added your +ModFamilies to UTEditor within UTGame/Config

    Once these files have been saved, you need to compile Unreals scripts. Open up the Unreal Editor. You will be told:

    Scripts are outdated. Would you like to rebuild now?

    Click YES!

    After a few moments a new window will appear... hopefully you should see:

    Success - 0 error<s>, 0 warning<s>

    Close this, we are nearly there.

    A new file will have appeared in:

    UTGame/Unpublished/CookedPC/Script

    ... called TutChar.u

    This is a result of updating the scipts. Everything you have saved in Unpublished, copy and paste it into UTGame/Published. Now it all works, this is the folder Unreal reads.

    Now boot up Unreal, go to your character select screen and your character should be under the IronGuard tab.

    Ingame in the console type 'behindview 1' and you will see your creation : )
    I am currently working on custom player FPS hands... once I have figured that out I will update this tutorial, along with any new information I learn.

    I believe I have covered everything, all the problems I encountered I have explained what to do correct so hopefully you wont suffer a similar fate.

    Enjoy!

    If I have missed anything out, I apologise... I think I have covered everything. Oh and please forgive the odd spelling mistake : )

    #2
    Nice, very useful. Much thanks.

    Comment


      #3
      Thank you very much for this ^^b I've managed to sort out a fair few problems I've been having.

      Comment


        #4
        Nice one, this means I don't have to go trial and error on this engine to get custom anims. You've savced me countless hours and most of my hair

        Comment


          #5
          Please sticky this

          Great tutorial here. Can someone sticky this.

          Comment


            #6
            Can u add how to make Custom Sounds, step by step, what soft is needed

            Comment


              #7
              Great tutorial! I went through the whole thing and everything seemed to be working well but when I actually try to view the model in game, I don't see anything. And when I select it as my custom playable character, it defaults to one of the normal UT3 characters. Did you ever have this problem?

              EDIT
              Also, I was getting some warning when I compiled, mainly about this line:

              MasterSkeleton=SkeletalMesh'CH_TutChar.Mesh.TutCha r_head'

              I changed it to
              MasterSkeleton=SkeletalMesh'CH_TuTChar.TutChar_hea d' and the warnings went away

              is it possible that taking the 'Mesh' out of there is the problem, and if so, what can I do to fix it?

              Also, the line:
              NonTeamEmissiveColor=(R=10.000000,G=0.200000,B=2.0 00000,A=1.000000)

              was giving me some parenthesis warning, I have no idea why.

              Thanks for the help!

              EDIT: So I realized I never put my meshes in the 'Mesh' group so I fixed that and everything is good. My character appears on the custom char select screen but I can't get past the loading screen when I try to play with it.

              Comment


                #8
                Hi,
                selkcir36, u ve problem in line :
                NonTeamEmissiveColor=(R=10.000000,G=0.200000,B=2.0 00000,A=1.000000)
                because B=2.0 00000 put B=2.000000 (no space) in UTFamilyInfo_CH_TutChar give in tutorial there are some useless spaces look well like SK_CH_IronG_Ma le_Arms01 or Mate rials so correct it or u ll ve compiling warnings.
                And for your loading problem if u copied and pasted [UTGame.UTCustomChar_Data] give in this tutorial be carefull to this line thats wrong:
                +Parts= (Part=PART_Thighs,ObjectName="CH_CharTest.Mesh.Cha rTest_legs",PartID="TutChar_legs",FamilyID="CHT")
                Thats not CharTest but replace it by TutChar (the name of your package)

                Update USE "CHT" for FamilyID or your anims wont work !
                Hope it ll help you and at last i ve to say IT WORKS ! Thank you Sevv !!!

                Comment


                  #9
                  Thanks for the info, that fixed pretty much everything. I'm getting some really weird stretching on my animations but I guess that's a Maya problem that I have to sort out.

                  EDIT: Ok, my final problem. I did the delete/undo method to export my model as different body parts. But for some reason, each piece is acting as if it is attached to the whole skeleton. So the bottom part of my head is trying to connect to the bone joints in the legs and follow its motion. I exported the model as a whole and the animation with that works fine, so I don't think its a skin weighting problem. Is there some way to fix this?

                  Comment


                    #10
                    Thanks for this. I'm about to set up my character for ut3 ,so I'll use this tut and let you know how it goes.

                    Comment


                      #11
                      Super thanks for this... Its really helpfull.
                      However, I have one question, that I havent been able to find anywere.
                      How do you set the UV(s), one for the entire mesh? or one for each part?

                      Edit: Additional Question:
                      Is there any particular reason why the folder for animations shold be called Anim and not Anims?

                      Comment


                        #12
                        Edit: Sorted it.

                        Comment


                          #13
                          Just thought id bump this back to the top, hopefully help a few more people

                          Comment


                            #14
                            Hi again,

                            Great tut, thanks.

                            Ive been having ago and I think Ive done most of it now. Ive got all meshes and materials exported from Max and into UE.

                            My problem is with custom animations. I have exported the 4 animations that are suggested in the tut (just for starters) copying the names exactly.
                            They seem to export and import fine with no errors and can even be viewed working in the generic browser with the my custom char.

                            The problem appears when in game none of the animations seem to work and the character just floats around (original jumping animations still seem to work tho).

                            I've tried various times and cant get any further. I assume it is somethign to do with UTFamilyInfo but not sure what.

                            The char works with original animations but not with custom ones and generally fails when either of these two parts are changed. As its the standard UTMale skeleton I have tried with various mixtures of original and custom animations/physics and generally it dies with anything custom to do with these.

                            Code:
                            PhysAsset=PhysicsAsset'CH_Again.Meshes.Again_head_Physics
                            AnimSets(0)=AnimSet'CH_Again.Anim.NewAnimSet'
                            I hope all that makes sense as I'm completely lost right now and I've wasted a lot of hours. Thanks in advance for any help you can give.

                            RockingSkier

                            Comment


                              #15
                              This really needs to be stickied immediately.

                              I'm having the exact same problem as Rockingskier, although since the UTFamilyInfo seems to be locating the physics files I guess the problem would have to come from the animset... Just a thought.

                              Any ideas what we might have done wrong?

                              Comment

                              Working...
                              X