Log in

View Full Version : DDS FILES


bigepilot
09-08-09, 05:40 PM
Hey gents, I've recently posted about promotions and how to unlock higher ranks. I've manged to get that figured out (as well as promotions for myself). The big question I now have is the basics of a dds file, more importantly how the game actually calls for certain files.
The dds file that generates the crew management screen (sh4/data/menu/gui/layout/crewsystemsmanagement.dds) contains everything that can be displayed on that screen. How does the game actually come to display a certain set of pixels from that dds file for say a LT, both his picture in the compartment (seaman, PO, CPO, or officer) and the picture of his rank symbol next to his name? Are there commands or a controlling file somewhere else buried in the folders that tells the game the exact location of the desired art on the picture?
The crux of the issue is when I promote a LT his picture changes to that of a seaman, and the symbol of his rank is blank altogether. Anything over the rank of LT. produces the same result. Thanks in advance. I'll try to post a picture of the file converted to bitmap.

http://www.subsim.com/radioroom/showthread.php?t=155007 This thread shows the upper left of the image contained in th dds file.

peabody
09-08-09, 06:08 PM
Hey gents, I've recently posted about promotions and how to unlock higher ranks. I've manged to get that figured out (as well as promotions for myself). The big question I now have is the basics of a dds file, more importantly how the game actually calls for certain files.
The dds file that generates the crew management screen (sh4/data/menu/gui/layout/crewsystemsmanagement.dds) contains everything that can be displayed on that screen. How does the game actually come to display a certain set of pixels from that dds file for say a LT, both his picture in the compartment (seaman, PO, CPO, or officer) and the picture of his rank symbol next to his name? Are there commands or a controlling file somewhere else buried in the folders that tells the game the exact location of the desired art on the picture?
The crux of the issue is when I promote a LT his picture changes to that of a seaman, and the symbol of his rank is blank altogether. Anything over the rank of LT. produces the same result. Thanks in advance. I'll try to post a picture of the file converted to bitmap.

http://www.subsim.com/radioroom/showthread.php?t=155007 This thread shows the upper left of the image contained in th dds file.

I don't know all the answers but I do know some of it (and maybe all of it) comes from the Menu1024_768.ini file. Open that file with notepad and do a search for "crewsystemsmanagement" and you will see there is a LOT of stuff associated with it.
The .dds file has an alpha channel (selection layer) and parts are "cut out" using coordinates on that .dds. For example the small medals, if the .dds file didn't have an alpha channel they would be squares not shaped like the medal.

It also uses the Crewleft.dds and Crew page background.dds. for that same screen.

Peabody

bigepilot
09-08-09, 06:32 PM
Awesome answer peabody. Thanks. Now, any idea how to make it all work? :o You sure were not lying about the size of the file.

bigepilot
09-08-09, 06:44 PM
I think I may be getting the jist of it all. From what I gather the "crop" value for something called "rank indicator" would be the file sizing the image around the desired bitmap. So if I placed an icon in there for a LT. Cmdr all i would have to do is space the cropping over the same distance as the previous ones in the horizontal axis and it would be go time? I just have to figure out the specific "call" for the ranks. Also, the files call for a crewsystemsmanagement.tga and not a dds. Does a dds convert at some point during gameplay?

UPDATE: Tried to insert a crop at the suspected location and it was a no go. Not sure what to do now.

karamazovnew
09-08-09, 07:53 PM
:nope:
Stop and think for a second. You have dragable items (the crew), that dynamically change depending on their rank and your actions (draging them from station to station). Now look around the menu_1024_768.ini file and search for any type of condition. Found any? Nope... Take a well known item such as the Fire and Lock buttons. I have yet to find any instances of those items id's in any file in the game. How do they work you ask? Through hard-coding locked in dll and act files which are out of your reach. With the exception of dials (only in the periscope, attack map and bottom bar), you can't make any item in SH4 that does anything but sit there and look preety. All of the items that do something are actually controlled by the game's engine code (unmoddable). There are also hundreds of invisible and unused items there, left over from sh3 (such as the entire old orders buttons, complete with image files). I suggest you PM lurker or someone in the RFB team. They have done amazing work within the crew page and they might explain better how to reuse existing crew compartments through the menu_1024_768.ini file.

There are so few differences between the menu.ini file in SH4 and the one in SH3 that they didn't even bother to write "dds" as the extension for graphic files.For the game, either crewsystemsmanagement.dds or crewsystemsmanagement.tga are the same thing. The dds files are simple tga files, with absolutely no smart resolution scaling. Scaling is done by the Zone line of the items but I won't go into that here. The important thing is that you don't need to bother with the weird dds features, you can use tga files with any compression, with or without alpha channels.

And now to answer your main problem. Unlike in SH3, the portraits in SH4 are generic, not specific. You can't have 2 officers of the same rank with different faces (as you did in sh3). You can photoshop the crewsystemsmanagement.dds file as much as you want, but do so in the current layout of the items inside it. You don't have ANY other choice. You can make them moustaches and weird hats, but not much else. The reason why the icons act weird on promotions is the game code. The RFB manual explains well the ranks and why some ranks are skipped (or simply put the "if" statements in the code only accept certain rank numbers when deciding which portrait to show). You also can't go beyond the maximum nuber of officers or petty officers. That's why you have that bug. And, at least through the menu_1024_768.ini file, you can't solve it in any way.

bigepilot
09-08-09, 08:22 PM
I've gotten it to display the "doctored" picture (that I created from the dds and then converted back) of what a Lt. Cmdr's sleeve would look like (next to his name at the bottom of the crew management screen). I added an image that did not exist before. As long as you stay within the confines of the image it works. I could keep adding instances and go all the way to ADM if desired. It also displays when a LT. is promoted. So that part of the "bug" was just taking the time to find the coordinates.

As far as the draggable items go, they are still calling for specific instances on this dds image, which also change size when they go from inactive to on your ship, or from lead in the compartment to secondary, all of which are dynamic actions. I have found the x/y's for the images in the menu code. The only real problem now may be that "if" statement you speak of. Why the Lt. CMDR rank calls for image 1 i don't know. If you could offer help as to where to find that statement I would tend to think it would indeed be moddable. I just need to know where that "if" statement is located. Ideas?

karamazovnew
09-09-09, 05:21 AM
Of course you can add new images, but they don't do anything. For example, try the simple task to create a working Fire Torpedo button in the Nav Map... The method for creating the image object is piss easy... But specific hardcoding prevents adding commands to items outside the layout order page (page G3F, and i think even that doesn't work anymore in sh4 :wah:). When dealing with hard-coded elements, all you can do is reuse them, modify their assets (image, text), positions and so on. But the rules by which they work are impossible to touch. For example, you asked why the game uses a certain part of a tga file for a specific rank (not through menu.ini crop/zone line), and where to change that behavior. The quick answer is "hard-coded". By the way how many mat/crop elements does that item have? There's a possibility that the game uses some status images through hardcode. But I highly doubt it to be that illogical :hmmm:

My simple point in this and previous post is that the menu_1024_768.ini file only specifies item positions and look. How they behave when clicked and what they do then is taken from other files (some of which are "locked"). So I repeat my advice of not messing with that file, but instead contacting the authors of mods that have already modded the crew page, such as RFB or OM. :03: Good luck. And by the way, if you do find the "IF" files, post it on a new thread, I'll make it my home page :haha:.

bigepilot
09-09-09, 06:22 AM
There is a crewrrank (not sure of the exact heading at the moment) section that started with 12 mat/crop elements which I changed to 15. I then added 3 images (Lt. Cmdr, Cmdr, and Capt.) to the right of the original rank images on the bottom of the crewsystemsmanagement.dds at the same spacing intervals and then added their values horizonatally to the added crop numbers. In-game the new sleeve images show on both the "unused" or "availible" crew side of the crew management page as well as when they are moved to your sub. Also, if i change the current experience of say a Lt. Cmdr to 25,000, and then promote him to Cmdr on the boat, the sleeve image will change upon promotion (I've set the promotion values for ranks over Lt. to "base"). I did, however, manage to crash the game last night with repeated promotions:down:.

I have also found 4 instances for "samplecrew" in the menu file that I believe tie to the four rows of crew images (4 images per row) that have 4 mat/crops each. So, like you said the images are there and tie to specic calls...but changing those calls is the issue. Unless I've completely missed the boat ;) At the very least I have contacted lurker via PM as per your advice and he was kind enough to respond and say that he would look into it. I'll keep this post updated if I find anything out.

bigepilot
09-09-09, 02:03 PM
Well, the game is failing to start at all now with the modded menu file. It all started when I promoted a CMDR to Captain. The instant I hit the button the game exited and poof, won't start back up. The odd thing is that it worked for quite some time before that happened. Guess it's back to using the backup for now...

bigepilot
09-10-09, 06:37 PM
Bit of an update. Got the game to run again, as well as run a while without crashing during promotions. I think they were calling for global abilities and the higher ranks over LT. were set to NULL. Seems to be working well now. So it's back to the original square one of the game not recognizing the higher ranks as officers.