SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
02-04-19, 10:04 AM | #136 | |
Soundman
Join Date: Mar 2016
Posts: 142
Downloads: 24
Uploads: 0
|
gap,
Quote:
|
|
02-04-19, 11:08 AM | #137 | |||
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
Now it is part of my job putting your scripts at work Quote:
Real world height data with a resolution much lesser than 50 m would still be useful for general terrain profile, especially for the seabed whose visual aspect is not so important, and we could add some random noise to that data so to simulate a resolution to the resolution we have in game; anyway such a poor resolution would be of small use for recreating realistic coastal profiles and elevations, and if we used only that data we would end up with a smoothed out version of the world. For height data with a resolution bigger than 50 m I see no problem: as you said we can average that data. Some manual adjustments might still be needed near the coasts for avoiding an undesirable "zigzags", but that kind of post-processing could be quickly performed in a 3D program (Wings3D 'sculpt' mode totally fits this need) or with the Terrain Editor that devs gave us. Quote:
For the rest, see my considerations above please: indeed 250m is not the best, but it is still of some use. The problem is that I have no idea on how to create a local query like the one you have described |
|||
02-04-19, 12:46 PM | #138 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
@ OldCoder, Jeff-Groves and all the concerned ones
I have found another STRM database promising high resolution (30-m) world height data: https://dwtkns.com/srtm30m/ From what I have read from STRM documentation available elsewhere, the resolution given is relative to the equator. Due to the distorsions of the SH world, the in-game resulting resolution will be slightly lesser than that, especially near the poles, but still bigger than the maximum terrain resolution of SH5 which is equal to 50m. There are two problems with that set of data: 1 - some areas are not covered, and data provided seem only relative to landmasses (no sea depth data) 2 - height data is provided in SRTMHGT format; I don't know how easy would be for us processing that kind of files. Moreover, in order to download the satellite data an username and password are required, but I didn't see any way to register into the site. Greyscale previews of each tile are freely accessible. They cover an area of 1 deg of latitude x 1 deg of longitude and they have a size of 3601x3601 pixels; realtive to our game, that makes an horizontal resolution of 120,000 ÷ 3,600 = 33.33m, more than we need, but being 8-bit images they can store only 256 shades of gray/height levels. Depending on the height range stored in each tile, this might involve a quite poor vertical resolution and an overall lack of accuracy considering that each tile might use its own greyshade-to-height scale, and that those scales are not provided |
02-04-19, 07:10 PM | #139 | |
Soundman
Join Date: Mar 2016
Posts: 142
Downloads: 24
Uploads: 0
|
Inspecting the URL for the download link, and trying the web site, it seems that registering an account at https://urs.earthdata.nasa.gov/ may be possible. It looks free to anyone, though I haven't tried it.
Quote:
|
|
02-04-19, 07:22 PM | #140 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
I had already registered on https://urs.earthdata.nasa.gov/, and logging in into it allowed me to download the .hgt file relative to the German Bight tile. Now we need to understand how we can convert such a file format into something that can be easily imported in game P.S: this link might be of some use: https://github.com/zbycz/srtm-hgt-reader Last edited by gap; 02-04-19 at 07:30 PM. |
|
02-05-19, 12:33 PM | #141 |
Soundman
Join Date: Mar 2016
Posts: 142
Downloads: 24
Uploads: 0
|
That 30m data and the hgt reader at github was a good find.
I've cooked up a little c++ exe that will read the hgt and dump the contents into output files. One output file is text format, and looks like: 51.999722 1.000000 47 51.999722 1.000833 47 51.999722 1.001666 46 where that's LAT/LON and height in metres. Second format is a greyscale image in PGM format, documented here: https://en.wikipedia.org/wiki/Netpbm_format. The image created looks exactly like the preview button image at the earthdata site, so I know it's correct (at least for the single tile I tested). So, download the height.zip file and put it into an empty folder. Then download a srtm hgt tile file and drop it into an srtm subfolder. Then run it like: height.exe 51 1 3 200 51 1 are the LAT/LON from the tile filename. 3rd param is the stepping value. Specifying 3 results in a 1201x1201 image file. Specifying 1 is the highest resolution of 30m 1 arc-second data, and generates output at 3601x3601. The 4th param is calibration of black to white, mapped to max height. So if you specify 200, then 0 is black and anything at 200+m will be drawn (and clipped if necessary) in white. You could specify 1000 instead and then a lot of low lying ground will be black or very dark, and only the highest mountains would be white. The text file output scales similarly in size according to the 3rd param. Also, you can run the exe with only 2 params just to return height at a specific LAT/LON if you want: height.exe 51.389057 1.384060 and it will return interpolated height of 9.3m I've only tested it briefly, so it may be a bit buggy lol. Unfortunately the forum won't let me upload the exe zip to this message, but when I find out a way to upload it I will do so. |
02-05-19, 12:33 PM | #142 |
Village Idiot
|
Nice link to github.
May compile that in VS 2008 and see what needs done to adapt for RAW. Oh OldCoder beat me to it! LOL! I can send you my e-mail address and you can send it to me. |
02-05-19, 12:53 PM | #143 | |
Village Idiot
|
Quote:
Say we build a matrix to hold just the height data for a given grid that matches what we need in SH5 then save that info as a float for each height. Output a proper format and you have a RAW file. We can edit the RAW files now in a 3D program and convert back to RAW. I butchered up some scripts for 010 that do the RAW to obj and back pretty well so far. A stand alone program is in the works. |
|
02-05-19, 01:58 PM | #144 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Thank you OldCoder!
Jeff is right in suggesting to adapt the output of your executable so that the exported terrain height values cover exactly one of the SH5 RAW maps. Each data tile provided in the 30-m STRM database is 1deg of longitude by 1deg of latitude in size, and it has a resolution of 1 arc-second. Conversely SH5 height maps measure 1/24 deg of lat/long, and they have a resolution of 1.5 arc-seconds. Knowing that, I suppose that it shouldn't be too complicated modifying your code so that for each export session it will extract from the appropriate hgt file only the elevation values we need for one of the RAW maps, down-sampling them to the desired resolution. Ideally, the exe should accept three user imputs. The first two onputs would be numbers comprised between 0 and 23, indicating the position of the data array we want to extract relative to the big hgt tile, while the third parameter should determine the resolution of the exportd data (1.5 if omitted). What do you think guys? Last edited by gap; 02-05-19 at 06:43 PM. |
02-05-19, 06:41 PM | #145 |
Soundman
Join Date: Mar 2016
Posts: 142
Downloads: 24
Uploads: 0
|
Hi, yes I just sent Jeff a link to the mediafile link for the exe.
If it works for Jeff I can easily upload sources so you guys can adapt as needed (or just do your own thing based on what's in github). The github code works (with a few fixups), and I then modified it to generate the output formats I was interested to see. |
02-05-19, 06:49 PM | #146 | |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
You are amazing guys |
|
02-11-19, 12:29 PM | #147 |
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
@ OldCoder
I am trying to run your tool as you said: I created a new folder in C:\, I dropped your executable into it, I created a subfolder of the first folder, I named it 'strm' and I dropped there one of the hgt files, but when I try running height.exe from the command prompt I get a missing VCRUNTIME14D.dll error even though I have the latest Visual C++ 2017 runtimes installed (x86 and x64). This happens in Windows 8.1. Is there anything I am doing wrong? |
02-11-19, 12:39 PM | #148 |
Soundman
Join Date: Mar 2016
Posts: 142
Downloads: 24
Uploads: 0
|
Try searching google/MS for Microsoft Visual C++ 2015 Redistributable
That should sort it (I think). |
02-11-19, 12:46 PM | #149 |
Village Idiot
|
OldCoder answered quicker then me.
And you need VCRUNTIME140.dll not VCRUNTIME14D.dll Get the full install as there may be other dll's you need. https://www.microsoft.com/en-us/down....aspx?id=52685 |
02-11-19, 01:01 PM | #150 | ||
Navy Seal
Join Date: Jan 2011
Location: CJ8937
Posts: 8,215
Downloads: 793
Uploads: 10
|
Quote:
Quote:
I am now trying to install the Microsoft Visual C++ 2015 Redistributable updates and to re-installe Microsoft Visual C++ 2017 Redistributables (I had to uninstall the latter in order to install the 2015 version) Last edited by gap; 02-11-19 at 01:29 PM. |
||
Tags |
enviromental mod, environment, terrain, trees, vegetation |
|
|