SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 10-31-11, 12:10 AM   #1
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Version 1.0.335.0 released. See post #1.

This version fixes the offsets reported wrong in the FileHeader and InfoHeader debug output.

Fixed bug in the extendeddata recursion function where if an item had no subitems you would get an exception.

More error checking added in this version. As a result of some of this I somehow totally overlooked not reading ALL the pointers for section 0. All this time I thought I was reading them all but the error checker told me differently. When I did the math it was quite evident that I've been overlooking pointers in section 0. I will be looking into what these 'new' pointers do now.

This version will now read just about any GR2 file in SH5 (except for Undersea). That means it will now read the VIIA sub I know why Undersea will not read and it's because I found a small part of hard-coded reading of ArtToolInfo:ExtendedData in the app. I will fix this in the next version I was able to open air units, sub units, land units, and files in the \data\Library folder.

If you find a file that will not open please let me know (except for \data\Library\Undersea.gr2)

When looking over the Debug output if you see any offsets (or actual file positions) or values that look suspicious/strange let me know. I hope I've corrected all the errors in those. If you can, compare random items in the Debug output to the actual file and see if they match or not.

Next version I hope to have the ability to change just about anything in the extendeddata of an item coded in. I also hope to have coded in the ability to adjust properties of items also (position, rotation, color, etc.)

If I have time and haven't coded in too much (I don't like to add too much to each version) I'll start working on the exporter so you can rip whatever you want from the GR2 file. I plan on making the exporter rip to OBJ format for now. I plan on adding Microsoft's X format to it in time. Additional formats might happen depending on the information available on them (so I know how to make the format).


Last edited by TheDarkWraith; 10-31-11 at 12:33 AM.
TheDarkWraith is offline   Reply With Quote
Old 10-31-11, 02:43 AM   #2
tonschk
Sea Lord
 
Join Date: Mar 2007
Posts: 1,897
Downloads: 172
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post

Version 1.0.335.0 released. See post #1.

This version will now read just about any GR2 file in SH5 (except for Undersea). That means it will now read the VIIA sub I know why Undersea will not read and it's because I found a small part of hard-coded reading of ArtToolInfo:ExtendedData in the app. I will fix this in the next version

Very Good TheDarkWraith Well done
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 10-31-11, 12:17 PM   #3
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

v1.0.342.0 released. See post #1

This version removed the hard-coded reading of some items in the ArtToolInfo:ExtendedData. Now the file tells it what to read based on the pointers. As a result of this the Undersea.gr2 file can now be read There is currently only one file I've found that it can't open still - \data\Library\ShipParts\guns_radars_01.gr2. Looking into why currently....
TheDarkWraith is offline   Reply With Quote
Old 10-31-11, 03:34 PM   #4
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Was single stepping the guns_radars_01.GR2 file in the Visual Studio debugger and noticed something interesting. It is a special GR2 file (pointers come before data) but it doesn't want to follow the 'rules' that these type of files have followed in the past (NSS_Undine for example). Now I have to figure out what makes the rules change and why Maybe someone might know the answer to this? Beuhler?

Normally in these type of files (these 'special' GR2 files) you have a pointer to say a model. That pointer then references a table (think of it as a virtual function table in exe files). The table points it to where the actual model is. This one doesn't want to use the table - it wants to go straight to the model.....

In normal GR2 files when you have a pointer to something (say a model) it points to the actual item. There is no table or indirect pointer for it.
TheDarkWraith is offline   Reply With Quote
Old 10-31-11, 04:22 PM   #5
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

didn't take as long as I thought to figure out the above problem.
There are two 'rules' (so far) to special GR2 files (pointers before data):
- if section 0's unknown2 is 0x0 then the pointer to the model will access the pointer table (think of it as v-table in exe files)
- if section 0's unknown2 > 0x0 then the pointer to the model points to the model (acts like a normal GR2 file in this regard)

I wonder what other interesting little things like this will rear their ugly head

Version 1.0.348.0 released. See post #1.

You should be able to open ANY SH5 GR2 file now. Let me know if you come across one that won't open
TheDarkWraith is offline   Reply With Quote
Old 10-31-11, 04:42 PM   #6
Will-Rommel
Chief
 
Join Date: Jan 2008
Posts: 319
Downloads: 81
Uploads: 0
Default

Impressive sir, i hope there wont be to much of those "exceptions" you encountered. (Must be a nightmare to treat)
__________________
-Fighting is a lifestyle-
Will-Rommel is offline   Reply With Quote
Old 10-31-11, 04:44 PM   #7
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 73
Uploads: 0
That's just awesome progress! Well done!

As of problems: I cannot open \data\Characters\CharacterBodyParts.gr2 due to errors in section 0 endpointersfileoffset being not equal to filesizeinbytes.
When I try to open NSS_Uboat*.gr2 files - the EVEI gives me a lot of
Code:
Exception
C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat2a\NSS_Uboat2a.GR2 closed
********* Exception while presenting
Exception is ***1054;***1096;***1080;***1073;***1082;***1072; ***1074; ***1087;***1088;***1080;***1083;***1086;***1078;***1077;***1085;***1080;***1080;.
-2005530516 (D3DERR_INVALIDCALL)
   ***1074; Microsoft.DirectX.Direct3D.Device.BeginScene()
   ***1074; TheDarkWraith.SilentHunter5.Graphics.Render() *********
...
which goes in endless loop. (WindowsXP 32 locale is RU)

None of the animations' gr2s can be opened either due to skeleton's data absence, but I recon - animations are thing of the future as of yet. When I open 'waypoints' files - I see nothing but no errors either, though I guess this is normal.
I am still hoping to create fully functioning crew and it appears that only you can make it possible, TDW, thanks for all your hard work.

Last edited by Vanilla; 10-31-11 at 04:54 PM.
Vanilla is offline   Reply With Quote
Old 10-31-11, 07:25 PM   #8
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,959
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Vanilla View Post
That's just awesome progress! Well done!

As of problems: I cannot open \data\Characters\CharacterBodyParts.gr2 due to errors in section 0 endpointersfileoffset being not equal to filesizeinbytes.
When I try to open NSS_Uboat*.gr2 files - the EVEI gives me a lot of
Code:
Exception
C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat2a\NSS_Uboat2a.GR2 closed
********* Exception while presenting
Exception is ***1054;***1096;***1080;***1073;***1082;***1072; ***1074; ***1087;***1088;***1080;***1083;***1086;***1078;***1077;***1085;***1080;***1080;.
-2005530516 (D3DERR_INVALIDCALL)
   ***1074; Microsoft.DirectX.Direct3D.Device.BeginScene()
   ***1074; TheDarkWraith.SilentHunter5.Graphics.Render() *********
...
which goes in endless loop. (WindowsXP 32 locale is RU)

None of the animations' gr2s can be opened either due to skeleton's data absence, but I recon - animations are thing of the future as of yet. When I open 'waypoints' files - I see nothing but no errors either, though I guess this is normal.
I am still hoping to create fully functioning crew and it appears that only you can make it possible, TDW, thanks for all your hard work.
I will look into these problems Nothing for animations has been coded yet. The hard part is figuring out how the animations work in GR2 files. I know how to read animations from dat files but GR2 is a whole different story.

As far as the waypoint files you need to turn the bones on. They have no models or meshes, they are strictly bones EDIT: ok just tried it myself and nothing showed. Will look into this.

The animation ones made me laugh when I just tried to open one up. Of course it has no skeleton, it's all animation data. At least my error checker is working as programmed. I'll correct this.
TheDarkWraith is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:51 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.