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 07-25-17, 03:06 PM   #361
the_frog
Commander
 
Join Date: Nov 2010
Posts: 456
Downloads: 17
Uploads: 0
Default

Hello folks,

so far, I only had a very brief look into the files and couldn't do any testing.

Some first impressions:

1. rather complex file structure
2. placement of textures in the Texture folder
3. textures, attached controllers, model setup, channels -- all fine

The way I would set up the files and the contents:

0. Use smaller textures; they are not very detailed so maps of 512 x 512 or 1024 x 1024 are sufficient, especially the submerged rock does not need a HR map
1. No texture in the Texture folder !!! All placed in the *.dat files
2. All material not changing over time removed from the _parts.files in the Library folder
3. Model of rock placed in the respective Location file, including texture.
4. Model of the platform and concrete base added into the Lighthouse files in the Land folder, including the respective texture
5. Either lantern and topmark remain the library file; then, a small cropped texture representing black and yellow metal can be placed into that file. Or place them also into the Land folder file. The lantern was likley not removed during wartime but just switched off. Therefore, it can stay; only the halo needs to "switched off".

More probably later the week (if I find some free time ...).
the_frog is offline   Reply With Quote
Old 07-25-17, 03:15 PM   #362
Anvar1061
Ocean Warrior
 
Join Date: May 2012
Location: In the sea, on land and above
Posts: 3,340
Downloads: 843
Uploads: 0
Default

Anvar1061 is online   Reply With Quote
Old 07-25-17, 04:18 PM   #363
MLF
Weps
 
Join Date: Sep 2002
Location: SW France
Posts: 361
Downloads: 137
Uploads: 0
Default

Inspiration.
__________________
Je pense donc je fuis!
MLF is offline   Reply With Quote
Old 07-25-17, 08:35 PM   #364
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Kendras View Post
I would like to correct all the sea depth of the area which is on the map I've posted.
This is the right time to do it, before we start placing lighthouses around the Atlantic coast of France

Quote:
Originally Posted by Kendras View Post
How can you modifiy the sea depth / terrain altitude with terrain editor ? I've never used it. Do you have to just change the color ? Is it a grey scale ?
Exactly, 256 shades of grey, each shade being a different height. Indeed, we need to know how many meters below the sea level each shade corresponds to. We don't have this information, all I can say righ away is that sea areas are marked with values from 0 to 47, and land areas go from 48 to 255 (0 being the deepest trench and 0 the highest peak) but...

Knowing that the globe is divided in 180 x 360 = 64,800 elevation squares having a resolution of 126 sq. pixels each, and that the three most external pixels on each side of each square are 'redundant' (i.e. they are overlapped with the outer border of the neighbouring squares), it is a matter of simple math deducing that each pixel on those squares is equal to 1 deg / (126 - 3 x 2) = 1/120 deg = 0.5 min = 30 sec = 1 km in the SHIII world. With those equations in mind, we can easily locate any set of SHIII-world coordinates on the height map.
Knowing how deep is that point in game, we can build our own chart with grey values on a column and depths in meters on the other column. I can imagine that there is a linear correlation between grey values and height values, so we don't have to repeat the process 256 times: two or three well space measures, maybe four to stay on the safe side, will be enough to plot a line which will tell us what is the right grey value for the (approximate) depth we want

Let's do an example with La Plate's position. Our lighthouse lies between 48 and 49 deg of latitude N, and 4 and 5 deg of longitude W. When we select a set of coordinates in SHIII extractor and we load a grid, SH3 TE will show a matrix of 3x3 squares, the central square having as top left coordinates the coordinates we have selected, so we should look for 49°N and 5°W if we want the square which actually encompasses La Plate's location to be loaded at the center of the 3x3 matrix:



The square higlighted in red is the one we are actually interested in, and the double green lines show the overlappings with surrounding squares.
When we export our square, again, it will be saved on file together with its neighbours in a raw file whose pixel resolution is 366 pixels (=120 pixels per square x 3 squares + 3 overlapping pixels per side x 2 sides). This is how it looks in PS, after converting it into a greyscale indexed image:



Note that I have added guidelines to it: the central area marked by the guidelines measures exactly 120 x 120 pixels, and it corresponds to the 1 deg x 1 deg quadrant that La Plate lies in.
Let's look for the exact position of our lighthouse now: we know that the bottom guideline marks 48 deg of latitude north. In SH metric units, that's 48 deg x 120,000 m/deg = 5,760,000 m. La Plate's position, from the mis file, is 5,764,737: a bit to the north of the line; 5,764,737 - 5,760,000 = 4,737: that's the metric distance between the top guidline on the elevation map and the lighthouse. Before, we had concluded that 1 pixel on that map was equal to 1,000 m, so if we want the distance from the bottom guideline in pixels we calculate 4,737 m / 1,000 m/pixel = 5 pixels. The calculation is similar for the longitude: the right guidline marks 5 deg of longitude west, -600,000 m in metric units. The lighthouse is placed at -571,143 m. -571,143 - (-600,000) = 28,857; 28,857 / 1,000 = 29 pixels from the right guidline. This is the pixel we were looking for, on the haight map:



For better readability I have zoomed in the map so only the zone comprised between the guidelines is visible (48-49°N, 5-4°W), and I have marked 'our' pixel with a selection mark. Its greyscale value is 46 by the way so, unless I made some gross mistake, we know now that a value of 46 on that indexed map, corresponds to an in-game depth of -17 m, and we also know that, if we want, we can do it shallower by one 'step', if we change that value from 46 to 47. Beyond that value, I think the area would still be submerged (the coastline map takes the priority for deciding what is sea and what land), but the area would probably be marked on the in-game navigation map as a brown pixel, as if it was land
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 07-26-17, 04:12 AM   #365
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by gap View Post
Exactly, 256 shades of grey, each shade being a different height. Indeed, we need to know how many meters below the sea level each shade corresponds to. We don't have this information, all I can say righ away is that sea areas are marked with values from 0 to 47, and land areas go from 48 to 255 (0 being the deepest trench and 0 the highest peak)
...
Knowing how deep is that point in game, we can build our own chart with grey values on a column and depths in meters on the other column. I can imagine that there is a linear correlation between grey values and height values, so we don't have to repeat the process 256 times: two or three well space measures, maybe four to stay on the safe side, will be enough to plot a line which will tell us what is the right grey value for the (approximate) depth we want
Precisely, the scale is not linear. A few months ago, I determined for almost all submerged pixels the exact depth, by changing colors of the scale (red-yellow-blue ... in order to distinguish between each depth) and putting land units on each depth in Mission Editor to know the exact depth.

Here is the scale :

 


Quote:
Originally Posted by gap View Post
Knowing that the globe is divided in 180 x 360 = 64,800 elevation squares having a resolution of 126 sq. pixels each, and that the three most external pixels on each side of each square are 'redundant'
Now, here is my idea : instead of searching the exact depth of each pixel (14400 for each square !) in Google Earth, let's take the map with red to blue scale I've posted, and convert into grey scale with the SH3 own scale, then apply to the SH3 map.

After that, I think we have to correct also the 3 pixels borders of the 9 squares around.
  Reply With Quote
Old 07-26-17, 05:26 AM   #366
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by the_frog View Post
Hello folks,

so far, I only had a very brief look into the files and couldn't do any testing.
Hi The_Frog, thank you

Quote:
Originally Posted by the_frog View Post
Some first impressions:

1. rather complex file structure
A while ago, Kendras asked me for some generic lighthouses that we can place around the globe while we wait for more accurate models to get available. My idea is creating models of real lighthouses and day beacons that can be stripped down to their basic elements. Those elements should be easy to combine in order to create the said generic lighthouses, and the file structure I have adopted is functional to this 'modular' concept

Quote:
Originally Posted by the_frog View Post
2. placement of textures in the Texture folder
I think I will move textures that are specific to a lighthouse unit, into the folder of that unit. All the remaining textures should remain in the tex folder, as I plan to re-use them on other models.

Quote:
Originally Posted by the_frog View Post
3. textures, attached controllers, model setup, channels -- all fine
Still, there's something wrong in our files, otherwise specular masks would work. I hope that apllying some of your suggestions below can solve the problem...

Quote:
Originally Posted by the_frog View Post
The way I would set up the files and the contents:

0. Use smaller textures; they are not very detailed so maps of 512 x 512 or 1024 x 1024 are sufficient, especially the submerged rock does not need a HR map
You are right; we are still at the alpha stage, but soon all the textures used by the model will be resized/compressed, especially the ones of the rock model. When it comes to textures and non-vectorial 2D art, my philosophy is: the bigger the source files, the better they will look once they are resized to their final size

Quote:
Originally Posted by the_frog View Post
1. No texture in the Texture folder !!! All placed in the *.dat files
If you mean in the same folder as the dat file, that's what I want to do. If you mean embedded in the dat files, I am a bit against embedded textures, essentially for two reasons:
a. they are not configurable; once you link a material to a 3d model and that material has a texture embedded, that model will have the same texture forever.
b. if you want to use the same texture on several dat files, you need to re-embed it as many times as the dat files that use it, with a total waste of disc stoting space and RAM.

Quote:
Originally Posted by the_frog View Post
2. All material not changing over time removed from the _parts.files in the Library folder
I don't get you here

Quote:
Originally Posted by the_frog View Post
3. Model of rock placed in the respective Location file, including texture.
The rock model might be re-used in other locations, that's why I decided to store it in the library file. If you look into stock locations, they are mostly composed of dummy nodes and placement nodes pointing to models in the harbor_kit.dat library file

Quote:
Originally Posted by the_frog View Post
4. Model of the platform and concrete base added into the Lighthouse files in the Land folder, including the respective texture
This is an option I had taken into consideration, but ad the end I decided to make it part of the rock terrain object, mostly for two reasons:
a. I don't want it to be destroyable
b. Ease of making terrain objects collisionable using the StaticObject controller

Quote:
Originally Posted by the_frog View Post
5. Either lantern and topmark remain the library file; then, a small cropped texture representing black and yellow metal can be placed into that file...
I don't get you. What would be the use of the cropped texture you are talking about?

Quote:
Originally Posted by the_frog View Post
...Or place them also into the Land folder file. The lantern was likley not removed during wartime but just switched off. Therefore, it can stay; only the halo needs to "switched off".
It is not only about the lantern or topmark being removed during wartime. As I mentioned before, we might proxy-clone the La Plate tower and use it in another position as a different type of sea mark. Depending on the type of mark we want to reproduce, we might need to replace or remove at all one or more library parts, including lantern and topmark.

Quote:
Originally Posted by the_frog View Post
More probably later the week (if I find some free time ...).
I am looking forward to listening to any other suggestion or remark you might come from you

Quote:
Originally Posted by Anvar1061 View Post
Amazing video Anvar1061, thank you for sharing, and by the way...

https://3dwarehouse.sketchup.com/mod...u-Fastnet-Rock
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 07-26-17, 05:53 AM   #367
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Kendras View Post
Precisely, the scale is not linear. A few months ago, I determined for almost all submerged pixels the exact depth, by changing colors of the scale (red-yellow-blue ... in order to distinguish between each depth) and putting land units on each depth in Mission Editor to know the exact depth.

Here is the scale :

 
Oh, amazing

Tha's exactly the scale we need, with the Terrain.act palette applied to it. You can replace each shade of blue on it with a grey value going from 0 to 47

Out of curiosity: do the first two values both correspond to -17 m?

Quote:
Originally Posted by Kendras View Post
Now, here is my idea : instead of searching the exact depth of each pixel (14400 for each square !) in Google Earth, let's take the map with red to blue scale I've posted, and convert into grey scale with the SH3 own scale, then apply to the SH3 map.
Sure, we can't do this work pixel by pixel

We are going to face some problems though:

1- what is the scale/projection of your depth map? If we want to do a decent work, that map should be stretched to fit the SHIII world

2- sure we can convert that colour map into a grey-scale image, but then grey values wouldn't have any relation with depths.

It would be better starting from a greyscale haight map. I have read on the web that, though a bit complicated, extracting height data from Google Earth is all but impossible.

Quote:
Originally Posted by Kendras View Post
After that, I think we have to correct also the 3 pixels borders of the 9 squares around.
That's going to be a real PITA
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 07-26-17, 06:16 AM   #368
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by gap View Post
Oh, amazing

Tha's exactly the scale we need, with the Terrain.act palette applied to it. You can replace each shade of blue on it with a grey value going from 0 to 47


Quote:
Originally Posted by gap View Post
Out of curiosity: do the first two values both correspond to -17 m?
I think so, but first value should not be used, as it can take blue or brown color, depending on the map scale...

Quote:
Originally Posted by gap View Post
2- sure we can convert that colour map into a grey-scale image, but then grey values wouldn't have any relation with depths.
Except if we "rescale" the SH3 map picture in order to be linear.

Quote:
Originally Posted by gap View Post
It would be better starting from a greyscale haight map. I have read on the web that, though a bit complicated, extracting height data from Google Earth is all but impossible.
That would be amazing !
  Reply With Quote
Old 07-26-17, 06:42 AM   #369
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Just a note : I realized that the map from Schnell Boot v2 is even better than the map from War Ace Campaign v4.1. So, we should use the one coming with SBM 2.
  Reply With Quote
Old 07-26-17, 07:53 AM   #370
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Kendras View Post
I think so, but first value should not be used, as it can take blue or brown color, depending on the map scale...
Maybe that's a feature. Let's take a mental note of it, just in case we will need something like that in future

Quote:
Originally Posted by Kendras View Post
Except if we "rescale" the SH3 map picture in order to be linear.
Believe me, that's not going to happen. The SH world is the way it is and, once you know the rules, everything is in its right place. Look for any known location on my spreadsheet if you don't believe it.
Sure, distances are not right, and land masses are stretched out, but there is no way we can squeeze a spherical world into a cylindrical one. The one thing we would achieve, is moving around islands, ports, straits, landmarks and other geographical features in unpredictable ways

Quote:
Originally Posted by Kendras View Post
That would be amazing !
Let's put us on that. Provided that we manage getting our hands on good quality grayscale heightmaps, we couldn't use them as they are. Reason is that shades of gray shown on them are a linear fucntion of RW heights, whereas in SHIII the relation is not linear. I have plotted data from your chart on an Excel graph and left the program to interpolate a likely tendency line. This is the result:

 


Before we could use any heightmap, we should adjust its tonal range to reflect the graph above...
__________________
_____________________
|May the Force be with you!|
...\/
gap is offline   Reply With Quote
Old 07-26-17, 08:06 AM   #371
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by gap View Post
Provided that we manage getting our hands on good quality grayscale heightmaps, we couldn't use them as they are. Reason is that shades of gray shown on them are a linear fucntion of RW heights, whereas in SHIII the relation is not linear.
Yes.

Quote:
Originally Posted by gap View Post
Believe me, that's not going to happen. The SH world is the way it is and, once you know the rules, everything is in its right place. Look for any known location on my spreadsheet if you don't believe it.
Sure, distances are not right, and land masses are stretched out, but there is no way we can squeeze a spherical world into a cylindrical one. The one thing we would achieve, is moving around islands, ports, straits, landmarks and other geographical features in unpredictable ways
You didn't understand me. I mean the picture of the SH3 scale, in photoshop or paint.net : for each meter of depth, and thanks to the scale i've posted, we add the correct grey used by SH3 (Terrain Editor). Then, we get a real depth map (heightmap for example), we create the depth color scale used by it, and put this scale just above the grey SH3 scale. And then, for each SH3 depth intervall (one unique grey color), we select all the colors from the real depth map scale, and convert them into the correct grey. Easy ! But maybe i'm not clear enough...
  Reply With Quote
Old 07-26-17, 08:37 AM   #372
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Kendras View Post
You didn't understand me. I mean the picture of the SH3 scale, in photoshop or paint.net : for each meter of depth, and thanks to the scale i've posted, we add the correct grey used by SH3 (Terrain Editor). Then, we get a real depth map (heightmap for example), we create the depth color scale used by it, and put this scale just above the grey SH3 scale. And then, for each SH3 depth intervall (one unique grey color), we select all the colors from the real depth map scale, and convert them into the correct grey. Easy ! But maybe i'm not clear enough...
I think I got you now

That would be easier if we had access to a bathymetric chart with several bands of different colours, each colour representing a range of heights, like the one below:

 

Okay, this is for wind speeds but you get the idea


Even easier if we had a graph showing bathymetric curves:

 



Working on colour gradients, as the ones in the graph we have currently available, makes things much more complicated
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 07-26-17 at 08:45 AM.
gap is offline   Reply With Quote
Old 07-26-17, 02:42 PM   #373
Anvar1061
Ocean Warrior
 
Join Date: May 2012
Location: In the sea, on land and above
Posts: 3,340
Downloads: 843
Uploads: 0
Default

Quote:
Originally Posted by Kendras View Post
Just a note : I realized that the map from Schnell Boot v2 is even better than the map from War Ace Campaign v4.1. So, we should use the one coming with SBM 2.
What card are you talking about? Show the path to the file and how it can be opened.
Anvar1061 is online   Reply With Quote
Old 07-26-17, 03:21 PM   #374
Kendras
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by Anvar1061 View Post
What card are you talking about? Show the path to the file and how it can be opened.
So here in WAC 4.1 :

 


And here in SBM 2 :

 
  Reply With Quote
Old 07-26-17, 03:32 PM   #375
the_frog
Commander
 
Join Date: Nov 2010
Posts: 456
Downloads: 17
Uploads: 0
Default

Hello gap,

before making things too complex -- what I was suggesting:

-- consider a less complex file structure (this may cause SH3 loosing track of all texture file paths ... that sometimes causes funny texture effects ....
-- this happens often preferentially with textures in the Texture folders ... that's why in GWX most textures were placed into the respective *.dat files or into the subfolders of the Air and Sea folder. Also, loading of large external texutures takes longer (and may cause fancy effects) than of embedded textures
the_frog 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 12:29 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.