|
CustomCharacter
IntroductionIn this tutorial we will be looking at how to create a custom character in unreal using blender. I will not be going into great depth on the modelling or rigging side of blender although this tutorial will be using a rig I created that matches the Epic male human rig. We'll got into details of why later. Before We StartYou will need to download the UT3SimpleRig.blend from the SVN it contains the rig and a very simple character model I created to serve as an example. I'm going to assume you have done the previous tutorials and will only be covering any new aspects of the process we didn't encounter in previous tutorials. You are also likely to need the UV layout guides I made. I will explain why and how to use these in more detail later but for now they are linked here and here. Since the last tutorials the blender foundation have released a newer version of blender 2.49a which has a few improvements to the texture painting which make it much more usable so I recommend upgrading. Get it here Getting StartedSo why are we using this prebuilt rig, well the answer is it saves a lot of time. This conforms to the models UT3 already knows about so epic have already done a lot of the hardwork and created texturing nodes and code to run them as well as a load of animations to drive them. By working form a prebuilt skeleton that epic can already drive it saves us having to make up a load of animations. If you want something a bit more custom say a non human character then you can make your own skeleton and meshes, however you would need to make all the required animations and there are a lot of them. I might cover how to do this in another tutorial but it's a lot of work from what I've seen and for this mod human characters are pretty much all we need. OK so you have all the various required starting bits and an idea of what sort of model you want to make. An important thing to bear in mind with this tutorial is that what ever model you make has to conform to the skeleton already setup in the simple rig file. If you change the rig or make a model that doesn't fit to the skeleton then the results when you get in game will be odd the animations may look wrong or it will distort badly as it fits your meshes to the skeleton it knows about. UT3 meshes are built in parts this is so the parts can be swapped in and out (if you remember the character screen there are options to swap out various bits of the model for others of the same family.) This makes for more flexible characters in the game and also allows us to make loads of different boots or arms or what have you that the player can use in the game. It does lead to some restrictions on how the models are made and what parts fit where. So let's dive right in with making your model. Making the Character ModelSo in what ever modelling program you like or blender itself you can make up the various parts of the model. Each part needs to be a separate object with it's own UV's but there are restrictions on how the UV's are laid out we will cover later. We then export each chunk as a separate UT3 skeletal mesh. The Mesh's of the separate parts need to skinned to the simple rig skeleton and also set with their origin at the same point as the skeleton so they fit when the game reassembles them later. Parts of the CharacterSo what parts are included in a character. The Major components are as follows:
there are also a few optional components that can also be included:
Each of these would be a separate mesh object parented to the armature and skinned to the skeleton with vertex groups (ignore the extra control groups like the IK controls) then exported as a skeletal mesh. Make up your mesh objects as above either as separate files with the base skeleton from UT3SimpleRig or all in the same one as I've done. One advantage of separate files is the export stage is smoother. It also allows you to use the split up parts to make more detailed normal maps that can be assembled later. UV LayoutUnlike previous custom objects in UT3 with characters we are constrained to a set UV layout for the body and the head. This is because when unreal takes the various parts that you make have mixed and matched with other bits in the same family it needs to make one texture for each of the groups. So it slices up the texture provided along pre-set lines and reassembles it later. Because of this the UV's for your model parts have to conform to the layouts epic expect. You can do what ever you like with the UV's within those boxes but you can't stray outside. Some of the areas are a bit obscure things like neck and neck cut I think are used mostly for the neck stump used with a full helmet when a head shot is achieved. Chest Female is used in female models. The simple rig was made from Epics Male rig but the female rig looks similar enough that it might work for female models, I've not tried it tho. So you need to layout you UV's for each part within the texture space set out for them by epic. I recommend loading the image into the UV Image editor in Blender then doing the UV mapping with that as a background so you can see where the extents of the areas are. Texturing DetailsWhen making a diffuse texture for your character typically it should be 2048 by 2048 and should make two one for each of the defined UV layouts ie one for head one for body. You can also make ones for a variety of texturing types ie Normal Specular Emit (how the texture glows) and a few others. Preparing your Meshes for ExportThe script to export to UT3 skeletal meshes is not very smart it takes all the meshes it can see and smashes them into one PSK file so if you have all your mesh parts in one blend file (as my starting example does) you basically have to delete all but the part you want to export before running the script. This might be something worth fixing in the script if I can be bothered later. Again standard export details apply ensure the mesh is fully skinned ie all the vertex's assigned to vertex groups matching bones in the armature. Naming ConventionFor most of the parts the name doesn't matter too much so long as you can remember it. I've tended to use the UT3 conventions for example SK_CH_RagingBob_Torso01.psk or the like the SK indicating Skeletal mesh CH that it is a character RagingBob the name of my custom character Torso01 the type of part it is and the number so I can have multiple should I want to. For the shoulder pads the name is very important it needs to fit a certain formalar (this allows UT3 to pick up both the left and the right shoulder pads and refer to them as one object even when they aren't) this mainly applys only once you import into the engine but it saves you time renaming things later if your file names match your asset names for import. So the format for shoulder pads SK_CH_RagingBob_RShoPad01.psk and SK_CH_RagingBob_LShoPad01.psk it always has to be RShoPad01 and LShoPad01 so they can be refered to as XShoPad01 later. That's just how things work. Other bits and bobsAs well as the other stuff you can also make a character portrait (this is the image that pops up in the game when you are selecting the characters usually a head shot of the guy. Make this by rendering out a head shot of your model in a suitably dramatic pose then converting it to a TGA with alpha make sure it's square image (typically 512 512 seems common) and then you can fiddle with erasing the borders to give it a nice non uniform shape like the other images. Getting The Character into UT3Ok so now you have all your textures and meshes ready we can fire up UnrealEd set up a new package calling something like CH_Bob Importing the TexturesOK so in your new package go to import and select all the textures you want to use. Set the group to materials and then in the options you need to set the LOD group for the various character textures in the drop down you will find TEXTUREGROUP_Character use this for you Diffuse texture maps use TEXTUREGROUP_CharacterNormalMap for any normal maps and TEXTUREGROUP_CharacterSpecularMaps for any specular maps These basically tell Unreal that the textures are for characters so can be cut up in accordance with their normal bodyuv/headuv layouts. After you have the textures imported you can also load in the portrait it doesn't need special group settings. Importing MeshesBy naming the meshes how you want the assets to be named you can save a lot of time and use the OK to all. Simply go to import select all your skeletal meshes then when the first box pops up set the group to Mesh and hit Ok to all and it will import all the meshes selected into the mesh group. Setting Up the Material InstanceIt's our old friend the Material Instance Constant again this time used for characters. So we need to create two Material Instance Constants in the Materials group (right click MaterialInstanceConstant in the drop down) call one Mat_Body the other Mat_Head. So open the Mat_Body by double clicking. Set the parent to MaterialInstanceConstant'CH_All.Materials.MI_CH_All_TwinSouls_Base' either by typing this in or hitting the maginfying glass button finding the above in the browser and then with it selected hitting the green arrow in out texture. With that put in click outside and let it sort itself out for a few seconds or so. Now go to TextureParameterValues and then fill in all the Body textures we have ie diffuse normal specular emissive and what ever else you've generated. when you are done it should look like this: Repeat the same procedure for the Head Textures Setting up the Mesh objectsNow you have all your meshes in and the textures ready we are almost there. Just a few more settings to do. Load up each of your mesh objects and then in the Mesh tab enter the materials required (ie for torso enter the body material or Mat_Body) again do this by selecting it in the browser then clicking the green arrow in the materials list. While you have the mesh tab open go to Origin open it up and set the Z to -51. Then go to RotOrigin and set Yaw to -90. This gets everything pointing the right way and offset correctly. Some Meshes also need sockets so in the socket manager add the following sockets on these meshes:
the UDN mentions that you may need to reorient the sockets to make sure particle effects are angled the correct way for head shots and jump boots. I've not investigated this so don't know what angle is needed some experimentation should reveal this fairly easily. SavingOnce you've set up all of this we are ready to save, save the character and then quit unrealed. Now go into the place where it saved (probably the unpublished directory) move it to the customchars directory under published so the normal game will be able to pick it up. Now we just need to tell unreal about this new character. Adding the Custom Character to UnrealTo get unreal to use the new character we need to add it to the config files. It's easy to screw this up so make a backup of the config file before editing it. The file in question is located here My Games/Unreal Tournament 3/UTGame/Config/UTCustomChar.ini Copy it to something like a .bak then open the ini file for editing in any old text editor. You will notice it contains a list of part types details on the mesh used and then a family code (usually four letters ie TWIM which is Twinsouls Male) lower down in the file will be a list of characters and what parts they are constructed with as well as details on their description and portrait. We are going to add our character to one of the existing families for now (in another tutorial I will cover making a custom family for all your custom characters) Go down the list of parts and for each on that your character has find the section for Twin souls Male and add your entry to the end. Ie for torsos you will see a series of entries for the family TWIM that look like this: Parts=(Part=PART_Torso,ObjectName="CH_RTeam_Male.Mesh.SK_CH_RTeam_Male_Torso03",PartID="C",FamilyID="TWIM") basically copy the last line in the series of entries replace the ObjectName with the name of your part so CH_RTeam_Male.Mesh.SK_CH_RTeam_Male_Torso03 becomes CH_RagingBob.Mesh.SK_CH_RagingBob_Torso01 increment the PartID so it is unique ie PartID="D" and leave the family the same. As an aside the PartID's don't need to be sequential letters they can be anything so long as they are unique, so you could go with PartID="MyCharsARMS". Do this for each of the parts you have made head arms torso thighs helmet googles boots etc etc. Make a note of the PartID you assign to each as this will save time when we come to add the character later. Scroll down in the file till you reach the characters and make a copy of reaper now we need to convert that to our character. First change the name by altering the CharName parameter CharName="RagingBob" or the like. Add a description in the Description field. Change the CharID to something unique leave the faction alone. To set the portrait in PreviewImageMarkup replace the text with your portrait so something like PreviewImageMarkup="<Images:CH_RagingBob.Images.Portrait>" or however you named your portrait and where it was positioned in your package. Now go through the rest of the line and where is specifies a part enter the part id's of your characters meshes that you created earlier. Once you are done save the ini file and fire up unreal. Screen Shots and Final ThoughtsTo set your character go to the character menu in the player section of settings. Assuming all has gone to plan there should be a new character in the Ronin section of characters. It should have your character portrait name and description if it isn't there or some such double check you correctly set the ini file Assuming all went to plan your character should appear in the customise window like this: Notice you can swap out most of the parts for others. Once you have the character set up to your satisfaction you can now get it in game. If you want a rear view of your character type behindview 1 into the console (usually mapped to tab) My cheap and cheerful character legs are way too thin and most of it too low poly bit of hoverboard action you can see it slots the feet in correctly dead again So there we have it the basics of getting a custom character in the game. Further work includes making custom families and also setting up your character for distribution to others but I think I'll cover that in another tutorial. |
thank you SO much!