![]() |
SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
![]() |
#31 |
GLOBAL MODDING TERRORIST
|
![]()
Once upon a time..............
(Yeah things start with that to this day!) The only way to work with the files was in Hex. Most of the early tools did that even if one did not know it was hex work. Some of the (Actually all the best) Modders worked the files in Hex. Those were the days before S3D which one person called a "Dumb down tool" On that I have 2 opinions. 1. Yes. It did open the door to just being ignorant of the TRUE file structure and hoping it would do EVERYTHING you wanted to do. 2. No. Blended with a GOOD Hex editor? One can do things in less time than S3D alone can never do. In Modding SH series of Games always look for the best Tools and ways of doing it. Years of modding with subpar tools have lost a lot of good modders. |
![]() |
![]() |
![]() |
#32 |
GLOBAL MODDING TERRORIST
|
![]()
Been expanding the script to read (False) RAW terrain files in SH5 to now export the information to the Object file format.
That will allow us to SEE the (False) RAW terrain files in a 3D program. ![]() SH3/4 use a different (True) RAW format then SH5. However. It should be possible to do the same thing for SH3/4 IF the height values are the same based on info We have. |
![]() |
![]() |
![]() |
#33 |
GLOBAL MODDING TERRORIST
|
![]()
Testing has proven the RAW files are inverted in SH5.
Not surprising in a way. Just have to adjust the scripts now. |
![]() |
![]() |
![]() |
#34 | |
Sonar Guy
![]() |
![]() Quote:
Most part look the same like the one posted in "The SH5 EcoMod" thread, but have some differences. Underwater is different near the shore, and 0-64 band is different. The rest look the same. When go home tonight, I'll post it if you need it. I did some experiments there, but now will be interested to change sh3 elevation table with this one from sh5, and to see the result.
__________________
If you ride like lightning, you're gonna crash like thunder. |
|
![]() |
![]() |
![]() |
#35 |
GLOBAL MODDING TERRORIST
|
![]()
That information would be useful. We could then create a 3D model of the SH3/4 terrain one could work with in any 3D program.
|
![]() |
![]() |
![]() |
#36 |
Sonar Guy
![]() |
![]()
SH3 Terrain elevations table
__________________
If you ride like lightning, you're gonna crash like thunder. |
![]() |
![]() |
![]() |
#37 |
GLOBAL MODDING TERRORIST
|
![]()
Thanks Tycho.
I saved that information for future testing. Now. The SH3/4 RAW files are 601 x 601 pixels and do use the 0 to 255 colors for height data. Viewing in a 3D program would greatly assist even SH3/4! Testing on the SH5 RAW files is going better then I expected so far. RAW files from SH5 will read as a 201 x 201 if imported to Photoshop. THAT IS A FALSE READING!!! SH5 RAW files are 101 x 101 pixels (Not a very accurate definition). They are 101 x 101 floats that give the height values of the given area. MUCH more accurate the SH3/4. @Tycho Given you can tell me where to find that data in the SH3.exe? It may be possible to edit for a sharper shore line and maybe shoals effect! Last edited by Jeff-Groves; 01-28-19 at 04:27 PM. |
![]() |
![]() |
![]() |
#38 |
CTD - it's not just a job
|
![]()
This is getting ~really~ good... High hopes!
![]()
__________________
"...and bollocks to the naysayers" - Jimbuna |
![]() |
![]() |
![]() |
#39 | |
Sonar Guy
![]() |
![]() Quote:
This year I decided to take a break from SH3. Everything related is archived, and will rest for year or two. So, I will not spend big amount of time and brain power for Silent Hunter. Here, about terrain I can change this elevations table with sh5 one. Just for experiment, to see the result, and because will be quick and easy. In fact, in sh3.exe have two such tables, the two are identical. First one is at: 0x530ac0 /or: 00130ac0 And I saw where is used in the code. Second one, at: 0x5314f0 /or: 001314f0 I don't saw where is used. Maybe is not used. It is matter of experiment, are it also need to be changed, if I change the first one. By address of the first one you can search where is used in the code section. In this function, for example: Maybe is possible, let's say, to prioritise the underwater and to simplify the above water terrain. If give it more indexes. Of course, this will require completely new map and elevations table, if now give 208 to the underwater and 48 to the ground: The most of the world will go underwater (Sci-Fi mod: Waterworld ![]() To better understand it, I need to run it through debugger, but I will not. Maybe is possible, this 601x601 also to be changed, I think, I once saw this somewhere there. So, probably many things are possible if someone have desire to do it.
__________________
If you ride like lightning, you're gonna crash like thunder. |
|
![]() |
![]() |
![]() |
#40 |
GLOBAL MODDING TERRORIST
|
![]()
Tycho,
Thanks Mate! ![]() On taking a break? I myself do so from time to time. gap got me interested in the current 010 script to extract the information in the SH5 RAW files. So far it will extract the heights and create an obj file that one can edit in any 3D program that imports the obj format. A second script will convert the obj back to a RAW file. Once the scripts are working as planned? A stand alone program will be done. |
![]() |
![]() |
![]() |
#41 |
GLOBAL MODDING TERRORIST
|
![]()
The start script to export SH5 terrain RAW files to the obj format.
This does all the x y z stuff but does not include the VT or faces code. Nice looping example thought! _____________________________________ //------------------------------------------------ //--- 010 Editor Script File // RAW to object file .003 // Reads the DetailMask RAW files in SH5 and outputs an Object file // //------------------------------------------------ int i, l, t, s=101; char W[40]; float x, y, z; x=-2550; for( i = 0; i < s; i++) { x=(x+50); z=-2550; l=101; { for( t = 0; t < l; t++) { y = ReadFloat(); z=(z+50); Printf( "v %f %f %f\n", z, y, x ); FSkip(4); } } } Printf("Test");// all the code for textures and faces will follow W = InputString("Save File", "Name your save file", "c:\\temp\\");// You can change the path when saving. OutputPaneSave( W ); |
![]() |
![]() |
![]() |
#42 |
GLOBAL MODDING TERRORIST
|
![]()
Had to send a possible bug report to SweetScape today!
![]() Run this script and you'll see the problem at line 84 or so. This does not interfere with the stand alone C++ version I'm working on. It only interferes with rapid prototype coding. Given this error? It may show up as I finalize coding the faces stuff. //------------------------------------------------ //--- 010 Editor Script File // RAW to object file add in // Adds the Textures // //------------------------------------------------ // all the code for textures coords below int j, m, q=101, p; float vt1=-0.00100000000003808065, vt2; for( j = 0; j < q; j++) { vt1=(vt1+0.001); vt2=-0.01; m=101; { for( p = 0; p < m; p++) { vt2=(vt2+0.01); Printf( "vt %f %f\n", vt1, vt2); } } } Printf("texture Testing. Error at texture coord 84"); Last edited by Jeff-Groves; 01-31-19 at 01:37 PM. |
![]() |
![]() |
![]() |
#43 |
GLOBAL MODDING TERRORIST
|
![]()
Fixed script above by replacing float with double.
float vt1=-0.00100000000003808065, vt2; to double vt1=-0.00100000000003808065, vt2; and changed the Printf function Printf( "vt %f %f\n", vt1, vt2); to Printf( "vt %lf %lf\n", vt1, vt2); Will triple check the output then move on to the faces scripting. |
![]() |
![]() |
![]() |
#44 |
CTD - it's not just a job
|
![]()
Ah-HAA! So I'm not the only one with data type issues... shneaky little data bits... Glad you got that. Looking at the documentation, a Double is a "64-Bit Floating Point Number ", while a Float is a "32-Bit Floating Point Number", which with the files of the game, it would seem to make more sense to use a 32-bit data type, but... I suppose it has to do with the OS maybe??
![]() ![]() ![]()
__________________
"...and bollocks to the naysayers" - Jimbuna |
![]() |
![]() |
![]() |
#45 |
GLOBAL MODDING TERRORIST
|
![]()
It's a problem with floats.
From Graeme at SweetScape............ "The error you are seeing is caused because 'float' is not very accurate for doing a lot of computations. We tried your function in C++ and it gives the same issue. 'float' is just not very accurate and if you switch to 'double' it will be better, although double has accuracy issues as well for lots of computations." Then next section (Faces) uses all ints so shouldn't have a problem. ![]() One thing I am doing is writing separate scripts for each part. Verts, Vertical Textures, Faces are all separate scripts. Makes catching errors easier. The 1st script calls the next 2 in order just as if it was all one script. |
![]() |
![]() |
![]() |
|
|