I've tried the BFEditor forums, and the BFSP forums, and I've used the sacred search tool, and I do not understand any of the threads, tuts etc. that I've found.
I'm trying to create a new atlas file to put lots of new selection icons into from a "\Ingame\Weapons\Icons\HUD\selection_alt\" folder, I've spent about 4 hours playing around and reading and re-reading and so on, but I can't work out what I'm supposed to do. I definitely don't understand the dice_TextureAtlasTool.exe or Rexman's tool.
Please help!
[?][HUD] How the hell do you make an atlas?
-
200rabbits
- Posts: 33
- Joined: 2008-08-30 09:47
[?][HUD] How the hell do you make an atlas?
Last edited by 200rabbits on 2009-12-06 16:48, edited 3 times in total.

-
Sniperdog
- Retired PR Developer
- Posts: 1177
- Joined: 2009-02-27 00:06
Re: [?][HUD] How the hell do you make an atlas?
<SIMPLE TUT: TEXTURE ATLASES FOR BEGINNERS>
OK now I'm no expert on this but I probably know enough to get what you need done. Going out on a limb here but I think you have a small enough job just avoid the texture tool, but maybe someone else can step in and explain how you use it, who knows.
For all examples I am going to reference the way PR does it as it is the PR Forums ; )
The first thing you would want to do is create an additional Texture atlas. Say you have the atlas's
MemeAtlas_030.dds
MemeAtlas_031.dds
MemeAtlas_032.dds
already created, start making a texture in photoshop called MemeAtlas_033.dds. If you have none already just start out with MemeAtlas_30.dds. From what I understand you've already done this so just make sure all the images are compressed together but not so much so that there will be overlap. Once you are done save the image as above (MemeAtlas_03<Whatever #you chose to use>.dds)and extract to the folder mod/menu/menu_client.zip\Atlas
Now the tough part
.
Navigate to the folder:
mod/menu/menu_server.zip\Atlas
You should have a file called AtlasList.con with this code in it:note the PR_MemeAtlas.tai might be named something different depending on what mod you're from.
If the file or those lines aren't there write them yourself
Next Open PR_MemeAtlas.tac (or whatever its called for you as long as it is a .tac file) in the same directory:
If for these icons you are replacing older files ensure that all your files are listed in here using search (control + f) and if they are in the file you are fine with this file. If not then add the appropriate lines at the bottom of the list with this basic template:
<directory of the texture in the menu_client folder with "menu" as the root> border
eg:
No idea why this is actually necessary but just do it lol
Once all your files are included in here the next thing you worry about is to make sure none of your files are in the exclude list which is
MemeAtlasExclude.lst (which is in the same directory we have been in)
if none are in this list, you are fine; if they are in the list remove them.
Finally the tough part which is editing the .tai file
Open up PR_MemeAtlas.tai in the same directory or whatever your .tai file is listed as.
Here is the very basic explanation of how the file works from the file itself:
----------------------------------------------------------------------------------------
menu\Atlas\PR_MemeAtlas.tai
<filename> <atlas filename>, <atlas idx>, <woffset>, <hoffset>, <width>, <height>
Texture <filename> can be found in texture atlas <atlas filename>, i.e.,
<group><idx>.dds with texture coordinates boundary given by:
A = ( <woffset>, <hoffset> )
B = ( <woffset> + <width>, <hoffset> + <height> )
where coordinates (0,0) and (1,1) of the original texture map correspond to coordinates A and B, respectively, in the texture atlas.
----------------------------------------------------------------------------------------
So basically in English what you are going to be doing is adding a line for each new image you want ingame. I will make the following line as an example of one of the textures from the actual HUD/Selection folder which is almost identical to what you need to do:
The final product will look like this:
So your code is going to look like this:
Menu/HUD/Texture/Ingame/Weapons/Icons/Hud/Selection_alt/my_weapon.tga Menu\Atlas\MemeAtlas_033.dds, 3, <[starting width pixel of icon]/[total width of map]>, <[starting height pixel of icon]/[total height of map]>, <[width of icon]/[total width of map]>, <[height of icon]/[total height of map]>
Now your going to have to find the 4 numbers at the end manually. The first thing you want to do is record the height and width of your image using the image/image size in photoshop. For this example the image is 2048 width and height. Now you need to record the starting and ending pixels of both the height and width of the image. To do this go to the ruler tool. When you click on a given pixel it will list the pixels height and width. By clicking the upper left corner of the icon you will get the starting height and width and then by dragging the other end to the bottom right corner you will get the height and width. Note: round to the pixel here and be sure you have the right pixels. Use the standard bf2 textures as templates.
Here is the example's pixels being measured in photoshop:

For the example the values (you can see them in the upper left corner of the example image) are:
Starting Width: 156
Starting Height: 1570
Width of icon: 150
Height of icon: 45
Next by doing some math you can find the four numbers in the file which are simply the numbers above divided by the total width and height rounded to 6-7 decimals (make sure you round the last decimal right
).
Starting Width: 156/2048 = .0761719
Starting Height: 1570/2048 = .766602
Width of icon: 150/2048 = .0732422
Height of icon: 45/2048 = .0219727
Finally take those 4 numbers and list them in order at the end of the line which once again looks like this:
Also note here that if the icons in question are already listed in the .tai file you need to replace the old values not create new ones but if they aren't just add these at the bottom of the list.
Hope that helps
OK now I'm no expert on this but I probably know enough to get what you need done. Going out on a limb here but I think you have a small enough job just avoid the texture tool, but maybe someone else can step in and explain how you use it, who knows.
For all examples I am going to reference the way PR does it as it is the PR Forums ; )
The first thing you would want to do is create an additional Texture atlas. Say you have the atlas's
MemeAtlas_030.dds
MemeAtlas_031.dds
MemeAtlas_032.dds
already created, start making a texture in photoshop called MemeAtlas_033.dds. If you have none already just start out with MemeAtlas_30.dds. From what I understand you've already done this so just make sure all the images are compressed together but not so much so that there will be overlap. Once you are done save the image as above (MemeAtlas_03<Whatever #you chose to use>.dds)and extract to the folder mod/menu/menu_client.zip\Atlas
Now the tough part
Navigate to the folder:
mod/menu/menu_server.zip\Atlas
You should have a file called AtlasList.con with this code in it:
Code: Select all
hudManager.addTextureAtlas "PR_MemeAtlas.tai"
hudManager.addTextureAtlas "MemeAtlas.tai"If the file or those lines aren't there write them yourself
Next Open PR_MemeAtlas.tac (or whatever its called for you as long as it is a .tac file) in the same directory:
If for these icons you are replacing older files ensure that all your files are listed in here using search (control + f) and if they are in the file you are fine with this file. If not then add the appropriate lines at the bottom of the list with this basic template:
<directory of the texture in the menu_client folder with "menu" as the root> border
eg:
Code: Select all
Menu\HUD\Texture\Ingame\Vehicles\Icons\Hud\VehicleIcons\t62.tga borderOnce all your files are included in here the next thing you worry about is to make sure none of your files are in the exclude list which is
MemeAtlasExclude.lst (which is in the same directory we have been in)
if none are in this list, you are fine; if they are in the list remove them.
Finally the tough part which is editing the .tai file
Open up PR_MemeAtlas.tai in the same directory or whatever your .tai file is listed as.
Here is the very basic explanation of how the file works from the file itself:
----------------------------------------------------------------------------------------
menu\Atlas\PR_MemeAtlas.tai
<filename> <atlas filename>, <atlas idx>, <woffset>, <hoffset>, <width>, <height>
Texture <filename> can be found in texture atlas <atlas filename>, i.e.,
<group><idx>.dds with texture coordinates boundary given by:
A = ( <woffset>, <hoffset> )
B = ( <woffset> + <width>, <hoffset> + <height> )
where coordinates (0,0) and (1,1) of the original texture map correspond to coordinates A and B, respectively, in the texture atlas.
----------------------------------------------------------------------------------------
So basically in English what you are going to be doing is adding a line for each new image you want ingame. I will make the following line as an example of one of the textures from the actual HUD/Selection folder which is almost identical to what you need to do:
The final product will look like this:
Code: Select all
Menu/HUD/Texture/Ingame/Weapons/Icons/Hud/Selection/Ataka_missile.tga Menu\Atlas\MemeAtlas_032.dds, 2, 0.0761719, 0.766602, 0.0732422, 0.0219727Menu/HUD/Texture/Ingame/Weapons/Icons/Hud/Selection_alt/my_weapon.tga Menu\Atlas\MemeAtlas_033.dds, 3, <[starting width pixel of icon]/[total width of map]>, <[starting height pixel of icon]/[total height of map]>, <[width of icon]/[total width of map]>, <[height of icon]/[total height of map]>
Now your going to have to find the 4 numbers at the end manually. The first thing you want to do is record the height and width of your image using the image/image size in photoshop. For this example the image is 2048 width and height. Now you need to record the starting and ending pixels of both the height and width of the image. To do this go to the ruler tool. When you click on a given pixel it will list the pixels height and width. By clicking the upper left corner of the icon you will get the starting height and width and then by dragging the other end to the bottom right corner you will get the height and width. Note: round to the pixel here and be sure you have the right pixels. Use the standard bf2 textures as templates.
Here is the example's pixels being measured in photoshop:

For the example the values (you can see them in the upper left corner of the example image) are:
Starting Width: 156
Starting Height: 1570
Width of icon: 150
Height of icon: 45
Next by doing some math you can find the four numbers in the file which are simply the numbers above divided by the total width and height rounded to 6-7 decimals (make sure you round the last decimal right
Starting Width: 156/2048 = .0761719
Starting Height: 1570/2048 = .766602
Width of icon: 150/2048 = .0732422
Height of icon: 45/2048 = .0219727
Finally take those 4 numbers and list them in order at the end of the line which once again looks like this:
Code: Select all
Menu/HUD/Texture/Ingame/Weapons/Icons/Hud/Selection/Ataka_missile.tga Menu\Atlas\MemeAtlas_032.dds, 2, 0.0761719, 0.766602, 0.0732422, 0.0219727Hope that helps
Last edited by Sniperdog on 2009-12-06 21:44, edited 3 times in total.


Will Stahl aka "Merlin" in the Squad community
-
200rabbits
- Posts: 33
- Joined: 2008-08-30 09:47
Re: [?][HUD] How the hell do you make an atlas?
Nice tut, and thanks...
but I've got about 80 new weapons here that're gonna need selection icons, and the icons are gonna want replacing on all the VBF2 weapons... please tell me I don't have to write a .tai file that long manually
but I've got about 80 new weapons here that're gonna need selection icons, and the icons are gonna want replacing on all the VBF2 weapons... please tell me I don't have to write a .tai file that long manually
Last edited by 200rabbits on 2009-12-07 13:23, edited 3 times in total.

-
Sniperdog
- Retired PR Developer
- Posts: 1177
- Joined: 2009-02-27 00:06
Re: [?][HUD] How the hell do you make an atlas?
Well It is a lot of work but its a job you only have to do once as from then on you can just replace the part of the image in the atlas that your changing once you've made it the first time. Your job can also be made easier if you map it out on paper and start figuring stuff like, well if the end pixel for this is 1130 then the start pixel for the next icon beneath it will be 1131 and because the height is 120 the end pixel will be 1151 etc... As long as you map it out carefully you should be able to come up with those values for large areas of the atlas in excel even. You say you have 80 weapons. Well if you make an 8 wide by 10 tall sheet in photoshop then the most number of custom values you can have is 20. They will be in a grid so there will be 8 different starting widths, 10 different starting heights, 1 icon width and 1 icon height value (because all the icons are the same size). You can see how a job like this can be made easier by just doing it carefully. Heck you shouldn't even need photoshop if you do some simple addition and work carefully.


Will Stahl aka "Merlin" in the Squad community
-
200rabbits
- Posts: 33
- Joined: 2008-08-30 09:47
Re: [?][HUD] How the hell do you make an atlas?
Excel... nice idea, thanks. I guess I'll just have to go for it.

-
200rabbits
- Posts: 33
- Joined: 2008-08-30 09:47
Re: [?][HUD] How the hell do you make an atlas?
One question:
For a 140x40 pixel selection icon in the very top right, would this be correct:
"Menu\Atlas\MemeAtlas_030.dds, 0, 0, 0, 140, 40"
?
EDIT - Ah, never mind, i get it.
For a 140x40 pixel selection icon in the very top right, would this be correct:
"Menu\Atlas\MemeAtlas_030.dds, 0, 0, 0, 140, 40"
?
EDIT - Ah, never mind, i get it.
Last edited by 200rabbits on 2009-12-07 16:30, edited 1 time in total.

-
ma21212
- Posts: 2551
- Joined: 2007-11-17 01:12
Re: [?][HUD] How the hell do you make an atlas?
man it would be nice if in vehicles when you choose what type of weapon you want youll get a hud menu just like when ur inf. (the scroll thing)




-
Sniperdog
- Retired PR Developer
- Posts: 1177
- Joined: 2009-02-27 00:06
Re: [?][HUD] How the hell do you make an atlas?
FYI that's the top left200rabbits wrote:One question:
For a 140x40 pixel selection icon in the very top right, would this be correct:
"Menu\Atlas\MemeAtlas_030.dds, 0, 0, 0, 140, 40"
?
EDIT - Ah, never mind, i get it.
you would want: "Menu\Atlas\MemeAtlas_030.dds, 0, 0, 0, 140/total size, 40/total size"
All the last four numbers will always be less then or equal to one because they are ratios. Be sure to use 6-8 decimal places for precision.
If you want just tell me the size of your total canvas and let me know the grid coordinates of a single button and I can tell you what it would be to use as a template. Otherwise if you get it then hop to it
Last edited by Sniperdog on 2009-12-07 17:49, edited 3 times in total.


Will Stahl aka "Merlin" in the Squad community
-
200rabbits
- Posts: 33
- Joined: 2008-08-30 09:47
Re: [?][HUD] How the hell do you make an atlas?
*facepalm*FYI that's the top left![]()
Last edited by 200rabbits on 2009-12-07 19:13, edited 1 time in total.

