Need help with Icon Atlases

Crook

Chieftain
Joined
Sep 28, 2019
Messages
16
Hello, I'm working on my own custom civ, and I'm having trouble using a custom icon for my civ. My main problem is this :
When booting up the game, my Database.log shows this :
Code:
[3790690.648] [Database]: While executing - 'insert into IconDefinitions('Name', 'Atlas', 'Index') values (?, ?, ?);'
[3790690.648] [Database]: In XMLSerializer while inserting row into table insert into IconDefinitions('Name', 'Atlas', 'Index') with  values (ICON_CIVILIZATION_DENE, ICON_ATLAS_DENE, 0, ).

My xml is this :
Code:
<?xml version="1.0" encoding="utf-8"?>
<GameData>
    <IconDefinitions>
        <Row Name="ICON_UNIT_NOMADICFAMILY" Atlas="ICON_ATLAS_UNITS" Index="0"/>
        <Row Name="ICON_UNIT_NOMADICFAMILY_PORTRAIT" Atlas="ICON_ATLAS_UNIT_PORTRAITS" Index="0"/>
        <Row Name="ICON_DISTRICT_DENE_SPORT_CIRCLE" Atlas="ICON_ATLAS_DISTRICTS" Index="7"/>
        <Row Name="ICON_CIVILIZATION_DENE" Atlas="ICON_ATLAS_DENE" Index="0"/>
        <Row Name="ICON_LEADER_YAMORIA" Atlas="ICON_ATLAS_LEADERS" Index="0"/>
        <Row Name="ICON_TRAIT_DENENDEH" Atlas="ICON_ATLAS_UNITS" Index="28"/>
    </IconDefinitions>
    <IconTextureAtlases>
        <Row Name="ICON_ATLAS_DENE" IconSize="32" IconsPerRow="1" IconsPerColumn="1" Filename="CIVILIZATION_DENE_32"/>
        <Row Name="ICON_ATLAS_DENE" IconSize="38" IconsPerRow="1" IconsPerColumn="1" Filename="CIVILIZATION_DENE_38"/>
        <Row Name="ICON_ATLAS_DENE" IconSize="50" IconsPerRow="1" IconsPerColumn="1" Filename="CIVILIZATION_DENE_50"/>
        <Row Name="ICON_ATLAS_DENE" IconSize="64" IconsPerRow="1" IconsPerColumn="1" Filename="CIVILIZATION_DENE_64"/>
        <Row Name="ICON_ATLAS_DENE" IconSize="128" IconsPerRow="1" IconsPerColumn="1" Filename="CIVILIZATION_DENE_128"/>
        <Row Name="ICON_ATLAS_DENE" IconSize="256" IconsPerRow="1" IconsPerColumn="1" Filename="CIVILIZATION_DENE_256"/>
    </IconTextureAtlases>
</GameData>

What am I doing wrong?
 
There is generally at least one more line of error-code in Database.log with the same timestamp which is needed to diagnose the issue completely and in many cases at all. There are often a total of four error-lines with the same timestamp when an error is encountered in an XML file. All four are really needed in order to determine the problem. The two error-lines shown merely tells us that the Database is objecting to an attempt to insert a new row into table IconDefinitions where the data for the attempted new row are:
Code:
('Name', 'Atlas', 'Index') with  values (ICON_CIVILIZATION_DENE, ICON_ATLAS_DENE, 0, )
But these two error lines do not specify what the database is objecting to.

It is generally better to add the <IconTextureAtlases> table before the <IconDefinitions> table.

Column "Filename" in table "IconTextureAtlases" generally wants a file extension-type as well as the filename, for example:
Code:
	<IconTextureAtlases>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="32" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_032.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="38" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_038.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="50" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_050.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="80" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_080.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="128" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_128.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS" IconSize="256" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_256.dds"/>
		<Row Name="ICON_ATLAS_ERA_BUILDINGS_FOW" IconSize="256" IconsPerRow="8" IconsPerColumn="8" Filename="EraBuildings_256.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01" IconSize="32" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_032.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01" IconSize="38" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_038.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01" IconSize="50" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_050.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01" IconSize="80" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_080.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01" IconSize="128" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_128.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01" IconSize="256" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_256.dds"/>
		<Row Name="ICON_ATLAS_BUILDINGS_ARE_FUN_01_FOW" IconSize="256" IconsPerRow="8" IconsPerColumn="8" Filename="BuildingsAreFunAtlas01_256.dds"/>
	</IconTextureAtlases>
 
Well thanks! Looks like that fixed it. (Either the file extension, or the order, or both).
There is an issue though : the color blue in my icon has turned to red. Any idea why that is?
 
If I recall correctly, it may be that you've saved your .dds files in the wrong format. They should be saved in RGBA8.
 
Hello, thank you for your answer.

I can't seem to make this work. I have a few issues :
- I subscribed to creative cloud to get photoshop and make icons properly using this template from an old thread : https://forums.civfanatics.com/threads/civilization-icon-template.534796/ However, I can't seem to export to .dds with photoshop.
- I found an nvidia plugin for photoshop that allows me to export to dds, but I can't export to all the right sizes (Since from my understanding I need icons that are 50x50 and 38x38, but nvidia's plugin only allows me to export to sizes that are multiples of 4)
- I decided to save my icons to PNGs, open them in GIMP, and export them to DDS from there. With this method, I get an icon with colors that change every time I boot the game... even if I'm using RGBA8 when exporting to DDS in gimp.

I'm at a loss, and could really use some help.
 
Top Bottom