SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 09-08-09, 05:40 PM   #1
bigepilot
Swabbie
 
Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
Default DDS FILES

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.

Last edited by bigepilot; 09-08-09 at 05:44 PM. Reason: Link added
bigepilot is offline   Reply With Quote
Old 09-08-09, 06:08 PM   #2
peabody
Admiral
 
Join Date: Jan 2008
Location: New York State, USA
Posts: 2,390
Downloads: 126
Uploads: 7
Default

Quote:
Originally Posted by bigepilot View Post
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
__________________

System Spec: Gigabyte GA-965P-DS3, PentiumD Dual Core Presler 945 3.4Ghz, Gigabyte Geforce 7600GS, 2-1GB Corsair XMS2 800Mhz in Dual Channel, 2-WD 250 SATA 3Gb/s, Onboard Realtek HD 7.1 Audio, DVD ROM, DVD burner, Hiper 580 Watt Power supply, WinXP SP2.

peabody is offline   Reply With Quote
Old 09-08-09, 06:32 PM   #3
bigepilot
Swabbie
 
Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
Default

Awesome answer peabody. Thanks. Now, any idea how to make it all work? You sure were not lying about the size of the file.
bigepilot is offline   Reply With Quote
Old 09-08-09, 06:44 PM   #4
bigepilot
Swabbie
 
Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
Default

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.

Last edited by bigepilot; 09-08-09 at 07:09 PM.
bigepilot is offline   Reply With Quote
Old 09-08-09, 07:53 PM   #5
karamazovnew
The Old Man
 
Join Date: Mar 2009
Location: Bucharest, Romania
Posts: 1,403
Downloads: 151
Uploads: 0


Default


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.
karamazovnew is offline   Reply With Quote
Old 09-08-09, 08:22 PM   #6
bigepilot
Swabbie
 
Join Date: Sep 2009
Posts: 11
Downloads: 0
Uploads: 0
Default

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?
bigepilot is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.