Jump to content
Sign in to follow this  
You need to play a total of 1 battles to post in this section.
PunishedKAsual

Camouflage Modding: Camouflage textures and .xml manipulation

2 comments in this topic

Recommended Posts

Modder
38 posts
2 battles

Camouflage Modding:

Camouflage textures and .xml manipulation

 

 

BOemiwx.jpg

^a possible out come of camouflage modding. Note that this particular "historical IJN DD" mod now longer use camouflage modding due to various reasons.

 

RmcUpvZ.png

Musashi Baltic camouflage mod: my all time favorite and frankly the my best camouflage work ever. A demonstration of this very mod's creation process is available as a demonstration in the appendix.

FUs1LPJ.png

Not every camouflage has to be grey-ish tho, with camouflage.xml you can specify the camouflage to sport any color schemes you want.

Preface

This is a comprehensive guide to modding in regard to World of Warship's camouflage mechanism and implementing skins as camouflages. The material is based mostly from my 3 year experience in wows modding, but I should not be so self-absorbed to deny many had helped me along the way. I hope this little guide will prove useful for newer mod creators who want to make skins in the form of camouflages.

I should mention that some of the effects with camouflage modding are achievable with direct texture modding, which in many case might be easier.  

Guide

Tools you will need

1. Wows Unpacker

A tool released by Wargaming. You need it to extract relevant files from the WoWs Game Client. You can acquire them here

ttps://forum.worldofwarships.eu/topic/113847-all-wows-unpack-tool-unpack-game-client-resources/

 

2. Image manipulation program (Paint.NET/ GIMP / Photoshop)

A image manipulation software such as Paint.NET, GIMP and Photoshop is needed to edit .dds texture files.

 

Paint.NET is a lightweight freeware. While the software is capable for simple edits, on more complex edits, one will quickly find the Paint.NET ‘s functionality on the rudimentary side, limiting the potential of what you can do.

 

GIMP is a open source software counterpart to Photoshop. To open and edit dds file you will want to download a DDS plugin for GIMP.

 

Photoshop(+ Nvidia dds plugin). Software of my choice. Note that this being a commercial software it WILL incur licensing fees.

 

3 Adobe Illustrator/ Inkscape/ any(optional)

Should you want to draw precise geometric forms, in which case camouflage files has plenty, you might find such vector graphics editors invaluable for drawing patterns.

 

4. A decent Text Editor

A capable text editor is needed to edit “camouflage.xml”

Examples being NotePad++, Atom, VIM, Microsoft Visual Studio.

Please do not use the notepad program that came included with your windows installation. It’s easy to lost track of things and make mistakes with the rudimentary functionalities.

Install NotePad++ for editing if you don’t already have an appropriate text-editor.

 

5. An up-to-date Wows Client

Obviously.

 

Extracting Files

Open the wows unpack tool.

 

Access \res\content\gameplay\common\camouflage\textures\  with the unpack tool. Camouflage pattern texture files are located in file path as .dds files.

Select the camouflage patterns you would like to edit. If, at this stage, you are unsure which camouflage file you need to edit, simply select the entire camouflage folder and work out which file to edit in a latter stage. Despite the numerous files, the overall size of all camouflage texture are decently minimal, comparatively speaking.

 

RpIu1mR.png

 

Select the camouflage.xml file for advanced camouflage configuration. If you are only interested in changing the pattern of some camouflage, you will not need this file. However, if you are interested in altering colour schemes, or reassigning camouflage for guns/ torpedo tubes, you will need the camouflage.xml file.You might also find it useful to find the files affecting the ship you want to edit, even if your final mod may not need the camouflage.xml.


 

Camouflage structure

Unfortunately, no one can be told what the camouflage rendering engine truly is. You'll have to see it for yourself. In this guide, I will first introduce various component of the mod to form a clearer picture of what’s going on. Where necessary, sample images and codes will be used to aid demonstration.

camo .dds

.dds files serves as patterns of the camouflage. They look like this and is always in straight Black, Red, Green, Blue pixels. Ideally, a camouflage pattern file should only contain these 4 colors, altho some gradient transition between them are possible.

e7hOeBh.png

Ship-specific camouflages, such as Permanent Camouflages following file name convention ShipID_ShipName_[year]_camo_01.dds,

Common camouflages, such as Type 1, Type 2, Type 5, has various files to them. Look up camouflage.xml for the exact file paths. 

 

Demonstration:

Spoiler

 

Here we have the Z-52 camouflage file opened. 

(btw, a useful trick to help with editing is to overlay your camouflage file on top of the a.dds file. As shown herem this makes it easier to find your way around)

EkpHeu4.png

 

Let say I want to add a + sign on the bow of the Z52 camouflage pattern, I can simply add the + sign to bow. We simply find the bow using clues from a.dds.

yTX5sIm.png

... like this. And save as .DDS in \res_mods\GameVersion\content\gameplay\common\camouflage\textures

JXlvIlT.png

Refresh the ship model by clicking on another ship, wait for it to load, and clicking the ship we are modifying (in this case the Z52,. the + pattern shows up as we wish)

 

Anatomy of “camouflage.xml” with demonstrations

An intuitive interpretation of the camouflage.xml configuration file would dissect the file into 3 sections:

1. Ship Groups

2. Indexed colour palette

3. Camouflages Block

 

1. Ship Groups

<shipGroup>

<name>RUS_group_1</name>

<ships> PRSD103_Derzky PRSD104_Izyaslav PRSB001_Nikolay_I PRSC101_Orlan PRSC002_Diana_1905 PRSC010_Diana_1905_Asus PRSC001_Avrora_1917 PRSC503_Oleg PRSC105_Kirov PRSC003_Murmansk_1944 PRSC106_Pr_94_Budeny PRSC506_Molotov_1943 PRSC107_Schors PRSC108_Pr_68_Chapaev PRSC508_Kutuzov_1952 PRSC110_Pr_66_Moskva PRSC513_Varyag PRSD709_Pr_41_Neustrashimy PRSB103_Knyaz_Suvorov PRSB104_Gangut PRSB105_Pyotr_Velikiy PRSB106_Izmail PRSC610_Smolensk</ships>

</shipGroup>

 

At the top of camouflage.xml you will find such “ship group” declarations. ShipGroup Elements declares any number of ships into a group to be easily assigned camouflages in bulk. You may define new ship groups by inserting new block of <shipGroup></shipGroup> in the same format. Be aware that each ShipID should only appear in one(1) ship group, or the game client will become unstable when loading.

 

This Section takes up around 200 lines in the camouflage.xml file.

 

2. Indexed colour palette Palettes  

<!--//IJN UNIQUE Yamato colour scheme 26-->

<colorScheme>

<name>colorSchemeIJNP26</name>

<color0>0.108 0.117 0.085 1.000</color0>

<color1>0.025 0.037 0.012 0.784</color1>

<color2>0.344 0.364 0.316 1.000</color2>

<color3>0.263 0.275 0.133 0.784</color3>

<colorUI>0.509 0.529 0.278 1.000</colorUI>

</colorScheme>

 

About 200 line or so into the camouflage.xml, you will encounter the “ship”. These elements assign a color to the Red/Green/Blue Pixels in the .dds file we discussed previously.

The <name> element defines the official name for software look up. This information has to be consistent with the data in the next section.

 

<color0> affects the black pixels,

<color1> affects the pixels in red,

<color2> are blue and

<color3> are the green one.

<colorUI> This control the Color Scheme UI button if eligible. This is what it looks like if you give the first colour scheme 1.000 0.000 0.000 1.000 and the second colour scheme 0.000 1.000 0.000 1.000:

 

(Special thanks to TheKingofUm for clarifying what this parameter does)

hzrKusj.jpg

 

 

 

 

Values in each color elements read from left to right Red, Green, Blue, Alpha. Adjusting the each value is analogous to dragging the RGB slide bar in Photoshop. To choose a color, break down their RGB or hex code to decimals by dividing 256 and then divide by a factor of 4 (or 5).

 

The reason for further dividing the RGB color is that the game engine will magnify the brightness of the RGB value when rendering, simply inputting the RGB value in decimal form will usually result in a glowing effect. To get a more accurate color, you are adviced to divide the decimal value by 4~5.


 

Regrettably, I am not yet able to confirm the role of <colorUI> in the camouflage.xml . It would be nice if experienced modders may be able to chime in to help us with this mystery.

 

Example using the Z-52 again.

Spoiler

Let say I want to change the color scheme of Z-52's color to that of the German flag's.

The first step is to acquire the color code of the three colors i want to use. 

uchkqAF.png

The decimals value is obtained by dividing the RGB value by 255 (bear in mind the range of RGB color is 256). As explained above, the value needs to be reduced further by a factor of around 4~5 to fit the rendering brightness.

9z6Hc6w.png

Accordingly, I edit the colorSchemeGERP25, which control Z52's camouflage color scheme and save the file res_mod\game version\camouflage.xml. Note that changes on has to be saved before the game launches to take effect.

FUs1LPJ.png

And here we are... not the most beautiful thing I've ever made, but i guess it suffices for our demonstration purpose.

 

3. Camouflage Block

Example 1 camouflage assigned to ship groups - you will first encounter this Subsection

<camouflage>

<annotation>Restless Fire tile camouflage block for the ships with a texture 4096*4096+2048*1024</annotation>

<name>camo_EU_special_tile</name>

<shipGroups>RUS_group_6 GER_group_5 IJN_group_6 FRA_group_7</shipGroups>

<tiled>true</tiled>

<UV>

<DeckHouse>1.25 1.25</DeckHouse>

<Tile>2.5 4</Tile>

<Gun>0.5 0.75</Gun>

<Bulge>0.6 1</Bulge>

</UV>

<Textures>

<Tile>content/gameplay/common/camouflage/textures/Dazzle_tile_camo_07.dds</Tile>

</Textures>

<colorSchemes>colorSchemeRF01</colorSchemes>

</camouflage>

 

Example 2 ship-specific camouflage (for Z52) - you will find this after the ShipGroupCamouflage Blocks Subsection. Premium camouflages and reward camouflages specific to a ship(such as the 2017 birthday camouflage) follows this format.

<camouflage>

<annotation>Z 52 unique permOflage block</annotation>

<name>camo_permanent_1</name>

<targetShip>PGSD110_Z_52</targetShip>

<tiled>false</tiled>

<UV>

<Tile>1 1</Tile>

<Gun>1 1</Gun>

</UV>

<Textures>

<Hull>content/gameplay/common/camouflage/textures/GSD009_Z52_1945_camo_01.dds</Hull>

<Gun>content/gameplay/common/camouflage/textures/Black_gun_camo_01.dds</Gun>

</Textures>

<colorSchemes>colorSchemeGERP25</colorSchemes>

</camouflage>

 

The camouflage block assigns camouflage .dds files and .color schemes to either a group of ships (as in example 1) or a specific ship  (as in example 2). Each of the elements control an aspect of the camouflage. Usually, tiled camouflage pattern are used on ship groups as common camouflages and ship specific files are unique to a ship. However, you can write a overriding declaration to replace a tiled pattern with a new ship-specific by injecting code blocks.

 

<annotation> lists the name and comments on the mod and is not interpreted by the game client. Evidently, you will find the information listed by Wargaming Studio useful to find which camouflage block affect which ship’s camouflage. Write relevant information in this to help your development process.

 

<name> lists the official name that correspond with the in game engine. The camouflage name should be self-explanatory, camo_1_tile would be Type 1 in game, camo_2_tile would be Type 2 in game, camo_3_tile actually points to the Type 5 camouflage in the camouflage tab, etc

 

<shipGroups> (example 1) defines which group of ship are affected by this camouflage block. Look for the Ship Groups section above for details. As shown in the example, you can include multiple Ship Groups in one camouflage bloc.

 

<targetShip> (example 2) is similar to <shipGroups>, except it points towards a specific ship with the ship ID. Such allows for high customization potential for a ship. Do be aware that, contrary to the usual conventions, ShipIDs in the camouflage.xml have 4 character prefixs “PXXX”

 

<tiled> determines if the camouflage pattern is treated a tiles or as a single stretch of canvas, think of tiles in your bathroom's walls. They are either true or false, which common camouflages patterns, whereas ship-specific ones are always “false”.

 

<UV> These parameters stretches the scale of pattern files. Linear Algebra stuff. Normally you wouldn't need to edit this criteria 

<Textures> This is where it get interesting. The sub-elements <Hull>, <Gun>, <DeckHouse> shows the file path to the camouflage file for their respective areas.

 

Changing the file paths can allow for adding extra/ custom camouflages, should the original file path’s file is not suitable or is being used by multiple ship. For example, some Battleship’s superstructure uses “B_gun_camo.dds” - file thats used by a few dozen ships, and hence cannot be modified without damaging other ships. You can easily insert a new custom.dds into the camouflage folder and modify the file path to the corresponding file name to enable a custom camouflage pattern for that ship only.

 

<colorSchemes> points to the Indexed colour palette we created in section 2 of this chapter. In some cases (mostly on Japanese and American ships), you will find two such instances of <colorSchemes>. This is down to the fact where special Admiral Halsey and Admiral Yamamoto may use an alternative camouflage color-scheme. Editing the first one will affect the left option in the UI and the second one affects the right option. You may also remove the second one, should you decide you do not need a color alternative in the camouflage mod.  


 

Exporting and Previewing your work

Presumably, you've already outputted dds files when you are making the mod. Your final camouflage mod output should contain a folder with file structure \res_mods\[GameVersion\\content\gameplay\common\camouflage\textures containing all the camouflage files

Save your PAint.Net/ Photoshop/ GIMP source files for future editing.

A useful trick is to edit the files in the res_mod\ folder while having them loaded with an active instance of the WoWs Client. Any effect you have made to a file will immediately refreshes each time you save the file as .dds and refresh the game model by click another ship in port and back forth.

Unfortunately, the same cannot be said about the camouflage.xml file. All changes to camouflage.xml requires a game restart to take effect.

 

Appendix: Extra Camouflage modding demonstration

Musashi Baltic camouflage mod process sharing.

Spoiler

A few years ago, an associate of mine who love the Baltic camouflage, came to me for an interesting request: he, of all men, wants to have the Baltic camouflage(the one you can see on German Premium Cruiser Prinz Eugen/Bismarck). Hint: you can easily preview all premium ship's camouflage using a extended tech-tree mod, as all premiums are shown in port with their permanent camouflages, even if you don't own them.

RmcUpvZ.png

First, I acquire the files necessary to the mod, camouflage.xml and camouflage texture files. In addition, the ship's skin texture (a.dds files ) are also extracted for reference during edit. More on that on the next page.

Cp1Kq3j.png

Open the .dds files in two group respective to their deckhouse and Hull markers. Here I demonstrate with Photoshop... oh wait, I didnt use photoshop. I actually used Illustrator for most of the work done on the musashi.

akjDyCO.png

Here is how it went:

RTViq6k.png

it was a bit complicated, but at the time, I wanted precise control over the geometry of the shapes I'm drawing, so i went to Illustrator.

notice I over lay the image as background layer to help me find where is which texture... otherwise the guess work would be complicated.

Ob02ppR.png

Notice that I actually plan to reuse the color palette directly from Bismarck's Baltic camouflage. As such, I correspond all the color blocks to the color im replicating. Standardizing the BRGB map is an easy trick if you plan to replicate a palette from an existing ship.

oyZbn0R.png

These are the final output files.

Now that we are done with the .dds files, we only have the camouflage.xml to edit

hSwrpCw.png

Here we navigate to the part. As mentioned above, in this demonstration we are reusing the existing Bismarck Color scheme. I simply edit the colorSchemes parameter

        <colorSchemes>colorSchemeIJNP34</colorSchemes>

        <colorSchemes>colorSchemeGERP16</colorSchemes>

Save the camouflage.xml in the res_mod folder, and load the game, along with the camouflage dds files we have edited.

SGRnPq7.jpg

success!
  

 

Others & Troubleshooting

Updating your mod

Notice that, any mod involving camouflage.xml will require updates to the xml file. Should you release such a modpack to the public world, you should commit to the effort involved updating every patch. At the very least, one should provide documentation to how to update the camouflage.xml. 

 

Trick with mg.dds

If you are looking into manipulating the areas of the ship covered by camouflages, or simply wants to disable all camouflage on a ship, you might find a trick with the texture files mg.dds useful.

For this method, read A simple Guide To Texture Modding 

 

Hard Edges and DXT artifacts 

Due to the way DXT compression works, hard edges between the different colors may sometime result in jarring and ugly artifacts. Camouflage modding may sometime not be able to create patterns too fine. You may circumvent this problem with

 

My pattern loads but it is in some funky shapes than I expected

Caused by error in dds file dimension. Check your .dds file dimensions. Each of the sides should be a power of 2, such as 512, 1024, 2048 or 4096. Sometimes software run into an error that accidentally output 4097 sides.

 

If your game fails to load with camouflage mods / camouflage fails to load

It can be down to one of these reasons: 

1. broken camouflage file.

2. wrong file name / file path in the res_mod folder

3. compression format with .dds file << You are advised to use one of the DxT formats (DXT1, DXT3, DXT5).

 

Conclusion

This wraps up all that I know about camouflage modding. If you spot a mistake, have a problem, or has anything to add, please dont hesitate from leaving a comment below.

 

 

Special thanks to @TheKingOfUm for clarifying what ColorUI parameter does!

 

  • Cool 4

Share this post


Link to post
Share on other sites
Players
9 posts
1,354 battles

Hi,

Could you update this guide as I'm having trouble finding the relevant files needed to change camos as under <Textures> there is a new subsection called <Tile> with the path to the file but no information on what that camo is called in-game.

EDIT: Nevermind I found it, Permenant camoflage Is always unique camoflage and does not relate to ship groups which had me confused.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×