Resource icon

Civ 6 Modding Tools & Basics

@Rajendran_P @raen
Hi guys, I've attempted to follow your prescribed steps for fixing the missing unit flag issue, but I still can't fix the problem after updating Gedemo's mod and the UnitFlagManager_MyMod.lua file. Would it be possible for an updated version of Gedemo's mod to be shared so that us modding noobs can use it? I've spent a few hours on it already and am at a loss. Thanks!

I got it working. The config I added before did not work, what works is direct import of files, including XML one.

Here is the working version of the mod with this modification.
 

Attachments

  • CSOUnitFlag.zip
    28.4 KB · Views: 251
I got it working. The config I added before did not work, what works is direct import of files, including XML one.

Here is the working version of the mod with this modification.

Raen, Thank you very much.
 
Raen, I read a discussion in the Forum regards to loading new artwork into a mod (https://forums.civfanatics.com/threads/loading-new-artwork-into-a-mod.657356/). I noted a feedback from Deliverator that there are two ways to get UI Textures into the game:

1) Via cooking into .blp files (Binary Library Packages) the contents of which are indeed defined by the .xlp files (XML Library Package Definitions).
2) Via direct load of DDS files using Import Files.

I have tried and successfully created a Civ mod based on your tutorial and guidance. I am now improving on the mod in the game text portion, and Civ/Leader's Traits. I also intend to add my own unique unit as well as unique building. I am confident that I can cross-reference and do my own trial and error using the game logs file to rectify the errors and complete the mod.

I am also intending to create my own template for future use in case I need to create a different mod and thus tested creating another mod. However, I noted that creating a new civilization, via modbuddy, using the same methodology does create a successful Civ mod but not for the icon portion. Sometimes, the Civ/Leader image/icons appears in the selection panel but not in the game startup screen (after we press the start button). I always see this error in the Log's artdef file Unable to resolve Package 'UI/UI_Icons_Platform.blp' from Project 'Civ6' ''. After reading the above-mentioned forum article, I am getting some insight to the problem, although I do not fully understand the inter-relation to the file. The forum also mentioned that "'If you are using the .blp method all the following folders are redundant in the built out mod should they happen to appear'':

* Animations
* Assets
* Behaviours
* Geometries
* Materials
* Textures
* XLPs

I am keen to try the step (1) as mentioned above which though may take longer than modbuddy, the processes and eventual outcome may produce the same result. To add on, I may also lesson on how the files inter-relate and produce the desired results. I wrote in the forum
"I just need some guidance on the required files/format to enable the icon only and a brief explain on the relationship between the files to enable the icon to appear during pre and post game launch. I can manage the other elements like Civ, Leader, Civ/Leader/Unit ability, unit, etc. Based on the discussion, does it means I only need to have (a) .dds / tex files [sizes 32, 45, 50, 55, 64, 80, 256) in Texture folder, (2) .xlp files in XLPs folder (Icons.xlp, Leader.xlp, LeaderBackgrounds.xlp, LeaderFallbacks.xlp and UILeaders.xlp) and (3) .artdef files in ArtDefs folder (FallbackLeaders.artdef and Leaders.artdef) and (4) mod art dependency file(.dep)".

If you are doing the mod as per step 1, your guidance on the relationship between the files (.xlp Vs .artdef Vs .dep) to enable the icon to appear during pre and post game launch will be much appreciate. As I am not young and tends to forget things at times, I am intending to write down all the required steps to create a successful mod as I may need this material for reference in case I want to create another mod in future. You guidance, if you are doing step 1, will be greatly appreciated.

Thank You
 
For the record, my tutorial uses approach 2. My Portugal Mod for a long time was not a modbuddy project. V16.4Beta of my Portugal Mod, last "file by hand only" version before I migrated to modbuddy successfully. I still have to add a section for Modbuddy approach 1 (what I call ModBuddy migration). But, meanwhile, I will be answering your questions.

The art in Modbuddy has additional steps to add the dds files you already built. The main step in my opinion is the generation of texture files (.tex) in Asset Manager. An important note is that when you change your DDS files you have to regenerate Texture again, by each DDS you modified. That´s why a "modbuddy template" does not work plain and simple, you often want to change DDS for your own, and nothing is there to see in-game if you don't regenerate textures. And, yes you have to add all sizes and generate all the textures, modbuddy is not that user friendly.

XLP files are used to build your package images, Modbuddy generates BLP files out of this XLP files config. Here (in XLP) you define what are all your textures (.dds/.tex), to the game to know what are your images. Most of them are UITexture type (ClassName), only fallback images have diffrent ClassName: LeaderFallback, and therefore go to another xlp file. You simply can have two xlp files, one for all UiTextures, including leaders screens, and another XLP file for fallbacks (see my Portugal mod for reference). XLP config does not mean you don't have to match your icons with your stuff, that is done in <IconTextureAtlases> and <IconDefinitions> (my Icons Tutorial section), you have to do both configs, but XLP is only in modbuddy, where BLP are generated for final publication of the mod.

Artdefs, also part of my tutorial look&feel section, define graphics of stuff in-game. If you want a building, unit, and such, you add correspondent artdef. LeaderScreens also require artdefs. For the game to know what is your in-game art goes to .Dep file, where there must be references for your artdefs files. XLP references also need to be added to mod.art.xml but pointed out as BLP extension (final published file). Modbuddy autogenerates .DEP file, but you have to add your references of artdefs and blp´s in right places of your mod.art.xml, and in project Properties mod art dependency file(.dep). Modbuddy needs you to add this 'mod art dependency file' instead of the mod.art.xml, to generate the .Dep file. Nevertheless, there´s a tool for mod.art.xml autogeneration, pointed by me, but did not work for you, in the meanwhile I noticed that there´s an update to that tool, go here, and try again.

About that autogenerated folders when you use .BLP method (approach 1) they are in fact redundant because BLP is a package with all your art in it. Understanding this, In my Portugal Mod, I removed the textures folder from modbuddy project, they are there yet but not added to the project, therefore they don't appear in published mod. Summing up, don't need textures (animations, etc) because all is in BLP (if all configured with approach 1). And art references are in .DEP file.

Hope this helps.
 
For the record, my tutorial uses approach 2. My Portugal Mod for a long time was not a modbuddy project. V16.4Beta of my Portugal Mod, last "file by hand only" version before I migrated to modbuddy successfully. I still have to add a section for Modbuddy approach 1 (what I call ModBuddy migration). But, meanwhile, I will be answering your questions.

The art in Modbuddy has additional steps to add the dds files you already built. The main step in my opinion is the generation of texture files (.tex) in Asset Manager. An important note is that when you change your DDS files you have to regenerate Texture again, by each DDS you modified. That´s why a "modbuddy template" does not work plain and simple, you often want to change DDS for your own, and nothing is there to see in-game if you don't regenerate textures. And, yes you have to add all sizes and generate all the textures, modbuddy is not that user friendly.

XLP files are used to build your package images, Modbuddy generates BLP files out of this XLP files config. Here (in XLP) you define what are all your textures (.dds/.tex), to the game to know what are your images. Most of them are UITexture type (ClassName), only fallback images have diffrent ClassName: LeaderFallback, and therefore go to another xlp file. You simply can have two xlp files, one for all UiTextures, including leaders screens, and another XLP file for fallbacks (see my Portugal mod for reference). XLP config does not mean you don't have to match your icons with your stuff, that is done in <IconTextureAtlases> and <IconDefinitions> (my Icons Tutorial section), you have to do both configs, but XLP is only in modbuddy, where BLP are generated for final publication of the mod.

Artdefs, also part of my tutorial look&feel section, define graphics of stuff in-game. If you want a building, unit, and such, you add correspondent artdef. LeaderScreens also require artdefs. For the game to know what is your in-game art goes to .Dep file, where there must be references for your artdefs files. XLP references also need to be added to mod.art.xml but pointed out as BLP extension (final published file). Modbuddy autogenerates .DEP file, but you have to add your references of artdefs and blp´s in right places of your mod.art.xml, and in project Properties mod art dependency file(.dep). Modbuddy needs you to add this 'mod art dependency file' instead of the mod.art.xml, to generate the .Dep file. Nevertheless, there´s a tool for mod.art.xml autogeneration, pointed by me, but did not work for you, in the meanwhile I noticed that there´s an update to that tool, go here, and try again.

About that autogenerated folders when you use .BLP method (approach 1) they are in fact redundant because BLP is a package with all your art in it. Understanding this, In my Portugal Mod, I removed the textures folder from modbuddy project, they are there yet but not added to the project, therefore they don't appear in published mod. Summing up, don't need textures (animations, etc) because all is in BLP (if all configured with approach 1). And art references are in .DEP file.

Hope this helps.
Raen, Thank for the information. Now have a better understanding how the files relate.
 
Raen, I have successfully created my mod. All my icons works except my units icons does not appear. The unit is displayed in the Tech Tree but the icon does not appear. I tried going through all the files to sieve out the error but all looks well. Don't know where I am missing. I would just like your guidance to resolve this unit icon issue and my mod is good to go. I created the mod via Modbuddy (to import the Civ/Leader/Unit icons) .The "Build" was not 100% successful. The Civilization and Leaders icon did not appear initially. Thus I want through the files to correct and finally the Civ and Leader's icon worked well in both pre startup, post startup and the Civilopedia. I'm doing all the changes directly in the mod. Appreciate your guidance.
 

Attachments

  • Indus_Valley.zip
    12.3 MB · Views: 133
  • Logs.zip
    237.6 KB · Views: 144
Raen, I have successfully created my mod. All my icons works except my units icons does not appear. The unit is displayed in the Tech Tree but the icon does not appear. I tried going through all the files to sieve out the error but all looks well. Don't know where I am missing. I would just like your guidance to resolve this unit icon issue and my mod is good to go. I created the mod via Modbuddy (to import the Civ/Leader/Unit icons) .The "Build" was not 100% successful. The Civilization and Leaders icon did not appear initially. Thus I want through the files to correct and finally the Civ and Leader's icon worked well in both pre startup, post startup and the Civilopedia. I'm doing all the changes directly in the mod. Appreciate your guidance.

I don't mean to hijack in to your conversation - but I had a moment so I downloaded your files quickly. I haven't really inspected in detail, just taken a cursory look.

A very initial observation is that you don't seem to have unit icons in all of the sizes I believe you need - you have 22, 32, 38, 50, 80 and 256 (for both the Trishul and the GBAD). According to my own files, unit icons should have 22, 32, 38, 50, 70, 80, 95, 200 and 256.
 
I don't mean to hijack in to your conversation - but I had a moment so I downloaded your files quickly. I haven't really inspected in detail, just taken a cursory look.

A very initial observation is that you don't seem to have unit icons in all of the sizes I believe you need - you have 22, 32, 38, 50, 80 and 256 (for both the Trishul and the GBAD). According to my own files, unit icons should have 22, 32, 38, 50, 70, 80, 95, 200 and 256.

Maconnolly, Thank you for your feedback. I took reference from another civilization (Bulgaria) mod on Steam Workshop. That mod worked well and the unit icons displayed in the pre startup, post startup, Civilopedia as well as the tech tree. Thus I used those sizes indicated in the Icon.xml file. I read from Civ 6 Modding Guide by. Lee "LeeS' Shipp the following

Unit Portraits: 256, 200, 95, 70, 50, 38
Units: 256, 80, 50, 38, 32, 22

Based on your advice and reference to Civ 6 Modding Guide, I created all the required sizes but still no unit icons were visible. Not sure where is the break.
 
Ok, sorry - I’ve sent you on a wild goose chase there. You have the right sizes - I’ve been doing it wrong!

I will take a look at your files in detail today; sorry for the bad tip.
 
Raen,
I have managed to resolve the unit icon issue. I followed Maconnolly's feedback to include all the icon sizes. Thereafter, I build the mod from modbuddy and manually made some changes to the '.dep' file. After looking through the errors in the log files, realised that I had indicated the wrong icon size for new added icon recommended my Maconnolly.

<Row Name="ICON_ATLAS_TRISHUL" IconSize="50" IconsPerRow="1" IconsPerColumn="1" Filename="Trishul 95.dds"/> plus a few more lines

After changing the size manually in the Civ 6 mod folder, the game started successfully with all the icon.

Raen, I must thank you again for teaching me the valuable lesson to look into the logs file to correct the errors.

Maconnolly - I included all the icon sizes that you highlighted. But I still have reservation as to the cause of icon not displaying. This is because, the Civ 6 workshop mod had only unit icon sizes 22, 32, 38, 50, 80 and 256. The mod worked fine in all areas. I was using that mod as a template to create my mod manually for the past few days, I did not see any issue with icon. Problem only started after I moved over to modbuddy to create my textures and thereafter 'Build' the mod. Even this successful mod is not completely from Modbuddy. The build the mod from Modbuddy and therafter made changes manually to the '.dep' file.

Thank you
 
Rajendran_P said:
I included all the icon sizes that you highlighted. But I still have reservation as to the cause of icon not displaying.

You're right - I don't think the icon sizes is the cause here; as per my earlier post, I think you can consider me mistaken for leading you in that direction.

I have the files I downloaded (yesterday), so will do my best to have a look and see if I can isolate the reason.

I have personally created mods where all icons show up and have only used ModBuddy - so there is definitely a process that works; it's just a case of isolating what is wrong. Will revert back when I can!
 
You're right - I don't think the icon sizes is the cause here; as per my earlier post, I think you can consider me mistaken for leading you in that direction.

I have the files I downloaded (yesterday), so will do my best to have a look and see if I can isolate the reason.

I have personally created mods where all icons show up and have only used ModBuddy - so there is definitely a process that works; it's just a case of isolating what is wrong. Will revert back when I can!
Thanks for your quick response. I will also try to nail the error/s that is causing this icon problem.
 
Thanks for your quick response. I will also try to nail the error/s that is causing this icon problem.

Also, modbuddy project itself can help to address this issue. Post it or PM it.
 
You're right - I don't think the icon sizes is the cause here; as per my earlier post, I think you can consider me mistaken for leading you in that direction.

I have the files I downloaded (yesterday), so will do my best to have a look and see if I can isolate the reason.

I have personally created mods where all icons show up and have only used ModBuddy - so there is definitely a process that works; it's just a case of isolating what is wrong. Will revert back when I can!

Maconnolly, after looking through the files and your highlights regards to some of the icon sizes that I did not include, may have helped to resolve the unit icon issue after all. This is because of the coding that I indicated in the Icon.xml file (see below). Your recommended icons and my missing icons were all "Portraits" sizes and since I did not include the portrait size icon, errors appeared in the log file and the icon fail to execute because there was no "Portrait" sizes. That is just my guess. I can only try it out in Modbuddy after I am back from work on Sunday.

<Row Name="ICON_UNIT_TRISHUL_PORTRAIT" Atlas="ICON_ATLAS_UNIT_PORTRAITS" Index="33"/>
<Row Name="ICON_UNIT_GBAD_PORTRAIT" Atlas="ICON_ATLAS_UNIT_PORTRAITS_2" Index="6"/>

Other than the addition of the Icons, I did not make any other significant changes to the files, before the icons worked successfully. Hope this is the reason for unit icon not appearing in the game.
 
I got it working. The config I added before did not work, what works is direct import of files, including XML one.

Here is the working version of the mod with this modification.
Raen, I have been using your Jun 27, 2020 updated file and it worked well till the Feb 21 update. Although the mod works, the unit flag does not appear. Help

Thank You
 
Top Bottom