3D ART ASSET OUTLINE FOR UNITS
Special Thanks: FurionHuang, Deliverator, sukritact, lasttry, Wolfdog
1) Windows File Explorer
- Go to (Sid Meier's Civilization VI SDK Assets/pantry) and copy/paste the .fgx file of any items you would like to use as a base to make your 3D Model or animation on your desktop or something.
- For 3D Models look under Geometries for the .fgx files, for animations look under the Animations folder for the .fgx files.
- For a human type unit you need to get a geometry file for the armor and another for the weapon. Example: Missionary_ArmorA.fgx for the clothing model, and GreatProphet_Staff.fgx for a weapon model
2) CivNexus6
- For Geometries: Click Open and select the .fgx file you copied of a geometry, under Additional Actions tab (make sure Import/Export Filetype is set to .cn6), click the Export Models (All Models) button.
- For Animations: Click Open and select the .fgx file you copied of a geometry, under Additional Actions tab click Export Animation to NA2, select the .fgx file you copied of an animation and click open.
3) Blender (Using Cyles Render)
- Change Units settings: in the Properties Menu, under Scene, then under Units, set Length to Metric and Unit Scale to 0.01, then in the 3D View's Properties Menu, under View, under Clip, set End to 100m.
- If you did the steps above: Click File => Import => CivNexus6 (.cn6), and select the .cn6 file you exported from CivNexus6 (.na2 for animations).
- Create 3D Model, and name your mesh (must be triangulated)
- Mark Seams (Ctrl + E => "Mark Seam")
> * Note: Not Required. (this allows you to tell Blender how to unwrap your mesh, it fixes UV island that has overlapping parts, as well as island proportion issues)
- Add a Bone (Add => Armature => Single Bone)
> If you loaded base game geometries in to Blender you it will already have bones so you won't need to add any.
- Add Vertex Group (In Edit mode for your 3D Model, select entire 3D Model, in the Properties Menu, under Object Data, then under Vertex Groups, add new vertex group and click Assign)
> Or if there is already a vertex group called Bone under Vertex Groups, just make sure your whole mesh is selected in edit mode and click Assign.
- Assign Bone to your 3D Model (In Object mode select 3D Model, then hold shift and select bone, then press Ctrl + P and select "With Automatic Weights")
> If you loaded base game geometries in to Blender you will need to unparent (Alt + P => Clear Parent) the bones, then parent them back to the mesh as described above.
- Add Inverse Kinematics (IK) to some of your bones ( in Pose Mode with a bone selected click Pose => Inverse Kinematics => Add IK to Bone => Without Targets)
> You only have to do this if you did not load base game geometries in to Blender, since the base game armature will already have IK bones
- Create a Material for each type of materials you will have on your 3D Model
> If you loaded base game geometries in to Blender there will already be a material there, just delete it
- Assign each Material to the corresponding faces of your 3D Model
- Create UV Map (In edit mode press U = > Unwrap)
- Pack Islands (In UV Map Editor press Ctrl + P)
> *Note: Not Required. (it just rearranges your islands so they fit better)
* Cycles Baking: (*Note: you do not have to use cycles baking, you could just save your UV map and edit it in a photo editor like Gimp)
- Get or Create PBR textures (PBR stands for Physically-Based Rendering)
> You will need an Albedo, bare minimum, but the more you use the better it will look (You can just use a 4x4 texture of RGB 255,128,128 for a completely flat normal map)
> Get PBR textures from the internet (Just google search free PBR textures. Examples: <
www.textures.com> & <
www.poliigon.com>)
> Create PBR textures
- Assign PBR textures to Materials using Nodes
- Fix any scaling/position issues with textures (Note that I use Generated Texture Coordinate and Mapping Nodes for this)
- Create a "New Blank Image" in UV Map Editor
- Create an unattached Texture Image Node in the Node Editor of each material with the "New Blank Image" as the texture file, and with this node as only selected node
- Bake your textures to your UV map
> Albedo = Diffuse (Color)
~ Unattached Texture Image Node with Color Space: Color
~ *Note: a dark grey background on the button means it is active. So the Color button should have a dark grey background, and Direct and Indirect should have a light grey background.
> Ambient Occlusion = Emit (*Requires Special Node Setup through the Emission shader)
~ Unattached Texture Image Node with Color Space: Non-Color Data
> Glossiness = Emit (*Requires Special Node Setup through the Emission shader)
~ Unattached Texture Image Node with Color Space: Non-Color Data
> Normal Map = Emit (*Requires Special Node Setup through the Emission shader)
~ Unattached Texture Image Node with Color Space: Non-Color Data
> Metalness = Emit (*Requires Special Node Setup through the Emission shader)
~ Unattached Texture Image Node with Color Space: Non-Color Data
- Delete all Materials, Create one Material, Assign your Baked UV Map Textures to the Material using Nodes
* Cycles Baking END
- Export Blender project to .cn6 format
4) Gimp (or Paint.NET)
- Export all of your Baked UV Map Textures to .dds format
> Gimp: Format RGBA8, Uncompressed, With Mipmaps
> Paint.NET: Format B8G8R8A8, Uncompressed, With Fant Mipmaps
5) CivNexus6
- Import the .cn6 file you exported from Blender
- Set Class under Additional Actions tab to: (LandmarkModel for buildings, Unit for units, Leader for leaders)
- Click Save (it will save it as a .fgx)
- Under Additional Actions tab, click [Create GeometrySet .xml for .ast file] (Creates GeomertySet.xml file)
- Under Additional Actions tab, click [Create Geomerty/Animation (.geo/.anm) File] (Creates .geo if the open .fgx file is a 3D Model, or a .anm if the open .fgx file is an Animation.)
6) Windows File Explorer
- Copy and paste all the files you just made in CivNexus6 in to the Geometries folder in your ModBuddy Project (normally all to the same folder )
> You should have a .geo, .fxg, and a .xml file at least. You may also have some .anm files to if you made animations.
- Go to (Sid Meier's Civilization VI SDK Assets/pantry/Assets) folder, copy and paste a simlar type assets in to the Asset folder in your ModBuddy Project and rename it the same name as your .fgx file.
> You may need to copy more than one .ast file type
> Example for a human type unit: Missionary_ArmorA.ast for the clothing model, and GreatProphet_Staff.ast for a weapon model
> Example for a vehicle type unit: TankA.ast
> You can open the .ast files in AssetEditor in ModBuddy to see what they look like to help you pick the right one.
7) AssetEditor in ModBuddy
- Create Texture files, click New, then Texture (creates .tex file and a copy of the .dds in your project folder)
> Albedo (Class Name: Generic_BaseColor) => (Path: ".dds file name") => (Save)
> Normal (Class Name: Generic_Normal) => (Path: ".dds file name") => (Save)
> Ambient Occlusion (Class Name: Generic_AO) => (Path: ".dds file name") => (Save)
> Metalness (Class Name: Generic_Metalness) => (Path: ".dds file name") => (Save)
> Glossiness (Class Name: Generic_Gloss) => (Path: ".dds file name") => (Save)
- Create Material file, click New, then Material (creates .mtl file in your project folder) (you will make one for every Material you had in Blender)
> Name: "whatever you named your material in blender"
> Class Name: (Unit)
> Under Cook Parameters, then under Value, for each entry click Add Existing, and Add correct .tex files you created to corresponding Value
> Save
- Create Unit ArtDefs (Units.artdef and Unit_Bins.artdef)
> Click New, then ArtDef, then for Art Definition Template choose "Units" (this will become the Units.artdef)
~ On Units, right click, select Add Element (Name: "Your unit's name from ModBuddy") (Formation: "choose one similar to your unit type") (EmbarkedUnit: "choose one similar to your unit type")
~ On UnitMemberTypes, right click, select Add Element (Name: "A short-hand version of your unit's name from ModBuddy"), On Cultures, right click, Add Element (Name: Any), On Variations, right click, Add Element (Name: A) (Scale: 1.1), On Attachments, right click, Add 5 Elements: (1) Name: Armor, Point: Root, Tint: CV_Any; (2) Name: Body, Point: Root; (3) Name: Boots, Point: Root; (4) Name: Head, Point: Root; (5) Name: Weapon, Point: WeaponPrimary, then for each of the Bins of the 5 elements, right click, Add Element, then for the Name field reference the assets that are defined under UnitAttachmentBins in the Unit_Bins.artdef in the format "first level group nane/asset name on third level" , so for example the Bins for each of the 5 elements could be: (1) Name: Armor/Missionary; (2) Name: Bodies/Male_MediumBody_Hands; (3) Name: Boots/Missionary; (4) Name: Heads/Male; (5) Name: Staffs/Missionary. Then go back up On Cultures, right click, Add Element and do the exact sane thing 7 more times, once for each ethnicity (Name: East/Asian, Mediterranean, Mughal, NorthAfrica, NorthernEuropean, SouthAfrican, SouthAmerican) ... And when you get to the (1) Armor element in each one, the Tint would be specific for each ethnicity (Tint: CV_EastAsian, CV_Mediterranean, CV_Mughal, CV_NorthAfrica, CV_NorthernEuropean, CV_SouthAfrican, CV_SouthAmerican).
* Note, if you made a brand new armature then instead of Point: Root it would be Point: "What you named your armature in Blender"
~ On Members, right click, Add Element (Scale: 1) (Count: 4) (Type: "The Name field you created in UnitMemberTypes")
~ On Audio, right click, Add Element (Name: "choose one similar to your unit type") (XrefName: "choose one similar to your unit type")
~ Save
> Click New, then ArtDef, then for Art Definition Template choose "Units", then click File, then Save As, and type in "Unit_Bins" for the file name (this will become the Unit_Bins.artdef)
~ On UnitAttachmentBins, right click, Add Element (Name: Armor), On Groups, right click, Add Element (Name: "The Name field you created in UnitMemberTypes"), On Cultures, right click, Add Element (Name: Any), On Assets, right click, Add Element (Name: "the name of your .ast file") (Asset: "choose random base game asset for now, but remember what you chose")
~ On UnitAttachmentBins, right click, Add Element (Name: "Choose Weapon Type: Bows, Crossbows, Muskets, Pistols, Rifles, Shields, Spears, Staffs, Swords, or Special), On Groups, right click, Add Element (Name: "The Name field you created in UnitMemberTypes"), On Cultures, right click, Add Element (Name: Any), On Assets, right click, Add Element (Name: "the name of your .ast file") (Asset: "choose random base game asset for now, but remember what you chose")
~ Save
8) ModBuddy
- From project's Solution Explorer panel, right click, Add => Existing Item, add all of the files that are in the Geometries, Assets, Materials, Textures, and ArtDefs folders
> You are adding all the files you have created up until now
- Open your model's .ast file, do a Find and Replace for all of the following (enter file names without file extentions)
> Change m_Name field near the end to what you renamed the .ast file , leave the first one as "Root"
> Change m_GeoName field to the name of your .geo file
> Change m_ObjectName field under AssetObjects::ObjectValue element to the name of your .mtl file
> Change m_GroupName field to whatever you named your material in Blender/CivNexus6
> Change m_MeshName to whatever you named your mesh in Blender/CivNexus6
- Open your Unit_Bins.artdef file
> Search for the random base game asset you put under the Armor group of UnitAttachmentBins for the Asset entry when you created the ArtDef, replace with your armor's .ast file name.
> Search for the random base game asset you put under "the weapon type you used " group of UnitAttachmentBins for the Asset entry when you created the ArtDef, replace with your weaopn's .ast file name.
- Create .xlp files with "correct coding"
> A Units.xlp
> With your armor's .ast file and your weapon's .ast file names listed (without file extentions)
- Create and/or Edit Mod.Art.xml with correct relativeArtDefPaths and libraryDependencies
> You will need to add elements under consumerName Units and libraryName Unit
- Project Properties => In-Game Actions
=> ImportFiles (All your .dds, .tex, .geo, .anm, .mtl, .bhv, .ast, and any other art files you created.)
=> UpdateArt ((Mod Art Dependency File) and any .artdef files you created)
- Click File => Save All => Click Build => Build Project
- *You do not need to add .xlp files, or the GeometrySet.xml to the Project Properties In-Game Actions
- *Your .blp files are auto generated from your .xlp files, and your .dep file is also auto generated from your Mod.Art.xml at build time.
9) Troubleshoot (Asset Editor/Blender/ModBuddy)
- Open your model's .ast file, make sure your model is displaying properly in the Asset PreViewer panel
- If you can't see your model in Asset PreViewer, then there could be something wrong with your .ast file or any other file associated with it
- If you see it, but it is not the correct size or in the correct position, then its back to Blender to scale/rotate/repostion
> Then export to .cn6, do the same steps in CivNexus6, and copy/paste/replace the .fgx, .geo, and .xml to your Geometries folder in your ModBuddy Project
- Then open back up in Asset Editor to see if it is now correct
- If it is the start game up and see if it displays properly in game, if not, then there could be something wrong with your .xlp files, or Mod.Art.xml file, or .artdef files, or Project Properties
- Troubleshoot