Deliverator
Graphical Hackificator
Tools Required
Nexus Buddy 2
CivNexus6
Blender 2.7+
Nexus Buddy 2/CivNexus6 Blender Scripts
Civ 6 Modbuddy & Asset Editor
Background
3D Art Assets in Civilization 6: A Modding Guide
There is now a slightly improved method available using the new .cn6 format and latest version of CivNexus6 and the scripts. I have colour-coded the different steps like so:
Steps that apply to both methods
Steps that apply to the improved .cn6 method
Steps that apply to original .br2 method
Steps
0) If not already done, unpack the Civ V models and textures from .fpk directories. You can use Dragon Unpacker for this.
1) Gather the model and animation .gr2 files for the specific unit as well as its .dds texture files into a working directory. e.g. Create a directory called "galleass" and copy the files galleass.gr2, all galleass*.gr2 files and galleass*.dds files into it.
2a) First use "Load String Database" first and load the *.gsd file that will have been unpacked with the models. This will be called something like unitmodels_stringdatabase.gsd.
2b) Start Nexus Buddy 2 and use the "Resave all GR2 Files in Directory" function under Additional Actions on your working directory. All .gr2 files will be resaved to a subdirectory named "resaveBatch".
3) Open your resaved model .gr2 and perform "Export Model" to export to .cn6.
4) Start Blender 2.7+ and import the .cn6 file using the Addon scripts.
5) In Blender create and name Material(s) and assign all vertices to them. (This saves having to create and name Materials in CivNexus6 later).
6) Export model to .cn6 format - use the same filename as the original .gr2 model apart from the extension.
7) Import your .cn6 model into CivNexus6. The materials you set up in Blender will automatically be created.
5) Export to .br2. The .br2 file will include not only the normals for each vertex, but also the binormals and tangents.
6) Make a copy of your model .gr2 and then open it in CivNexus6 - it will immediately be resaved as a .fgx file.
7) Now use "Ovwr. BR2" to overwrite the model's meshes with the data from the .br2 file. The reason for doing this is that the mesh format in Civ 6 is different from that in Civ 5/Civ BE.
8a) In Civ 5 units face forwards whereas in Civ 6 units face to the right as you look at them (to their left). This means we need to rotate them by 90 degrees. This can be simply achieved by using "Insert Adjustment Bone and Save" in CivNexus6 with Axis set to "Z (Up-Down)" and Rotation Angle set to 90. This will save your .fgx with the new bone inserted so you'll probably want to back up your .fgx beforehand.
8b) Add, Remove, Rename Materials and reassign Materials to meshs as required using CivNexus6 then save the .fgx.
9) Use the "Create GeometrySet .xml for .ast file" and "Create Geometry/Animation (.geo/.anm) File" buttons to create the GeometrySet XML and .geo file for the model.
10) Now bulk convert all the Civ 5/Civ BE .gr2 animation files to Civ 6 .fgx/.anm by using the "Convert all .gr2 Files in Directory to .fgx/.anm" button on your resaveBatch directory - the output will be saved in a subdirectory called "fgx_anm_output".
If using CivNexus6 1.2.3+ your Asset .ast file will be created automatically as part of the "Convert all .gr2 Files..." action. This works by assigning Civ V animations into the Civ VI animation slots. The mapping is editable if you need to tweak it - see the Civ6ToCiv5AninMap.txt in the CivNexus6 application directory. Another file containing just the Behavior data is generated within the fgx_anm_output folder called m_BehaviorData.xml in case you want to copy it into an .ast file manually.
The Asset file should allow the unit to work in the Asset Previewer and Civ VI once you have hooked up the Materials and Textures. There will be no Attachment Points, Sound FX or Visual FX included initially so you will have to edit these in yourself.
As with the CivNexus6-generated .geo file, the .ast file has no indentation formatting, but this is easily fixed in Modbuddy after you import it using Edit > Advanced > Format Document (shortcut Ctrl-K followed by Ctrl-F).
Now you can assemble everything in Modbuddy:
11) Open a new Modbuddy project and start the Asset Editor.
12) Add your animation .anm/fgx pairs to the Animations folder - probably better to do this via your file explorer locating your project's directory under \My Documents\Firaxis ModBuddy\Civilization VI - and then use Add Existing Item to import to your project.
12) Add the .geo and .fgx file pair for the model to your Geometries folder.
13) Use the Asset Editor to create a new Texture importing the Diffuse map as Generic Base Color type. Note: before importing it is best to re-save the .dds file as an uncompressed .dds using Photoshop, Gimp or Paint.NET (using the A8B8G8R8 format). This will create the .dds/.tex file which may be referenced from your Material .mtl. Initially it is quickest to stub out non-Base Color textures with black/white/flatNormal 4x4 squares - as discussed here.
14) You will then need to:
(i) Create a Material (.mtl) file (you can copy one from the pantry just make sure that the m_Name towards the bottom matches your new file name) and reference all your Textures. Add to your project's Materials folder.
(ii) Create an Asset (.ast) file (again you can copy one, but update m_Name), overwrite the GeometrySet entry with the XML created in step (9).
(iii) In your .ast file, update the m_ObjectName in the Material element to point to your newly create Material file:
<Element class="AssetObjects::ObjectValue">
<m_ObjectName text="My_New_Material"/>
<m_eObjectType>MATERIAL</m_eObjectType>
<m_ParamName text="Material"/>
</Element>
(iv) You will need to reference your individual Animations (.anm files) under the <m_animationBindings> section, either in the .ast file directly or in a Behaviour .bhv file referenced under <m_behaviorInstances>. As usual copying and editing a vanilla .ast file is a good place to start.
Once you're done add your .ast file to the Assets folder of your project.
At this stage you should be able to view your unit correctly and test the animations in the Asset Previewer. If not then something has gone wrong and you should identify and fix the issue before proceeding.
15) Create an .xlp file including your new Asset and add to your project's XLPs folder.
16) Create the Unit_Bins.artdef (or relevant .artdef for type of asset) to reference the Asset entry inside the .blp that will be generated from the .xlp package spec.
17) Create your Units.artdef to reference the Unit_Bins.artdef entry plus whatever gameplay XML/SQL needs to be set up to see your object in game.
18) Make sure your Mod.Art.xml references your .artdef files under <artConsumers> and the target .blp of your .xlp under <gameLibraries>.
19) Now you can build out your project and test in game.
Good luck!
Examples
A full working conversion can be found in the Even Moar Units: Macedon and Persia mod - the Ballista converted from Civ 5 or the main Moar Units mod contains the Trebuchet and Gatling Gun converted from Civ 5.
Mammoth Unit, previously ported from Wildlife Park 2 using vanilla Naresuan's Elephant (u_siamese_warelephant) animations.
Civ Beyond Earth CARVR Unit:
Nexus Buddy 2
CivNexus6
Blender 2.7+
Nexus Buddy 2/CivNexus6 Blender Scripts
Civ 6 Modbuddy & Asset Editor
Background
3D Art Assets in Civilization 6: A Modding Guide
There is now a slightly improved method available using the new .cn6 format and latest version of CivNexus6 and the scripts. I have colour-coded the different steps like so:
Steps that apply to both methods
Steps that apply to the improved .cn6 method
Steps that apply to original .br2 method
Steps
0) If not already done, unpack the Civ V models and textures from .fpk directories. You can use Dragon Unpacker for this.
1) Gather the model and animation .gr2 files for the specific unit as well as its .dds texture files into a working directory. e.g. Create a directory called "galleass" and copy the files galleass.gr2, all galleass*.gr2 files and galleass*.dds files into it.
2a) First use "Load String Database" first and load the *.gsd file that will have been unpacked with the models. This will be called something like unitmodels_stringdatabase.gsd.
2b) Start Nexus Buddy 2 and use the "Resave all GR2 Files in Directory" function under Additional Actions on your working directory. All .gr2 files will be resaved to a subdirectory named "resaveBatch".
3) Open your resaved model .gr2 and perform "Export Model" to export to .cn6.
4) Start Blender 2.7+ and import the .cn6 file using the Addon scripts.
5) In Blender create and name Material(s) and assign all vertices to them. (This saves having to create and name Materials in CivNexus6 later).
6) Export model to .cn6 format - use the same filename as the original .gr2 model apart from the extension.
7) Import your .cn6 model into CivNexus6. The materials you set up in Blender will automatically be created.
5) Export to .br2. The .br2 file will include not only the normals for each vertex, but also the binormals and tangents.
6) Make a copy of your model .gr2 and then open it in CivNexus6 - it will immediately be resaved as a .fgx file.
7) Now use "Ovwr. BR2" to overwrite the model's meshes with the data from the .br2 file. The reason for doing this is that the mesh format in Civ 6 is different from that in Civ 5/Civ BE.
8a) In Civ 5 units face forwards whereas in Civ 6 units face to the right as you look at them (to their left). This means we need to rotate them by 90 degrees. This can be simply achieved by using "Insert Adjustment Bone and Save" in CivNexus6 with Axis set to "Z (Up-Down)" and Rotation Angle set to 90. This will save your .fgx with the new bone inserted so you'll probably want to back up your .fgx beforehand.
8b) Add, Remove, Rename Materials and reassign Materials to meshs as required using CivNexus6 then save the .fgx.
9) Use the "Create GeometrySet .xml for .ast file" and "Create Geometry/Animation (.geo/.anm) File" buttons to create the GeometrySet XML and .geo file for the model.
10) Now bulk convert all the Civ 5/Civ BE .gr2 animation files to Civ 6 .fgx/.anm by using the "Convert all .gr2 Files in Directory to .fgx/.anm" button on your resaveBatch directory - the output will be saved in a subdirectory called "fgx_anm_output".
If using CivNexus6 1.2.3+ your Asset .ast file will be created automatically as part of the "Convert all .gr2 Files..." action. This works by assigning Civ V animations into the Civ VI animation slots. The mapping is editable if you need to tweak it - see the Civ6ToCiv5AninMap.txt in the CivNexus6 application directory. Another file containing just the Behavior data is generated within the fgx_anm_output folder called m_BehaviorData.xml in case you want to copy it into an .ast file manually.
The Asset file should allow the unit to work in the Asset Previewer and Civ VI once you have hooked up the Materials and Textures. There will be no Attachment Points, Sound FX or Visual FX included initially so you will have to edit these in yourself.
As with the CivNexus6-generated .geo file, the .ast file has no indentation formatting, but this is easily fixed in Modbuddy after you import it using Edit > Advanced > Format Document (shortcut Ctrl-K followed by Ctrl-F).
Now you can assemble everything in Modbuddy:
11) Open a new Modbuddy project and start the Asset Editor.
12) Add your animation .anm/fgx pairs to the Animations folder - probably better to do this via your file explorer locating your project's directory under \My Documents\Firaxis ModBuddy\Civilization VI - and then use Add Existing Item to import to your project.
12) Add the .geo and .fgx file pair for the model to your Geometries folder.
13) Use the Asset Editor to create a new Texture importing the Diffuse map as Generic Base Color type. Note: before importing it is best to re-save the .dds file as an uncompressed .dds using Photoshop, Gimp or Paint.NET (using the A8B8G8R8 format). This will create the .dds/.tex file which may be referenced from your Material .mtl. Initially it is quickest to stub out non-Base Color textures with black/white/flatNormal 4x4 squares - as discussed here.
14) You will then need to:
(i) Create a Material (.mtl) file (you can copy one from the pantry just make sure that the m_Name towards the bottom matches your new file name) and reference all your Textures. Add to your project's Materials folder.
(ii) Create an Asset (.ast) file (again you can copy one, but update m_Name), overwrite the GeometrySet entry with the XML created in step (9).
(iii) In your .ast file, update the m_ObjectName in the Material element to point to your newly create Material file:
<Element class="AssetObjects::ObjectValue">
<m_ObjectName text="My_New_Material"/>
<m_eObjectType>MATERIAL</m_eObjectType>
<m_ParamName text="Material"/>
</Element>
(iv) You will need to reference your individual Animations (.anm files) under the <m_animationBindings> section, either in the .ast file directly or in a Behaviour .bhv file referenced under <m_behaviorInstances>. As usual copying and editing a vanilla .ast file is a good place to start.
Once you're done add your .ast file to the Assets folder of your project.
At this stage you should be able to view your unit correctly and test the animations in the Asset Previewer. If not then something has gone wrong and you should identify and fix the issue before proceeding.
15) Create an .xlp file including your new Asset and add to your project's XLPs folder.
16) Create the Unit_Bins.artdef (or relevant .artdef for type of asset) to reference the Asset entry inside the .blp that will be generated from the .xlp package spec.
17) Create your Units.artdef to reference the Unit_Bins.artdef entry plus whatever gameplay XML/SQL needs to be set up to see your object in game.
18) Make sure your Mod.Art.xml references your .artdef files under <artConsumers> and the target .blp of your .xlp under <gameLibraries>.
19) Now you can build out your project and test in game.
Good luck!
Examples
A full working conversion can be found in the Even Moar Units: Macedon and Persia mod - the Ballista converted from Civ 5 or the main Moar Units mod contains the Trebuchet and Gatling Gun converted from Civ 5.
Mammoth Unit, previously ported from Wildlife Park 2 using vanilla Naresuan's Elephant (u_siamese_warelephant) animations.
Civ Beyond Earth CARVR Unit:
Last edited: