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-26-11, 07:59 PM   #181
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

7A loads fine for me with your last version.

Would a defined version of the UnderSea gr2 file help you?
  Reply With Quote
Old 10-27-11, 08:35 AM   #182
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
7A loads fine for me with your last version.

Would a defined version of the UnderSea gr2 file help you?
I'd be willing to look it over. The problem currently is I have to get rid of the hard-coded items I have. I know where the ArtToolInfo resides and how to read it but I need the app to be dynamic and let the pointers tell it where to read this from. Once I get over this hurdle then the rest should be cake. I have it reading the embedded strings dynamically. Now I'm making it read any data associated with those strings dynamic. This is proving to be a little on the challenging side though.
I've coded in the checking of the file size in bytes and the auto correcting of it. Adding the CRC checker and auto correcting of it also

7A has always loaded fine. It's the IIA and undersea that won't load due to some additional data contained in them that I haven't figured out what the purpose is for yet. Because of my current hard-coded reading of the ArtToolInfo these will always fail. That is why I'm moving to dynamic reading of information. Live and learn.

Last edited by TheDarkWraith; 10-27-11 at 08:47 AM.
TheDarkWraith is offline   Reply With Quote
Old 10-28-11, 07:43 AM   #183
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
Downloads: 172
Uploads: 0
Default

Thank you very much TheDarkWraith for this Magnificent Work you are doing
__________________
What we do in life echoes in Eternity
tonschk is offline   Reply With Quote
Old 10-28-11, 05:42 PM   #184
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by TheDarkWraith View Post
I'd be willing to look it over. The problem currently is I have to get rid of the hard-coded items I have. I know where the ArtToolInfo resides and how to read it but I need the app to be dynamic and let the pointers tell it where to read this from. Once I get over this hurdle then the rest should be cake. I have it reading the embedded strings dynamically. Now I'm making it read any data associated with those strings dynamic. This is proving to be a little on the challenging side though.
I've coded in the checking of the file size in bytes and the auto correcting of it. Adding the CRC checker and auto correcting of it also

7A has always loaded fine. It's the IIA and undersea that won't load due to some additional data contained in them that I haven't figured out what the purpose is for yet. Because of my current hard-coded reading of the ArtToolInfo these will always fail. That is why I'm moving to dynamic reading of information. Live and learn.
SummaryInfo in the Undersea.gr2 is blank.
Appears to be for comments which is probably useless anyway.

IIA has an animation which adds info to the Section 0 stuff as a start.

I'll finish up some things and send you a link.
  Reply With Quote
Old 10-29-11, 04:34 AM   #185
urfisch
Sea Lord
 
Join Date: Mar 2005
Location: Deep down in Germany
Posts: 1,969
Downloads: 42
Uploads: 0
Default



__________________


urfisch is offline   Reply With Quote
Old 10-29-11, 08:42 AM   #186
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by privateer View Post
SummaryInfo in the Undersea.gr2 is blank.
Appears to be for comments which is probably useless anyway.

IIA has an animation which adds info to the Section 0 stuff as a start.

I'll finish up some things and send you a link.


The file size checker/fixer has been coded in.
The CRC-32 checker/fixer has been coded in.

These two items will be checked when the file is first loaded. If either/both are incorrect it will ask if you want to fix each one. The fix will be immediately written to the file
TheDarkWraith is offline   Reply With Quote
Old 10-30-11, 12:41 AM   #187
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Recursion can be a powerful thing. It is sometimes very difficult to setup/get correct. This was the case for the reading of the extended data for items. On my plane flight home from Portland, OR I was single stepping through the debugger in Visual Studio trying to get the recursion correct for item's extended data. I finally have it working correctly for the extended data now I had the reading of the item's extended data 'hard-coded' for I knew basically what to expect. This was not acceptable to me because there are probably files that contain more or less in extended data. I needed this to be dynamic and let the file tell me what it has.
I didn't fully understand at first how say GrannyViewer knew how to read everything that it did (and thus was why many things were 'hard-coded'). This took some time to figure out. Now I fully understand Nothing (currently) is hard-coded in the app. It is fully dynamic and it knows what to read from those magical pointers (and some other new pointers that I call data type pointers).
Just because it's fully dynamic doesn't mean it can read everything. If it doesn't 'understand' something (it reads something and the app doesn't know what it read/how to interpret it) then it will fail. This is currently the case with any GR2 file that has animations in it. I have not told the app how to handle animations. The mystery data in undersea and VIIA it doesn't know how to handle either (yet). Those I am still working on

This new version (1.0.322.0) includes the above and also the file size checker and CRC-32 checker. You'll notice new text in the DbgView output for these and also for the ArtToolInfo's extended data (it will look like GrannyViewer shows it because that's how it told me to read it )

New version 1.0.322.0 released. See post #1


Last edited by TheDarkWraith; 10-30-11 at 01:00 AM.
TheDarkWraith is offline   Reply With Quote
Old 10-31-11, 12:10 AM   #188
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #189
tonschk
Admiral
 
Join Date: Mar 2007
Posts: 2,200
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   #190
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #191
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #192
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
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   #193
Will-Rommel
Chief
 
Join Date: Jan 2008
Posts: 320
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   #194
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
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, 05:14 PM   #195
THE_MASK
Ace of the deep .
 
THE_MASK's Avatar
 
Join Date: Jan 2006
Posts: 9,225
Downloads: 901
Uploads: 73


Default

Yay , i can open the trees and the undersea rocks . Thats all i need
THE_MASK 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 12:45 AM.


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