[Modding Instructions] Adding Custom Emblems/Portraits (DDS Textures)

  • Crusader Kings II Expansion Subscription

    Subscribe to the CK II Expansion and enjoy unlimited access to 13 major expansions and more!


  • Paradox Space Exploration Sale has arrived! Up to 75% off

    How's the space on your hard drive? Paradox wants to challenge your galaxy brain with a great selection of space exploration games - and they're all on sale for some very down-to-earth prices! The sale runs from May 4th until May 10th at 17:00 CEST / 08:00 PDT.


    May 4th - May 10th
  • Crusader Kings III Available Now!

    The realm rejoices as Paradox Interactive announces the launch of Crusader Kings III, the latest entry in the publisher’s grand strategy role-playing game franchise. Advisors may now jockey for positions of influence and adversaries should save their schemes for another day, because on this day Crusader Kings III can be purchased on Steam, the Paradox Store, and other major online retailers.


    Real Strategy Requires Cunning

GenTask

Captain
3 Badges
Mar 16, 2018
354
0
  • BATTLETECH - Initiate of the Order
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
(I have adapted these instructions from here)

Adding Custom Emblems/Portraits (DDS Textures)


A simple step-by-step guide for creating a DDS Texture from an existing image for an emblem (ie with a transparent background) and adding it to your game as a mod.

Prerequisites
  1. Download and install Gimp 2 from http://www.gimp.org/downloads/ (the installer will detect whether you are running a 32-bit or 64-bit Windows)
  2. Download and install the DDS plug-in from https://code.google.com/archive/p/gimp-dds/downloads
  • IMPORTANT - Select the DDS Plugin for 32-bit or 64-bit, you must know what OS type you are running
  • gimp-dds-win64-3.0.1.zip is 64-Bit
  • gimp-dds-win32-3.0.1.zip is 32-Bit
3. NOTE: If you have a DDS plugin for Photoshop, then you skip using GIMP altogether - to download that plugin for Photoshop go here.

Creating the graphic file
  1. Using your preferred image manipulation program (such as Photoshop) create your graphic, any areas to be transparent should ideally be white
    • For the purposes of these instructions, if you are using Photoshop go to File->New->
    • Dimensions must be: 256x256
    • Background Contents: Transparent
  2. Save as a PNG (don't worry about setting transparency if you are unsure how to do this)

Creating the DDS texture file
  1. Start GIMP (If you are not using GIMP and have a DDS plugin for Photoshop, skip to the "For Photoshop" Section)
  2. Create a new image, the same size as the PNG, with the Color Space set to RGB (under Advanced Options), and click OK
  3. Open the PNG image in separate window, Go to Edit and Copy
  4. Select the new image you created, Go to Edit and Paste
  5. In the "Layers, Channels, ..." window, right click the Floating Selection and select "Anchor Layer"
  6. From the Layer menu, select Transparency and then "Color to Alpha ..."
  7. If the areas to be transparent are not white (or any solid color that does not exist in your emblem/portrait), click the color bar between "From:" and "to alpha"
  8. Click OK
  9. Go To, Image->Transform->Rotate 180 (NOTE: If you are using Text or if the image is Offset/Non-Symmetrical you may also need to flip Horizontally)
  10. Save the graphic as an xcf file (this is just in case you make a mistake and need to reload the file in GIMP, however you will need xcf file to save as DDS)
  11. Open the XCF file
  12. Select File -> Export As... and expand the Select File Type and click on (DDS image) item
  13. Scroll down and select "DDS Image" (if there is no option check you installed the DDS plug-in correctly!)
  14. Click Export
  15. In the Save As DDS options pop-up panel, Format to "RGBA8", set Compression to "BC3 / DXT5", set Mimaps to "Generate Mipmaps" and ignore the "Advanced Options" section
    • NOTE: These options are Important and must be selected or the game will not load the completed dds file
  16. Click OK to save the dds file
For Photoshop (adapted from here)
  1. If you have already created a new graphic file, start here.
  2. Ensure the background is transparent (delete the background layer or when creating a new image, have the background contents as transparent)
  3. Go To, Image->Image Rotation->180 (NOTE: If you are using Text or if the image is Offset/Non-Symmetrical you may also need to flip Horizontally)
  4. Go To, File->Save As->Select "Format" as "D3D/DDS"
  5. In the NVIDIA dds format pop-up window, select the following settings: In top drop-down "DXT5 ARGB 8 ppp | interpolated alpha" ; "2D Texture"; Leave "Generate MipMaps" selected
  6. Click "Save"

Creating the Mod (Emblems)
  1. Copy and Paste the dds file (named as whatever you want); example "custom_emblem_007" into your "X:\...\steam\steamapps\common\BATTLETECH\BattleTech_Data\StreamingAssets\emblems" where X is the hard drive. For GoG this will simply be where-ever you set GoG to install your games to, example "X:\...\Games\GOGGAMES\BATTLETECH\BattleTech_Data\StreamingAssets\emblems"
  2. Navigate to your "...BATTLETECH\BattleTech_Data\StreamingAssets\data" folder and open "VersionManifest.csv" (Recommended to use Notepad ++)
  3. For Emblems, you will need to create two new lines (one for "Sprite" and one for "Texture2d" so the custom image will be selectable in SP and MP
    • Go to the end of the VersionManifest OR find emblem sections which start at "envTxrHrld_000"
    • The lines you will create must mimic what you see below
    • After creating the lines "save" the VersionManifest (WARNING: Make sure you have a backup of this file or remember where you entered any new lines in case you need to delete them)
(Sprite entry)
spongebob_0000,Sprite,emblems/player/spongebob_0000.dds,0,2018-04-21T11:38:11.9043442Z,2018-04-21T11:38:11.9043442Z,,,False,0,False

(Texture2D)
spongebob_0000,Texture2D,emblems/player/spongebob_0000.dds,0,2018-04-21T11:38:11.9043442Z,2018-04-21T11:38:11.9043442Z,,,False,0,False

Notes: "spongebob_0000" is the name of the file which needs to be at the beginning and also in the folder call path that you see on each line - this part ",0,2018-04-21T11:38:11.9043442Z,2018-04-21T11:38:11.9043442Z,,,False,0,False" is not unique (I simply copied it from another emblem entry)

Creating the Mod (for Pilot Portraits)
  • This works pretty much the same as described on the Modding Wiki at this link, except the image must be 512 x 512. It is saved as PNG and saved in the "BATTLETECH\BattleTech_Data\StreamingAssets\sprites\Portraits" folder.
  • Follow the instructions in the link for creating the pilot.json file that needs to go with it.

Testing the Mod

1. Pretty simple

For Single Player, Go to Captains Quarters -> Click on Customize Company
For Multiplayer, Go to Manage (Under your Player Profile Name) -> Click on Heraldry

sYGzLZr.png


Get creative! Technically this will allow the community add in every single historical BattleTech emblem, from House Units to Mercenary groups, or just make up your own.
 
Last edited:

GenTask

Captain
3 Badges
Mar 16, 2018
354
0
  • BATTLETECH - Initiate of the Order
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
I had to rotate my image 180 degrees AND flip it horizontally because otherwise the image was mirrored.

Yup, sorry. I forgot about that part of it (it's in the instructions above now).
 

GenTask

Captain
3 Badges
Mar 16, 2018
354
0
  • BATTLETECH - Initiate of the Order
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
You forgot the horizontal flip.

Hmm, so I was looking at that and I'm not sure its needed unless one prefers which way they want the logo to face? For my Spongebob example, I could flip it horizontally so it he faces the other way and that's it will do. For custom logo's that are symmetrical though, like the ones HBS has, it shouldn't make a difference?
 

KnightCole

Colonel
2 Badges
Mar 2, 2018
823
0
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
can we use paintdotnet? its what I used in the beta.
 

KnightCole

Colonel
2 Badges
Mar 2, 2018
823
0
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
OK, lol, that was easy as pie. Yeah, I just saved it as a DDS and followed the .csv changes, it worked fine in paintdotnet.

On pilots, in the CSV I cant seem to find anything like the 'sprites' that we used before and that is in that link. I do see 'PortraitPreset" is that what we copy and alter for our pilots now?
 
Last edited:

CHH_Rampage

Second Lieutenant
6 Badges
Feb 25, 2018
182
0
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • BATTLETECH: Flashpoint
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
OK, lol, that was easy as pie. Yeah, I just saved it as a DDS and followed the .csv changes, it worked fine in paintdotnet.

On pilots, in the CSV I cant seem to find anything like the 'sprites' that we used before and that is in that link. I do see 'PortraitPreset" is that what we copy and alter for our pilots now?

At this point, you cannot use the method described in the Wiki to change the Commander or the starting lance. Those are all Portraits that are generated by the Character creator. You can use the method to create characters similar to the backer pilots either by adding one or replacing one of the pilots that is already there with your own. The problem with this is that they then only appear in the hiring halls and you have to find them or someone needs to figure out how to place them in a specific hiring hall. It might be most plausible to hire a backer mercenary and THEN change the character with your own portrait, bio and callsign. I have not tried it yet.

People, including me, are looking for ways to bypass the character creator so that custom portraits can be used for the Commander and the starting lance. To the best of my knowledge no one has found it yet.


@ Gen Task Nice guide. I used Photoshop and an outside DDS converter that eliminated a couple steps but was in essence the same as what you wrote up. I am sure this guide will be a great help to those wanting to add their own unit logo. Now go look at SpongeBog on the leg of the ShadowHawk if you have the Umbra skin for it.
 
Last edited:

rhaak

★ The Fox God ★
144 Badges
Apr 7, 2009
276
169
  • Crusader Kings II
  • Stellaris: Necroids
  • Europa Universalis IV
  • Crusader Kings III
  • Stellaris
  • Surviving Mars
  • BATTLETECH - Initiate of the Order
Hmm, so I was looking at that and I'm not sure its needed unless one prefers which way they want the logo to face? For my Spongebob example, I could flip it horizontally so it he faces the other way and that's it will do. For custom logo's that are symmetrical though, like the ones HBS has, it shouldn't make a difference?

I does make a difference if you have text in your logo :)
 

KnightCole

Colonel
2 Badges
Mar 2, 2018
823
0
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
Yeah, I had to flip mine the 180 and then horizontally to get it to sit right.
 

Hasler

First Lieutenant
7 Badges
Mar 30, 2018
220
0
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Steel Division: Normandy 44
  • BATTLETECH - Digital Deluxe Edition
  • Crusader Kings II
  • Naval War: Arctic Circle
At this point, you cannot use the method described in the Wiki to change the Commander or the starting lance. Those are all Portraits that are generated by the Character creator. You can use the method to create characters similar to the backer pilots either by adding one or replacing one of the pilots that is already there with your own. The problem with this is that they then only appear in the hiring halls and you have to find them or someone needs to figure out how to place them in a specific hiring hall. It might be most plausible to hire a backer mercenary and THEN change the character with your own portrait, bio and callsign. I have not tried it yet.

People, including me, are looking for ways to bypass the character creator so that custom portraits can be used for the Commander and the starting lance. To the best of my knowledge no one has found it yet.


@ Gen Task Nice guide. I used Photoshop and an outside DDS converter that eliminated a couple steps but was in essence the same as what you wrote up. I am sure this guide will be a great help to those wanting to add their own unit logo. Now go look at SpongeBog on the leg of the ShadowHawk if you have the Umbra skin for it.

So is it possible to redo the code inside the pilot data to mirror that inside the backer pilots. And then change the photo or does that break the game.
 

SpaceDrake

Recruit
Apr 25, 2018
7
0
So is it possible to redo the code inside the pilot data to mirror that inside the backer pilots. And then change the photo or does that break the game.

It is going to take a lot of work to get 2D-style portraits onto the Commander and starting lance - the override to give the lancemates 3D portraits is buried deeper in the code than the JSON level (the game gets very unhappy if it cannot find a PortraitProfile, which defines the parameters for each of the starters' 3D portraits, for every starting lancemate, even if you try to ADD more lancemates). And the Commander's data is buried withing your campaign save file.

Either HBS needs to give us some way to edit pilot portraits (and give them 2D ones if we wish) and profile in the game itself, or it's going to require a save-editing application capable of hex manipulation.

Also, with some testing I've discovered something further: if you wish to edit the profiles of the backers to use them as substitutes for your own characters (since they have 2D portraits by default that can be changed easily), you must do your edits BEFORE starting a new game. If you attempt to edit a pilot's .json after a campaign begins, when you find them all there will be is a blank white area for the portrait and your text profile edits won't have gone through. All of the pilot JSONs are loaded into memory when starting a new game, and then stored in the save file. I suspect this is true for nearly all the data JSONs - if you don't make the edits before a new game, they won't be reflected in your save game.
 

GenTask

Captain
3 Badges
Mar 16, 2018
354
0
  • BATTLETECH - Initiate of the Order
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
I does make a difference if you have text in your logo :)

Cool gotcha, added a note for horizontal flip.

---
Also for everyone else discussing pilot portraits, once I have time next week I'll try to test that more, but from the digging I did you should be able to still set 2D portraits and at least create a character that can be readily selectable in SP/MP Skirmish.

A lot of the other starter pilots and hired pilots were created with the character generator (I hope HBS releases an external tool for this, otherwise someone may need to create one?) and their values are stored in the portrait folder as "PortraitPreset" jsons.

If it's possible to locate the portrait that each player creates, it may then be a matter of simply creating a new game and customizing new characters, then look at the file that generates and copy those parameters into new portraitpresets.
 

CHH_Rampage

Second Lieutenant
6 Badges
Feb 25, 2018
182
0
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
  • BATTLETECH: Flashpoint
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
So is it possible to redo the code inside the pilot data to mirror that inside the backer pilots. And then change the photo or does that break the game.

Everything I have tried so far, breaks the game. At the very least, we are looking at changes to the pilot JSON, simgame constants JSON, player Portraits PNG and the Version Manifest. Like SpaceDrake said it is likely that the code runs even deeper than that. This is puzzling to me because HBS stated that although they would not support modding, they left the files very accessible for the modders. Surely, they realized that individuals would want to RPG the game and add their own pilot names and portraits to raise the level of immersion. I would have thought they would have left a relatively easy avenue to doing this. Maybe we just have not found it yet or are missing a step.

Right now, I am having too much fun playing the game to spend the time needed to dig deeper into the files. I hope someone beats me to it and makes it easy for me.
 

ronhatch

Lt. General
3 Badges
Feb 23, 2018
1.304
2
  • BATTLETECH
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
First off... c'mon, guys... rotating 180 degrees and then flipping horizontally is exactly the same as flipping vertically. Save some steps.

As far as changing commander portraits and such, the key is the save files. Once we figure out the format, it shouldn't be at all hard to compare the procedural stuff with the backer mechwarriors and convert everyone to use pre-generated portraits.

Personally, I'm passionate about never changing anything in the data directory except for the VersionManifest.csv file and (eventually) the database. Put it all in StreamingAssets/mods and make your manifest entries point to the appropriate location. There is absolutely nothing special about the emblems directory, it is there only to keep things organized... and keeping non-stock images out of there is a *much* better way to organize things.

Right now, I am having too much fun playing the game to spend the time needed to dig deeper into the files. I hope someone beats me to it and makes it easy for me.
Yeah, pretty much.

I actually wasn't expecting that at all, since it didn't work out that way for me during the beta. But so far I've only had time for a mission or two each day, so that just isn't enough to get my fix.
 

Canis

Private
Apr 24, 2018
24
0
Very nice guide, I went a slightly different way. I used 'paint.net' which I already had downloaded and it can save pics as .dds by default which made it easy. I took my emblem, deleted the background and flipped the image vertically. I found the folder with the emblems and found one that I didn't like, I renamed mine to that name and renamed the old one to something else, so the game thinks that my image is the old one. Luckily the whole thing only took a few minutes.
 

N.tony

Recruit
49 Badges
Apr 25, 2018
3
0
  • Cities in Motion 2
  • Semper Fi
  • The Showdown Effect
  • Europa Universalis IV: Pre-order
  • Pillars of Eternity
  • Magicka 2
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum
  • Stellaris
  • Europa Universalis IV: Rights of Man
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Mandate of Heaven
  • BATTLETECH
  • Cities: Skylines - Green Cities
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Cities: Skylines Industries
  • Europa Universalis IV: Golden Century
  • Prison Architect
  • War of the Roses
  • Warlock: Master of the Arcane
  • Teleglitch: Die More Edition
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Res Publica
  • Majesty 2 Collection
  • Crusader Kings II
  • Crusader Kings II: The Old Gods
  • Dungeonland
  • Europa Universalis III
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • Magicka
The game has reverted the changes in the manifest file (I guess after the patch), which makes it impossible to load a save if you used custom emblem in your campaign. Same with trying to modify the profile if you used custom icon for it before.
The only way I found to repair it is to add back the exact names of the icons in the manifest.
 

GenTask

Captain
3 Badges
Mar 16, 2018
354
0
  • BATTLETECH - Initiate of the Order
  • BATTLETECH - Beta Backer
  • BATTLETECH - Backer
The game has reverted the changes in the manifest file (I guess after the patch), which makes it impossible to load a save if you used custom emblem in your campaign. Same with trying to modify the profile if you used custom icon for it before.
The only way I found to repair it is to add back the exact names of the icons in the manifest.

Yeah, every patch is going to overwrite the manifest. Always have a backup so you remember how you input your lines.