Log in

View Full Version : Modding Silent Hunter 1.


Sheppard
09-06-11, 05:13 AM
I've looked through the SUBS.DAT file for SH:CE and deciphered maybe 65-70% of it using UGE -- Universal Game Editor, a old DOS-era editor that still works quite well for old style games.

Here's the output file for the TENCH entry block in SUBS.DAT created by UGE:

================================================== =========================
Num. Variable name OFFSET VAR.TYPE RANGE
================================================== =========================
13 Tench Name #1 13921 9 letters TEXT
14 Tench Name #2 13931 9 letters TEXT
15 SHP File #1 13962 12 letters TEXT
16 SHP File #2 13976 12 letters TEXT
17 Surf Speed Range 14021 4 bytes +/- 2,147,483,648
18 Surf Range Speed 14025 4 bytes +/- 2,147,483,648
19 Subm Speed Range 14029 4 bytes +/- 2,147,483,648
20 Subm Speed Range 14033 4 bytes +/- 2,147,483,648
21 Bow TT 14037 4 bytes +/- 2,147,483,648
22 Stern TT 14041 4 bytes +/- 2,147,483,648
23 # Torp Bow 14045 4 bytes +/- 2,147,483,648
24 # Torp Stern 14049 4 bytes +/- 2,147,483,648
25 Deck Gun Count 14057 4 bytes +/- 2,147,483,648
26 Deck Gun Cal. (inch) 14061 4 bytes +/- 2,147,483,648
27 Length 14069 4 bytes +/- 2,147,483,648
28 Beam 14073 4 bytes +/- 2,147,483,648
29 Height 14077 4 bytes +/- 2,147,483,648
30 Test Depth 14081 4 bytes +/- 2,147,483,648
31 Periscope Depth 14085 4 bytes +/- 2,147,483,648
32 Radar Depth 14089 4 bytes +/- 2,147,483,648
33 Periscope Height 14093 4 bytes +/- 2,147,483,648
34 Radar Mast Height 14097 4 bytes +/- 2,147,483,648
35 Top Speed Surf 14109 10 letters TEXT
36 Top Speed Subm 14119 10 letters TEXT
37 Tench Surf Disp 14129 4 bytes +/- 2,147,483,648
38 Tench Subm Disp 14133 4 bytes +/- 2,147,483,648
39 Displacement Coeff 14137 4 bytes +/- 2,147,483,648
40 Tench Surf Power 14141 4 bytes +/- 2,147,483,648
41 Tench Subm Power 14145 4 bytes +/- 2,147,483,648
42 Surfaced Spd Coeff. 14149 4 bytes +/- 2,147,483,648
43 Submerged Spd Coeff. 14153 4 bytes +/- 2,147,483,648
44 # Diesel Motors 14181 4 bytes +/- 2,147,483,648
45 # Electric Motors 14185 4 bytes +/- 2,147,483,648
46 Diesel Fuel (gal) 14189 4 bytes +/- 2,147,483,648
47 Diesel Consumption?? 14193 4 bytes +/- 2,147,483,648
48 Surf Mot Coef. ??? 14197 4 bytes +/- 2,147,483,648
49 Surf Mot Coef. Stop? 14201 4 bytes +/- 2,147,483,648
50 Surf Mot Coef. 1/3 F 14205 4 bytes +/- 2,147,483,648
51 Surf Mot Coef. 2/3 F 14209 4 bytes +/- 2,147,483,648
52 Surf Mot Coef. STD F 14213 4 bytes +/- 2,147,483,648
53 Surf Mot Coef. FUL F 14217 4 bytes +/- 2,147,483,648
54 Surf Mot Coef. FLK F 14221 4 bytes +/- 2,147,483,648
55 Subm Mot Coef. ??? 14241 4 bytes +/- 2,147,483,648
56 Subm Mot Coef. Stop? 14245 4 bytes +/- 2,147,483,648
57 Subm Mot Coef. 1/3 F 14249 4 bytes +/- 2,147,483,648
58 Subm Mot Coef. 2/3 F 14253 4 bytes +/- 2,147,483,648
59 Sub. Mot Coef. STD F 14257 4 bytes +/- 2,147,483,648
60 Sub. Mot Coef. FUL F 14261 4 bytes +/- 2,147,483,648
61 Sub. Mot Coef. FLK F 14265 4 bytes +/- 2,147,483,648
================================================== =========================

A lot of these variables are inter-related; such as Surfaced/Submerged Power and the Surfaced/Submerged Speed Coefficients.

I've been able to edit in a pretty decent SSN-571 Nautilus into the game, but have been unable to find the numbers that handle battery capacity in SUBS.DAT; hence me posting this.

aanker
09-06-11, 01:19 PM
I've looked through the SUBS.DAT file for SH:CE and deciphered maybe 65-70% of it using UGE -- Universal Game Editor, a old DOS-era editor that still works quite well for old style games.

A lot of these variables are inter-related; such as Surfaced/Submerged Power and the Surfaced/Submerged Speed Coefficients.

I've been able to edit in a pretty decent SSN-571 Nautilus into the game, but have been unable to find the numbers that handle battery capacity in SUBS.DAT; hence me posting this.
With the PTC SH1 Database project by Kim Rønhof, Kim and others deciphered just about everything possible except for creation of new Patrol Zones. We were even playing with that idea when SH4 came out.

Kim created a program that combined all of Hawks Utilities plus changing the torpedo loadout and is called the Torpedo Change Tool - TCT.

Furthermore, WEAPONT.DAT, ROSTERXX, Subs.dat, Ships.dat, RosterX.dat, Carsub.dat, and PZ.dat were all deciphered with a hex editor and almost all important bytes and bits were located for everything. The introduction:
The PTC SH Database project main target is to decrypt the database structure of the Sh (1) game making it possible to change elements in the game.

The database structure of SH is not available, as the members of PTC do not have access to the source code. The Database projects object is to create a insight into the database structure making changes in the game possible.

Information produced by the project is the database structure as we think it is, but there is always a element of uncertainty, please keep this in mind.

A few of the database file have been analyzed by Kim’s Hex program, this program has made it relatively easy to gain insight into database such as patrol files and Data files, where different closely related data can be compared such as 2 nearly equal patrols where only firing 1 torpedo
differs, and comparing the different torpedoes (mark10/mark14 ex.)

A short test faze has evaluated changes in the databases, to se if change create the expected results (this has not always been the case)

SH Database structure : the elements :
The directory structure – under the silent hunter main directory there are the following subdirectories :
The result of all this work was the TCT.
The Subs.dat file
The Subs.dat file starts with byte 09
Then it lists
The different Sub types in text
Each listing is 32 bytes long the ending last 4 bytes hold the address where the
Data for the specific Subtype data is.

The specific Sub type data are each 1704 bytes long.
And start as follows Dec Hex
Type - - - - Address - - - - Low Byte - - - High byte
S-Class - - - 289 - - - - - - 21 01 - - - - 00 00
Barracuda - - 1993 - - - - - C9 07 - - - - 00 00
Narwhal - - - 3697 - - - - - 71 0E - - - - 00 00
P-Class - - - 5401 - - - - - 19 15 - - - - 00 00
Salmon - - - - 7105 - - - - - C1 1B - - - - 00 00
T-Class - - - 8809 - - - - - 69 22 - - - - 00 00
Gato - - - - 10513 - - - - - 11 29 - - - - 00 00
Balao - - - - 12217 - - - - - B9 2F - - - - 00 00
Tench - - - - 13921 - - - - - 61 36 - - - - 00 00


00000465:19 00 00 00 1C 00 00 00 A0 00 00 00 31 33 00 00 13 speed surface
00005577:18 00 00 00 1C 00 00 00 78 00 00 00 31 39 00 00 19 in text
00007281:18 00 00 00 1D 00 00 00 78 00 00 00 32 30 00 00 20
00010689:1A 00 00 00 1E 00 00 00 64 00 00 00 32 30 2E 37 20.75

00000481:00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 9 speed subm.
00005593:00 00 00 00 00 00 38 00 00 00 00 00 00 00 00 00 8 in text
00007297:00 00 00 00 00 00 39 00 00 00 00 00 00 00 00 00 9
00010705:35 00 00 00 00 00 38 2E 37 35 00 00 00 00 00 00 8,75

for example - I don't see battery capacity....... yet... Are you past the excerpts posted above and is this type of information that you're after?

Happy Hunting!

aanker
09-06-11, 01:25 PM
Battery would be Submerged Range, correct?

Hitman
09-06-11, 04:09 PM
Interesting, never had heard of that before aanker :up:

If I could have one thing, and only one modded by code into SH1, then that would be a huge reduction in enemy traffic. The amount of traffic and contacts, specially in areas where it was truly scarce in real life, is what killed a big part of the fun for me, as it made huge tonnage figures too easy. :down:

kgsuarez
09-06-11, 04:12 PM
I don't have anything useful to add as far as technical things go, but I would like to say that this is very interesting.

I downloaded a copy of this UGE program and tried to play around with my AOD install with it, but I couldn't figure out what to do. It just looks like a hex editor to me. I would like to be able to make some changes, or mods, to AOD as well. So I will be watching this thread for any more info about doing such things.

Sheppard
09-07-11, 01:04 AM
aanker:

Where's the following document you cite here:

The PTC SH Database project main target is to decrypt the database structure of the Sh (1) game making it possible to change elements in the game.

The database structure of SH is not available, as the members of PTC do not have access to the source code. The Database projects object is to create a insight into the database structure making changes in the game possible.

available? Googling that text returns this thread. It does no good to have deciphered SH's file formats if nobody knows about it but the project.

Sheppard
09-07-11, 08:08 AM
It just looks like a hex editor to me.

It's not a PURE hex editor, as it's file viewer screen displays things differently, in a format more legible to the average person. It also handles an editing front end; so that you don't need to write an editor; just give away the *.MDL file you've created.

I would like to be able to make some changes, or mods, to AOD as well. So I will be watching this thread for any more info about doing such things.

Let me take a quick look at AOD's files. The first thing you should do for editing with UGE, is to go into the game itself and write down everything possibly to do with numbers shown in the game. SH1 is very good about this, it displays a lot of game data in the game itself, so you know right away if your edits worked or didn't, and what to look for.

AOD...doesn't seem to be as easy.

kgsuarez
09-07-11, 08:05 PM
Sheppard, before you get too far into it I would advise you to take a look at the following excerpt from http://www.subsim.com/tips/tipaod.php (http://www.subsim.com/radioroom/../tips/tipaod.php).


Hex-Editing the Gamesave File for "Command Aces of the Deep - Ver.1.1"
**Copyright(C)2000 by Steven L. Hildebrand**
Yes, you can Hex-Edit the Command AOD game-save file to give yourself any sub type you want, as well as giving yourself a promotion, a medal, or changing your home port...wanna try a Mediterranean career without running the British ASW gauntlet at Gibralter?? No prob, hex edit your home port and load the edited gamesave file...instant Med Cruise! ;)

The reader uses this info at their own risk, I cannot be responsible if you manage to trash your files, or if your computer becomes possessed by the unclean spirit of Richard Nixon. Not my problem, dudes...

The following file addresses are in HEX, not Decimal:

48 = Rank
49 = Medals
4A = Sub Insignia
4B = Homeport
4C-4F = Assigned Patrol Grid
56 = # of Patrols
57-59 = Total Tonnage Sunk (See Notes Below)
5B-5D = Career Score (See Notes Below)
69 = Sub Type


Values for Sub Type:
00 = Type IIC
01 = Type IID
02 = Type VIIB
03 = Type VIIC
04 - TypeVIIC/41
05 = Type IXB
06 = Type IXC/40
07 = Type XXI


Values for Home Port:

00 = Bergen, Norway (11th Flotilla)
01 = Trondheim, Norway (13th Flotilla)
02 = Kiel (1st Flotilla)
03 = Wilhelmshaven
04 = Brest, France (9th Flotilla)
05 = Lorient, France
06 = St. Nazaire, France (6th Flotilla)
07 = La Rochelle, France (3rd Flotilla)
08 = Bordeaux, France
09 = La Spezia, Italy
0A = Salamis, Greece


Values for Rank:

00 = Leutnant
01 = Oberleutnant
02 = Kapitanleutnant
03 = Korvettenkapitan
04 = Fregattenkapitan


Values for Medals:

01 = Knights Cross
02 = Knights Cross w/Oak Leaves
03 = Knights Cross w/Oak Leaves & Swords
04 = Knights Cross w/Oak Leaves, Swords & Diamonds


Notes:

First, I can find no value/location for a sub crew's level of experience (green, veteran, etc.)...and since it has nothing to do with the number of patrols, I can only assume that it is determined by the number of ships you've sunk. Pity, since it would be nice to start a "career" in 1939 with a veteran crew.

Also, no location for the number of ships sunk, so the game must count the number of sunk-ship records in the game-save file. Speaking of which, my next task is to decode the sunk-ship portion of the career record.

**Very Important** -- the Hex values for total tonnage and career score are actually expressed backward. Let me explain...

On the save file I used for exploration, my total tonnage sunk was 181,244. This value, expressed in Hexidecimal, is "02 C3 FC" but in the gamesave file, it was written as "FC C3 02." My career score was 92270, or "01 68 6E" but it was written as "6E 68 01." Weird, eh?? I remembered this from decoding the gamesave files from many other games.

Don't know how to convert Decimal values into Hexidecimal?? It's easy if you have Win95 or Win98. Open up the Windows Calculator ... under "View," select "Scientific." Then select "Dec" from the toolbar, and type in your Decimal value (181244), then select "Hex" on the toolbar...your Decimal value will be converted into a Hex value (02C3FC).

Check Baffles!!


Steven ".High*Ping*Drifter." Hildebrand
Chicago, IL. [[ HighPingDrifter@hotmail.com (HighPingDrifter@hotmail.com) ]]

"And a thousand, thousand slimy things lived on...and so did I..."

As you can see, some of the work has already been done. I have used the information above myself in the past.

I'm going to try to give it another go. Maybe I can find some other useful things.

aanker
09-08-11, 10:57 AM
aanker:

Where's the following document you cite here:

available? Googling that text returns this thread. It does no good to have deciphered SH's file formats if nobody knows about it but the project.
I thought this was publicly available in the groups but I'm not having any luck finding it in either group (Yahoo). I'll write him and try and get permission. I agree, the more working on this, the better. Furthermore all of this work was wasted if nobody knows about it - right?

aanker
09-08-11, 03:50 PM
Good news, he zipped it up and will upload it. Very important work IMO and many hours invested. Please share what you find too ;) Your hex editor on steroids looks great !!

Sheppard
09-10-11, 02:53 PM
To what group though?

Will it be this one?

http://groups.yahoo.com/group/PacificThunder/

aanker
09-10-11, 03:53 PM
Yes, PacificThunder. I received the zip this morning and emailed back to see where he (or I) should put it - and did I have permission, etc, etc.

It seems logical that it should go there.

----

Sheppard
09-16-11, 06:27 PM
Are you ever going to upload it, or will it remain lost forever?

aanker
09-16-11, 09:00 PM
I am waiting for permission - we must do these things right. When he lets me know where he wants it, I'll post back when I upload it. Should be soon.... and worth the wait - hang on ;)

aanker
09-18-11, 03:22 PM
Okay Sheppard and anyone else,

I received permission from Kim, got a whole lot more data than I thought existed, and the files are in a zip:

Located in the Files section at:
http://games.groups.yahoo.com/group/PacificThunder/

Zip is called:
SH1database files.zip

Its description is:
"SH1 Database Project - Kim Rønhof"

I hope it is helpful because Kim put a lot of work into getting the info to make his tools for SHCE - SH1. I hate to see this work go to waste or get lost!

I also uploaded them here.
http://www.subsim.com/radioroom/downloads.php?do=file&id=3377

Happy Hunting!

Art

Sailor Steve
09-18-11, 10:40 PM
I downloaded a copy, so it shouldn't get lost. Also having it here at SubSim helps.

aanker
09-19-11, 11:06 AM
Thanks - I was looking for the 'like' button Sailor Steve - just kidding :) Subsim is too cool for that kind of thing anyway!

Happy Hunting!

Art

TorpX
12-28-11, 09:02 PM
Has anyone done any modding of SHCE with these tools lately?

aanker
12-28-11, 09:54 PM
Not as far as I know. Kim said he has no interest in doing any more with SHCE. Can't blame him for that, he worked hard on all his various tools for SHCE & SH4.

Hitman
12-29-11, 07:33 AM
I didn't know that Kim did any work for Sh4, can you elaborate a bit more please Art? :)

aanker
12-29-11, 12:06 PM
Kim made a patrol report generator that got the data from the various game files to produce a patrol report for the Pacific Thunder Campaign.
Your name, rank, boat, mission, weather, # torpedoes fired including results of ships sunk, dud, miss, hit. Also all commands & warnings so the skipper could reconstruct a patrol report from the data at the end of their patrol.

Along with the Patrol Report Generator he made TBox which could select the patrol zone, change the boat name, the date of departure, etc.
This TBox was specific to another set of files made by another member which re-made the campaign layers to be historically accurate, for example all special missions were the missions actually conducted during the War. 99% of all forward bases were also created along with appropriate traffic.

These campaign layers came with a license that they be destroyed when no longer in use - probably when the member left the PTC. They were heavily researched and well made. They were called the "Cycles mod". Too bad the creator licensed it like that. I really liked the Cycles mod and with a random number generator and an XL doc to select the mission, a single person could have their own little realistic campaign.

As you know, the game selects what mission you get by the ID number of the mission so Kim's TBox selected missions using missions from the Cycles mod. (cycles mod was so name because there were 15 cycles of three months each to complete the war from Dec 7th 41 - Aug 15, 1945).

So, that's the big picture. TBox set up the assigned patrol and after the mission was conducted the Report generator gathered data for the patrol report. Pretty cool.

Art

TorpX
12-29-11, 09:16 PM
I looked at some of the files in the zip, but they are all greek to me.

Did anyone ever figure out a way to reduce the merchant traffic, or change (or add) patrol zones?

aanker
12-29-11, 10:00 PM
Almost - very close but it didn't happen. Too bad

Happy Hunting!

Hitman
12-30-11, 09:54 AM
Wow, that was again excellent work by Kim :rock:

Sad that those revised PTC campaigns weren't released publically :dead:

CTarana
01-04-12, 08:29 AM
I wonder if the code for the APR-1 radar detector ever made it into Silent Hunter 1 or they ditched the whole thing? :salute:

ChristopherT

aanker
01-04-12, 11:53 AM
Many people have asked that question ..... I 'think' the code is in. I recall hearing a few things I never heard before in SHCE but I don't exactly remember.

I've sunk more hours into patrolling with SHCE than I care to admit but slowed down to one patrol a month when I joined the PTC in Feb 2002 and we switched to SH4 about a year after SH4 stabilized with 1.4 - 1.5.... and what I heard was before that. GoldWave will play all the sound files.

Whatever I heard was before 2002 and I only heard it once or twice so I can't say for sure.... lol - that's a long time ago!

Happy Hunting!

Art

CTarana
01-06-12, 09:18 AM
I use Goldwave to listen to EVP's. I suppose I could turn it loose on my SHCE folders and take a listen! :D

ChristopherT

Sheppard
02-10-14, 12:31 AM
Jesus, last time I logged in onto SUBSIM was 03-24-2012 at 07:39 PM!

Anyway, reason for up-voting this was I recently started learning C++; and I've actually ported some NASA rocket engine code to C++ and I can do simple text input/output using that code...now I want to move onto more advanced C++ programming; and programming a SH1 CE editor would be a good test :arrgh!:

Sheppard
02-10-14, 01:34 PM
And after several hours of banging my head on C++ code (first time reading multi-byte variables from a file on the hard drive); I have this output:


************************************************** *******
* SILENT HUNTER COMMANDER'S EDITION EDITOR (SCED) v1.00 *
************************************************** *******

1.) Edit SUBS.DAT File.

Choose Menu Item:

MENU SELECTION DISABLED


Test Depth for Sub Slot 0 is: 200 feet.
Test Depth for Sub Slot 1 is: 200 feet.
Test Depth for Sub Slot 2 is: 328 feet.
Test Depth for Sub Slot 3 is: 250 feet.
Test Depth for Sub Slot 4 is: 256 feet.
Test Depth for Sub Slot 5 is: 288 feet.
Test Depth for Sub Slot 6 is: 300 feet.
Test Depth for Sub Slot 7 is: 400 feet.
Test Depth for Sub Slot 8 is: 400 feet.
Holding for acknowledgement.


I've currently pulled a list of variables from the game after some study of my old notes plus those by the "SH1 Database Project - Kim Rønhof"


Variable Name Offset from Block Start (Calc)
Submarine Name #1 0
Submarine Name #2 10
SubType (Slots 0 to 8) 36
Unknown Byte 40
SHP File #1 41
SHP File #2 55
Month Built 72
Year Built 76
Month No Longer Available? 80
Year No Longer Available? 84
Maybe Active Month in Pacific? 88
Maybe Active Year in Pacific? 92
Unknown -- looks like a Year 96
Surfaced Range 100
Surfaced Speed at which range is achieved 104
Submerged Range 108
Submerged Speed at which range is achieved 112
Number of Bow TT 116
Number of Stern TT 120
Torpedoes in Bow Torpedo Room 124
Torpedoes in Stern Torpedo Room 128
BLANK 255/255/255/255 Space 132
Number of Deck Guns 136
Deck Gun Caliber (in Inches) 140
Blank Spot? May Be Deck Gun Positions 144
Length 148
Beam 152
Height (or Draft) 156
Test Depth 160
Periscope Depth 164
Radar Depth 168
Periscope Height 172
Radar Mast Height 176
Unknown -- Tench is 30 180
Unknown -- Tench is 50 184
Top Speed Surfaced 188
Top Speed Submerged 198
Surfaced Displacement 208
Submerged Displacement 212
Displacement Coefficient 216
Surfaced Power 220
Submerged Power 224
Surfaced Speed Coefficient 228
Submerged Speed Coefficient 232
Unknown - Tench is 2097 236
Unknown - Tench is 2097 240
Number of Diesel Motors 260
Number of Electric Motors 264
Diesel Fuel (gallons) 268
Diesel Fuel Consumption Rate? 272
Surfaced Motor Coefficient Astern Modifier? 276
Surfaced Motor Coefficient STOPPED 280
Surfaced Motor Coefficient 1/3 Ahead 284
Surfaced Motor Coefficient 2/3 Ahead 288
Surfaced Motor Coefficient Standard Ahead 292
Surfaced Motor Coefficient Full Ahead 296
Surfaced Motor Coefficient Flank Ahead 300
Unknown Variable 244
Unknown Variable 248
Unknown Variable 252
Unknown Variable 256
UNKNOWN - 140 in Tench 304
UNKNOWN - 70 in Tench 312
UNKNOWN - 163 in Tench 316
Submerged Motor Coefficient Astern Modifier? 320
Submerged Motor Coefficient STOPPED 324
Submerged Motor Coefficient 1/3 Ahead 328
Submerged Motor Coefficient 2/3 Ahead 332
Submerged Motor Coefficient Standard Ahead 336
Submerged Motor Coefficient Full Ahead 340
Submerged Motor Coefficient Flank Ahead 344
Descriptive Text of Submarine Class 368

Sheppard
02-10-14, 02:08 PM
Produced a file to crank out data for any sub in the game; here's a test run for slot 8.

NOTE: These are just integers; I still need to write code to output string data!


************************************************** *******
* SILENT HUNTER COMMANDER'S EDITION EDITOR (SCED) v1.00 *
************************************************** *******

Slot 0 (Stock S-Class)
Slot 1 (Stock Barracuda)
Slot 2 (Stock Narwhal)
Slot 3 (Stock P-Class)
Slot 4 (Stock Salmon)
Slot 5 (Stock T-Class)
Slot 6 (Stock Gato)
Slot 7 (Stock Balao)
Slot 8 (Stock Tench)

Choose Sub Slot: 8

DATA EXTRACTED FROM SUBS.DAT BELOW FOR YOUR SLOT CHOICE!

Month Built :2
Year Built :1945

Month Unavailable :10
Year Unavailable :1945

Month Sent to PTO? :2
Year Sent to PTO? :10

Unknown Year Variable :1945

Surfaced Range :12000
Speed at Which Surfaced Range Achieved :10

Submerged Range :95
Speed at Which Submerged Range Achieved :5

Bow Torpedo Tubes :6
Bow Torpedo Reloads :12

Stern Torpedo Tubes :4
Stern Torpedo Reloads :6

Number of Deck Guns : 2
Deck Gun(s) Caliber (Inches) : 5

Length (ft) : 312
Beam (ft) : 27
Draft (ft) : 15

Test Depth (ft) : 400
Periscope Depth (ft) : 65
Radar Depth (ft) : 48

Periscope Height (ft) : 68
Radar Mast Height (ft) : 40

Displacement, Surfaced : 1860
Displacement, Submerged : 2428
Displacement Coefficient : 2438

Power, Surfaced : 5400
Power, Submerged : 2740

Surfaced Speed Coefficient : 351 << This might be water drag?
Submerged Speed Coefficient : 688 << This might be water drag?

Number of Diesel Motors : 4
Number of Electric Motors : 4

Diesel Fuel (Gallons) : 117000
Diesel Fuel Consumption Rate? : 7209

ENGINE COEFFICIENTS:
-----------------------------------------------------------
Surfaced Astern Modifier : 100
Surfaced Stopped Coefficient : 0
Surfaced 1/3ds Ahead Coefficient : 40
Surfaced 2/3ds Ahead Coefficient : 93
Surfaced Standard Ahead Coefficient : 186
Surfaced Full Ahead Coefficient : 320
Surfaced Flank Ahead Coefficient : 400

Submerged Astern Modifier : 10
Submerged Stopped Coefficient : 0
Submerged 1/3ds Ahead Coefficient : 50
Submerged 2/3ds Ahead Coefficient : 120
Submerged Standard Ahead Coefficient : 190
Submerged Full Ahead Coefficient : 270
Submerged Flank Ahead Coefficient : 400

Muscellaneous Unknown Variables:
--------------------------------------------------------------------------
It's highly likely that the missing variables (or possible variables)

Maximum Flooding Level Capacity
Maximum Compressed Air Capacity
Maximum Oxygen Level Capacity
Maximum Battery Voltage Capacity

Are contained within these unknown variables:
-----------------------------------------------------------
Unknown Variable #4 : 30
Unknown Variable #5 : 50
Unknown Variable #6 : 2097
Unknown Variable #7 : 2097
Unknown Variable #8 : 65536000
Unknown Variable #9 : 688128
Unknown Variable #10 : 1389363
Unknown Variable #11 : 2503475
Unknown Variable #12 : -372
Unknown Variable #13 : -186
Unknown Variable #14 : -93

Holding for acknowledgement.

Sheppard
02-10-14, 03:01 PM
Actually I just remembered I made an error in decipering a variable:

Displacement, Surfaced : 1860
Displacement, Submerged : 2428
Displacement Coefficient : 2438 << this isn't a coefficient.

It's actually the "death displacement".

See, when you get damaged, your sub will start shipping water on board; and this will affect your displacement. Eventually, if you take on enough water, your submerged displacement will go above the Death Displacement; and you'll die.

I found this out when I tried to mod in the Nautilus into the Tench Slot -- the surfaced displacement -- 3,533 tons was above the death displacement; so each time I loaded the game, I died instantly from flooding. :rotfl2:

This mechanic is probably to simulate eventual death if you're stuck on the ocean floor above crush depth, but your boat is filling with water.

Sheppard
02-10-14, 08:03 PM
The variable at offset 272 is definitely the diesel fuel consumption rate.

It's however, set for an extremely large value; it's the daily fuel consumption in gallons if your engine(s) are running full tilt.

I think I've also figured out what these are:

Surfaced Motor Coefficient Astern Modifier?
Surfaced Motor Coefficient STOPPED
Surfaced Motor Coefficient 1/3 Ahead
Surfaced Motor Coefficient 2/3 Ahead
Surfaced Motor Coefficient Standard Ahead
Surfaced Motor Coefficient Full Ahead
Surfaced Motor Coefficient Flank Ahead

They're how much of your main propulsion plant is used to reach that speed (and also how many lights come on in the main propulsion control panel for that).

If your submarine has 2 electric motors; then if you have 200 for a submerged flank coefficient; you need to have both electric motors online to reach flank submerged speed.

I noticed this because now that I've got all the coefficients pulled out with my early editor and plotted in Excel for all eight subs; plus all the other variables; I can now discern data patterns.

Case in point:

Narwhal. 1 diesel and 2 electric motors; and her coefficient curves break down as:

Surfaced Astern Modifier 150
Surfaced Stopped Coefficient 0
Surfaced 1/3ds Ahead Coefficient 10
Surfaced 2/3ds Ahead Coefficient 33
Surfaced Standard Ahead Coefficient 50
Surfaced Full Ahead Coefficient 75
Surfaced Flank Ahead Coefficient 100

Submerged Astern Modifier 5
Submerged Stopped Coefficient 0
Submerged 1/3ds Ahead Coefficient 20
Submerged 2/3ds Ahead Coefficient 66
Submerged Standard Ahead Coefficient 100
Submerged Full Ahead Coefficient 150
Submerged Flank Ahead Coefficient 200

While the Gato/Balao/Tench classes all have 4 diesels and 4 electric motors; and have the following coefficients:

Surfaced Astern Modifier 100
Surfaced Stopped Coefficient 0
Surfaced 1/3ds Ahead Coefficient 40
Surfaced 2/3ds Ahead Coefficient 93
Surfaced Standard Ahead Coefficient 186
Surfaced Full Ahead Coefficient 320
Surfaced Flank Ahead Coefficient 400

Submerged Astern Modifier 10
Submerged Stopped Coefficient 0
Submerged 1/3ds Ahead Coefficient 50
Submerged 2/3ds Ahead Coefficient 120
Submerged Standard Ahead Coefficient 190
Submerged Full Ahead Coefficient 270
Submerged Flank Ahead Coefficient 400

Sheppard
02-10-14, 09:49 PM
I may have discovered the electric charge/discharge system variables.

What threw me off is that they are negative; so they have lots of 244/etc variables, so they appear to be placeholders at first.

So; there are two sets of four variables each. Each set appears right after the engine requirements for that mode (surfaced or submerged).

I think what clinches it is Narwhal.

While all subs have evenly matched charge/discharge statistics -- e.g. the S Class has the following stats:

DIESEL
-180
-150
-80
-50

ELECTRIC
-180
-150
-80
-50

And this sets the pattern for all the other boats; equal charge/discharge....except for Narwhal...

Which is...

DIESEL
-90
-50
-30
-10

Electric
-180
-100
-60
-20

Sheppard
02-11-14, 10:17 AM
I've advanced as far as I can in understanding the file format.

I think that unfortunately, battery capacity and oxygen capacity are hard coded as global variables; or if they aren't it's almost impossible to find them without a memory search to find the variables that keep changing when you're submerged; because there's no digital gauge that displays their status; just an imprecise analog gauge.

TorpX
02-11-14, 09:43 PM
Have you looked at any of the files related to the patrol zones and shipping?

Sheppard
02-11-14, 10:38 PM
No; I've been too busy trying to do a what if -- USS Nautilus ten years early. :arrgh!::har::/\\k:

Hitman
02-12-14, 09:47 AM
Looks great :up: Maybe the old SH1 realism fix by Vickers could give you more clues?

If I had to request one and only one change to the code, that would be to reduce the shipping to about 10% of what it is now during the patrols :D

TorpX
02-12-14, 11:37 PM
Looks great :up: Maybe the old SH1 realism fix by Vickers could give you more clues?

If I had to request one and only one change to the code, that would be to reduce the shipping to about 10% of what it is now during the patrols :D


That, and the inexplicable goof in the patrol zone dimensions, were my big peeves.

Sheppard
02-13-14, 02:42 AM
I believe I've identified four unknown variables in WEAPONS.DAT for torpedoes.

Like SUBS.DAT; speed in knots and range in yards is...for fluff purposes only.

The actual data is held in horsepower/drag variables, and there are two sets of it; one for each "FAST/SLOW" setting.