Thread: [WIP] The SH5 EcoMod
View Single Post
Old 02-23-19, 01:58 PM   #213
gap
Navy Seal
 
Join Date: Jan 2011
Location: CJ8937
Posts: 8,214
Downloads: 793
Uploads: 10
Default

Quote:
Originally Posted by Jeff-Groves View Post
Had to go back to Cleveland for a few days but I have the files.
Now I just got word I have to go to California for a few days.
California is not exactly around the corner
how is your jet lag

In the last few days I have been experimenting with Ref's Terrain Extractor-Importer, and I can confirm that it works for SH5 as well as for SHIV, though I think there is a little glitch with the inbuilt ZHF to RAW conversion utility.

Low-detail height maps extracted from TerrainData.BFD are greyscale images with a size of 601x601 pixels and covering an area of 1 deg x 1 deg. That means that they have a resolution of six seconds: four times lesser that the high-detail height masks generated by Terrain Editor.

Being able to edit the low-detail game terrain tiles is very important, especially for the sea bottom and for areas that we don't visit that often and/or we only see from far away; using 1-sec elevation data for the whole SH5 world would be a waste of time and resources.

The GEBCO website has bathymetric data that can be freely downloaded:

https://www.gebco.net/data_and_produ...thymetry_data/

Its maps have a resolution of 30 arc-seconds; this is five times lesser than we need, but while better resolution public domain maps would be welcomed (suggestions anyone?), the lack of resolution is not a big problem either, as underwater everything looks blurred and smoothed out anyway. Data offered by GEBCO is in many formats. The ones I have found more useful are GeoTiff (which can be opened and converted in a regular raster format using softwares as QGIS, thank you for pointing me into this program Seaowl!), and asc, which is a plain ASCII format with heigh values sorted in an array.

What I did, was creating an Excel spreadsheet which converts from metric height values contained in the asc files, to 8-bit grey shades calculated according to SH5's height table; the calculated grey values are then sorted by the same spreadsheet in the order required by the portable bitmap format (eternal gratitude to OldCoder for making me aware of it).

The next steps are importing the output maps in photoshop, re-scaling them to the desired size (some post-processing is needed for hiding the pixelization caused by magnification), replacing unacceptably blurred landmasses (where they apply), with the greyscale version of SRTM 30m data, (similarly edited to match the in-game height table) and, finally, replacing pixels along the borders of each map so that they match the pixels along the adjoining borders of the next maps (for avoiding abrupt height changes: as usual there is some overlapping between nearby tiles).

When I finish with those tasks I export to RAW/ZHF format, and the maps are ready to be used in game. The result I get is visually convincing: at least for the tiles I have edited so far, the edited seafloor has a lot more depth changes than the stock one, with trenches, sandbanks and shoals which obviously resemble the real bathymetric profile of the same areas. There is something I have found out though: in spite of the general similarity, and of all the care I have placed into matching they grey values of those maps with real heights, there will always be some important discrepancies, caused by the fact that there is not a simple relation between grey values and height/depth at any given point: due to the blending of an hardcoded noise mask, even if a set an area totally flat, there will always be a slope of some sort, and the height of that area might vary considerably relative to the height expected according to table I linked above.

If/when we need that level of accuracy, we will have to edit the 1.5 arsecond raw maps using Jeff's importer/exporter and/or terrain editor



The Channel Islands seen in Mission Editor. Left: as they look in stock game; right after the edits I described above
__________________
_____________________
|May the Force be with you!|
...\/

Last edited by gap; 02-23-19 at 06:37 PM.
gap is offline   Reply With Quote