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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 04-08-12, 03:57 AM   #16
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

The first time I tried to create this mod, I ran out of time and energy before I completed it. I left SH3 and then the files were lost. I had something to contribute to the community but I waited until it was perfect and ended up contributing nothing. This time I will show my work as it is performed so the successes and failures have some value to those interested. Feel free to use my work in your own mods.

I have a link in my signature to the files I am using. All of the mini mods will come with instructions for how I did my modding. I used GWX for the first voyage but might use a different GUI for one of the next voyages.

Here is what is available for download now. All JSGME compatible and documented. If you want to know how I did something, ask me and I will update the documentation.

Utility/Testing Mini Mods
11Bravo - Blank Campaign {Empty campaign files for fast loading during testing}
11Bravo - No Movies {Empty movie folders for fast loading during testing}
11Bravo - Navigation Missions {Pre-War missions used to understand the SH3 world, time, and sky models}

The first voyage was to understand how SH3 handles latitude, longitude, time, time zones. So the important mini mods are the chart and the clock.

Navigation Mini Mods
11Bravo - Nautical Chart {replaces your Map1 and Map2 files to give you accurate latitudes, longitudes, and nautical time zone lines }
11Bravo - Nautical Clock {modifies the xx_menu.txt file}

The megamods make heavy use of a few core files. Any small mod that comes along must learn to coexist. The two most common files are the menu_1024_768.ini and the xx_menu.txt. So here is the documentation for the Nautical Clock mod that allows you to manually mod your custom installation.

Code:
Modifies:

\data\Menu\en_menu.txt (existing file)

The xx_menu.txt files are often changed by the supermods.  It would be best to manually edit the xx_menu.txt file of the supermod of your choice.
Comment out entry 2703, and replace as shown below.

2703=|T: HHMM  TZ: HH-%02d  GMT: T+TZ|
;2703=|Local time: %02d:%02d
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-08-12, 04:06 AM   #17
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

@TorpLos

I am sure the clock mod will interfere with any megamod, so instructions for how to manually mod the en_ment.txt file are included.

The chart mod is a simple replacment of the two files that make up your navigation maps.

The quickest way to test anything out is to use JSGME to disable all your old mods, fire up the new one, and then begin your testing to see if it is incompatible. The utility mods I included make loading a lot faster during the testing process. If you hit an incompatibility, then you resort to manual editting of the megamod files...
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-08-12, 04:47 AM   #18
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

Here is the celestial navigation checklist

Nautical chart -- Mostly Done. The SH3 world is a cylinder with a grid spacing of 1° = 120 km. The mission editor outputs a simple text file that allows lat/lon to be entered in meters. This means simple time-speed-distance calculations should work at any latitude or heading and are easily tested with the tools on board. Current version of the chart is available for testing.

Nautical clocks -- In Testing. Accurate GMT/Local Time necessary for calculation of positions of stars. Looks like SH3 uses a separate time models for the sea and the sky. Sky GMT = T + TZ. TZ = HH - hh. Screen Clock gives T=HHMM. Mouse Clock gives hhmm. Available now.

Sextant -- In Development. Accurate elevation measurements are required for celestial navigation. Current sextants in SH3 are less accurate than necessary. My next project.

Celestial Data -- Not Started. SH3 might not calculate and display the proper positions of the stars, sun, and moon. The consensus is the stars look right, the sunrise/sunsets are close, and the moon is wrong. Will need to make many observations with accurate tools.

So the U-13 departs the Gulf von Guinea with orders to return to Kiel for a secret sextant development project. Nervous of a channel crossing in even these pre-war years, Bernard steers a heading of SW for the long way around...besides, it gives a chance to test the new clocks.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-08-12, 12:02 PM   #19
TorpLos
A-ganger
 
Join Date: Apr 2012
Posts: 71
Downloads: 35
Uploads: 0
Default

Glad your deciding to go all in on this project Bravo! I cant wait to chart my uboot with only the guide of the stars and sun!

And i hope i can get it working with my megamod and any other little mods i have. I always thought that it shouldnt be so difficult since its mostly the maps and a few options changing...
TorpLos is offline   Reply With Quote
Old 04-13-12, 04:51 PM   #20
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

Quote:
What does it all mean?

It means the SH3 Gods Must Be Crazy. It seems that the developers created one time system for the sea and one for the sky. Hopefully I'm wrong and this is all just a terrible mistake.
I was wrong and that is a good thing, because now I understand the SH3 clocks.

When you start a mission or a campaign, SH3 remembers the starting time zone, lets call that Base Time Zone, or BTZ. The two clocks are then offset from the correct time by the BTZ.

The theory I originally developed was based by studying the sunrise and sunsets after loading single missions with the mission editor. I tested the theory by cruising to different time zones and was getting the wrong results. I went back to the drawing board and made some new observations.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-13-12, 05:03 PM   #21
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default



I started this mission at 0°N 45°W in nautical time zone +03, which is now my base time zone, or BTZ. SH3 attempts to display the local time as the mouse time and the GMT as the screen time, but they are wrong. They are both offset from the correct time by the BTZ. I cruised from the starting position East making observations of sunrise and sunset.

Displayed above are the sunrise and sunsets together with the almanac data for the positions on those dates. If you add the BTZ to the dates SH3 displays, you will match the almanac times of sunrise and sunset.

Below are the results when I started at 0°N 45°E with BTZ -03 and cruised West.

__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-13-12, 05:20 PM   #22
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

What does all of this mean?

It means that the clocks in SH3 work when you correct them for an offset I will call Base Time Zone. Simply know the starting nautical time zone of the campaign or mission and subtract that number of hours from the two clocks and you will know the correct local or GMT time.

Thus ends the first voyage of the U-13. The purpose was to develop a nautical chart and nautical clocks necessary for celestial navigation. BDU is satisfied with the results. They decide that further testing of the clocks will require higher precision measurements than simple sunrise and sunset. We will need to make accurate measurements of the star positions.

Next up will be an accurate sextant. That will be the work of the second voyage. Here is a preview of the result using the prototype...


__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21

Last edited by 11Bravo; 04-13-12 at 08:24 PM.
11Bravo is offline   Reply With Quote
Old 04-13-12, 08:13 PM   #23
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

Now we are back at port let us talk about accuracy of positional measurement. Let us assume for now that SH3 displays the positions of the stars correctly. We can't determine that without an accurate sextant, so we will have to assume it for now. What type of measurement errors could we expect?

We need to think about the resolution of time and position. We need to think about what is possible. And what is necessary.

If we have a 8km or 16km environment for micro scale work like hydrophones or visual, then I think we can agree that 30km or 120km accuracy is good enough for macro scale work like rough positioning. Is that possible in SH3?

We should consider time first. SH3 has a stop watch that allows seconds to be added to the two clocks. My testing shows that the seconds are good to about 5 seconds for normal use. Heavy time compression and extended use will actually cause the second hand to stop working on 1X TC. Let the stopwatch run for 24 hours and it keeps accurate to about 5 seconds. Reset it when necessary and it is definitely good to 5 seconds and probably 1 second accuracy.

What does that mean?

If we assume 24 hours = 360 degrees for a celestial body, 5 seconds would indicate time errors of 0.02° or 2.5 km on planet SH3. Clearly, time will not be the limiting factor in positional accuracy. Even if we ignored seconds, 1 minute accuracy would allow 0.25° accuracy or 30 km.

Now let us consider position. SH3 is based on a 1024x768 pixel interface. Celestial navigation depends on the measurement of the altitude of the heavenly body from the horizon. The maximum altitude is 90°. If we try to measure 90° with 768 pixels to 1 pixel accuracy, we will have a minimum error of 0.12° or 14 km. We could cut this in half if we used 2 fields of view. But with eyeball measurements we shouldn't expect it better than about 14 km.

If the celestial model is not correct, we will have to create our own model that accurately predicts the SH3 displays.

I can tell you right now (but will show you later) that the star positions in SH3 are more accurate than can be displayed in the SH3 design.

What does it mean?

It means that SH3 is capable of more accuracy than the user interface is possible of allowing. My estimate is that the theoretical accuracy is 15 km because of the resolution of the gui. (See the picture above) My goal is to create a method good to 30 km. I will accept an accuracy of 120 km as useful for game purposes. Most of the time. Assuming a sober kaleun.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21

Last edited by 11Bravo; 04-14-12 at 07:20 AM.
11Bravo is offline   Reply With Quote
Old 04-20-12, 01:34 PM   #24
vanjast
Sea Lord
 
Join Date: Jun 2006
Location: Somewhere else now
Posts: 1,660
Downloads: 783
Uploads: 4
Default

A word on the clocks... It's a long time since I played with this so I'm a bit 'rusty'

The 'Ship Clock' is the one that jumps forward or backward an hour whenever you cross a timezones 'halfway mark'. This I think is true to real life, where one of the ships navigators duties is to check/set the ships clock everyday, to the correct timezone.

The other clock was either set for GMT time or your Base's time zone. I think there was a problem when you loaded a saved game and this time was now swopped around or set to your current timezone. So each time you saved you must keep a record of the timezones

This of course would throw a navigator into a 'didley'...
vanjast is offline   Reply With Quote
Old 04-20-12, 02:33 PM   #25
reaper7
sim2reality
 
Join Date: Jun 2007
Location: AM 82
Posts: 2,280
Downloads: 258
Uploads: 30
Default

@11Bravo check your email - first piece of the solution solved.

Edit: 2nd piece of the Solution solved - check mail.

Last edited by reaper7; 04-20-12 at 03:42 PM.
reaper7 is offline   Reply With Quote
Old 04-20-12, 05:14 PM   #26
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

Quote:
Originally Posted by vanjast View Post
A word on the clocks... It's a long time since I played with this so I'm a bit 'rusty'

The 'Ship Clock' is the one that jumps forward or backward an hour whenever you cross a timezones 'halfway mark'. This I think is true to real life, where one of the ships navigators duties is to check/set the ships clock everyday, to the correct timezone.

The other clock was either set for GMT time or your Base's time zone. I think there was a problem when you loaded a saved game and this time was now swopped around or set to your current timezone. So each time you saved you must keep a record of the timezones

This of course would throw a navigator into a 'didley'...
vanjast!! Your mod was my inspiration to study navigation in SH3. Thank you for your remarks. I will test the effect of saved games after I get the accurate sextant built. I will be posting today some measurements of the distortion with the SH3 cameras that have prevented accurate star altitudes from being measured.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-20-12, 05:21 PM   #27
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

Quote:
Originally Posted by reaper7 View Post
@11Bravo check your email - first piece of the solution solved.

Edit: 2nd piece of the Solution solved - check mail.
Got your email and will reply with the answer tonight.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21

Last edited by 11Bravo; 04-20-12 at 06:01 PM.
11Bravo is offline   Reply With Quote
Old 04-20-12, 06:28 PM   #28
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default Second Voyage

The U-13 has returned to port to assist a Kriegsmarine research project into optics. The aim is to understand distortions present in the "cameras" used at various stations. The immediate goal will be accurate altitude measurement of stars for celestial navigation, but there might be implications for Weapons Officers as well as these distortions could affect measuring accurate bearings and range.

There are two distortions present in the SH3 cameras which must be accounted for if we are to measure the altitude above the horizon of a heavenly body. The first is well known and encountered frequently in the game. This picture shows it well.



Even though the horizon displays as a flat line, the altitude to the sun or star appears to increase as bearing changes from the correct azimuth. Obviously we must center the object if we are to measure the altitude consistently and perhaps accurately.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-20-12, 07:03 PM   #29
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default

The second type of distortion depends on the altitude, not the bearing. To understand and measure it, we must first discuss the cameras.dat file, and the important parameters of the cameras for the stations we will use.

Veteran Kaleuns know of the awesome work by skwas on his Silent 3ditor and have used this tool to explore the inner workings of their u-boats and the SH3 environment. Every captain owes it to himself to download and use this tool to better understand the game, the work of the developers, and the modders. skwas!!



First we have to understand the vertical field of view (FOV) of the camera. There is a parameter called AngularAngle that I believe controls the horizontal field of view (untested). I have found that the vertical field of view is 0.8 of the AngularAngle. In other words the aspect ratio of the cameras is 5:4 horizontal to vertical. This was interesting to me because the aspect ratio of the GUI is 4:3 horizontal to vertical (1024x768).

Second we have to define two angular scales for the vertical. The first is Screen Altitude. It defines the vertical position of an object on the screen or viewport of the camera. It ranges from 0° at the bottom to the FOV° at the top. So if the AngularAngle of your camera is 75°, the vertical FOV is 0.8*75=60° and the Screen Altitude ranges from 0° to 60°. The second scale is Sky Altitude. It is the vertical position of an object in the game relative to the horizon. This is what we want to measure for celestial navigation. The horizon defines 0° of Sky Altitude. Other parameters control the link between these two scales.

Based on early measurements with linear sextants and reading the Subsim forums, it was clear to me that the star positions were tantalizingly close to accurate. It didn't make sense that they would be so close, but not correct. So I assumed they were correct, and that it was the game engine rendering that was "wrong", not the star positions. This implies that the game engine displays correct information incorrectly. And I can show you that it does just that.

There are two parameters in the cameras.dat that control the position of the horizon in external views. This is the Elevation Min and Max. Lets talk only of the Min for now. The Elevation Min is the Sky Altitude of the middle of the vertical FOV when the camera is tilted down all the way. In other words, it is the angle of the middle of the screen from the horizon. When the Elevation Min is 0°, the horizon displays in the middle of the screen. The purpose of the Elevation Min and Max is just that...to control where the horizon appears in external views. But if you carefully measure the position of the horizon, you will find it displays incorrectly.

The error is the second type of distortion present in SH3. It can be measured and a calibration curve created to allow correction of altitude measurements. This will be the basis of our accurate sextant.
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Old 04-20-12, 07:18 PM   #30
11Bravo
Medic
 
Join Date: Dec 2006
Location: Error Triangle
Posts: 168
Downloads: 157
Uploads: 0
Default



Look very closely at the image above. Here, my camera is the GWX Gold F11 Flak Station, with AngularAngle = 75° and hence VFOV = 60°. I ask the game engine to render the horizon in the middle of the screen at 30° up and it almost succeeds. I ask it to display at 50° up by setting Elevation Min to -20° and it displays too low by more than a degree. Asking it to display at 10° up by setting Elevation Min to +20° and it displays too high this time by about a degree.

The game rendering engine is displaying correct information incorrectly.

This is the second type of distortion in SH3. Objects in the upper half of the screen display too low, while objects in the lower half display too high. The errors are only on the order of a degree or so, but it is enough to make celestial navigation difficult. Together with the strange interpretation of local Zone Time and Greenwich Mean Time by the game clocks, it is no surprise that celestial navigation has eluded us within the SH3 world. Together with the lack of a proper navigation map with latitude, longitude, and time zone lines, it seems that they didn't quite implement what was possible.

The good news is that this can be measured and corrected for in the usual way of correcting sextant measurements for altitude. It is similar to a refraction correction (but quite different).
__________________
"Sounds of terror are in his ears; While at peace the destroyer comes upon him." -- Job 15:21
11Bravo is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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 04:25 AM.


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