Rough Guide to Units.artdef

Deliverator

Graphical Hackificator
Joined
Feb 12, 2008
Messages
4,806
Location
London, UK
People have been asking for a guide on editing Units.artdef so here is a rough guide. Some or all of this might become redundant when the mod tools are released so I'm keeping it rough!

Note: This was written before the Asset Editor was released (as part of the Civ 6 SDK). Now you have the option of using that instead of directly editing the XML.

Units.artdef is just an XML file without the .xml extension. Although it is possible and sometimes easier to edit XML files with a simpler text edit such as Notepad++ it's helpful also to use an XML editor. The best I've found is the freeware 1.1 version of XML Marker. (Don't bother with the 2.2 version which is pretty much the same but costs $125!)

http://symbolclick.com/xmlmarker_1_1_setup.exe

Having installed XML Marker 1.1 we can open Units.artdef. You'll need to change "Files of type:" to be all files since Units.artdef doesn't have the .xml extension.

Navigating to the RootCollections element you can get an overview of the structure of the file.

rough_guide_artdef.png


The three subcollections I have been editing so far are: Units, UnitMemberTypes and UnitTintTypes. More detail on each of these in turn follows:

Units

The m_Name of each of these is the same name as the name of the Unit in the GameData XML files e.g. UNIT_WARRIOR, UNIT_SPEARMAN. Apparently this provides the link between a Unit and its Art Definition. If I wanted to reuse the Apostle unit art for a new unit called UNIT_WIZARD I would need to duplicate the UNIT_APOSTLE entry in Units.artdef and update the m_Name field on my duplicate copy to be UNIT_WIZARD.

The number, type, scale and formation of the UnitMemberTypes (the actual individual unit models used for the unit) can be changed here. So if I want to make a unit consisting of two Swordsmen and an Apostle then I can achieve that purely by editing the entry in the Units collection. Looking at this section taken from the UNIT_SCOUT Units entry you can see that 1 instance of the "Scout" UnitMemberType and 1 instance of the "ScoutDog" UnitMemberType are specified.

Code:
...
                <m_ChildCollections>
                    <Element>
                        <m_CollectionName text="Members"/>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects::FloatValue">
                                        <m_fValue>1.000000</m_fValue>
                                        <m_ParamName text="Scale"/>
                                    </Element>
                                    <Element class="AssetObjects::IntValue">
                                        <m_nValue>1</m_nValue>
                                        <m_ParamName text="Count"/>
                                    </Element>
                                    <Element class="AssetObjects::ArtDefReferenceValue">
                                        <m_ElementName text="Scout"/>
                                        <m_RootCollectionName text="UnitMemberTypes"/>
                                        <m_ArtDefPath text="Units.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Units"/>
                                        <m_ParamName text="Type"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Members1"/>
                        </Element>
                        <Element>
                            <m_Fields>
                                <m_Values>
                                    <Element class="AssetObjects::FloatValue">
                                        <m_fValue>1.000000</m_fValue>
                                        <m_ParamName text="Scale"/>
                                    </Element>
                                    <Element class="AssetObjects::IntValue">
                                        <m_nValue>1</m_nValue>
                                        <m_ParamName text="Count"/>
                                    </Element>
                                    <Element class="AssetObjects::ArtDefReferenceValue">
                                        <m_ElementName text="ScoutDog"/>
                                        <m_RootCollectionName text="UnitMemberTypes"/>
                                        <m_ArtDefPath text="Units.artdef"/>
                                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                        <m_TemplateName text="Units"/>
                                        <m_ParamName text="Type"/>
                                    </Element>
                                </m_Values>
                            </m_Fields>
                            <m_ChildCollections/>
                            <m_Name text="Members2"/>
                        </Element>
                    </Element>
...


UnitMemberTypes

This is where I can actually recombine and vary the attachment elements that make unit each individual unit member. The start point is again to clone an existing UnitMemberType entry taking the Unit you want to use as a base giving it a different name. In XML Marker, Ctrl-E to select the whole of element is useful for duplication. Also the Moar Units mod I've used the prefix "UnitMember_" for names to make it easier to re-find them later.

Here is the entire UnitMember_Minuteman entry from Moar Units with some comments on the significant changes from the Redcoat entry it was based on:

Code:
        <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects::ArtDefReferenceValue">
                        <m_ElementName text="Redcoat"/>
                        <m_RootCollectionName text="UnitMovementTypes"/>
                        <m_ArtDefPath text="Units.artdef"/>
                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                        <m_TemplateName text=""/>
                        <m_ParamName text="Movement"/>
                    </Element>
                    <Element class="AssetObjects::ArtDefReferenceValue">
                        <m_ElementName text="RedcoatCombat"/>
                        <m_RootCollectionName text="MemberCombat"/>
                        <m_ArtDefPath text="Units.artdef"/>
                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                        <m_TemplateName text=""/>
                        <m_ParamName text="Combat"/>
                    </Element>
                    <Element class="AssetObjects::ArtDefReferenceValue">
                        <m_ElementName text="MEAT"/>
                        <m_RootCollectionName text="MaterialTypes"/>
                        <m_ArtDefPath text="VFX.artdef"/>
                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                        <m_TemplateName text=""/>
                        <m_ParamName text="VFXMaterialType"/>
                    </Element>
                    <Element class="AssetObjects::ArtDefReferenceValue">
                        <m_ElementName text="MEAT"/>
                        <m_RootCollectionName text="MaterialTypes"/>
                        <m_ArtDefPath text="VFX.artdef"/>
                        <m_CollectionIsLocked>true</m_CollectionIsLocked>
                        <m_TemplateName text=""/>
                        <m_ParamName text="VFXWeaponImpact"/>
                    </Element>
                    <Element class="AssetObjects::FloatValue">
                        <m_fValue>0.000000</m_fValue>
                        <m_ParamName text="ImpactHeightOverride"/>
                    </Element>
                </m_Values>
            </m_Fields>
            <m_ChildCollections>
                <Element>
                    <m_CollectionName text="Cultures"/>
                    <Element>
                        <m_Fields>
                            <m_Values/>
                        </m_Fields>
                        <m_ChildCollections>
                            <Element>
                                <m_CollectionName text="Variations"/>
                                <Element>
                                    <m_Fields>
                                        <m_Values>
                                            <Element class="AssetObjects::FloatValue">
                                                <m_fValue>1.100000</m_fValue>
                                                <m_ParamName text="Scale"/>
                                            </Element>
                                            <Element class="AssetObjects::BoolValue">
                                                <m_bValue>false</m_bValue>
                                                <m_ParamName text="IsAttachment"/>
                                            </Element>
                                        </m_Values>
                                    </m_Fields>
                                    <m_ChildCollections>
                                        <Element>
                                            <m_CollectionName text="Attachments"/>
                                            <Element>
                                                <m_Fields>
                                                    <m_Values>
                                                        <Element class="AssetObjects::StringValue">
                                                            <m_Value text="Root"/>
                                                            <m_ParamName text="Point"/>
                                                        </Element>
                                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                                            <m_ElementName text="Color_Minuteman_Jacket"/> <!-- A custom color specified in UnitTintTypes - see below -->
                                                            <m_RootCollectionName text="UnitTintTypes"/>
                                                            <m_ArtDefPath text="Units.artdef"/>
                                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                                            <m_TemplateName text=""/>
                                                            <m_ParamName text="Tint"/>
                                                        </Element>
                                                    </m_Values>
                                                </m_Fields>
                                                <m_ChildCollections>
                                                    <Element>
                                                        <m_CollectionName text="Bins"/>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Armor/Redcoat"/>
                                                        </Element>
                                                    </Element>
                                                </m_ChildCollections>
                                                <m_Name text="Armor"/>
                                            </Element>
                                            <Element>
                                                <m_Fields>
                                                    <m_Values>
                                                        <Element class="AssetObjects::StringValue">
                                                            <m_Value text="WeaponPrimary"/>
                                                            <m_ParamName text="Point"/>
                                                        </Element>
                                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                                            <m_ElementName text=""/>
                                                            <m_RootCollectionName text="UnitTintTypes"/>
                                                            <m_ArtDefPath text=""/>
                                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                                            <m_TemplateName text=""/>
                                                            <m_ParamName text="Tint"/>
                                                        </Element>
                                                    </m_Values>
                                                </m_Fields>
                                                <m_ChildCollections>
                                                    <Element>
                                                        <m_CollectionName text="Bins"/>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Rifles/Redcoat"/>
                                                        </Element>
                                                    </Element>
                                                </m_ChildCollections>
                                                <m_Name text="Weapon"/>
                                            </Element>
                                            <Element>
                                                <m_Fields>
                                                    <m_Values>
                                                        <Element class="AssetObjects::StringValue">
                                                            <m_Value text="Hat"/>
                                                            <m_ParamName text="Point"/>
                                                        </Element>
                                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                                            <m_ElementName text=""/>
                                                            <m_RootCollectionName text="UnitTintTypes"/>
                                                            <m_ArtDefPath text=""/>
                                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                                            <m_TemplateName text=""/>
                                                            <m_ParamName text="Tint"/>
                                                        </Element>
                                                    </m_Values>
                                                </m_Fields>
                                                <m_ChildCollections> <!-- Each Unit Member will be randomly allocated one of these 3 hats/hair -->
                                                    <Element>
                                                        <m_CollectionName text="Bins"/>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Hats/Ranger/#/Ranger_HatC"/>
                                                        </Element>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Hair/Male"/>
                                                        </Element>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Hats/Redcoat/#/Redcoat_HatA"/>
                                                        </Element>
                                                    </Element>
                                                </m_ChildCollections>
                                                <m_Name text="Hat"/>
                                            </Element>
                                            <Element>
                                                <m_Fields>
                                                    <m_Values>
                                                        <Element class="AssetObjects::StringValue">
                                                            <m_Value text="Root"/>
                                                            <m_ParamName text="Point"/>
                                                        </Element>
                                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                                            <m_ElementName text=""/>
                                                            <m_RootCollectionName text="UnitTintTypes"/>
                                                            <m_ArtDefPath text=""/>
                                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                                            <m_TemplateName text=""/>
                                                            <m_ParamName text="Tint"/>
                                                        </Element>
                                                    </m_Values>
                                                </m_Fields>
                                                <m_ChildCollections>
                                                    <Element>
                                                        <m_CollectionName text="Bins"/>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Bodies/Male_MediumBody_Hands"/>
                                                        </Element>
                                                    </Element>
                                                </m_ChildCollections>
                                                <m_Name text="Body"/>
                                            </Element>
                                            <Element>
                                                <m_Fields>
                                                    <m_Values>
                                                        <Element class="AssetObjects::StringValue">
                                                            <m_Value text="Root"/>
                                                            <m_ParamName text="Point"/>
                                                        </Element>
                                                        <Element class="AssetObjects::ArtDefReferenceValue">
                                                            <m_ElementName text="Caucasian_Light"/>
                                                            <m_RootCollectionName text="UnitTintTypes"/>
                                                            <m_ArtDefPath text="Units.artdef"/>
                                                            <m_CollectionIsLocked>true</m_CollectionIsLocked>
                                                            <m_TemplateName text=""/>
                                                            <m_ParamName text="Tint"/>
                                                        </Element>
                                                    </m_Values>
                                                </m_Fields>
                                                <m_ChildCollections>
                                                    <Element>
                                                        <m_CollectionName text="Bins"/>
                                                        <Element>
                                                            <m_Fields>
                                                                <m_Values/>
                                                            </m_Fields>
                                                            <m_ChildCollections/>
                                                            <m_Name text="Heads/Male"/>
                                                        </Element>
                                                    </Element>
                                                </m_ChildCollections>
                                                <m_Name text="Head"/>
                                            </Element>
                                        </Element>
                                    </m_ChildCollections>
                                    <m_Name text="A"/>
                                </Element>
                            </Element>
                        </m_ChildCollections>
                        <m_Name text="Any"/>
                    </Element>
                </Element>
            </m_ChildCollections>
            <m_Name text="UnitMember_Minuteman"/> <!-- Name referenced from Units entry -->
        </Element>

The "Bins" collection for each attachment needs some further explanation. These paths correspond to entries in the Unit_Bins.artdef file. For example in the vanilla Units.artdef you have Bins entries such as "Hats/Spearman" or "Heads/Male". If you look under this path in Unit_Bins.artdef you can see that under each of these you have all different cultural variants e.g. "NorthernEuropean" or "Mughal". This is how cultural variation is applied. The nice part of this is that if I set up a new non-unique unit such the Moar Units Rifleman I can use "Heads/Male" and each civilization will automatically get its own ethnic skin tone. If I don't want any variation cultural or otherwise then I specify specific models that I want to use. For example, in the Moar Units Druzhina Cavalry units I am using one Mughal helmet and one NorthernEuropean helmet like so:

Code:
...
                                                    <m_ChildCollections>
                                                        <Element>
                                                            <m_CollectionName text="Bins"/>
                                                            <Element>
                                                                <m_Fields>
                                                                    <m_Values/>
                                                                </m_Fields>
                                                                <m_ChildCollections/>
                                                                <m_Name text="Hats/Spearman/NorthernEuropean/Spearman_European_HelmA"/>
                                                            </Element>
                                                            <Element>
                                                                <m_Fields>
                                                                    <m_Values/>
                                                                </m_Fields>
                                                                <m_ChildCollections/>
                                                                <m_Name text="Hats/Spearman/Mughal/Spearman_MiddleEastern_HelmA"/>
                                                            </Element>
                                                        </Element>
                                                    </m_ChildCollections>
                                                    <m_Name text="Hats"/>
...


UnitTintTypes

This is effectively UnitColorTypes (or UnitColourTypes if you're not American!). In the Minuteman UnitMemberTypes example above this is where the UnitTintType "Color_Minuteman_Jacket" is specified.

UnitTintTypes are also used to vary the color of the horses - search for the UnitTintTypes called "Horse_Default".

In this example, for the "Color_Spain" entry I've made two colors corresponding to the red and the yellow from the Spain civilization colors. The EasyRGB tool is handy for converting RGB 0-255 to RGB 0-1.

Code:
<Element>
    <m_Fields>
        <m_Values/>
    </m_Fields>
    <m_ChildCollections>
        <Element>
            <m_CollectionName text="Colors"/>
            <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects::RGBValue">
                            <m_r>173</m_r>
                            <m_g>36</m_g>
                            <m_b>36</m_b>
                            <m_ParamName text="Color"/>
                        </Element>
                    </m_Values>
                </m_Fields>
                <m_ChildCollections/>
                <m_Name text="Colors001"/>
            </Element>
            <Element>
                <m_Fields>
                    <m_Values>
                        <Element class="AssetObjects::RGBValue">
                            <m_r>221</m_r>
                            <m_g>205</m_g>
                            <m_b>0</m_b>
                            <m_ParamName text="Color"/>
                        </Element>
                    </m_Values>
                </m_Fields>
                <m_ChildCollections/>
                <m_Name text="Colors002"/>
            </Element>
        </Element>
    </m_ChildCollections>
    <m_Name text="Color_Spain"/>
</Element>

UnitCultures

Update: With Gathering Storm there are now 11 base Unit Cultures:
Asian
Mediterranean
Indian
MiddleEastern
European
African
SouthAmerican
Maori
NativeAmerican
SouthEastAsian
Barbarian


Pre-GS: There are only eight "UnitCultures" in the vanilla ArtDefs (as opposed to "Cultures" which are used for Cities, Districts, Improvements etc by the look of it):

EastAsian (Japan, China)
Mediterranean (Greece, Rome)
Mughal (Arabia, India, Sumeria)
NorthAfrican (Egypt)
NorthernEuropean (America, England, France, Germany, Spain(!?), Russia, Poland)
SouthAfrican (Kongo)
SouthAmerican (Aztec, Brazil)
Barbarian (Barbarian)

This means Norway and Scythia get the "Any" default Culture with regards to Units.artdef.

All the cultural variations you see come from one of these 8 buckets.

It is possible to create a new UnitCulture in the Cultures.artdef and then start to define new cultural variations of units in the Units.artdef.
 
Last edited:
sounds great ! thanks Deliberator :)

This is how cultural variation is applied. The nice part of this is that if I set up a new non-unique unit such the Moar Units Rifleman I can use "Heads/Male" and each civilization will automatically get it's own ethnic skin tone.

Nice !!!

on Mac, you can open directly the artdef files with BBEdit and Text Wrangler ( free ) :
 
Last edited:
This seems straight forward but my Great Merchants are still not showing up. I noticed that you include the Units.artdef with the Units_Moar.artdef in your mod. Is there a reason for this?

Create a separate Units_Moar.artdef was just to make to keep my new entries in a separate file and minimise the work when it is possible to release these changes via a mod. Duplicating the element under Units and giving it the same name as your new unit in Units.artdef should work for you.
 
Create a separate Units_Moar.artdef was just to make to keep my new entries in a separate file and minimise the work when it is possible to release these changes via a mod. Duplicating the element under Units and giving it the same name as your new unit in Units.artdef should work for you.
Ok thanks again!
 
People have been asking for a guide on editing Units.artdef so here is a rough guide. Some or all of this might become redundant when the mod tools are released so I'm keeping it rough......

What controls the icon in the building queue, when it is selected?

I am creating, for my own fun, a super-fast scout unit. I created it within the XML files, and then I added art in the Units.artdef. I was able to make it look like two scouts without the dog.. which was pretty cool, I must say.

But, the icon that appears in the build queue looks like the settler for some reason, rather than the little dog look of the scout. It can't be because I removed the dog, right.. :: chuckle ::
 
How did you get your MOAR_UNITS.artdef file to load in the game?
I tried to make my own artdef file but can't figure out how to get Civ to find it.

Also - this bit is off topic - I created a copy of the builder just called TEST_BUILDER. It is just a copy of the stock builder at the moment. I can build it in game but I can't do any tile upgrades (I can remove stuff from tiles though). I don't suppose you can help with that at all??
 
What controls the icon in the building queue, when it is selected?

I am creating, for my own fun, a super-fast scout unit. I created it within the XML files, and then I added art in the Units.artdef. I was able to make it look like two scouts without the dog.. which was pretty cool, I must say.

But, the icon that appears in the build queue looks like the settler for some reason, rather than the little dog look of the scout. It can't be because I removed the dog, right.. :: chuckle ::

At the moment the one way is to reuse other units' icons by editing the core game files Icons_Units.xml, Icons_UnitFlags.xml and Icons_UnitPortraits.xml.

How did you get your MOAR_UNITS.artdef file to load in the game?
I tried to make my own artdef file but can't figure out how to get Civ to find it.

Take a look at my edited Civ6.dep and look for references to Units_Moar.artdef. That's how I did it!

Also - this bit is off topic - I created a copy of the builder just called TEST_BUILDER. It is just a copy of the stock builder at the moment. I can build it in game but I can't do any tile upgrades (I can remove stuff from tiles though). I don't suppose you can help with that at all??

Without the game files in front of me I'm not sure exactly where this is done, but essentially there'll be another XML that controls what Improvements each unit can build. It may be the same as how the Legion - Roman Fort build is set up which I used for the Bandeirante:
<Improvement_ValidBuildUnits>
<Row ImprovementType="IMPROVEMENT_FORT" UnitType="UNIT_BANDEIRANTE"/>
</Improvement_ValidBuildUnits>

But I'd advise starting by searching all the XML files for usages of UNIT_BUILDER and see what you find.
 
Also - this bit is off topic - I created a copy of the builder just called TEST_BUILDER. It is just a copy of the stock builder at the moment. I can build it in game but I can't do any tile upgrades (I can remove stuff from tiles though). I don't suppose you can help with that at all??

Yeah, take a look here.

https://forums.civfanatics.com/threads/better-builders-mod.605016/

You will see we add each building ability to each builder and the code is actually in the spoiler tag on the 3rd or 4th post.

EDIT: Here it is, but I would still look at our entire XML code for the improvements.

Spoiler :

<Improvement_ValidBuildUnits>
<Row ImprovementType="IMPROVEMENT_FARM" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_MINE" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_QUARRY" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_FISHING_BOATS" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_PASTURE" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_PLANTATION" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_CAMP" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_LUMBER_MILL" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_OIL_WELL" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_CHATEAU" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_COLOSSAL_HEAD" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_GREAT_WALL" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_KURGAN" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_MISSION" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_SPHINX" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_STEPWELL" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_ZIGGURAT" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_OFFSHORE_OIL_RIG" UnitType="UNIT_MEDIEVAL_BUILDER"/>
<Row ImprovementType="IMPROVEMENT_BEACH_RESORT" UnitType="UNIT_MEDIEVAL_BUILDER"/>
</Improvement_ValidBuildUnits>

 
Last edited:
At the moment the one way is to reuse other units' icons by editing the core game files Icons_Units.xml, Icons_UnitFlags.xml and Icons_UnitPortraits.xml.

Ugh.. really? I can't put those snippets of XML in a mod? That is disappoint.
 
Without this, icons of units are random right? I got my special caravel to be a warrior, navigating in the sea lol

Not random, but they will use the same default unit mod and icons for everything. The only way to specify different art for new units is to amend the core game files as I have with Moar Units.
 
@Deliverator, I'm working on trying to figure out how to use all the different element types in .modinfo to try to avoid mods having to have files manually copied to the base Civ 6 folder as much as possible.

Unfortunately, the last public release of IDA (recent versions are only sold to security firms for amounts in the $10k's) doesn't have great support 64-bit or C++, but I can see that the Componets\ModArt element parsing code is looking for *.dep files.

Yours is the first example of a change to Civ6.dep I've seen, so I'm going to play around with different ideas for how <ModArt> might be supposed to work with that to see if I can get it incorporate your artdef changes without copying--i.e., trying putting your Civ6.dep file under <ModArt><Items><File>, trying renaming it and putting just the changed parts in a new .dep file, trying put the Units_Moar.artdef file under <ModArt>, under <ImportFiles>, etc.

Have you tried anything along these lines already that I can rule out as not working?

At least with the Civ6.dep file you've identified what is causing various .artdef files to be loaded. I spent hours last night trying to just get icons added without copying, and one thing I can't figure out is why it will load, say, UI\Icons\Icons_Units.xml, but if you put a new file in that same folder, say UI\Icons\Icons_Moar_Units.xml, it won't load it. I've grepped all the Civ 6 files (including .exe and .dll) and can't find a list of the initial files in the directory anywhere, so I don't know how it knows to load the original ones but not any new ones added.
 
Date of modification maybe.

It doesn't use the name but the extension type as those replacing files in the base game, while leaving the original in the same folder but with a different name, have found out.

Edit : and thanks for your work so far on that !
 
Yours is the first example of a change to Civ6.dep I've seen, so I'm going to play around with different ideas for how <ModArt> might be supposed to work with that to see if I can get it incorporate your artdef changes without copying--i.e., trying putting your Civ6.dep file under <ModArt><Items><File>, trying renaming it and putting just the changed parts in a new .dep file, trying put the Units_Moar.artdef file under <ModArt>, under <ImportFiles>, etc.

Have you tried anything along these lines already that I can rule out as not working?

I haven't really experimented very much with it. I've pretty much just decided to wait for them to patch mod support and/or release DLC which will show how to set up new artdef files via a mod.

My assumption is that they'll need to be able to load new .artdef files via a mod before they can release any new Civ DLC (most likely Poland Winged Hussars). Then we'll have an example on how to set it up. Seeing as the first patch was exactly 4 weeks after release the next patch, potentially next patch and first DLC could be out next week as it will be 4 weeks since the patch. All speculation of course!
 
@Gedemon, you lost me. At least in Assets\UI\Icons, it's definitely loading only the original file names. You can rename the existing Icons_Buildings.xml to Icons_Buildings2.xml, for instance, and it won't load it--you can look in the Civics tree, for instance, and the building icon for Temple, etc., will be blank icons.

I'm not having any luck using <ModArt> with .dep files so far. Modding.log claims it's loading them:

[3717545.829] Status: ModArtLoader - Loading Civ6.dep
[3717545.829] Status: Applied component to game.

And if you put a file with an extension other than .dep there, the log will show an "invalid extension" error, so it is at least checking for a valid extension--but it doesn't seem to actually do anything, and Artdef.log isn't indicating that it's reloading anything. Also tried changing the name to Something.dep, changing the GUID in the .dep file, adding the file to the Imports section, etc., with no luck. Either they're using it in some way I can't figure out, or they just haven't really implemented it yet.
 
Last edited:
...My assumption is that they'll need to be able to load new .artdef files via a mod before they can release any new Civ DLC (most likely Poland Winged Hussars). Then we'll have an example on how to set it up....

Unless they cheat again and just add the icons and artdefs they need to base assets directory like they did with the Aztec DLC ("ICON_ATLAS_MONTEZUMA" is in Base\Assets\UI\Icons\Icons_Leaders.xml, for instance, rather than actually added by the DLC itself).
 
My suspicion is that there is hard-coding around 3D artdefs, icons and civilopedia text. Otherwise why is the Aztec 3D art, icons and pedia text all in core game files and why haven't they released DLC yet considering Babylon Civ DLC was released 34 days after Civ 5 launch? I think we need another patch to make it possible to mod them.
 
Unless they cheat again and just add the icons and artdefs they need to base assets directory like they did with the Aztec DLC ("ICON_ATLAS_MONTEZUMA" is in Base\Assets\UI\Icons\Icons_Leaders.xml, for instance, rather than actually added by the DLC itself).

That is possible too since I'm guessing making everything mod-able would be quite a significant refactor. But it would be disappointing!
 
Top Bottom