I am currently working on a mod and I am trying to find a way to add in custom icons for units, techs, and buildings. I’m starting to wonder if it is even possible without completely rehauling the way that the .JSON files “talk” to one another. I know that replacing icons in the game is possible, as I have done that already, but the whole idea is to be able to add in your own. Working with the file “icons.json” seems to be in the right direction, but modifying the file does nothing because the game’s original “icons.json” file gets loaded instead, no matter the case.
I know that I can’t be the only person having an issue with figuring this out… I created this thread in hopes that I, and other people wondering the same thing, can discuss, collaborate, and perhaps find a workable solution.
Maybe one of you reading this has figured it out already and knows how to do it? (I hope!)
The mod I’m working on locally is always prioritized to the top of the list, unless I decide to play multiplayer and need to prioritize others… so unfortunately that can’t be the case. Thank you for the input/suggestion though!
I gave it a shot and loading the mod as subscribed instead of locally didn’t seem to make a difference. The game simply will not read “icons.json” from the directory of a mod. My file path is identical to the game’s FYI, so there couldn’t be an issue with that… I even tried to only include my changes in the “icons.json” file (similar to how you mod strings) , but that was a no-go as well… there must be a way to do this!
EDIT: The file “icons.json” does in fact get loaded by the game through a mod directory. I emptied all the content from the file, and the game showed no icons for anything when I tested it. Therefore it is reading the file, but not reading any additional modifications to it. (i.e. in that file, for buildings, there are 83 references to icons, and when I attempt to add an 84th and point it to the .DDS file of my custom icon, the game can’t/won’t read that.)
the limitation for building seems to be 5 to 6 more icons, while technologies maybe 15-20 can’t remember. units so far has no limitation yet. the limitation I am talking about is rather specific and may not have issue for units in game, but in techtree they give me headache and its an annoying problem to deal with.
This is the file (materials.json) that the other file (icons.json) points to in order to find and load the .DDS files.
Either there is something I am still doing wrong, or the game is ignoring my changes for this specific file… I am trying to put an icon in the game for the Trade Workshop, similar to what you did, but it keeps loading the icon for the Market, even though I set the icon number in Genie Editor to the number I assigned the information in the json files, as well as the .DDS file itself.
Perhaps there was an edit in “materials.json” that I might have missed?
my only mistake is not realizing there might be a limitation, otherwise i’d start at buildingicons entry 084. theres also problem starting with 084 is that if dev makes a new building and takes away that slot, you would have to change it down the road.
in your case you are using 101, theres few things u need:
making sure your .dat file you have copied icon number correctly correspond to your entry number.
make sure your dds is saved as format “Uncompressed A8R8G8B8 (32-bit)”, I use slx studio to do this, I do not know other software and have no intention to try new programs right now.
the image must be 256 x 256 (as of 2 months ago), I use photoshop to make all image like this for icon, smaller or bigger i’d sometimes have problem not loading.
make sure your icon directory is correct, following my mod folder path you probably have no issue here, just checking.
BuildingIcons101TradeW needs to be present in icons.json as well, you have got the materials.json correct.
I believe (havent test this extensively), if you are using entry 101, you will likely need all the previous entry in there as well, which means original game ends with 083, you need to have entries in icons.json from 084 to 100 to exist, even if they dont yet exist in materials.json. if they dont, 101 will not show correctly.
honestly i have spent way too much time on this because no one to ask, if you entered your entries from 084 to 100 in icon.json and still doesn’t work, try having all entries exist in materials.json as well.
as you can see its a lot of work just copy/paste alone can take hours, start with 084 if you can.
edit: I just read your comment again I missed the part you mentioned “it keeps loading icon for market”.
you probably haven’t copy graphics/icon properly in your empires2_x2_p1.dat file. usually when you edit an unit icon, it defaults to gaia. you will need to copy it manually to the civ you want it to show up.
Thank you for your extensive reply @thieftdp8498! I am going to run through everything you mentioned, although I think I may have done everything the way that you said, other than that I use GIMP for image manipulation, which seems to work fine, as I have successfully replaced the icon for 008Fortress with a .DDS already.
It is a lot of work, especially modifying the json files, but anybody with any scripting experience at all could certainly figure it out. Everything you mentioned though I pretty much spent time on figuring out as well, it was the “materials.json” that I didn’t realize I needed.
I am going to triple check my work and see what I can do… thanks again for your perspective, it’s going to help a lot. For something so simple in-game, it’s a lot of work to modify lol.
My hope is that somebody else that was wondering how to do this will see this thread and learn from it as well!
I was using replacement method until I ran out of icons to replace lol then i discover the entries name duplicates in materials.json im glad they allow us to modify it.
the new futuravailableunits.json they added as of last patch (or 2 ago) can only be edited in original game path. meaning copy paste into the mod folder directory and edit it will have no effect, but edited version in core game path will show its effect in game.
hope they can allow futuravailableunits modded too in future.
Could you share more on this with a few screenshots to explain how you did this? I want to add more units but the substitution method ran into problems when the Lords of the West DLC came up and some icons got overridden by the modded icons.
We need to be able to add icons for units/buildings/techs without needing to do this.