Adding a new head to the game

Discussion in 'PC Mods' started by SpudsyForever, Dec 9, 2017.

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

    SpudsyForever Starting Off

    I am new.to the forum, so if this has already been answered, tell me.

    I have a group of people getting into modding this game, and we all are trying to get our faces added in. We have the .obj files done, but we know we need them to be .chr. We also are aware the SDK for cryengine 3.3.9 no longer exists, but we hope there is still a way this is possible. We know about most XML modding, buy cannot figure out how to get the heads into the game. If anyone could enlighten us on a process to this, it would be greatly appreciated.
     
    Bob Crees likes this.
  2. QMJS

    QMJS Famous

    There are more parts to the characters than just the model. Here is a brief overview.

    The characters.xml file refers to the chr in the Model section:
    Model="characters/male/human/body/sweater/variant/v03.cdf"

    The CDF file is a text file:
    Code:
    <?xml version="1.0" ?><CharacterDefinition>
     <Model File="characters/male/human/skeleton/skeleton.chr" Material="characters/male/human/skeleton/skeleton"/>
     <AttachmentList>
      <Attachment AName="body" Binding="characters/male/human/body/sweater/sweater.chr" BoneName="" Flags="0" Material="characters/male/human/body/sweater/variant/v03.mtl" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN"/>
      <Attachment AName="skin" Type="CA_SKIN" Rotation="1,0,0,0" Position="0,0,0" BoneName="" Binding="characters/male/human/skin/med_sleeve_thick_jacket/skin.chr" Flags="0" Material="characters/male/human/skin/variant/med_sleeve_v04.mtl"/>
      <Attachment AName="legs" Binding="characters/male/human/legs/jeans/jeans.chr" Material="characters/male/human/legs/jeans/variant/v02.mtl" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN"/>
      <Attachment AName="head" Binding="characters/male/human/heads/head13/head.chr" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN" Material="characters/male/human/heads/head13/variant/beard01.mtl"/>
      <Attachment AName="hair" Binding="characters/male/human/hair/hair05/hair05.chr" BoneName="" Flags="0" Position="0,0,0" Rotation="1,0,0,0" Type="CA_SKIN" Material="characters/male/human/hair/brown01.mtl"/>
      <Attachment AName="eye_left" Binding="" BoneName="eye_left_bone" Flags="0" Position="-0.032982595,0.13186496,1.8033698" Rotation="0.99999988,-3.7252907e-009,8.9406981e-008,0" Type="CA_BONE"/><Attachment AName="eye_right" Binding="" BoneName="eye_right_bone" Flags="0" Position="0.032982595,0.13186496,1.8033698" Rotation="0.99999988,-3.7252907e-009,8.9406981e-008,0" Type="CA_BONE"/></AttachmentList>
     <ShapeDeformation COL0="0" COL1="0" COL2="0" COL3="0" COL4="0" COL5="0" COL6="0" COL7="0"/>
    </CharacterDefinition>
    
    If your model already has the hair and such attached, you can skip those attachments, but then the textures need to be included with the head's MTL file (basically, the defaults for that model).

    It contains the sub-components which relate to the overall character, and includes references to the MTL files. The MTL files are also text files which control the textures used on the body part:
    Code:
    <Material MtlFlags="524544">
     <SubMaterials>
      <Material Name="shirtShader" MtlFlags="524416" Shader="UL_Character" GenMask="200000000000" StringGenMask="%BLEND_PATTERN_MAP" SurfaceType="" MatTemplate="" Diffuse="0.79949999,0.79949999,0.79949999" Specular="0.026548682,0.034230206,0.037028514" Emissive="0.056374099,0.056374099,0.056374099" Shininess="2" Opacity="1" AlphaTest="0.0099999998">
       <Textures>
        <Texture Map="Diffuse" File="characters/male/human/body/sweater/shirt_d.tif"/>
        <Texture Map="Bumpmap" File="characters/male/human/body/sweater/shirt_ddn.tif"/>
        <Texture Map="Detail" File="characters/textures/flannel_basic.tif">
         <TexMod TileU="14" TileV="7"/>
        </Texture>
        <Texture Map="Custom" File="characters/male/human/body/sweater/shirt_m.tif"/>
       </Textures>
       <PublicParams AlphaRef="0.024" Saturation3="0.1" FresnelBias3="0.25" FresnelScale0="1" Contrast1="0.0049999999" Hue0="0" SpecColor2="0.013473397,0.015175238,0.016988052" Glossiness1="2" VertColorMaskY="0" FresnelPower0="4" BloodBlendEnd="1" Brightness1="0.34999999" FresnelPower1="2.2" VertColorMaskX="0" Brightness0="1" SpecColor3="0.0077510267,0.0006381828,0.0006381828" Hue1="-2.451" Contrast0="0" FresnelScale1="14" FresnelBias2="0.1" Saturation2="0.5" Hue3="0.59200001" SpecColor1="0.0160677,0.024222942,0.025371276" FresnelBias0="0.25" Saturation0="1" Contrast2="0.0049999999" FresnelScale3="1" Brightness2="0.2" VertColorMaskZ="0" FresnelPower3="3.75" DecalMaskIdChoice="0" Glossiness2="2" Glossiness3="1" Brightness3="1" DetailMaskIdChoice="2" VertColorMaskW="0" FresnelPower2="3" FresnelScale2="12" Contrast3="0.15000001" Saturation1="0.23999999" FresnelBias1="0" BloodBlendStart="1" Hue2="0" IndirectColor="0.25,0.25,0.25"/>
      </Material>
      <Material Name="lambert1" MtlFlags="524416" Shader="Illum" GenMask="0" StringGenMask="" SurfaceType="" MatTemplate="" Diffuse="0.5,0.5,0.5" Specular="0.5,0.5,0.5" Emissive="0,0,0" Shininess="10" Opacity="1">
       <Textures />
       <PublicParams FresnelPower="4" GlossFromDiffuseContrast="1" FresnelScale="1" GlossFromDiffuseOffset="0" FresnelBias="1" GlossFromDiffuseAmount="0" GlossFromDiffuseBrightness="0.333" IndirectColor="0.25,0.25,0.25"/>
      </Material>
      <Material Name="skinShader" MtlFlags="524416" Shader="UL_Test_Skin" GenMask="0" StringGenMask="" SurfaceType="" MatTemplate="" Diffuse="0.79949999,0.79949999,0.79949999" Specular="0.071761452,0.098689198,0.15105805" Emissive="0,0,0" Shininess="10" Opacity="1" AlphaTest="0.029999999">
       <Textures>
        <Texture Map="Diffuse" File="characters/male/human/skin/skin_d.tif"/>
        <Texture Map="Bumpmap" File="characters/male/human/skin/skin_ddn.tif"/>
       </Textures>
       <PublicParams SpecularStrenght="0.30000001" VertColorMaskY="0" FresnelPower="3" VertColorMaskX="0" Melanin="0.30000001" RimStrenght="0.30000001" FresnelScale="4" SelfShadowSoftening="20" BlurScale="0.80000001" FresnelBias="0.30000001" VertColorMaskZ="0" VertColorMaskW="0" IndirectColor="0.25,0.25,0.25"/>
      </Material>
     </SubMaterials>
     <PublicParams FresnelPower="4" GlossFromDiffuseContrast="1" FresnelScale="1" GlossFromDiffuseOffset="0" FresnelBias="1" GlossFromDiffuseAmount="0" GlossFromDiffuseBrightness="0.333" IndirectColor="0.25,0.25,0.25"/>
    </Material>
    
    The CDF file also points to the CHR files, which each also has an associated MTL file. This MTL specifies the defaults when the head is used.

    Specifically for your question of how to use the obj file to make a CHR:

    That CHR file is the model.

    There aren't any OBJ files in use by the game or the engine, so you will have to convert them. You'll need Maya or 3dsMax, or an equivalent 3d modeling software that can export in the proper formats.

    To determine what you need to do to create/convert one, you should start here: http://docs.cryengine.com/pages/viewpage.action?pageId=1310785
     
    Last edited: Dec 9, 2017
    Bob Crees likes this.
  3. SpudsyForever

    SpudsyForever Starting Off

    Ok, I have two questions.

    1. I have 3ds Max, but how do I convert it to the file type I need?

    2. How do I then get that into the games coding correctly.

    If you need any extra information, I'd be happy to supply. Thanks for the fast response.
     
    Bob Crees likes this.
  4. QMJS

    QMJS Famous

    Just edited that for readability.

    I don't know the exact specifics, but it is under the export settings. You would open your obj and then export it. I believe that those two programs are specified in the cryengine documentation because they can already export the right format without adding in additional converters.

    Check that link about the creation, because there are some specific bone names and orientation that you need to have them in to make it work properly. (Otherwise you can get the head in the wrong position/orientation on the body, and such.)

    Once you have the CHR, you work backwards to make the MTL for the textures, and then make the CDF. Once you have all of those, then you can put it into the characters.xml.
     
    Bob Crees likes this.
  5. SpudsyForever

    SpudsyForever Starting Off

    And this would work if it was soley a head, not a full character?
     
    Bob Crees likes this.
  6. SpudsyForever

    SpudsyForever Starting Off

    Okay, I did everything it said and loaded up my character. His head is now entirely missing, and I'm not sure if I did something wrong in code or in the file format.
     
    Bob Crees likes this.
  7. QMJS

    QMJS Famous

    Missing, as in nothing, or missing, with a big orange ball?

    If it can't find the file, it will have a big orange ball place holder. If that isn't there, it is loading, but there is an issue with the model itself.

    As for the other part, yes, it should work, as the head is a separate part, and as long as it is pointing to it in the overall CDF file, and it can find the pieces, it should display everything.
     
    Bob Crees likes this.
  8. SpudsyForever

    SpudsyForever Starting Off

    It's that it just isn't there. At first I could see the outline. Then I decided to isolate the head by removing all other character parts, but still the head wouldn't appear. I change some textures to .dds to see if that would help and copy pasted the games my life format into the models, then editing that. Still to no evale, so I'm poking around with different settings, trying to see if I can figure it out.
     
    Bob Crees likes this.
  9. SpudsyForever

    SpudsyForever Starting Off

    My life = .mtl
     
    Bob Crees likes this.
  10. QMJS

    QMJS Famous

    Try this... pick a character that you have access to, and leave everything else the same and change only the head, leaving everything else alone. (The CHR file, change only Attachment AName="head" Binding="characters/male/human/heads/head13/head.chr")

    Once you get that working, then you can move to getting the texture for the head right.

    Edit: The CDF appearances are the one thing you can change without having to start a new game, so you can exit, make a change, load it up again to see the effect, without needing to start a new game to see the changes. Just about everything else does need a new game.
     
    Bob Crees likes this.
  11. QMJS

    QMJS Famous

    Also, once you get it working, put up a picture. Not many people have ventured into this area, because modelling a head is pretty hard to do. For example, I have the technical ability, but not the artistic part... so I generally stay away from the visual changes myself.
     
    Bob Crees likes this.
  12. SpudsyForever

    SpudsyForever Starting Off

    So in this case, I am using Marcus, just because I can load him up the easiest. I went into his head folder, and replaced all that stuff with my custom stuff (I have backups of the original). So where the attachment says head.chr, would I change that to the filename of my head?
     
    Bob Crees likes this.
  13. SpudsyForever

    SpudsyForever Starting Off

    And if it has any jurisdiction, I am using your extended functions 1.6 if that changes anything that relates to this.
     
    Bob Crees likes this.
  14. SpudsyForever

    SpudsyForever Starting Off

  15. QMJS

    QMJS Famous

    No, the appearances won't change anything with the mod.

    Yes, change the head.chr to the path to your file's location. It has to be somewhere under the game folder. For ease of reference it is best to put in the characters folder, but it is technically not necessary.

    Edit: Yes, that looks right, if you put your model in the same place as his head model normally is.
     
    Bob Crees likes this.
  16. SpudsyForever

    SpudsyForever Starting Off

  17. QMJS

    QMJS Famous

    Does Marcus' hair show up, but without a face? Two possibilities are that it is reading the head as being really tiny, or it is not finding the bone to attach it to.
     
    Bob Crees likes this.
  18. SpudsyForever

    SpudsyForever Starting Off

    Yes, that is it exactly. (The pic was too big for the forum). I'm not sure which problem is occurring, so which way would I go about either?
     
    Bob Crees likes this.
  19. QMJS

    QMJS Famous

    I'd try the head size first. In the picture there is has the file's units specified as millimeters... try bumping that up. Try meters first, because most of the objects are measured in meters. If it is huge, then use cm.
     
    Bob Crees likes this.
  20. SpudsyForever

    SpudsyForever Starting Off

    I just resized it, but the exact same issue occurred. I'm going to try adding a skeleton, but I'm new to that WHOLE spectrum.
     
    Bob Crees likes this.
Thread Status:
Not open for further replies.

Share This Page