MasaruKondera

[Flag Mod Tutorial]How the flags.atlas file works together with the flags.dds file

  • You need to play a total of 10 battles to post in this section.

10 posts in this topic

Posted (edited) · Report post

Heyho!

 

Sharing = Caring and thats why I wanna tell you something that I learned some time ago.

 

This should be a tutorial on the topic of creating flag mods. I've seen quite some people only replacing current flags and always going with the order from WG. This tutorial will show you how to create a flags.dds file like this one

fdmILaI.jpg

(size decreased to 25% of the original size, which was 2048 times 2048 for demonstration purposes)

which also works ingame in combination with a new flags.atlas file. Positive side effect: Updating your files will most probably take less time than before because you don't have to edit every flag again and the mod doesn't break so fast and gives you some time to react. Non existing flags in the atlas file just don't get displayed at all on a ship and the rest of the flag shows up wihtout any errors and problems because you changed the position values in the flags.atlas file which overwrites the original WG values which change every time. (so no longer changing national flags, only some missing commorative flags like a new oscar award flag and they do not show up most of the time anyway before you could update the mod)

 

It also requires quite a lot work for the first time but it is worth it.

 

Requirements:

  • Already exisitng new flags.dds file
  • Knowledge in Photoshop (or similar programs which support DDS)
  • Knowledge in Excel (or similar programs)
  • Time

 

The flags.atlas file

Let's start with investigating a standard flags.atlas file from WG.

 

0AYHguu.jpg

 

The beginning of the atlas file will always look like this:

 

page "flags.dds" 2048 1024

 

This basically tells the game about the owner of this atlas file. In this case it is a flags.dds file with a size of 2048px times 1024px. An important note would be that the numbers here are very important. They have to be the same size as the DDS file. Otherwise it won't work. Also very important: The numbers should always be 2x where X can be any number at all.

 

so it can be:

  • 2 (21)
  • 4 (22)
  • 8 (23)
  • 16 (24)
  • 32 (25)
  • 64 (26)
  • 128 (27)
  • 256 (28)
  • 512 (29)
  • 1024 (210)
  • 2048 (211)
  • and so on

 

Now let us inspect a "flag element" in the list. Let us just start with "poland" right away

 

"poland" { 0.000000 0.000000 0.098145 0.100586 }

 

But what does each value mean? They basically mean this:

 

"flag name" { positionX positionY positionX positionY }

 

But why do we have 2 postition numbers? Well, the first 2 positions (X & Y) are pointing to the top left corner of the flag and the second X & Y position point to the bottom right corner of the flag.

 

What does this mean for us? This basically means that we can create a simple calculation in Excel or similar programs to create the arrays for us just by providing the top left corner position, the width and the height of an flag which is very easy to do if you have photoshop. I sadly can't offer information on other programs though.

 

The Excel Table:

So we create an excel sheet and in my case i created different tabs which consists always only one kind of flag so that it is easier for me to read it. You might use it in the future if you want to sort it a bit.

(Like: Signal flags, Ship Flags [which are only obtainable via buying the most expensive bundels], nation flags and so on])

 

Here an example of how it looks like on my end:

kCI3BJW.png

 

Important here: You will enter values at the A,B, C and D colum. The K colum is basically only here to adjust the size if necesarry in the future. That would automatically update the J colum which gives us the necesary arrays for the flags.atlas file.

 

So for now only enter your size into the K colum. K1 = width and K2 = height.

 

 

Let's begin with the calculations

 

The F colum gets the following calculation in the first row:

=($A1/$K$1)

 

The $ means basically that it will always stay like that. In other words: Always use the A colum (absolute) and change the row (relative) if it gets copied downwards the A colum. and divide this value against the value in K1 (this will never change because both are made static via the $ sign, in other words K1 is an absolute reference for the colum and the row)

 

We press enter and see a 0 there. We click on F1 again and see that there is a box at the right bottom corner. We use this box, press and hold the left mouse button and drag it downwards the F row.

This will copy the function from above and will only change the row.

 

We repeat this with the following three calculations as well:

 

Enter at G1 the following calculation:
=($B1/$K$2)
drag and drop it to your desired row.

 

Enter at H1 the following calculation:

=(($A1+$C1)/$K$1)

drag and drop it again

 

Enter at I1 the follwing calculation:

=(($B1+$D1)/$K$2)

drag and drop it again.

 

It should look now similar to this table here:

wBsLRJa.jpg

 

Now let us enter the formula for the J row:

="{ " & TEXT($F1;"0,000000") & " " & TEXT($G1;"0,000000") & " " & TEXT($H1;"0,000000") & " " & TEXT($I1;"0,000000") & " }"

 

This will create the text automatically which we need for the flags.atlas file.

 

Drag and drop it again and we are nearly finished now.

 

Using Photoshop to fill the Excel table

 

Open up Photoshop, open up your flags.dds file and choose your rule/ruler tool.

YXGvM76.jpg

 

This tool is the only thing we need now. So zoom into your flags file and draw a line form the top left corner to the bottom right corner

Kc9kpxy.png

 

The ruler tool will show some values now (kinda like those)

qARGXUk.jpg

 

Now we have the X value, the Y value, the Width (B) and the Height (H) [German localization on my pc]

 

We enter the X value in the A colum, the Y value in the B colum, the width in the C colum and the height in the D colum.

 

the result in the J line after doing this will look similar:

{ 0,484375 0,000000 0,552246 0,050293 }

 

The final thing we need to do is exchanging the "," with a "." and the array is finished for the alpha flag. (if you have a diffrent character than "," exchange it with "." It has to be a "." otherwise your game will crash)

 

We now have basically everything that we need to create our own flags.atlas file which enables us to create our own way of sorting the flags and adding one new flag is now just copy paste into the flag file (adding the correct alpha mask) looking up the 4 values, entering them in Excel and adding them in the flags.atlas file with the correct name and the benefits are in my eyes bigger which justify the work for it.

 

Using the values in the atlas file

 

To use the values we need basically the name of the flag first. for that we open up the atlas and the dds file. We should basiclaly notice that they are kinda sorted. It always goes from top to bottom. Only on the right side it gets a bit confusing with those signal flags.

 

So you shouldn't have any problems at all finding the name of the flag.

 

The alpha flag for example has the name: "tester_alpha"

 

so we add the following line in the flags.atlas file:

 

"tester_alpha" { 0.484375 0.000000 0.552246 0.050293 }

 

and we have the alpha tester flag always on this position now. No changes needed for this flag anymore.

 

Our flags.atlas file should look like this now:

 

v3KZo0y.jpg

 

Repeat the steps from above, insert all values into the Excel file, copy the values in the J colum, insert it in the flags.atlas file with the correct flag name, exchange the "," with ".", and you will have less problems in the future. And don't forget to always save the excel file.

 

If you have any questions feel free to ask. If you need an example you can always download the latest version from my flag mod here

(Pls do not simply reuse my atlas file though)

 

One last thing: I recommend putting the signal flags to the complete left side (like i did in the first picture). They will hardly ever change (except they add one which is hardly ever the case).

Edited by MasaruKondera

5

Share this post


Link to post
Share on other sites

...okay so I have to ask. What's the flag that looks like a pixel censored Japanese flag? Is that the hentai flag? :teethhappy:

 

Great tutorial. Thanks for making this!


0

Share this post


Link to post
Share on other sites

Very detailed man, thanks for this +1


0

Share this post


Link to post
Share on other sites

Thank you! :great:

 

I've been looking for a mod that will have the Kaiserliche Marine (aka the pre mustache boy German navy, for the uninformed) fly their true war ensign instead of that kludge that WG put on all German vessels because of above mentioned screwball. Now thanks to this I can start making it myself! :bajan:


0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Thank you! :great:

 

I've been looking for a mod that will have the Kaiserliche Marine (aka the pre mustache boy German navy, for the uninformed) fly their true war ensign instead of that kludge that WG put on all German vessels because of above mentioned screwball. Now thanks to this I can start making it myself! :bajan:

 

or simply use already existing ones with an extenstion which changes the flag on a lot of vessels. (Bayern WW1 flat, Scharnhorst WW2 and much more)

 

...okay so I have to ask. What's the flag that looks like a pixel censored Japanese flag? Is that the hentai flag? :teethhappy:

 

Great tutorial. Thanks for making this!

 

Of course it's the hentai flag :trollface:

 

Edited by MasaruKondera

0

Share this post


Link to post
Share on other sites

Very well made tutorial Masaru. Thank you for sharing it!

Can you assign a specific flag to a specific ship, without affecting the other ships of the same nation, using this technique?

From what I experimented (and from what I can read from your tutorial), changing the atlas file only change the location of the corresponding flag.

 

What I'm really asking is how do you do your historical flag mod, where the imperial germany ships have the imperial flag for example. Can you do it using only the atlas, or do you need other changes?


0

Share this post


Link to post
Share on other sites

Very well made tutorial Masaru. Thank you for sharing it!

Can you assign a specific flag to a specific ship, without affecting the other ships of the same nation, using this technique?

From what I experimented (and from what I can read from your tutorial), changing the atlas file only change the location of the corresponding flag.

 

What I'm really asking is how do you do your historical flag mod, where the imperial germany ships have the imperial flag for example. Can you do it using only the atlas, or do you need other changes?

 

I basically adjust the gameparams.data file with each startup. It only changes the flags so there isn't a problem here. This requires a modded copy_reg.py file and some other files which tell the game to change the nationflag on specific hulls. I wouldn't be able to offer this mod if I wouldn't have some special friends that help me here data mining the hull names.

 

Some examples:

 "PGSC502_Emden_1908": {
    "A_Hull": {
      "nationFlag": "germany1921"
    }
  },
  "PGSC107_Yorck": {
    "B_Hull": {
      "nationFlag": "germany1935"
    },
    "C_Hull": {
      "nationFlag": "germany"
    }
  },

 

 

"PASB013_Arkansas_1912": {
    "HullDefault": {
        "nationFlag": "usa"
    }
  },  
   "PASC002_Chester_1908": {
    "A_Hull_1908": {
        "nationFlag": "usa1908"
    },
    "B_Hull_1917": {
        "nationFlag": "usa1912"
    }
  },

 

There are tons of diffrent namings because they changed that since the beginning and I sadly can't share the details here though.

 

I even added a complete new germany flag which isn't even in the WG files and the ship uses it :trollface:

 

I can offer you something else though. You can use my existing files but for more details contact me via PM pls


0

Share this post


Link to post
Share on other sites

Where are these files located anyway? I didn't see any mention of their locations in the game files.

 

You need the extractor from WG and then you have to extract the files in the folder content gameplay common flags. There are the original gamefiles.

0

Share this post


Link to post
Share on other sites

Thanks, I'll find the extractor. By any chance, is one able to just mod the existing dds file and replace it like we can for tanks in WoT?

 


0

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.