[NFP] Wrapping my head around adding art (*not* unit art)

Zagaroth

Chieftain
Joined
Nov 27, 2009
Messages
60
OK, back after my mod building was interrupted by life. Anyway, I seem to be having trouble finding a guide that explains this part in the way I get, so let me break down what I have and what I am looking for. skipping unit graphics for now, will come back to that later.

I have .dds images that should be formatted properly, and I can import them into my project just fine. And if I need others, I can make them (though honestly with help from my wife, she is more the graphic artist than I). Have GIMP for that work. It's all flat 2D images, I am not doing any moving or 3D stuff.

Now, to put this in steps for the way I need to sort everything in my head:

1) What file do I need to use for attaching the art & icons to my civ & leader?
Part of my memory from when I tried to do this before says that I need to identify what art needs to be loaded via a .artdef file, and then assigning that art via Leader_config or such. I do not currently have any .artdef file in the civilization mod.

2) What is the exact relationship between art labels and the art we see? Like, Fallback suggests to me that this is the scene used when the game can't find a more specifically labelled scene. But is it also used for specific specific scenes?

3) I need to understand the structure of the relationships between the different parts to adding the art. I'm not sure how to explain this better, just that I hate doing stuff when I don't understand why it works this way.

4) I have a file from the template I am building off of called Mod_Name.Art.xml. Going through it, it looks like it just exists for loading all the default art libraries? Do I need to touch this at all?

5) I've seen some mods seem to use multiple sizes of certain images like icons, do I really need to do that?

I can probably attempt to tackle a guide when I get stuff straightened in my head, just trying to jump back in to something half done makes it harder find a starting point, since this is my first real mod. So I'm trying to get a better grasp on what it is I need to actually do before I try a guide again.

Sorry if all this is explained somewhere I should have been able to find it, I'm trying to work around part of my brain that is not cooperating, and I can only spend so much energy on searching.
 
In few words just to try to put you on track

You add your dds files (you need all sizes yes) to a folder named textures. In modbuddy you open asset manager to generate new textures for all your dds files. Choose userinterface for all but fallback use leader_fallback.

Having that, you have to add one file to define your icons, to match with your dds files. Another file is the xlp file where you define dds and texture links ( this is to generate blp file in build).

For leaders is a particular case, you need at least two artdefs, one for leader and another for fallback. You add also a xlp file.

Finally, in mod.art.xml you add what you need, in this case, icons and leaders' references.
 
Last edited:
I messaged you earlier but, to be honest, @Deliverator is right - the thread he linked (which was mine) is a good, documented conversation that goes down the same path.

I have .dds images that should be formatted properly, and I can import them into my project just fine.

Good that you are happy with this - but just a reminder regarding export/compression format. For GIMP, it's ABGR8 with no compression.

Zagaroth said:
1) What file do I need to use for attaching the art & icons to my civ & leader?
Part of my memory from when I tried to do this before says that I need to identify what art needs to be loaded via a .artdef file, and then assigning that art via Leader_config or such. I do not currently have any .artdef file in the civilization mod.

There are a few files needed in order to ensure the display of the icon. Let's assume you are asking for the files you should be able to see before you build via ModBuddy, with the intention being to cook into a BLP - which is the slightly more advanced, but 'tidiest' way to do it. You will need:

- a .dds file that contains the image in question. This can be created in a graphics program; in your case, GIMP.
- a .tex file that contains some metadata about the image in question. This can be created from within the Asset Editor, simply by creating a new asset of the type Texture, selecting the UserInterface class and pointing to the .dds file as the source.

The above two files will be in the Textures folder in your ModBuddy project.

- an .xlp file that defines the files you wish to 'cook' into the .blp format. You'll create this and place it in the XLPs folder in your ModBuddy project.
- a .sql (or .xml) file that defines the icon-sets. This is the file that will tie a specific image file to an in-game object. It does it via two steps - it defines an 'atlas' via the IconTextureAtlases table and, secondly, ties an atlas to a named object via the IconDefinitions table.

An 'atlas' is the game's term for an icon-set, which may consist of multiple files that all contain different-sized versions of the same icon. In this way, even though you have ten different files for ten different-sized civilization icons, they are all defined as a single atlas. That atlas is defined as the atlas to use to display the civilization icon and the game will pick the graphic of the appropriate size in the right in-game situation. So you end up with a structure where lots of files make up one atlas and one atlas is tied to an object.

You will then likely have other game-code files (again, .sql or .xml) which reference the icons defined in the IconDefinitions table. You'll reference these icons in different locations, depending on what game-content you're creating - the leader icon will appear in the Players table, a Unique Unit icon will appear in the PlayerItems table, a Unique Infrastructure icon in the Improvements or Buildings table, etc.

It's worth noting that the game has a hard-coded relationship (in terms of filenames) for icons and the respective in-game objects. In simple terms, an icon game reference is the object reference with a prefix of: ICON_

- Mod Art Dependency File (ProjectName.Art.xml, or similar). This will reference libraryName and relativePackagePaths entities that tell the mod to use the BLPs (created from the XLPs as part of the build process) specified. It's often forgotten and leads to things not showing up, despite all the other logic being sound.

Finally - and this is important, because pre-build in ModBuddy this is not a file, but an abstracted concept - you need to instruct the game to execute various files under various FrontEnd or In-Game Actions. These are configured in the project Properties and, at the point of build, this is translated into part of the .modinfo file that is generated.

There's an action type called UpdateIcons - this is where you specify the icons SQL or XML file to execute. Typically, you'll be executing this as a FrontEnd Action and an In-Game Action.

You'll also want to use UpdateArt to execute the Mod Art Dependency File - which your template likely has as an XML called TemplateName.Art.xml.

Zagaroth said:
2) What is the exact relationship between art labels and the art we see? Like, Fallback suggests to me that this is the scene used when the game can't find a more specifically labelled scene. But is it also used for specific specific scenes?

For the most part, there are three commonly-used 'label' types. The labels are used for referencing different m_PackageName entities, which are used for cooking into .blp files. You have UI/Icons, UI/Leaders and LeaderFallbacks.

UI/Leaders are rendered in the case of animated, 3D leaders. LeaderFallbacks are used where none exist. UI/Icons are used for other static imagery, that is tied to in-game objects and displayed as part of the UI in various places.

As @raen mentioned, within the Asset Editor - as far as the class goes (which is the m_ClassName entity), everything is of the type UserInterface except for the LeaderFallbacks, which are LeaderFallback.

Zagaroth said:
3) I need to understand the structure of the relationships between the different parts to adding the art. I'm not sure how to explain this better, just that I hate doing stuff when I don't understand why it works this way.

Please feel free to respond here or PM me if you need more than the detail above.

Zagaroth said:
4) I have a file from the template I am building off of called Mod_Name.Art.xml. Going through it, it looks like it just exists for loading all the default art libraries? Do I need to touch this at all?

Possibly - it'll depend on what it's been set up to reference versus what content you are creating. The ModArt.xml file doesn't reference specific images you create (DDS files) - but groups/types of assets that are baked into BLPs. If it's defining every group your XLPs are causing the build process to create and you build the rest of the file dependencies, you should be fine.

The <m_PackageName> text attributes specified in your XLPs should be found in the ModArt.xml file. They'll appear under <libraryName> elements. As an example, search for: <libraryName text="UITexture"/>

You should see, within that, a number of <relativePackagePaths> specified under separate <Element> elements. UI/Icons and UI/Leaders for example. Possibly also UI/Shell_Loading and UI_LeaderScenes.

Similarly, search for: <libraryName text="LeaderFallback"/>

You should see a <relativePackagePaths> element specified named LeaderFallbacks.

These <relativePackagePaths> elements correspond to the <m_PackageName> elements specified in your XLP files, if I am not mistaken.

Zagaroth said:
5) I've seen some mods seem to use multiple sizes of certain images like icons, do I really need to do that?

Yes. Each icon file needs to be created separately - they are defined individually, but tied together in a single atlas, as per my earlier comments. No shortcut there I'm afraid.
 
Last edited:
Top Bottom