0% found this document useful (0 votes)
42 views32 pages

Create Custom Units in Civ 6 Tutorial

This tutorial provides a step-by-step guide to integrating a custom unit model into Civilization 6 using various tools like Blender, CivNexus6, and GIMP. It covers the necessary preparations, model adjustments, weight transfers, and file exports required to create a new unit, specifically a Japanese Spearman. The document emphasizes the importance of correctly setting up models, textures, and associated files to ensure proper functionality within the game.

Uploaded by

louis landron
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views32 pages

Create Custom Units in Civ 6 Tutorial

This tutorial provides a step-by-step guide to integrating a custom unit model into Civilization 6 using various tools like Blender, CivNexus6, and GIMP. It covers the necessary preparations, model adjustments, weight transfers, and file exports required to create a new unit, specifically a Japanese Spearman. The document emphasizes the importance of correctly setting up models, textures, and associated files to ensure proper functionality within the game.

Uploaded by

louis landron
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

In this Tutorial you will learn to integrate a new Model to Civilization 6, as a new custom Unit.

I assume that you have some experience with Blender and the Mod Tools we will need and know
how to install the following necessary Tools :

-Notepad++ (Downloadable at Notepad Website )


-Blender 2.79 ( Downloadable at Blender Website )
-Blender 2.49 ( optional )

-CivNexus6

downloadable here : [Link]

-BlenderScripts

here : [Link]
civnexus6.25925/updates

Sid Meier's Civilization VI Development Tools : ( Downloadable at Steam )


( in this Toolset the necessary Asset Editor and also necessary ModBuddy are included )
Sid Meier's Civilization VI Development Assets : ( Downloadable at Steam )

Gimp 2 For Creating Textures and the Gimp DDS-plugin. ( Downloadable at GIMP Website )

ok, now finally, we can start to work on our first Civ 6 Custom Unit-Model :)

STEP 1 :

-first of all, copy and paste the [Link] and Unit_Bins.artdef from your Civilization VI Game
folder to your Desktop. In my case, i find them here :
C:\Program Files (x86)\Steam\steamapps\common\Sid Meier's Civilization VI\Base\ArtDefs

-Create a new Modbuddy Project, i call it Unit_Tutorial, and launch the Asset Editor. This will
create important folders in your modbuddy Project Folder. Click in Asset Editor on File--->Open
Art Def and then navigate to your Desktop(!!!) and open the [Link] File.

-Click on UnitMemberTypes and as we will make a new Custom Spearman in this tutorial, scroll
down until you find Spearman. Then click multiple times until you see this :
on my screenshot when i click on Armor--->Bins, then i can see on the right Panel
Armor/Spearman, which is the entry we wanted to find.

now we can open the Unit_Bins.artdef, so again File--->Open Art Def and then Desktop(!!!) and
open the Unit_Bins.artdef. Click on UnitAttachmentBins

and as we clicked on the Bins for Armor in the [Link], we want to click also on Armor in the
Units_Bins.artdef

Click on Armor--->Groups--->Spearman

and click multiple times again like on the left side on my screenshot 2 :
so on the right side we finally find the asset file which is used for this Armor Part
Spearman_ArmorC

search in your folder, where you have the Development Assets installed, for the
Spearman_ArmorC.ast file. And open it via Notepad++

you want to find this part :


1. is the name of the .geo file, and also the .fgx file we need to find. ( Spearman_ArmorC in
this case )

2. Is the name of the material file, which you can find also in the Assets pantry. (
Spearman_Material in this case )

So lets copy and paste the Spearman_ArmorC.fgx and Spearman_ArmorC.geo to the Desktop.

I recommend that you always use the Parts from the Unit you want to use the Animations from.
i want to integrate a new custom Japanese Spearman, so i want to import the Spearman to blender,
but if i want to make a new Knight, then i import the Knight of course, but if you do not know
which model is the correct model (the [Link] and .geo file) then do this Step 1 we have done
now, and you will be able to figure out which model ( fgx and geo ) is actually used by the Game.

BUT WE WILL NOT USE this Spearman_ArmorC, we use instead the full-body and the head
which is used by the Spearman unit : Male_Caucasian_MediumBody_FullA and
Male_Asian_HeadA.

If you want to check if those full-body and head models are the correct ones, then repeat this step,
but this time do not search for the armor which is used, but search for the body and head.

STEP 2:

find the Male_Caucasian_MediumBody_FullA.fgx and Male_Asian_HeadA.fgx on your


Desktop, if you cant find them make sure you copied and pasted them from the pantry to your
desktop. and then open the first fgx file in CivNexus6 : Male_Asian_HeadA.fgx
( if CivNexus6 do not work for you at the first start, then you will have to make an entry in the
registry via regedit tool ( regedit is included in Windows ).

Deliverator explained that before, and i will paste his words here :

„To use it you will need to have the Windows registry key
HKEY_CURRENT_USER\Software\Firaxis\Tools
ToolAssetPath set to any directory that contains two directories named "Assets" and "Resource".

.NET Framework 4 may also be required“


with the fgx file open in CivNexus6 go to the "Additional Actions" Tab and hit the Export Models
( All Models ) Button. Now CivNexus6 export the fgx file as a new .cn6 file in the same folder
where your opened fgx file is. Repeat this for Male_Caucasian_MediumBody_FullA.fgx as well.
You can close CivNexus6 for now.

STEP 3:

now we open Blender 2.79, and import the .cn6 file we created in CivNexus6 at Step 2.
first import the head, after import you delete the skeleton. Now import the body model with the
skeleton we will use.
now the model and the skeleton is imported to Blender, and i recommend moving the Model to a
second Layer in Blender, while we let the Skeleton on Layer1. Your own model could be on a 3rd
Layer. Now create your model, or Scale your created model and make the pose editing if needed,
target is that the skeleton is inside of your model, without moving the skeleton ( !!! ), so your model
should be adjusted to the position, scaling, rotation and pose of the skeleton. You can also use the
vanilla game model you imported together with the skeleton to see how the model should be
adjusted. Here are the different layers in blender are very very useful.
But from now on, i use my Japan_Spearman Model, which is already scaled, rotated, in the right
position and posed for the civ6 Spearman Skeleton, i would recommend for the first try, that you
use it too, you can find it in the .rar file you just downloaded from my post at CivFanaticsCenter.

On the following screenshot you can see the skeleton is inside of the model. Hands of the model
where the hands in the skeleton are, legs of the model where the legs of the skeleton are and so on.
And this is how the model looks with the skeleton :

STEP 4:

now we can transfer the weights from the vanilla game body model to the Japan_Spearman Model.
My Japan_Spearman Model consists of 7 meshes. I would not recommend that you use 7 meshes
for your own model in the future, but multiple meshes in general are ok. But before we will transfer
the weights, we should set up some things first.

On the following screenshot you can see this panel with icons.
these icons have names, and we will walk through 4 different icons on that panel.

1. Object
2. Modifiers
3. Data
4. Material

so lets begin with Object.


On the screenshot above you can see in the object field, we need to edit 3 different things.

1. the name of the object. Give it a unique name. I choose Japan_Spearman_Hat, as i start with
the Hat-mesh
2. you can see that rotation x is 90 Degrees, which is wrong and if we not apply the
transformation,Rotation and Scale then you will have trouble later. So press Ctrl and A, and
click on Location. Hit Ctrl and A again, and click on Rotation&Scale.
3. Click on the empty field under Parent. Choose "Root" and under Root you change the
setting from Object to Armature.

Then under Modifiers you click on Add Modifier and choose Armature.

Here on the screenshot you see where we have to change something.

1. click on the empty field and choose "Root"

Then we can go to Data.

Under UV Maps you set 3 UV Maps. You want to give them the following names :

UV1
UV2
UV3

now we can transfer the weights from the game Model to our own model. As this is for the Hat, we
will transfer the weights from the head to our Hat. If you would choose the body, then you would
have trouble or will have a lot to improve later at Bone Weights Correction Step.

Click first on the Game Head-Model , then hold Shift and click on your Model. So both Models
have been selected, but the game Head-model first.
Then we move from Object Mode to Weight Paint [Link] Transfer Weights, and then set Sourc
from Active Layer to : By Name.
Done for the first Mesh ( the Hat )

Then we go to Material and click on New, and then give your new Material a Name. Again, i choose
Japan_Spearman_Hat

so....first mesh is done so far. Repeat all those sub-steps for the other 6 meshes and then we can
move to the next step.

STEP 5: ( optional )

this step only contains the vertex weight Correction. I would recommend that you skip this step as
often as you can. Try it ingame without weight correction, and only if it looks weird ingame, then
try to improve the weights.

EDIT : also Deliverator told me there is another, maybe better way to do this step.

I will paste his words here :

"Personally I think that using Blender 2.49 for correcting Vertex Weight problems is not the best
way. I generally use FGXViewer to test the .fgx animations against my rigged .fgx model then adjust
in Blender 2.78 using Weight Paint mode or by editing Vertex Groups directly. Re-exporting to .cn6
and then re-testing in FGXViewer is quick. To load .fgx animations into FGXViewer you can just
drag and drop the animation .fgx files into it." - Deliverator

its up to you, which of the both ways you want to go to correct vertex weights.

For the way with blender 2.49, We will need Blender 2.49 of course.
So just save the project with "Legacy Mesh Format" checked, and then open it in Blender 2.49.

here in Blender 2.49 the first thing i do is set the view to SR:1-Animation and the Viewport
Shading to Solid.
Now we want to convert a civ VI Spearman-animation to .na2 format, so that its ready for import to
Blender 2.49. i choose this animation you can find on the CIV VI Development Assets pantry :
Spearman_PokeAttack.fgx

first start CivNexus6 and open a vanilla game model from the Geometries folder in the pantry.
I choose Spearman_ArmorC.fgx.
Then go to Additional Actions in Nexus and click on Export Animation to NA2
now you choose Spearman_PokeAttack.fgx
if its successfully converted then you should have a .na2 file to import into Blender 2.49.
import it and change the timeline to go through the frames of the animation.

The timeline is this :


as you can see, i would have a lot to correct here. It looks weird by now
if your model is even more deformed, then make sure under Deform Options you have Vertex
Groups deactivated.
Go to Weigth Paint Mode and choose a bone ( vertex group ) here :

then you can choose a weight value from 0.000 ( 0 = vertex will not move when the bone is moving
) to 1.000 ( 1 = vertex will fully move when the bone is moving ) 0,5 is half weighted to that bone
and so on. Then you can simply paint the weight value to the vertices of the model.
If you more or less happy with the result, then save it and open it in Blender 2.79 again.
( Weight Painting and Correction is a time consuming painful process, i for one hate this step, but
the better the weights, the better the unit will look ingame when animated.
So now we have it again in Blender 2.79, here you will notice that the model is still in animated
pose. What i do now is simply delete the skeleton from the project, as you can see when skeleton is
deleted, then we have our model in the civ VI Pose again. So just import again the Full Body
Model, then keep the skeleton but delete the body game model. Now you have to check if
everything is set as before we opened it in Blender 2.49, just as before.
You may have to correct the names of the meshes and materials, and definitely need to parent the
model to the skeleton we imported from the game body model again. Same with Armature Modifier,
you will need to set it again to Root
if you unsure what i mean, i mean the following sub step of step 4 :

these icons have names, and we will walk through 4 different icons on that panel.

1. Object
2. Modifiers
3. Data
4. Material

so lets begin with Object. AND SO ON...please look at Step 4 again if you are unsure.

STEP 6:

now we are ready to export the model to .cn6, so please do that. Then open Civ Nexus6 again, and
click on "Import", choose Japan_Spearman.cn6

Click on Save. You could then Click on View and take a look at your model.
Then check if everything is correct, if all the materials are linked to the correct meshes. If yes, go to
Additional Actions.
Choose Class: Unit
Click on Create [Link] for .ast file
click on Create Geometry/Animation (.geo/.anm) File
close Civ Nexus6.

Copy and paste the created .fgx and .geo file into your Geometries folder of your Modbuddy
Project.

STEP 7:

now we are ready to make our .ast file. First copy and paste: Spearman_ArmorC.ast from the
pantry and rename it to, in our case Japan_Spearman.

So open the generated Japan_Spearman_GeometrySet.xml via Notepad, and also the


Japan_Spearman.ast. Go to the Japan_Spearman.ast Tab in Notepad and scroll to the bottom of
the code. We will replace the following entry with our own :
1. delete the entry and replace it with the name of the .ast file, so in our case Japan_Spearman
2. this line <m_GeoName text="Spearman_ArmorC"/> we want to replace with the entry
you can find in your Japan_Spearman_GeometrySet.xml :

As you can see, the name is <m_GeoName text="Japan_Spearman"/>

so we need to choose in our .ast file the exactly same name as we see in the [Link], so
in our case : Japan_Spearman
so this is correct :

We will now replace the following part of the code in our .ast file ( the selected part on the image )

with the code part from our [Link]


so, in words : we select from the line <m_GroupStates> til the line </m_GeometrySet>

copy that selection, and paste it into the selected part of our .ast file.

Save the Japan_Spearman.ast file or your .ast file, and Copy and paste the .ast file to the Assets
Folder, in your Modbuddy Project Folder.

STEP 8:

now prepare a folder with your textures inside. When you use GIMP then you should save textures
without compression and with Generate Mipmaps checked, as a dds.

Now open your modbuddy project, and launch asset editor, while the [Link] is opened in
Notepad.

Click in Asset Editor on File--->New--->Texture

and here we will create the first texture files.

edit name and class name for the first texture, in my case like this :

then choose your Source File Path and choose the texture dds file.
Save.
This will automatically create a copy of your dds file and a tex file into the textures folder of your
modbuddy project.

So now we need to create a material ( .mtl ) file.


Click File--->New--->Material in Asset Editor.

The name you need to choose for the material, you can find in the [Link] :
in Notepad, copy the name.
Then go to asset editor again and paste the name into the name field for the material file.

Choose class name Unit

so it should look like this now :

so then click on this symbol for the BaseColor entry :


( right click, and then Add Existing )

in the search field, type in a part of the name of your texture file, in my case all i need to type in is
"japan" , and then choose the texture and then hit ok.
Now you could edit the normal, the gloss, the AO and the metalness fields and add textures as well,
but in this tutorial we will skip this step.

Repeat this step for all the other meshes, you can find them all in your generated
[Link], dont forget to always copy and paste the correct name for the material file.

STEP 9:

now we can test if our unit model will show up in Asset Previewer.
Close the asset editor, and launch the Asset Editor again.

Then click on File--->Open Entity and search your .ast file, in our case Japan_Spearman.ast,
then double click it. Now you should see your model with textures in the asset previewer. If not,
then something was not correct, a name for example or you forgot something else.
But if it looks like this :
then everything is good, and we can go to the next step.

STEP 10:

now we can make the artdef and xlp stuff.


Click in the Asset Editor on File--->New--->XLP

and choose a package name and xlp class.


Then click on Add Existing.
And then search and choose your .ast file.
So in my case exactly as on the screenshot above.
Then save it under the same name you have chosen for package name. In my case
Tutorial_Units.xlp

then Click in the Asset Editor on File--->New--->Artdef

and choose for Art Definition Templates : Units

at the same time, open the vanilla Unit_Bins.artdef we pasted on the desktop at Step 1 of this
tutorial.
Click on UnitAttachmentBins--->Armor--->Groups--->Spearman

you got it ? ok. Then go to your new artdef and right click on UnitAttachmentBins here, then
click on Add Element. Change the name to Armor. So it looks now like this :
then go again to the [Link] from the desktop and click on Copy the selection and paste it
on the clipboard

go again to your artdef and with Groups selected, click on Paste the content from the clipboard
and make that the new selection.

Now click on Spearman--->Cultures and you will see the list of Culture Variants, but for this
tutorial we dont need that. So delete all except of Any
Click on Any and then click on Assets. Type in Japan_Spearman in both fields,because in our xlp
file created before, we have chosen Japan_Spearman in both fields. The entry for the asset field
need to be the same name as your .ast file

Change the name from Spearman to Japan_Spearman. ( IMPORTANT !!! )


save the artdef as Unit_Bins.artdef into the artdef folder of your modbuddy project.

NOW WE WILL MAKE THE [Link].

Close all the tabs except of your own Unit_Bins.artdef you have saved.

Open both the [Link] from your modbuddy project "Artdef" Folder and from the desktop.

Go to the [Link] from the desktop and click on Units


then find UNIT_SPEARMAN and copy it to your clipboard, as you have done for the first artdef
file.

Go to your [Link] Tab and click on Units


then paste it from your clipboard.
Now we can delete UNIT_PEON so only UNIT_SPEARMAN is left.
Change the name to UNIT_JAPAN_SPEARMAN.

Now go again to the [Link] from your desktop ( marked with Read only )
and click on UnitMemberTypes---->Spearman

select Spearman, and copy it.


Go to your own [Link] and click on UnitMemberTypes and paste it.
Click on Cultures and delete every CultureVariant except of Any
Click on Any--->Variations--->A--->Attachments

here you can delete Hat, Body and Head, because we have them combined in our model.
Keep Armor, Shield, and Weapon. Click on Armor--->Bins
we now basically have to type in whats in our Unit_Bins.artdef.
Go to the Unit_Bins.artdef Tab and you will see UnitAttachmentBins--->Armor---->Groups----
>Japan_Spearman

the two keywords for us here are Armor and Japan_Spearman

so go back to your [Link] and type in under Armor--->Bins : Armor/Japan_Spearman

like on this Screenshot, change Spearman to Japan_Spearman, and then it look like on the
Screenshot :

now go back to Units, click on UNIT_JAPAN_SPEARMAN and click on Members.


Change the type to Japan_Spearman , the reason is we have under UnitMemberTypes the entry
Japan_Spearman
save the [Link]. And close the Asset Editor.

now you only have to check some entries in Notepad.


Open the two Artdef Files from your Modbuddy Project Folder via Notepad.
The important one, cause this often causes a problem if you not have the correct entry,
is this part in the Unit_Bins.artdef:

here the important part is mainly that this two code parts have a entry, the correct entry of course :

<m_XLPPath text="Tutorial_Units.xlp"/
<m_BLPPackage text="Tutorial_Units"/>

XLP Path needs to have the same name as your xlp file
BLPPackage the same name as your package name in your xlp

STEP 11:

now we have to edit our [Link]. Use thecrazyscotmans ModArtGenerator or do what i do


now :

and :
if you have chosen other names, then type in your names, this is just for my case and if you
following this tutorial step by step excactly with the same names.

STEP 12:

now set the NewUnit_Gameplay NewUnit_Icons and New_Unit_Text xml files. I think you already
know how to do this, if you really want to add new 3d models. So i will not explain this. But If you
want to see how it works, then open the modbuddy project "Unit_Tutorial" from the rar file you
have downloaded in order to follow this tutorial.

Now open the modbuddy project in modbuddy,


and add all the files from your project folder and sub folders. Set the artdefs to ArtDef and the xlps
to XLP, like on this screenshot :
here you can see the files are added, and the xlp is set to XLP.

Right click on the project name, in our case Unit_Tutorial and then click on Properties and edit the
name, author, teaser and the description.

Then go to In-Game Actions.

Make sure everything is set correct, and UpdateArt is there, linked to the entry : ( Mod Art
Dependency File ) like on the screenshot :
STEP 13:

Build the Project and then test it in game !

And as you can see, the unit is visible, is there and works like a charm, even without any weight
corrections ( Step 5 )

DONE ! SUCCESS !
Please if it do not work for you on the first try, dont give up, try and check everything, and if you
really cant find the problem, ask for help on CFC.

Happy Modding !

Credits :

Many Thanks to Deliverator and Wolfdog

Common questions

Powered by AI

Integrating multiple 3D meshes into a single model increases complexity due to the need for precise alignment, consistent weighting, and unified texture application across meshes. This can complicate the modding process as each mesh needs proper configuration, including scaling, rotation, and skinning, to ensure a seamless final model. Best practices to manage this complexity include using descriptive naming conventions, maintaining organized layer management in Blender, and employing separate UV maps for different materials to simplify texture application .

The key steps involve several phases: 1) Identifying the correct .fgx and .geo files to determine which models are used by the game. 2) Exporting the models using CivNexus6 to convert them into .cn6 files. 3) Importing these .cn6 files into Blender, and ensuring the model is properly adjusted in terms of position, scale, rotation, and pose to align with the game skeleton. 4) Deleting the skeleton within Blender post-adjustment but keeping the model intact. 5) Re-importing the model into the game environment and ensuring all vertices are properly weight painted, facilitating smooth animation .

Correct weight painting directly influences animation quality by determining how vertices and thus the entire mesh move with the skeleton. Proper weight assignments allow smooth and natural deformations consistent with character motions. Any weight painting errors can result in unnatural or rigid animations, disrupting visual quality and player immersion. Hence, precise weight painting is crucial to achieve realistic movements in custom game models .

The Asset Editor plays a critical role in finalizing a model by allowing the creation and management of textures and material files necessary for the visual representation of the model within Civilization VI. Key tasks include creating texture files and linking them to the correct meshes, creating .mtl files for materials, adding existing assets, and testing model appearance in the Asset Previewer to ensure that textures and materials are correctly applied and visualized. It's an essential step to ensure model compatibility and visual consistency within the game .

Weight painting is crucial for defining how the mesh will move and deform with the skeleton during animations. It involves assigning weights to each vertex, where a value of 1 means the vertex will fully move with the bone, and 0 means it won't move at all. This step ensures that movements look natural and are aligned with the character's intended design. The challenges include the time-consuming nature of ensuring the correct weights for numerous vertices, the need for precise vertex group selection, and the potential for deformation issues if weights are not correctly assigned .

Texture management involves ensuring that texture files are created and stored correctly within the Asset Editor, utilizing .dds file formats with appropriate settings such as Mipmap generation for optimal display. Considerations include ensuring the textures are linked to the correct meshes, using consistent naming schemes to avoid errors, and managing the .dds files' compression settings. The material files must accurately reference these textures for correct application and visualization on the model within the game .

ArtDefs are pivotal in defining the visual properties and linking the 3D models with in-game unit variations. They specify the appearance settings and ensure the game correctly displays custom units. Creating and modifying ArtDefs involves copying and customizing default .artdef files, ensuring they reference the correct models and assets, and setting up UnitAttachmentBins and UnitMemberTypes for defining cultural variants and unit compositions. Proper formatting and careful attention to file paths and naming consistency are crucial to avoid errors in importing and displaying the custom units .

Maintaining consistent naming conventions like 'Japan_Spearman' is crucial in the modding process to ensure cohesion across multiple files and systems. It helps prevent errors and ensures that different game files such as .ast, .xml, and .artdef files correctly reference the intended models and animations. Misnaming can lead to issues where the game cannot find or apply the correct assets, leading to missing models or broken animations within the game environment .

CivNexus6 facilitates the integration of custom models by allowing users to export .fgx files into .cn6 files that can be imported into Blender for further editing. It requires specific configurations such as setting up a Windows registry key HKEY_CURRENT_USER\Software\Firaxis\Tools ToolAssetPath, pointing to directories named 'Assets' and 'Resource'. This setup ensures compatibility and correct file pathing for CivNexus6's operation, along with potentially requiring .NET Framework 4 for additional functionality .

Benefits of using multiple meshes include flexibility in texture and material management, allowing for detailed and varied surface properties, and simplifying complex model building by segmenting different parts. However, potential drawbacks include increased difficulty in maintaining consistent weight painting and ensuring precise alignment and seamless transitions between meshes. Managing these separate elements requires careful attention to transformation properties and correct parenting to the skeleton to avoid animation issues .

You might also like