Log in

View Full Version : [TEC] GWX SH4TerrainEX Information!


Jeff-Groves
04-16-22, 02:20 PM
This is information You need to know when using ref's program.

When exporting from a ZHF to the RAW format the program adds 4 bytes to the start of the file! Tthey can easily be removed when opening the RAW in PhotoShop!
Failure to do this pushes all pixels 4 places out of place and can and probably will cause CTDs when transformed back to ZHF!

Images below show the proper settings.

Opening the RAW
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12476

Saving the RAW
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12477

astvitaliy1982
04-16-22, 04:46 PM
Hello) Tell me, is there a finished version of Sh4 Terrain Extractor? Is it possible to replace the squares of the map in the game (as in SH3 Ter Ex) and not add them?

Jeff-Groves
04-16-22, 05:28 PM
Only way to place the information in the BFD file is with a Hex Editor.
Then you need to edit the BFI file so sizes match.

I've done that several times so I know it works.

astvitaliy1982
04-16-22, 11:04 PM
I need help. Unfortunately, I am not a programmer and do not own this information... (I am currently working on editing the depths in SH4 and have rebuilt the entire Baltic and already half of the North Sea. This work differs from the one I did for SH3 by a much larger volume. But when I finish this mod, it will take up a lot of memory. I ask you to share information on how to replace the squares of the map but not add them to the Terrain/Data folder. If possible...

Jeff-Groves
04-16-22, 11:22 PM
If you add them into the BFD directly people would need to download the BFD.
That comes in at 1.04 GB compressed as it is now.

astvitaliy1982
04-17-22, 12:22 AM
Ok. I'll leave it as it is.

propbeanie
04-18-22, 10:21 AM
Astvitaliy1982, look in the Stock game for examples. In "Data / Terrain / Data" folder are folders E157N022, W158N022, W159N022 and W178N029, that each contain a same-named ZHF file. The SH4 game sees those files, and replaces the BFD data with those four "tiles" of terrain data. Hence, as Jeff-Groves mentions, you only need properly built data in a proper folder structure for the altered segments you make. The game does the rest of the BFD structure itself. The ZHF files are only 6kb each. :salute:

astvitaliy1982
04-18-22, 10:52 AM
Thanks for the information, I will study this issue.

astvitaliy1982
04-18-22, 11:01 AM
Jeff-Groves, can you give me a SH4 depth hint like you gave me in SH3?


// Depths in м

45 0 - 0xc4bb8000 = -1500.0
46 1 - 0xc3e00000 = -448.0
47 2 - 0xc3d00000 = -416.0
48 3 - 0xc3c00000 = -384.0
49 4 - 0xc3b00000 = -352.0
50 5 - 0xc3a00000 = -320.0

Jeff-Groves
04-18-22, 11:05 AM
propbeanie is correct as to how the Game works with the files.

The BFD file is nothing more then all the ZHF files and RL2 files bundled together end to end. There's no special compression added as the files are already compressed.
The BFI file contains the name and size of the files in the BFD.

I add and remove the files with 010 if I wish doing nothing but cut and paste operations.
Then a quick edit to the BFI and Bob's your Uncle!


SH4's depths should be exactly the Same. Only SH5 is a little different.

astvitaliy1982
04-18-22, 11:35 AM
These are the depths I use. I wanted to check them out, just in case...


// Depths in м


Terrain.act\In editor : Echo sounder in game


- 47 \ -20 : 14-15
- 46 \ -20,86 : 14-15
- 45 \ -21 : 14-15
- 44 \ -21,4 : 16-17
- 43 \ -23,5 : 17-18
- 43 \ -23,5 : 16-17
- 42 \ -25,3 : 19-20
- 41 \ -27,2 : 21-23
- 40 \ -29,4 : 24-25
- 39 \ -30,9 : 26-27

Jeff-Groves
04-18-22, 11:47 AM
Not sure how your reading the terrain.act file.

But I can tell you I don't trust the echo sounder.
I trust what the Devs told me and what the code shows me.

astvitaliy1982
04-18-22, 11:47 AM
I created squares on the map with a tint of 47 to 0, installed them in the game and compared their readings in the mission editor and in the game.

I would like to insure once again with your help...

Jeff-Groves
04-18-22, 11:54 AM
Send me a link to down load that square. I can look at it in 010 and tell you exactly what is the depth settings.

It's possible Mission Editor reads them wrong.
You must also take into account the possible slope between depths when sounding.

And in Game? Thermal layers can distort deep depth readings.

astvitaliy1982
04-18-22, 11:58 AM
Ok, sorry about the table, it's not complete. I have to explain it. I will send you the full answer a bit later.

Jeff-Groves
04-18-22, 12:00 PM
Any information can only help better understand the way the Game actually works.
:salute:

propbeanie
04-18-22, 01:25 PM
4 is the same as 3 in this regard as Jeff mentions, astvitaliy1982. You will notice though, with the "sounding" of the depth, seemingly a "variability" is added in. You do one sounding and get 13.8m, while the next is 14.2m, and the next 14.7, then back to 13.8. The depth seems to be centered on a figure, such as 15m, but will vary as you travel through the 'terrain'. If you reverse and did the same exact course, and were able to do a sounding at the exact same locations, I don't think you will find the same depth. What they should have done in the game, is have a "0" (zero) depth, as well as a -2m depth, such that you could have "shoals", with waves washing over them. Who needs a 2000m depth, when the crush depth of the sub is less than half of that? That way, you would potentially see more variability in the shallows. But what else would have been nice to have is low and high tides... :har: - a skipper would have to really pay close attention to their route as they travel in the South China Sea, or in your case, certain areas of the Baltic while enroute to the North Sea... :salute:

- I'll be willing to bet that the devs did what they did, so that the player would have to really work at running aground... lol

astvitaliy1982
04-18-22, 04:40 PM
My problem is that when building a map using the SH3 depth template, the depth error was plus or minus 80 meters. Where it should be 200m, I got 120m.
Then I went the other way and scanned the depths with an echo sounder. Meter by meter. And then the map began to turn out ...

https://i.postimg.cc/qqm9zkCk/1.jpg (https://postimg.cc/YLWXPB3V)

The blue and red borders are what have been redone.
Approximately correct ratio of depths is highlighted in red.
Blue, what I will redo.

If anyone is interested, here is my draft. Just install it via JSGME.
Inside each square folder there are three files, for example:

E003N058.ZHF
E003N058.raw
E003N058.psb

I need them for work. Therefore, the mod takes 385 MB.

https://drive.google.com/file/d/1SWcUrCtXNiB502aOLfe8kqPUL_Ir3qnt/view?usp=sharing

The deepest point of the Skagerrak should be about 660m, I had to draw it again, but the game engine does not allow me to do this(

This is the site I use to check depths:
https://portal.emodnet-bathymetry.eu/


The SH4 katra differs from the SH3 in its improved detail, if it is properly worked on.
But the stock version of the map is much worse in quality than in the third part of the game. Now I'll show you what I want
see depths in game:

Strait of the English Channel
https://i.postimg.cc/DyxxkjqK/image.jpg (https://postimg.cc/QHWQcq46)

North Sea
https://i.postimg.cc/R05fjKbB/image.jpg (https://postimg.cc/k2sBS6m1)

Baltic
https://i.postimg.cc/vBjGNL37/image.jpg (https://postimg.cc/zbCmLWm3)


I wanted to know if the depths of the fourth part are really the same as in the third, to make sure that I'm on the right track.

astvitaliy1982
04-18-22, 04:45 PM
I will write my scheme for constructing depths a little later. It has some interesting moments which I will share with you. I want to think about my answer.

propbeanie
04-18-22, 06:43 PM
As Jeff mentions in the first post here, you have to be aware of that potential for a 4 byte error. If you take the BFD database, and extract a segment to RAW, use PhotoShop to convert to greyscale, and then indexed color, as described in the GWX Terrain Extractor, do not "Save" the data in any other format other that PSD if you might want to edit it further at a later time. Once you go to Save back to RAW for a convert to ZHF, that's where you have to be careful with the "header" data as Jeff points out, else you have an improper file, although it does convert into a ZHF file. That might be why the game is not letting you re-edit a segment... ??

I'll be checking some of the "tiles" we did in FotRSU, and I'll let you know what we find with out stuff. We did a few files and had no apparent issues, but I am not going to be surprised that I don't find a "size error" when attempting to load the files again... which will mean that we have header errors in our files... :salute:

propbeanie
04-18-22, 11:43 PM
OK astvitaliy1982, I have gone through all of our FotRSU ZHF files (21 of them), and found that "Header error" that Jeff-Groves describes. Of the files, only a few are from the FotRSU days, while several are from the FOTRS days, a few from the TMO days, and a couple from the Stock game... ( :o - surely not! :haha: ) All have now been converted back and then Saved with a zero header (as Jeff-Groves mentions in the first post), and then converted back to ZHF files. I have pictures of the 601x601 pixel "tiles" from "Before" and "After" the proper Saves, as well as several screen shots of Pearl Harbor, and I do not see any obvious differences, though my mind does see a slight color shift in the color palette when looking at zoomed images. To say for certain if there is any differences between the files, I will have to find something prominent in one of the files, and try to compare that are fully zoomed-in. I do still have all of the "old" files, so I'll keep looking to see if I can find any discernible differences... other than the "error" I was getting when first attempting to open the RAW files in Photoshop... :salute:

astvitaliy1982
04-19-22, 01:02 AM
Don't rush to look for anything yet. So far, this is superfluous. I will prepare an article in which I will describe my method of building a map and together we will see exactly what needs to be done and in which direction to move.

astvitaliy1982
04-19-22, 02:58 AM
Forum member "ref", created his GWX SH4TerrainEX program for everyone who loves the Silent Hunter series of these games.
I think I managed to gain some experience in working with the program and I want to share my method.
I'll start with the method itself.

Building a depth map in Photoshop.

To find a map for SH games, I tried a bunch of maps from different sites, ranging from GIS to
matlab. I managed to find a map that was almost perfect for us. It is located on the website NGDC.NOAA.GOV

https://gis.ngdc.noaa.gov/index.html?bbox=-180.0,-90.0,180.0,90.0

so...

1) I go to this site, enter the latitude and longitude data, set the "image size" parameter to 4210.4210 and
I save the image as a PNG file. The latitude and longitude data I choose is such that it captures the area
three squares in width and two squares in height. My experience has shown that this is the best option. Can save
and one game square each, but the game will still not see this detail.

https://i.postimg.cc/3w1pJ9KX/15.jpg (https://postimg.cc/MccX97fH)

2) I open all these files in Photoshop and stitch them together. Then, I transfer the stitched image from RGB mode
indexed color mode. The file is converted to this format and creates its own, roughly speaking, "Terrain.act"

I choose the maximum allowed number of color cells, which is 255 shades.

https://i.postimg.cc/PJ4vtsBz/1170.png (https://postimg.cc/hQXtrw4f)

3) Next, I clean the map from the land, leaving only the places where there is water. Shades I don't need (squares)
are converted to white.

https://i.postimg.cc/HLxqzwYp/1171.png (https://postimg.cc/ZWGsKyvg)

4) Then I translate the color table into "Spectrum":

https://i.postimg.cc/WpMHMWGG/1173.png (https://postimg.cc/23SGYxXy)

5) Here the most interesting begins ... Here again I turn the land into white. Then very carefully
I find the necessary depth limits. Constantly checking with the map "The NGDC.NOAA.GOV" in different places of the world.

https://i.postimg.cc/VsDHGShv/1175.png (https://postimg.cc/rzRJzpM2)

https://i.postimg.cc/1zhWnD8C/1176.png (https://postimg.cc/YvRNTGfY)

6) I designate these depth limits on my map with different colors.

https://i.postimg.cc/jqFGXgCC/1177.png (https://postimg.cc/fkY2Wvch)

https://i.postimg.cc/bYtKm0nT/1178.png (https://postimg.cc/F1hWRLDd)

This is the most delicate work in fashion...
Further, knowing all the depth limits, I begin to insert my depths into the color palette, which correspond to the depths
SH3. Knowing the depth number -16.0 and the depth number -52.0, I specify these two values ​​as the start and end.
The program itself builds the gradient. Etc. As a result, I get this image:

https://i.postimg.cc/fW0TN0G2/1179.png (https://postimg.cc/vDbd7DHf)


7) Then, I convert this image to the "Grayscale" format and drag the file into the already prepared
project with our squares from the game.

https://i.postimg.cc/Ls6LCV00/1180.png (https://postimg.cc/HrRrjbmQ)

8) Then I compare all this, move it, cut it into squares and paste it into the game.



This is a rather superficial description describing the method of constructing a map.
A little later I will write about the depths themselves in the game.

astvitaliy1982
04-19-22, 03:59 AM
In general, the larger the scale of the work, the easier it is to work with it. No need to waste time on each square.

astvitaliy1982
04-19-22, 05:37 AM
This post will be long to fit all the information I have in one place.

// SH3 depths (by Jeff-Groves) in measures

45 0 - 0xc4bb8000 = -1500.0
46 1 - 0xc3e00000 = -448.0
47 2 - 0xc3d00000 = -416.0
48 3 - 0xc3c00000 = -384.0
49 4 - 0xc3b00000 = -352.0
50 5 - 0xc3a00000 = -320.0
51 6 - 0xc3900000 = -288.0
52 7 - 0xc3800000 = -256.0
53 8 - 0xc36a0000 = -234.0
54 9 - 0xc35c0000 = -220.0
55 10 - 0xc3530000 = -211.0
56 11 - 0xc34a0000 = -202.0
57 12 - 0xc3410000 = -193.0
58 13 - 0xc3380000 = -184.0
59 14 - 0xc32f0000 = -175.0
60 15 - 0xc3260000 = -166.0
61 16 - 0xc31d0000 = -157.0
62 17 - 0xc3140000 = -148.0
63 18 - 0xc3090000 = -137.0
64 19 - 0xc3000000 = -128.0
65 20 - 0xc2f00000 = -120.0
66 21 - 0xc2de0000 = -111.0
67 22 - 0xc2d00000 = -104.0
68 23 - 0xc2c20000 = -97.0
69 24 - 0xc2b40000 = -90.0
70 25 - 0xc2aa0000 = -85.0
71 26 - 0xc2a00000 = -80.0
72 27 - 0xc2980000 = -76.0
73 28 - 0xc2900000 = -72.0
74 29 - 0xc2880000 = -68.0
75 30 - 0xc2800000 = -64.0
76 31 - 0xc2700000 = -60.0
77 32 - 0xc2600000 = -56.0
78 33 - 0xc2500000 = -52.0
80 35 - 0xc2300000 = -44.0
81 36 - 0xc2200000 = -40.0
82 37 - 0xc2140000 = -37.0
83 38 - 0xc2080000 = -34.0
84 39 - 0xc1f80000 = -31.0
85 40 - 0xc1e00000 = -28.0
86 41 - 0xc1d00000 = -26.0
87 42 - 0xc1c00000 = -24.0
88 43 - 0xc1b00000 = -22.0
89 44 - 0xc1a00000 = -20.0
90 45 - 0xc1900000 = -18.0
91 46 - 0xc1880000 = -17.0
92 47 - 0xc1800000 = -16.0

------------------------------

------------------------------
// Heights in m
48 - 0x40800000 = 4.0
49 - 0x40a00000 = 5.0
50 - 0x40c00000 = 6.0
51 - 0x41000000 = 8.0
52 - 0x41200000 = 10.0
53 - 0x41400000 = 12.0
54 - 0x41600000 = 14.0
55 - 0x41700000 = 15.0
56 - 0x41800000 = 16.0
57 - 0x41900000 = 18.0
58 - 0x41a00000 = 20.0
59 - 0x41b00000 = 22.0
60 - 0x41c00000 = 24.0
61 - 0x41d00000 = 26.0
62 - 0x41e00000 = 28.0
63 - 0x41f00000 = 30.0
64 - 0x42000000 = 32.0
65 - 0x42080000 = 34.0
66 - 0x42100000 = 36.0
67 - 0x42180000 = 38.0
68 - 0x42200000 = 40.0
69 - 0x42280000 = 42.0
70 - 0x42300000 = 44.0
71 - 0x42380000 = 46.0
72 - 0x42400000 = 48.0
73 - 0x42480000 = 50.0
74 - 0x42500000 = 52.0
75 - 0x42580000 = 54.0
76 - 0x42600000 = 56.0
77 - 0x42680000 = 58.0
78 - 0x42700000 = 60.0
79 - 0x42780000 = 62.0
80 - 0x42800000 = 64.0
81 - 0x42880000 = 68.0
82 - 0x42900000 = 72.0
83 - 0x42980000 = 76.0
84 - 0x42a00000 = 80.0
85 - 0x42a80000 = 84.0
86 - 0x42b00000 = 88.0
87 - 0x42b80000 = 92.0
88 - 0x42c00000 = 96.0
89 - 0x42c80000 = 100.0
90 - 0x42d00000 = 104.0
91 - 0x42d80000 = 108.0
92 - 0x42e00000 = 112.0
93 - 0x42e80000 = 116.0
94 - 0x42f00000 = 120.0
95 - 0x42f80000 = 124.0
96 - 0x43000000 = 128.0
97 - 0x43040000 = 132.0
98 - 0x43080000 = 136.0
99 - 0x430c0000 = 140.0
100 - 0x43100000 = 144.0
101 - 0x43140000 = 148.0
102 - 0x43180000 = 152.0
103 - 0x431c0000 = 156.0
104 - 0x43200000 = 160.0
105 - 0x43240000 = 164.0
106 - 0x43280000 = 168.0
107 - 0x432c0000 = 172.0
108 - 0x43300000 = 176.0
109 - 0x43340000 = 180.0
110 - 0x43380000 = 184.0
111 - 0x433c0000 = 188.0
112 - 0x43400000 = 192.0
113 - 0x43480000 = 200.0
114 - 0x43500000 = 208.0
115 - 0x43580000 = 216.0
116 - 0x43600000 = 224.0
117 - 0x43680000 = 232.0
118 - 0x43700000 = 240.0
119 - 0x43780000 = 248.0
120 - 0x43800000 = 256.0
121 - 0x43840000 = 264.0
122 - 0x43880000 = 272.0
123 - 0x438c0000 = 280.0
124 - 0x43900000 = 288.0
125 - 0x43940000 = 296.0
126 - 0x43980000 = 304.0
127 - 0x439c0000 = 312.0
128 - 0x43a00000 = 320.0
129 - 0x43a40000 = 328.0
130 - 0x43a80000 = 336.0
131 - 0x43ac0000 = 344.0
132 - 0x43b00000 = 352.0
133 - 0x43b40000 = 360.0
134 - 0x43b80000 = 368.0
135 - 0x43bc0000 = 376.0
136 - 0x43c00000 = 384.0
137 - 0x43c40000 = 392.0
138 - 0x43c80000 = 400.0
139 - 0x43cc0000 = 408.0
140 - 0x43d00000 = 416.0
141 - 0x43d40000 = 424.0
142 - 0x43d80000 = 432.0
143 - 0x43dc0000 = 440.0
144 - 0x43e00000 = 448.0
145 - 0x43e80000 = 464.0
146 - 0x43f00000 = 480.0
147 - 0x43f80000 = 496.0
148 - 0x44000000 = 512.0
149 - 0x44040000 = 528.0
150 - 0x44080000 = 544.0
151 - 0x440c0000 = 560.0
152 - 0x44100000 = 576.0
153 - 0x44140000 = 592.0
154 - 0x44180000 = 608.0
155 - 0x441c0000 = 624.0
156 - 0x44200000 = 640.0
157 - 0x44240000 = 656.0
158 - 0x44280000 = 672.0
159 - 0x442c0000 = 688.0
160 - 0x44300000 = 704.0
161 - 0x44340000 = 720.0
162 - 0x44380000 = 736.0
163 - 0x443c0000 = 752.0
164 - 0x44400000 = 768.0
165 - 0x44440000 = 784.0
166 - 0x44480000 = 800.0
167 - 0x444c0000 = 816.0
168 - 0x44500000 = 832.0
169 - 0x44540000 = 848.0
170 - 0x44580000 = 864.0
171 - 0x445c0000 = 880.0
172 - 0x44600000 = 896.0
173 - 0x44640000 = 912.0
174 - 0x44680000 = 928.0
175 - 0x446c0000 = 944.0
176 - 0x44700000 = 960.0
177 - 0x44780000 = 992.0
178 - 0x44800000 = 1024.0
179 - 0x44840000 = 1056.0
180 - 0x44880000 = 1088.0
181 - 0x448c0000 = 1120.0
182 - 0x44900000 = 1152.0
183 - 0x44940000 = 1184.0
184 - 0x44980000 = 1216.0
185 - 0x449c0000 = 1248.0
186 - 0x44a00000 = 1280.0
187 - 0x44a40000 = 1312.0
188 - 0x44a80000 = 1344.0
189 - 0x44ac0000 = 1376.0
190 - 0x44b00000 = 1408.0
191 - 0x44b40000 = 1440.0
192 - 0x44b80000 = 1472.0
193 - 0x44bc0000 = 1504.0
194 - 0x44c00000 = 1536.0
195 - 0x44c40000 = 1568.0
196 - 0x44c80000 = 1600.0
197 - 0x44cc0000 = 1632.0
198 - 0x44d00000 = 1664.0
199 - 0x44d40000 = 1696.0
200 - 0x44d80000 = 1728.0
201 - 0x44dc0000 = 1760.0
202 - 0x44e00000 = 1792.0
203 - 0x44e40000 = 1824.0
204 - 0x44e80000 = 1856.0
205 - 0x44ec0000 = 1888.0
206 - 0x44f00000 = 1920.0
207 - 0x44f40000 = 1952.0
208 - 0x44f80000 = 1984.0
209 - 0x45000000 = 2048.0
210 - 0x45040000 = 2112.0
211 - 0x45080000 = 2176.0
212 - 0x450c0000 = 2240.0
213 - 0x45100000 = 2304.0
214 - 0x45140000 = 2368.0
215 - 0x45180000 = 2432.0
216 - 0x451c0000 = 2496.0
217 - 0x45200000 = 2560.0
218 - 0x45240000 = 2624.0
219 - 0x45280000 = 2688.0
220 - 0x452c0000 = 2752.0
221 - 0x45300000 = 2816.0
222 - 0x45340000 = 2880.0
223 - 0x45380000 = 2944.0
224 - 0x453c0000 = 3008.0
225 - 0x45400000 = 3072.0
226 - 0x45440000 = 3136.0
227 - 0x45480000 = 3200.0
228 - 0x454c0000 = 3264.0
229 - 0x45540000 = 3392.0
230 - 0x45600000 = 3584.0
231 - 0x45680000 = 3712.0
232 - 0x45700000 = 3840.0
233 - 0x45780000 = 3968.0
234 - 0x457c0000 = 4032.0
235 - 0x45820000 = 4160.0
236 - 0x45860000 = 4288.0
237 - 0x458a0000 = 4416.0
238 - 0x458e0000 = 4544.0
239 - 0x4594d000 = 4762.0
240 - 0x45960000 = 4800.0
241 - 0x45a20000 = 5184.0
242 - 0x45a92000 = 5412.0
243 - 0x45b12000 = 5668.0
244 - 0x45b6b000 = 5846.0
245 - 0x45be0000 = 6080.0
246 - 0x45c20000 = 6208.0
247 - 0x45c92000 = 6436.0
248 - 0x45d04000 = 6664.0
249 - 0x45d76000 = 6892.0
250 - 0x45db6000 = 7020.0
251 - 0x45e36000 = 7276.0
252 - 0x45e76000 = 7404.0
253 - 0x45ee8000 = 7632.0
254 - 0x45f68000 = 7888.0
255 - 0x45fa0000 = 8000.0

Use the ref terrain editor - this is the best I can suggest


-------------------------------------------------- ------------------------

When opening files 21600_10800.RAW or 4320_2160.RAW in Photoshop, which are in the game along the file path:
Silent Hunter Wolves of the Pacific\Data\Terrain\Maps
We open medium and long scale maps.
To work with depths, we change the map file from the "Grayscale" mode to the "Indexed Colors" mode,
open the color palette and see this picture.

https://i.postimg.cc/KzgbtrYw/1182.png (https://postimg.cc/G8r6CDGx)upload photo (https://postimages.org/ en/)

This is our depth in the game.

https://i.postimg.cc/50jqxg3H/Depths.jpg (https://postimages.org/)


In total, we have 3 stripes of 16 squares - 48 depth values,
and 13 bands of 16 squares - 208 height values.

These are the main colors of the depths and heights that the game reads.

R=0, G=0, B=0, that is, the deepest place in the game is perfectly black, all values ​​in which are equal to zero.

If you look at the rest of the squares, then the color values ​​\u200b\u200bwill be equal to 1,1,1; 2,2,2; 3,3,3; ...; 47.47.47; In total, we get 48 squares from 0 to 47.
Altitude values ​​range from 48 (the skyline) to 255 (the highest place in the game).

Now look at this table.

--------------------------------

92 - 47 \ -20 gray
91 - 46 \ -20.86 gray
90 - 45 \ -21 gray
89 - 44 \ -21.4 gray
88(87) - 43 \ -23.5 red
87 - 43 \ -23.5 red
86 - 42 \ -25.3 blue
85 - 41 \ -27.2 blue
84 - 40 \ -29.4 blue
83 - 39 \ -30.9 blue
----------------------
82(83) - 39 \ -30.9 blue
81 - 38 \ -33.8 blue
80 - 37 \ -36.7 blue
79 - 36 \ -39.9 brown-green
78 (79) - 36 \ -39.7 brown-green
77 - 35 \ -44 brown-green
76 - 34 \ -48 brown-green
75 - 33 \ -52 brown-green
74(75) - 33 \ -52 brown-green
73 - 32 \ -56 brown-green
72 - 31 \ -60 brown-green
----------------------
71(70) - 30\-64 red
70 - 30 \ -64 red
69 - 29 \ -68 blue
68 - 28 \ -72 blue
67(68) - 28 \ -72 blue
66 - 27 \ -76 blue
65 - 26 \ -80 blue
64(65) - 26\-80 blue
63 - 25 \ -85.48 blue
62 - 24 \ -90.5 brown-green
-----------------------
61(62) - 24 \ -90.5 brown-green
60 - 23 \ -98.4 brown-green
59(58) - 22 \ -105.00 brown-green
58 - 22 \ -104.67 brown-green
57 - 21 \ -111.93 brown-green
56 (55) - 20 \ -121.10 brown-green
55 - 20 \ -121.12 brown-green
54 - 19 \ -128.32 brown-green
53 (54) - 19 \ -129.61 brown-green
52 - 18 \ -137.49 red
51(52) - 18 \ -138.34 red
50 - 17 \ -149.80 red
49(48) - 16 \ -159.77 red
48 - 16 \ -157.13 red
----------------------
47(46) - 15 \ -167.81 blue
46 - 15 \ -168.36 blue
45 - 14 \ -177.92 blue
44(45) - 14 \ -175.27 blue
43 - 13 \ -186.83 blue
42(43) - 13 \ -186.58 blue
41 - 12 \ -193.83 blue
40(41) - 12 \ -194.31 blue
39 - 11 \ -200 brown-green
38(39) - 11 \ -200 brown-green
37(36) - 10 \ -200 brown-green
36 - 10 \ -200 brown-green
35(34) - 9 \ -200 brown-green
34 - 9 \ -200 brown-green
33(32) - 8 \ -200 brown-green
32 - 8 \ -200 brown-green
----------------------
31(32) - 8 \ -200 brown-green
30(29) - 7 \ -200 brown-green
29 - 7 \ -200 brown-green
28(27) - 6\-200 brown-green
27(27) - 6\-200 brown-green
26(27) - 6\-200 brown-green
25(24) - 5\-200 red
24 - 5 \ -200 red
---------------------
23(24) - 5 \ -200 red
22(21) - 4\-200 red
21 - 4 \ -200 red
20(21) - 4\-200 red
19(18) - 3\-200 red
18(18) - 3\-200 red
17(18) - 3\-200 red
16(18) - 3\-200 red
15(18) - 2 \ -200 gray-transparent (dark gray + red)
14 - 2 \ -200 gray-transparent (dark gray + red)
13(14) - 2\-200 dark gray
12(14) - 2 \ -200 dark gray
11(9) - 1\-200 dark gray
10(9) - 1 \ -200 dark gray
9(9) - 1 \ -200 dark gray
8(9) - 1 \ -200 dark gray
7(14) - 2 \ -200 dark gray
6(9) - 1 \ -200 dark gray
5(9) - 1 \ -200 dark gray
4(9) - 1 \ -200 dark gray
3(0) - 0 \ -200 dark gray
2(0) - 0 \ -200 dark gray
1(0) - 0 \ -200 dark gray
0(0) - 0 \ -200 dark gray

--------------------------------------------------

Decryption:
The game has 48 depth colors in the Terrain.pal file
0 - maximum depth
47 - minimum depth
-------------------------------------------------- -
92 - 47 \ -20 gray

92 - the color value of the minimum depth in Photoshop before indexing the file and converting it to .raw
47 is the real color of the minimum depth in the game after indexing and converting the file to . raw
(that is, if you need this color in the game, then in Photoshop you need to choose color 92)
-20 is the actual color depth of 47 in mission editor.
Gray is the color of depth in the mission editor.
-------------------------------------------------- --
-------------------------------------------------- --
88(87) - 43 \ -23.5 red

(87) - this value means that Photoshop does not read color 88 but replaces it with color 87.
(and since the raw depth file we are working with was taken from the game, it means that the game does not see the color 88 a
replaces it with a nearby one 87);
-------------------------------------------------- -
-------------------------------------------------- -

92 - 47 \ -20 gray
91 - 46 \ -20.86 gray

-20.86 - a comma means that the depth of this color can range from -20.1 to -20.99.
-------------------------------------------------- --
It follows from this that the game has depths of 300m, 1000m, but the game does not generate them graphically on the map,
or depths below 200m are prescribed differently.


And now the same table but with echo sounder readings.

Photoshop: in the game: in redactor. : sonar readings.


92 - 47 \ -20 14-15 gray
91 - 46 \ -20.86 14-15 gray
90 - 45 \ -21 14-15 gray
89 - 44 \ -21.4 16-17 gray
88(87) - 43 \ -23.5 17-18 red
87 - 43 \ -23.5 16-17 red
86 - 42 \ -25.3 19-20 blue
85 - 41 \ -27.2 21-23 blue
84 - 40 \ -29.4 24-25 blue
83 - 39 \ -30.9 26-27 blue -----------------
----------------------
82(83) - 39 \ -30.9 26-27 blue
81 - 38 \ -33.8 28-30 blue
80 - 37 \ -36.7 31-32 blue
79 - 36 \ -39.9 34-35 brown-green
78(79) - 36 \ -39.7 34-35 brown-green
77 - 35 \ -44 38-40 brown-green
76 - 34 \ -48 43-45 brown-green
75 - 33 \ -52 46-47 brown-green
74(75) - 33 \ -52 47-48 brown-green
73 - 32 \ -56 52-53 brown-green
72 - 31 \ -60 55-57 brown-green ----------
----------------------
71(70) - 30 \ -64 57-60 red
70 - 30 \ -64 58-61 red
69 - 29 \ -68 61-63 blue
68 - 28 \ -72 64-70 blue
67(68) - 28 \ -72 67-70 blue
66 - 27 \ -76 71-72 blue
65 - 26 \ -80 74-77 blue
64(65) - 26 \ -80 74-78 blue
63 - 25 \ -85.48 78-81 blue
62 - 24 \ -90.5 84-90 brown-green
-----------------------
61(62) - 24 \ -90.5 84-90 brown-green
60 - 23 \ -98.4 89-94 brown-green ---------
59(58) - 22 \ -105.00 99-100 brown-green
58 - 22 \ -104.67 100-103 brown-green
57 - 21 \ -111.93 102-104 brown-green
56 (55) - 20 \ -121.10 115-121 brown-green
55 - 20 \ -121.12 115-121 brown-green
54 - 19 \ -128.32 118-128 brown-green
53 (54) - 19 \ -129.61 118-128 brown-green
52 - 18 \ -137.49 127-132 red
51(52) - 18 \ -138.34 128-137 red
50 - 17 \ -149.80 140-151 red
49(48) - 16 \ -159.77 145-156 red
48 - 16 \ -157.13 146-157 red
----------------------
47(46) - 15 \ -167.81 153-168 blue
46 - 15 \ -168.36 156-168 blue
45 - 14 \ -177.92 167-174 blue
44(45) - 14 \ -175.27 168-178 blue
43 - 13 \ -186.83 178-186 blue
42(43) - 13 \ -186.58 179-188 blue
41 - 12 \ -193.83 184-193 blue
40(41) - 12 \ -194.31 185-195 blue
39 - 11 \ -200 193-208 brown-green
38(39) - 11 \ -200 193-206 brown-green
37(36) - 10 \ -200 196-212 brown-green
36 - 10 \ -200 197-216 brown-green
35(34) - 9 \ -200 207-226 brown-green
34 - 9 \ -200 207-228 brown-green
33(32) - 8 \ -200 225-238 brown-green
32 - 8 \ -200 226-245 brown-green
----------------------
31(32) - 8 \ -200 233-246 brown-green
30(29) - 7 \ -200 255-246 brown-green
29 - 7 \ -200 255-270 brown-green
28(27) - 6 \ -200 285-306 brown-green
27(27) - 6 \ -200 292-309 brown-green
26(27) - 6 \ -200 297-311 brown-green
25(24) - 5 \ -200 315-342 red
24 - 5 \ -200 315-333 red
---------------------
23(24) - 5 \ -200 319-331 red
22(21) - 4 \ -200 341-359 red
21 - 4 \ -200 347-367 red
20(21) - 4 \ -200 347-367 red
19(18) - 3 \ -200 374-395 red
18(18) - 3 \ -200 374 395 red
17(18) - 3 \ -200 374-395 red
16(18) - 3\-200 374-398 red
15(18) - 2 \ -200 375-400 gray-transparent (dark gray + red)
14 - 2 \ -200 405-430 transparent gray (dark gray + red)
13(14) - 2 \ -200 400-427 dark gray
12(14) - 2 \ -200 410-425 dark gray
11(9) - 1 \ -200 446-452 dark gray
10(9) - 1 \ -200 438-460 dark gray
9(9) - 1 \ -200 439-469 dark gray
8(9) - 1 \ -200 445-466 dark gray
7(14) - 2 \ -200 446-472 dark gray
6(9) - 1 \ -200 439-469 dark gray
5(9) - 1 \ -200 over 1000 dark gray
4(9) - 1 \ -200 over 1000 dark gray
3(0) - 0 \ -200 over 1000 dark gray
2(0) - 0 \ -200 over 1000 dark gray
1(0) - 0 \ -200 over 1000 dark gray
0(0) - 0 \ -200 over 1000 dark gray

------------------------------------

Jeff-Groves
04-19-22, 03:27 PM
I don't doubt other depths show when you echo sound them.
Any transition from one depth height to another has a slope to it.
The greater the difference, the greater the slope.

Each pixel is about 1000 meters square.

My understanding is, the depths listed are in feet in the table I provided, not meters.


Now I'll show you how the RAW files actually work as seen in hex. You can not change how the files work!

Jeff-Groves
04-19-22, 03:56 PM
Each RAW file is a 601 x 601 square with 6 pixel over lap at each side.

So that is a 589 x 589 active square with the others being a transitional, possibly, read ahead render, type deal.

6 pixels will give the Game Engine 6000 meters to swap renders and such.

Now. Let's look at the RAW file in detail.

The RAW file can ONLY detail the numbers 0 to 255 in Hex. That's 256.
The RAW file does NOT contain COLORS! It contains a number.
That number is HARD CODED to equal a depth. Nothing more.

Now given you have a difference in depth from one pixel to the next?
You get a slope and not a sharp drop. Haven't figured out the slope distance but it can be seen in Game.

Here is an example from in Game of said slope.
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12488

Notice the shape angle leading to a DIFFERENCE from Above water to below Water!
Now if one steps the depths down nicely? You'll ping a crap load of different depths as you traverse that difference.

Given I get a hair up my Arse? I could translate SH4 depths from the exported RAW files to a 3D model.
Already done that for SH5 so the very basic code is done and proven.

Jeff-Groves
04-19-22, 08:16 PM
Transitional code from an SH4 RAW to a 3D model object How to.

Given we know the depth settings and transitions to a 256 table depth?
It's a simple codeing job to assign 0 to -1500 or such.

Doing a transitional table allows a RAW file to be converted to a 3D model.
That model, converted back to RAW format would do the exact same thing
as using paint programs but give you a perfect visual in 3 dimensions.
Infact? It would also allow one to see the sloping effect in the Game.

I was told once it could not be done.
Yet here I am trying to decide if I should prove a Dev wrong!

astvitaliy1982
04-20-22, 01:20 AM
I want to clarify one nuance with the construction of squares. In SH3 I made a 6 pixel overlay, but in SH4 this is not necessary.
(I mean the process when building squares in Photoshop.)

https://i.postimg.cc/BZ22qdwy/image.jpg (https://postimg.cc/mh2Pj64N)

astvitaliy1982
04-20-22, 02:03 AM
1) This would be great and would make it a little easier to work on depth editing. Considering that the terrain in CX4 is quite detailed and you literally have to manually redo some areas.
2) If I understand correctly, the depths in the game are hard-coded and there is no way we can change them.
3) Is it possible to change the navigation map filter settings in the game or disable it altogether. In my Terrain.act file, all depth shades are different, but I don't see it on the map... I only see colors within a certain range (30-60-90-150-200-300).

https://i.postimg.cc/SRQ1hCpQ/1184.png (https://postimg.cc/1nTr0gtb)

propbeanie
04-20-22, 07:55 AM
I want to clarify one nuance with the construction of squares. In SH3 I made a 6 pixel overlay, but in SH4 this is not necessary.
(I mean the process when building squares in Photoshop.)

https://i.postimg.cc/BZ22qdwy/image.jpg (https://postimg.cc/mh2Pj64N)
astvitaliy1982, editing the SH4 files the way you are, or the way Jeff is thinking of, might not incur the same SH3 6-pixel overlap that you show in your "nuance" image above, but if using the GWX Terrain Extractor and Photoshop to make the changes, you will indeed run into the same 6-pixel overlap in the SH4 files. If you edit a 601x601 "tile" within the 6-pixel area of the overlap, the neighboring "tile" has to be edited ~exactly~ the same in that overlap area, else you will see pillars of stone at the corners of the "tile" intersections, and sometimes shear wall of "dirt" that reach to the heavens... accidentally altering just one pixel can cause issue, which I have seen first-hand :roll:... definitely not fun trying to track down the "mistake"... :arrgh!:

Jeff-Groves
04-20-22, 08:10 AM
As propbeanie said. Take a look at E141S002 for a perfect example of overlap issues.

And that is in a stock BFD!
:o

propbeanie
04-20-22, 08:17 AM
As propbeanie said. Take a look at E141S002 for a perfect example of overlap issues.

And that is in a stock BFD!
:o
Scary, ain't it?... "Quality Control"... :har:

Jeff-Groves
04-20-22, 08:29 AM
https://i.imgur.com/AFlS7zj.jpeg
https://i.imgur.com/2cxbDqC.jpg

astvitaliy1982
04-20-22, 10:06 AM
There is one iron rule in editing with GWX SH4TerrainEX. It should be written in red letters - Never edit already redone squares!!!
This will lead to what you wrote about. However, this is also fixable. It just takes a little fiddling around.
But never edit what has been changed. The best way out is to redo the square
yourself or apply the converted square to the native one and convert it. But I wouldn't risk it. Taking the square out of the game, we are already violating its integrity. If you do this many times, then voids appear. I call them Wandering Pixels. That's why I never use the same square twice.:)


https://i.postimg.cc/fL6jvmkH/21600-10800.jpg (https://postimages.org/)

astvitaliy1982
04-20-22, 10:28 AM
When you take a stock square, edit it, put it in "color indexed" mode, and
press "Save as RAW", then the Title should be equal to - 0.

https://i.postimg.cc/F1tvmWzj/1185.jpg (https://postimg.cc/m1SJySQD)

astvitaliy1982
04-20-22, 11:50 AM
E141S002 - check this file

https://drive.google.com/file/d/1aL7wPvjiyZKYP6nGI7ogIUxK9bJeTVMX/view?usp=sharing

Jeff-Groves
04-20-22, 02:58 PM
We edited E141S002 a few days ago.

Your image of 'wandering pixels' is to small to see any detail.
Only time I've seen that is when one does not remove the header when exported from the ZHF file. No need to do that if exported directly from the BFD file.

It may be possible to edit the TerrainMapPS.fx and TerrainMapVS.fx Shader files to change how the Navigation map appears in Game.
I removed both as a test and lost all land masses!

astvitaliy1982
04-20-22, 04:07 PM
I was just one step away from the perfect map. I have a map with a colored depth gradient. Is there a way to replace the color palette of a photo with the one we need? (0-47) I know Phyton can do it. But I can't find a user manual...

Jeff-Groves
04-20-22, 04:36 PM
Try changing the picture as if you doing a RAW file.

Jeff-Groves
04-20-22, 04:51 PM
Only way I can reproduce 'Wandering Pixels' is to NOT remove header information when exporting from a saved ZHF file.

Now you only remove the header information 1 time! So any more opening of a saved RAW file as you work on it?
DO NOT have the 4 bytes removed!

astvitaliy1982
04-20-22, 04:52 PM
Ok. I've been thinking... No matter how I implement this method, it will still be based on intuition... Either I do it visually by comparing pictures, or I do it by going over mathematical formulas based on approximate analysis... The result will not be 100%. But... The depths in the game will now matter... I'm going to get a bottle of beer for inspiration and get to work...)

Jeff-Groves
04-20-22, 04:56 PM
We can ONLY work in the limits the Hard Code allows.
And I'll have a beer with you My Friend!
:salute:

propbeanie
04-20-22, 05:25 PM
Make mine a sarsaparilla!!! Unless, of course, you like mogwai gremlins and their water reaction, 'cause that's the way I react to beer... lol

astvitaliy1982
04-21-22, 02:22 AM
I want to share with you one observation in SH3TerrainEX,
but I don't know which branch to put it in.

When building lakes, I had one problem.
Since the world in SH3 is flat and the terrain is based on a real map,
that is observed in such not beautiful situation.

https://i.postimg.cc/kGt1rb5Z/1.jpg (https://postimg.cc/2LrFh3hF)


A) If you build a lake in the depths of the mainland, then the relief is too high. And if in
the center of the lake will be islands, then when building a depth map (in certain places)
they will turn into huge rocks coming out of the water.

https://i.postimg.cc/SKxbBgbv/2.jpg (https://postimg.cc/hX6YxbjL)

What I do in this case... The area on the editable "Depths" square where the lake will be located,
I completely paint over with shades of sushi of small heights.

// Heights in m
48 - 0x40800000 = 4.0
49 - 0x40a00000 = 5.0
50 - 0x40c00000 = 6.0
51 - 0x41000000 = 8.0

1) I throw this "Depths" square into the game without building a height map.
2) Run it in game via JSGME and make sure it is replaced (in Sh3Mission Editor)
3) I build a map of "Heights" and also throw them into the game. Again I check through JSGME, and make sure
that it has been replaced in the Sh3Mission Editor.
Depths at this moment are all equal -16.0 ( Table // 92 47 - 0xc1800000 = -16.0)
4) I throw in the "Depths" square those depths that I need. But! The height of the islands with this manipulation,
remains the same as I did in point 1.

I can't explain it in programming language, but with SH3TerrainEX you can build,
add and edit heights in the game.

I did this method on the construction of lakes Venern and Vättern, Ladoga and Onega lakes.

Jeff-Groves
04-21-22, 11:07 AM
All the SH Games have a set water table. Sadly.
So one can not build a lake at the true height above Sea level.

astvitaliy1982
04-26-22, 01:52 AM
An interesting anomaly has crept into square E009N057... I don't see the error, but the submarine can't enter this square...
Need advice on this... I could not resist the temptation to create a Gyota channel on the map... This link has a demo version of the Göta channel and Limmfjord files)

Download

https://drive.google.com/file/d/1bh0YkvS3slAX5kyqNceLbyPxrGzKTFN-/view?usp=sharing


https://i.postimg.cc/gcfhyvZ7/Limfjord.jpg (https://postimg.cc/yWyWs3nh)

propbeanie
04-26-22, 10:28 AM
... if you edited the 6-pixel overlap area in any of the surrounding squares, as well as the one you cannot enter, then you might have a "wall" issue. Have you looked externally from the bridge of your boat when you get to the border of that square? In SH4, if you edit that 6-pixel overlap area in any of the squares and do not match EXACTLY the bordering area of the next square, there will then be a pillar of "dirt" at each corner of the affected area, and usually a "wall" of "earth" between them, sometimes just below the surface of the water, and sometimes going up to the limit of the game's "height" , of roughly 2000 meters. I am 99.9% certain that SH3 does the same. Dependent upon your viewing angle, this "wall of earth" may or may not be visible, because of the sheer change in height associated with it... If you do not "see" anything, change the angle of your view, or use the external camera and move around more. Also, double-check the 6-pixel overlap area of all of the nine squares that border each other there.

astvitaliy1982
04-26-22, 12:49 PM
The depth of the entire fjord is -14m. At the junction of the squares, the depth decreases to -1m. But I can't see the wall...
I don't see it underwater, above water, or on the map. The relief itself looks normal, but the stones and algae are
almost "above" the water. I understand what you mean when you write about the wall, I had similar cases.
This really happened in those places where there was a mismatch between the shade and the bordering area.
Square E009N057 does not have different shades like its neighbors. They are all the same color.

There is something different here... I liked the depth effect going up to -1 but it would be a pity if I had to refuse
away from Limfjord because of this problem...

https://i.postimg.cc/dtxNMf6B/1205.png (https://postimg.cc/KRtDBJdk)

https://i.postimg.cc/jjzM7Sbg/1204.png (https://postimg.cc/DWwQVFmL)

https://i.postimg.cc/g2hDC2nz/1203.png (https://postimg.cc/LJHLfRtw)

https://i.postimg.cc/KzW3ctHd/1202.png (https://postimg.cc/1np3JVPH)

https://i.postimg.cc/TwVyXhb6/1207.png (https://postimg.cc/S2KQ6SVT)

propbeanie
04-26-22, 01:48 PM
Most interesting... Is your submarine taking damage while sitting in the "shallow" water there? How did you manage to get the "water" to be shallower than -4m? Hex editing? Using GWX Terrain Extractor? Usually, there is nothing between -4 and +4 for height that we can edit. I don't know if Ubi did that to keep players from running aground unless they had a definite landmass to see, or what the reason is. Perhaps Jeff-Groves or gap will come along and comment...

Jeff-Groves
04-26-22, 02:53 PM
A -1 meter depth can only come from adjacent squares causing the slope I talked about earlier.

You can not 'Hex' the Raw files for any different depths other then what they would contain using the Palletes from SH3 or SH4.

Minimum depth from my information is -16
lowest land mass is +4

Jeff-Groves
04-26-22, 03:24 PM
You REALLY need to look at your undersea.dat file!
:o

Rocks are floating because of THAT file!
:nope:

astvitaliy1982
04-26-22, 03:41 PM
In SH3 I had similar problems. I remember the Rockall bank very well. When I took out two different squares standing side by side from the game, the Extractor gave me two absolutely identical squares. The problem was solved when I edited three squares that were nearby. But in strict sequence. Then I met a similar error near Italy and near Turkey

For modding, I use the SH4 1.5 stock game and a mod made of small stones and algae. After this error, I removed the algae mod with stones, but the error did not disappear. I'll do some magic on this square. If I can't solve the problem, I will continue my journey without the fjord) But with a clear conscience, high intentions and the realization that we did everything we could)))

Jeff-Groves
04-26-22, 03:43 PM
Where did you get the undersea.dat file?
I looked at it and the rocks are NOT placed properly!!!!

They need to be moved DOWN!

astvitaliy1982
04-26-22, 03:49 PM
I'll show you this mod tomorrow. I took it here on Subsim

Jeff-Groves
04-26-22, 03:52 PM
Easy enuff to fix but who ever did it just placed things wrong.

propbeanie
04-26-22, 04:56 PM
It looks like his bottom screen grab is taken with the camera below the sea bed level - maybe... if the rocks are indeed "floating", then they might be getting the data from his edits, but the sea floor is not... ??

Jeff-Groves
04-26-22, 05:18 PM
look at his undersea.dat.
rocks are above sea floor level in that!

I don't just make this crap up you know.

astvitaliy1982
04-27-22, 02:52 AM
The problem has been fixed) These are different pixels in neighboring squares.
I figured out why they were there.
Let's say we are building a new lake on a piece of land that consists of three horizontal squares 1,2,3.

It is in this sequence that they should be inserted into the game. If you put them 1, 3 and then 2, then squares 1 and 3
copy into their data a section of square 2, which at that moment is still land. And because of this appears
this error.


In my case, I put 1 and 3 squares because 2 was not ready yet. Now it's fixed)

A classic mistake with a classic solution... I'm going to hang myself...)))

propbeanie
04-27-22, 11:46 AM
look at his undersea.dat.
rocks are above sea floor level in that!

I don't just make this crap up you know.
If you are referring to my comment on the screen grab, I was referring to the phenomenon where if the camera is below the floor, but looking across a "valley" at another stretch of sea floor, it can look like that. This is not the best screen grab for illustration, since I do not have a deep enough valley close enough to be fully visible, but you can somewhat see the sea floor a bit in the distance

https://i.imgur.com/HGsKa13.jpg

That was grabbed while beneath the sea floor terrain line, of course. Moving up in "elevation" just a pinch, and it looks like

https://i.imgur.com/JPG5HJl.jpg

Too much murkiness in the PH harbor area... :roll:


The problem has been fixed) These are different pixels in neighboring squares.
I figured out why they were there.
Let's say we are building a new lake on a piece of land that consists of three horizontal squares 1,2,3.

It is in this sequence that they should be inserted into the game. If you put them 1, 3 and then 2, then squares 1 and 3
copy into their data a section of square 2, which at that moment is still land. And because of this appears
this error.


In my case, I put 1 and 3 squares because 2 was not ready yet. Now it's fixed)

A classic mistake with a classic solution... I'm going to hang myself...)))
I do not understand where the problem comes in there with that work sequence astvitaliy1982, unless you are re-assembling the BFD/BFI yourself. If putting ZHF files and folders in the Terrain / Data folder, the game should re-assemble things properly, and only run into that issue if you edit within the 6-pixel border areas of adjacent squares, and don't match the edits in the neighboring square. ??

Jeff-Groves
04-27-22, 12:53 PM
I get what was done.
All 3 sectors were not adjusted and tested properly.

Now I'm working on a way to have 010 check the 6 pixel boarder areas around any given RAW file/files.

So the script would read the 1st 6 lines of 601 bytes each.
Then read the next 6 bytes then skip to the last 6 bytes of the lines until we reach the last 6 lines which would read them start to end.
That would give us the border information for a RAW.

Run it on all sectors touching? You'd have a table that would not need slight color guessing.

I did check sectors in the area in question but I looked at the upper and lower sectors!
Not the left or right sectors.
Doh!


Another thing I'm working on is to change the UI of the program to allow a bigger image when using it.
Also trying to change it so that damned header information is removed when exporting from the ZHF files.

astvitaliy1982
04-27-22, 01:42 PM
If I understand the situation correctly, then the error "with a pixel" occurs when I start the game with ready-made squares
ZHF 1 and 3 (figuratively speaking). When the game has already loaded them onto the map. I think if I didn't load them into the game
if I had finished square 2, and then loaded three finished squares into the game at once, this error would not have occurred ...

Jeff-Groves
04-27-22, 01:50 PM
Correct.

propbeanie
04-27-22, 10:46 PM
I get what was done.
All 3 sectors were not adjusted and tested properly.

Now I'm working on a way to have 010 check the 6 pixel boarder areas around any given RAW file/files.

So the script would read the 1st 6 lines of 601 bytes each.
Then read the next 6 bytes then skip to the last 6 bytes of the lines until we reach the last 6 lines which would read them start to end.
That would give us the border information for a RAW.

Run it on all sectors touching? You'd have a table that would not need slight color guessing.

I did check sectors in the area in question but I looked at the upper and lower sectors!
Not the left or right sectors.
Doh!


Another thing I'm working on is to change the UI of the program to allow a bigger image when using it.
Also trying to change it so that damned header information is removed when exporting from the ZHF files.
I like the idea of "a table that would not need ... guessing"!!! The header info change would be a bonus! My 010 Editor stands at the ready. I am sure it would appreciate a competently written script, unlike the krapp someone I know all-too-well currently tries to feed it... :oops:

astvitaliy1982
04-28-22, 02:49 AM
Average depth indicators in the game:

https://i.postimg.cc/hGKSZkky/21600-10800-2.jpg (https://postimg.cc/0zHRbB2D)

This is how the depths look in Photoshop:

https://i.postimg.cc/fTLSBr4f/K-SH4.jpg (https://postimg.cc/MXCGGtpn)

Dogger Bank in SH3

https://i.postimg.cc/pTsXjPdb/1211.png (https://postimg.cc/wysp88J0)

Dogger Bankr in SH4

https://i.postimg.cc/43JgQjqJ/1210.png (https://postimg.cc/0zHF8X93)

Dogger Bank in SH4 game:

https://i.postimg.cc/kgHHBzC1/1224.png (https://postimg.cc/cvQhzDrw)

https://i.postimg.cc/FRVGgBtQ/1223.png (https://postimg.cc/CBdjwJLv)

-------------------------------------------------- --------------------------------------

English Channel in SH3:

https://i.postimg.cc/pTc5HfzF/1213.png (https://postimg.cc/ZB35Pyfb)

English Channel in SH4:

https://i.postimg.cc/Y24zS00H/1212.png (https://postimg.cc/RqBHsMws)


The English Channel in SH4:

https://i.postimg.cc/sxFQxVHj/1219.png (https://postimg.cc/2bw8XffM)

-------------------------------------------------- ------------------------------------

North Sea in its upper part:

In SH3:

https://i.postimg.cc/3NHX6CTF/1217.png (https://postimg.cc/BLMPPFtj)

In SH4:

https://i.postimg.cc/1XPFMmGW/1216.png (https://postimg.cc/8JKszVnW)

-------------------------------------------------- ----------------------------------------

Wilhelmshaffen in SH3:

https://i.postimg.cc/KjJ1Nnvz/1214.png (https://postimg.cc/Lgg44gPK)

Wilhelmshaffen in SH4:

https://i.postimg.cc/HxTWhVN7/1215.png (https://postimg.cc/SXtpXNky)

Wilhelmshaffen in SH4:

https://i.postimg.cc/yxbVxn8F/1218.png (https://postimg.cc/jnyVkHN5)

-------------------------------------------------- -----------------------------------------



Unfortunately, the filter in the Navigation map of the game does not show us much. Still, I impose
on the map texture in Photoshop, "Median" filter. I lose a bit of depth detail,
but this is a necessary measure to ensure that the isolines of the depths on the game map look smooth. If a not to do this, the result is a map in which there are many square depressions and pits one pixel in size.

astvitaliy1982
04-28-22, 02:54 AM
P. S. I will not replace the fjords of Norway. I'll leave what was.

Jeff-Groves
04-28-22, 02:49 PM
I like the idea of "a table that would not need ... guessing"!!! The header info change would be a bonus! My 010 Editor stands at the ready. I am sure it would appreciate a competently written script, unlike the krapp someone I know all-too-well currently tries to feed it... :oops:

Writing the Script to check RAW files now (in my head at the moment).
1. It will ask for 2 RAW files to compare.
2. It will ask the direction of 1st RAW file to check. N, S, E, or W.
3. It will then compare the border areas of both files.
If N is selected for RAW 1, The Southern border of RAW 2 will be scanned.
And so on for given directions.

propbeanie
04-28-22, 02:56 PM
That sounds very sensible! Paint me in as a guinea pig! :salute:

Jeff-Groves
04-28-22, 03:00 PM
I'll probably allow you to do an auto 'fix' if pixels don't match.
:hmmm:

propbeanie
04-28-22, 03:07 PM
That would be very nice also! :salute:

astvitaliy1982
04-29-22, 02:50 AM
Можно ли создать скрипт который сможет открывать не один квадрат а девять, обьединенных в один квадрат?

Jeff-Groves
04-29-22, 09:11 AM
Можно ли создать скрипт который сможет открывать не один квадрат а девять, обьединенных в один квадрат?

I'd say it is possible. One would read each file line by line and create a new, combined file. Over laps would be dropped from known areas of course.

You'd end up with a RAW file 1791 X 1791

You might be able to write a Script for Photoshop that would do the same thing.
Never wrote any Photoshop scripts so just guessing about that.

astvitaliy1982
04-29-22, 09:36 AM
If you can do that, that would be really cool. I would say that it would be a completely new level of relief processing. It would speed up the process of importing squares into the game by nine times. With such a script, it would be possible to create not only the Baltic and the North Sea, but the entire Mediterranean, the coast of America, Newfoundland and anything ...)
Depths and elevations are easy to create. This is done in a couple of days. But transferring this data to the game takes a very long time...(((


I use "script" in Photoshop. I recorded a history of my actions and use it to import each file into the game. This speeds up my work by 15 seconds.)))

Jeff-Groves
04-29-22, 09:45 AM
One would have to reverse the blending to create standard 601 x 601 RAW files then pack them into ZHF files.

propbeanie
04-29-22, 01:55 PM
That is an interesting idea astvitaliy1982... it would allow easier editing across the "border" areas of adjacent 601x601 tiles...

Would it be easier to do the combining / re-interpolating the "borders" area of the nine tiles (almost sounds like we're talking about Scotland and England), or just do the 601x601 edits and have a program to remember and / or match the adjacent "borders" settings between them? :hmmm:

astvitaliy1982
04-30-22, 03:20 AM
Fuuuuuuh. Finally, I have achieved an ideal understanding of the balance of "price and quality."
Depths are now similar to real ones (as far as the game allows) but,
at the same time, they look very harmonious on the map. Now I have only one thing left -
import them into the game.

I hope that in a month and a half I will have something to show you.)

P.S. Please send me the squares that have been changed in the game before.
I have them, but to find them in my heap, I need to reinstall
game and spend time on it.

If you have any wishes or suggestions for the relief of the coastline,
I'll gladly put them in the game.

For example: I can add the islands of Hirsholm and Gresholm (Kattegat)
to the map.

https://i.postimg.cc/T31BCvKn/1.jpg (https://postimg.cc/v4RPZjLm)

propbeanie
04-30-22, 08:09 AM
Wow... there are a LOT of the Pacific "islands" left out of the game, plus much too shallow harbors and other areas... anything that does not have enough land mass is missing... lol - not a high enough resolution in the mapping of the game, to allow some of them, plus the fact that high and low tide makes a difference for a lot of them also...

astvitaliy1982
04-30-22, 12:49 PM
Okay) I'll focus on the standard version of the game.

Jeff-Groves
04-30-22, 03:44 PM
Playing with the Shader settings I've removed the black line around land masses in Game so far.

I like it A lot better so far!

astvitaliy1982
05-01-22, 10:14 AM
Share a secret?

Jeff-Groves
05-01-22, 12:26 PM
Still playing with the Shader but here's a couple test shots.
Black out lines gone.

https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12500


Where I'm at now.
I'm in Grey scale but it does show more detail.

https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12501

astvitaliy1982
05-02-22, 03:59 AM
I noticed a feature. The higher the island in the game, the better it can be seen on the map (shaders show it better). If the height of the island is less than +24m, then it is not displayed on the medium scale map...

Jeff-Groves
05-02-22, 02:40 PM
That's why there are 2 maps in the Terrain folder.

astvitaliy1982
05-02-22, 03:23 PM
Hello) I want to restore a historical error in the game. A ghost island is marked on the map of all Hunters.

Sandy Island. Pacific Ocean
https://i.postimg.cc/pdbrg4cS/image.jpg (https://postimg.cc/dh6JCHYR)

Let me remind you that the incident with a non-existent island in the Coral Sea happened in the fall of 2013. A group of Australian marine geologists and oceanographers, who were measuring the seabed to study plate tectonics in the area, decided to look at an island not far from their study area, which was considered uninhabited and for which there was no data other than location coordinates. It was also interesting that Sandy was not marked on the navigation map used by the captain of the RV Southern Surveyor research vessel - he appeared only on the map of geologists and was still present in the Google Earth cache.

What was the surprise of the researchers when, having arrived at the place, they did not find any island. Assuming that perhaps this piece of land could simply sink under water due to the tectonic activity of the ocean floor, geologists carefully examined the depths of the sea. But in vain - the results of the study showed that in this place in the last hundred thousand years there were no catastrophes capable of destroying the entire island. Moreover, it turned out that there had never been any piece of land here at all. But where did Sandy appear on so many Google Earth maps?

Returning from the expedition, the researchers decided to find out why a non-existent island appeared on the maps. To begin with, they started studying this area in Google Earth, as a result of which they found out the following - at one time the satellite photographed an area that was automatically excluded from the data due to the presence of land there. Thus, it turned out just a black spot, resembling a piece of sushi in its appearance. However, further the satellite image was checked with terrestrial topographic maps, where at this place there was an uninhabited island called Sandy. Thus, the spot was given an appropriate name.

Further, scientists began to rummage through old maps, trying to find out which of the sailors or travelers first put this non-existent island on the map. Their search led them to a 1908 British Admiralty map, which was said to have been discovered by sailors from the crew of the whaling ship Velocity in 1876. Interestingly, after this, apparently, this discovery was repeatedly checked, the result of which was completely not in favor of the island - for example, in 1974, French cartographers from the New Caledonia colony "erased" Sandy from their maps, and in 1985, similarly received from the Australian Hydrographic Service (which is why the island was not on the navigation map of the RV Southern Surveyor).

https://i.postimg.cc/7h0TRzSF/Sandy-Island-on-1908-chart-cropped.jpg (https://postimages.org/)

Download fix:

https://drive.google.com/file/d/1id-HdOR0ASGoJq6Og2HC0-gSLlKi1w-L/view?usp=sharing

Jeff-Groves
05-02-22, 03:36 PM
:har:

I actually did a test mission near Sandy Island. Knowing it was an anomoly!

I used it to show how terrain slopes and posted the picture a few posts back!

Post #27 to be exact.

astvitaliy1982
05-02-22, 03:57 PM
I haven't been able to find the right depth for this island. I put -14 )

Jeff-Groves
05-02-22, 04:37 PM
That area is 1,400m deep.

https://www.bbc.com/news/world-asia-20442487

Here's the thing though. It would have been on maps in WWII. So it's kind of wrong to change it.
IF We could have a WWII map and real depths would be cool.

astvitaliy1982
05-04-22, 02:11 PM
Can you guys create a script to export and import 1791 X 1791 pixel squares into the game? Can I count on your help?

astvitaliy1982
05-05-22, 03:40 AM
https://i.postimg.cc/CL603xgJ/1.jpg (https://postimg.cc/crYPYZ68)

propbeanie
05-18-22, 03:02 PM
Coming back to this seemingly "deep" subject (sorry, bad terrain joke... :D ), but I have run into an issue with shore guns on edited terrain tiles... The added guns do not seem to show in the game. I know that several of the stock game's guns do not function as guns, but they do show in the game. Such is not the case thus far, in my experience in FotRSU, when placing them on terrain that has been "raised", shall we say, from below sea level to anything above. These are tiles edited by Astvitaliy 1982, and others edited by me. Granted, several of the places I am attempting to put guns are rather "steep" terrain locations, but the guns are placed into the sides of Corregidor Island, so surely they would "place" on Caballo and Carabao Islands (which is quite low in height)?... anyone else? Rather frustrating. surely, again, it is something simple?... lol

Jeff-Groves
05-18-22, 03:50 PM
may be this?
:hmmm:

; Locations configuration file

;General settings

[Config]
MinBuildingTerrainHeight=0 ;[meters] minimum terrain height for placing buildings
MaxBuildingSlope=0.25 ;[0..1] maximum slope for a biulding to be placed

propbeanie
05-18-22, 04:01 PM
That could potentially be the issue on Astvitaliy 1982's west shore of Caballo, which is where the "hill" is, but I attempted to place the guns ("Render accurate shoreline) right by the water's edge where the slope is not as great. As for Carabao, it barely changes height at all... though a 1 in 4 slope really is rather shallow... :hmmm: - some of the items are set to 0.55 in the Campaign_LOC file, so the game might be fighting itself in this regard... What would be ~nice~ is if placing a gun would do an automatice "carve-out" of terrain for the modder... lol - not happening with this relic of a game. Thanks Jeff!

Jeff-Groves
05-18-22, 06:48 PM
Just did this in a stock location near Antarctica.
Cool eh?
:har:
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12525

Eastern shore of Caballo Island.
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12526

propbeanie
05-18-22, 08:41 PM
Most interesting Jeff. That's what I see on Corregidor in places... which gun is that, the medium?? Thanks!

Jeff-Groves
05-19-22, 09:40 AM
That's the Large Coastal Gun.

propbeanie
05-19-22, 09:47 AM
Thanks. I'll try substituting my Medium guns for Large, and see what happens...

Jeff-Groves
05-19-22, 09:50 AM
When GWX 4 was in the works, We made a bunch of German Coastal Guns.
We had to add 3D modeled terrain around some of them to get them to look right.

Jeff-Groves
06-23-22, 06:06 PM
A little image so you can visualize a SINGLE pixel of terrain compaired to a Type 7 Submarine.
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12598

The White box is a SINGLE pixel in HALF SCALE!
:o

I came across this as I was working on a way to edit Terrain in a 3D visual program.
(And YES. I'm writing the Tools to do so.)
Why you might ask? Cause I can and because people can't seem to wrap their mind around how terrain slopes in SH3/4

Jeff-Groves
06-28-22, 06:10 PM
Wrote a few scripts and use a few programs to do some cool stuff.
1st I export all the data from the BFD file to seperate files.
All 64800 of them!
2nd I grap the names and size of those from the BFI file.

I plant any new terrain files in the exported files then pack them all back into a single file.

Then run a script to re-index that and create a new BFI file.

astvitaliy1982
06-30-22, 01:47 PM
Hi Jeff, really need help.
I managed to build a SH4 depth map for this section of the map

https://i.postimg.cc/C5CPb8J7/549.jpg (https://postimg.cc/LgX3pncg)


But again I have to ask for help in solving the problem with the relief squares.
The square size of 601x601 pixels is very inconvenient for importing depths into the game.

Is it possible to write a script to export squares with a size of 4207x4207 pixels?

Small squares make it almost impossible to import depths into the game. It is too long
and labor intensive.


https://i.postimg.cc/SxhNGbdx/3.jpg (https://postimg.cc/Tpt6RSBz)


For comparison, I want to show a screenshot of the depths in the game and the depths that should be in the game.

https://i.postimg.cc/DwJd1sCT/5.jpg (https://postimg.cc/xXQz2kDx)

Jeff-Groves
07-01-22, 11:40 AM
It could be done but you still end up with the 601x601 RAW files compressed to ZHF or RL2 files.
That's what the Game uses and We can't change that.

I'm working on an RL2 Decompressor now.
Already have the ZHF Decompressor.

Both do a MASS decompress to RAW files.

What I'll do is Decompress all 64800 files then upload the package for others to do as they wish with them.

You can do what you want in Photoshop and could even script a lot of the work.
I did some testing last night and figured out the steps. Then played with a few scripts to help speed things up. So it's probably better to do the heavy work in Photoshop JSX scripting.

I don't know if CS2 scripts will work in your version so they might not help you.

astvitaliy1982
07-01-22, 11:01 PM
Well) Thanks) I tried working in Photoshop CS 8.0, then switched to Photoshop 2020. It turned out that version 2020 works much more stable when, when creating a mod, the working file begins to reach a size of 500 MB. I'll try to look at the scripts, maybe it will help facilitate some actions)

Jeff-Groves
07-02-22, 11:19 AM
From reading on the 'Net it seems many CS2 scripts should work on later versions of Photoshop. If you would like to test a couple of early scripts I can upload them. One of them removes pixels from the left side of an image.
I have a reason for removing pixels.
:03:

I'm very early on the learning of the Java scripting for Photoshop but it's not really hard given the scripts posted all over the 'Net.

Jeff-Groves
07-02-22, 03:07 PM
Here's my test grid based on the size you asked about.
The lines are the Grids turned on and set to 601 for now.
That is going to be changed and I'll explain why later tonight.
I'm going to my Son's house for the 4th of July fire works he does every year.
:yeah:
https://www.subsim.com/radioroom/picture.php?albumid=1069&pictureid=12619

I'll be using Snaps so imported RAW files will be easy to place properly as I go.

astvitaliy1982
07-02-22, 03:27 PM
I would appreciate your help)
In turn, I am also ready to help you in any way I can)

astvitaliy1982
07-02-22, 05:07 PM
Хочу поделиться своим опытом для тех кто будет читать этот форум в будущем.


Если вы захотите построить свою карту, не изобретайте колесо а берите
готовые моды и редактируйте их.

При построении своей карты обращайте внимание на названия городов,
морей и т д.

Пример 1
Разные названия городов. Возьмем город Беломорск. На картах Люфтвафе до 1941
он обозначается как город - Сорока а потом как - Беломорск.

https://i.postimg.cc/Rq5hNRpR/1.jpg (https://postimg.cc/D46nNqTJ)


Пример 2

Залив Биафра.
В 1972 году после Гражданской войны в Нигерии за отделение государства Биафра залив
был переименован правительством Нигерии в залив Бонни.


https://i.postimg.cc/Zq5G4HMG/1.jpg (https://postimg.cc/SnHTG6qd)

Пример 3

Названия морей. В европейских картах одно и то же море может иметь разные названия.

New Guinea Sea - Bismarck Sea.


Пример 4


Всегда сверяйте реальные показания с игрой.


https://i.postimg.cc/mrChQQ46/1111.jpg (https://postimg.cc/VSsYw0dj)upload image (https://postimages.org/ru/)



https://i.postimg.cc/VkyxJTfM/scapa-flow.jpg (https://postimg.cc/SJrT5gzN)

Jeff-Groves
07-02-22, 10:24 PM
I'll talk about my System now and the Scripting for PhotoShop.
Given the size of 4207x4207? That will not work for a good way to import, edit, and then export, after editing.

Why? Remember there is a 3 pixel over lap. I'm accounting for that when I build a map in PS. The over lap is the most common area to cause problems!
I'm gonna explain how I'm fixing that with scripts.

The Scripts will remove pixels to allow a blended image that I'll later export after edits are done. Any work near borders will not be a problem.

The Export Script will account for border edges so you can't possibly screw them up!

Mornar Brane
07-03-22, 02:26 AM
Top info thread
Great work buddys

astvitaliy1982
12-21-23, 05:17 PM
Hi guys! Hi Jeff! There is a question... Are the values of depths and heights in the game Constants or not? Or are these values floating? I apologize for the terminology, as I am not a programming specialist and I write from the experience of my superficial knowledge in this field.

Jeff-Groves
12-22-23, 02:16 PM
The depths are constant. There is no such thing as tides as in real life.
On a temporary basis you could do changes.