![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
|
|
02-19-19, 03:26 PM
|
#1 |
|
GLOBAL MODDING TERRORIST
|
Send the files your working with to my e-mail and I'll work with them.
|
|
|
02-19-19, 04:41 PM
|
#2 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
|
|
|
|
02-21-19, 07:55 PM
|
#3 |
|
GLOBAL MODDING TERRORIST
|
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. |
|
|
02-23-19, 01:58 PM
|
#4 | |
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Quote:
![]() 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
Last edited by gap; 02-23-19 at 06:37 PM. |
|
|
|
02-23-19, 04:47 PM
|
#5 | |
|
GLOBAL MODDING TERRORIST
|
Quote:
The compressed tiles are 601x601 and have been since SH3. That's one of the main reasons the Kiel canal is like it is in SH3/4. Limited detail terrain work can be done in SH3/4 because of the restriction. SH5 we can go to greater details thanks to the Detailed RAW files that use actual height values over a smaller area rather then a crude 0-255 scale over a much larger area. Given the size exported by Ref's program and based on info we have on the details RAW files? The Ref Exported files are 6 time larger then a true SH5 Detail RAW. (Not a fault of his program. That's how it is stored in the files) Given We know the difference? I'm thinking We could cut the exported files down to the needed detail RAW size with one problem! It will still be just a 0-255 limited output. On California? I have a few friends very near there that I'm hoping to spend a weekend with to shoot some nice Air Guns. |
|
|
|
02-23-19, 06:20 PM
|
#6 | |||
|
Navy Seal
![]() Join Date: Jan 2011
Location: CJ8937
Posts: 8,160
Downloads: 793
Uploads: 10
|
Maybe not exactly a glitch. I din't check if the uncompressed RAW files work as well as ZHF files and RAW files saved by photoshop, probably yes, but if you want to understand what I mean try doing the following: extract one tile from TerrainData.BFD and open the resulting RAW file in photoshop. The RAW importing menu will select for you the best import options and once opened everything will look in order.
Now try converting the same RAW file to the ZHF format, and then uncompress it again, or if you prefer uncompress one of the stock ZHF files. On opening the resulting RAW file, you are no longer suggested the optimal dimensions. If you try selecting anything bigger than 601x601 obviously you will be told that the image you are trying to open is bigger than the file and you are not allowed to go on with the import; if you select 601x601 you are told that the image is actually smaller than the file, and once opened, five or six columns of pixels in the map are shifted from left to right or vice versa, I don't remember exactly now. Quote:
![]() Quote:
![]() Quote:
|
|||
|
|
02-23-19, 07:13 PM
|
#7 |
|
GLOBAL MODDING TERRORIST
|
If you need to work with a file saved to ZHF with Ref's program?
Extract it to RAW again and then delete the first 4 bytes with 010. ![]() Not sure why that is added but I'll look closer at those 4 bytes. I can do a script for 010 to remove them if you'd like. |
|
|
02-23-19, 07:25 PM
|
#8 |
|
CTD - it's not just a job
|
Using the GWX Terrain Extractor, SH4 tiles are 601x601 when opened in PS for the first time, and the tiles do overlap by 6 pixels also. If you do NOT get the transitions between tiles edited exactly correct, you often end up with pillars of rock six pixels wide and hundreds of ?? pixels high at the corner junctions. You also have to do all edits in one session. You cannot go back in and re-edit any mistakes you make, else you might end up with 6 pixel wide walls or trenches at the borders, depending upon your edits. Therefore, it's best to print out the original tile on paper, and noodle with that and a pencil first, then use the software. There is an issue with either the PS edits, the Save back to RAW, or the conversion from RAW to the game's ZHF, and you end up with the blank dimensions in the Open dialog if trying to edit a 2nd time. If you just do one edit on the RAW file, then it will display in the game correctly after a single edit session with PS, else you get that shift of six pixels, and other areas near the 6 pixle "border" area that have changed their values. Anymore, if editing terrain for SH4, I export to RAW each time I do an edit, instead of trying to re-edit. Very frustrating...
![]() Edit: oooohhh, as I was typing Jeff posts about those first four bytes... I will be doing some experiments with that in a few days! I could try that 010 script for you Jeff!... thank you! :salute
__________________
"...and bollocks to the naysayers" - Jimbuna Last edited by propbeanie; 02-23-19 at 07:27 PM. Reason: Jeffz Post |
|
|
![]() |
| Tags |
| enviromental mod, environment, terrain, trees, vegetation |
| Thread Tools | |
| Display Modes | |
|
|
