![]() |
well the moment of truth arrived.....
http://www.subsim.com/radioroom/pict...pictureid=5023 Success :rock: I read and parsed the GR2 file without the granny2.dll (or any DLL for that matter) or any other outside file. Did it strictly from reading the file itself. The pointers tell you everything you need to know. I haven't coded in the materials or textures yet that's why it's wireframe only. Will work on that tomorrow :D Also have to code in reading the extended data for everything so one can edit/view it also. That'll probably be day after tomorrow. This extended data has stuff like jitter, blur, and some other stuff that I'm curious to play around with and see what it does in game :yep: The indicies threw me for a loop for many hours. The pointer kept telling me they started at x offset but no matter what I couldn't find them. I kept finding the wrong data. After hours of this it finally hit me that they are probably like the vertex data and located in a different section. Yep, that was the case :damn: There seems to be many different names that can be used for texture coordinates 0 and 1. If while using the app you load a model and it says unrecognized vertex component name please make a note of it and which GR2 model you were trying to view and send that information to me please. I currently have 2 defined for each. So section 0 contains all the arttool info, file info, bindings, extended data, and texture and map info. Section 1 contains the vertex data. Section 2 contains the indicies. Haven't figured out what the other sections do yet. Maybe with the coding of the textures, materials, and extended data they will make themselves known. I'm going to code in some 'debugger' type things into this. Things like being able to extract all the pointers and it tell you what they are, a file manifest that will include the offset address and physical address in the file of everything loaded by pointers, and some other ideas. This way one can see the information I used to make this possible. The granny viewer is an SDK of sorts. It tells you the file structure, it tells you the structure of items, and it even tells you the data type of the items. Using that and the pointers you can find/make anything. You'll occassionally stumble into something where you expected to be reading a pointer but you see a hard coded int value in the file. I've come across this when granny viewer shows an item with (x) where x denotes the number of them. You'll find that you read the number of the item first, then you read a pointer that points you to where the items are. The end of that pointer then will have x amount of that type in succession. There are some other little annoyances that took some time to figure out but can't think of them currently. The app is still using the fixed-function pipeline of DirectX for rendering. I'll convert it over to programmable pipeline (aka shaders) here soon. This will allow me to use the actual shaders of SH5 to do the rendering so we can see items just like in game (or near to it). I really can't wait to code in the animations part of this. I really want to see the keyframes of these GR2 files. Actually I'm just very curious to 'see' how they do it. :|\\ http://www.gamefront.com/files/20899...itorViewer_zip Let me know if you encounter any errors using it. How to use: left mouse click + mousemovement rotates 3D model right mouse click + forward/backward of mouse moves in/out on 3D model center mouse click + mouse movement changes camera focus point |
Thanks TDW. I downloaded it. Great job. Today is a new step to make this game unforgetable.
edit: Ok, i saw that i need to select my sh5 folder. Will test when I reinstall SH5. |
Quote:
|
:up:
Thank you TDW. Great work. Regards. Echol:ping:t. |
Hi TheDarkWraith!
When I start, issuing this message: Code:
Details of the operational My system: Win7 x64 sp1 Athlon II x2 255 4gb ram ddr3 ungaged mode GeForce GTX240 1gb |
Can not open any files in the folder Submarines - when I open any file returns consistently two errors:
http://www.subsim.com/radioroom/pict...pictureid=5024 http://www.subsim.com/radioroom/pict...pictureid=5025 Only open files from the Sea. From Dbgview: Code:
00000000 0.00000000 [4008] Silent Hunter 5 GR2 Editor/Viewer v1.0.58.0 by TheDarkWraith |
Quote:
Have you tried it on anything in \data\Sea? Worked on many of the ships I tried it on there. I'll open up the NSS_Undine using VS 2008 and look at its pointers and see what's going on. |
There's always a special one somewhere.....the NSS_Undine is laid out differently than other GR2 files I've seen. It defines it's pointers for section 0 where the file info header should be. I see from the section descriptions that it says it was going to do this but I never took something like that into account. I figured all GR2 would have their info header located at 0x1C8 in the file :shifty: That's what you get for assuming!!
I'll have to make some changes..... |
Quote:
http://www.subsim.com/radioroom/pict...pictureid=5026 http://www.subsim.com/radioroom/pict...pictureid=5027 http://www.subsim.com/radioroom/pict...pictureid=5028 From last screen: Quote:
Code:
00000000 0.00000000 [3980] GR2 file path is D:\GAMES\U-Boats\data\Sea\NBB_Nelson\NBB_Nelson.GR2 |
Quote:
Or is it creates a virtual drive then?:06: |
Quote:
|
Oops!:oops: At the end of the log display the Cyrillic properly. That's what it says:
00000779 40.36660385 [3980] ********* Pointer data value read was blank @ line number 111 340 ********* 00000780 40.36660385 [3980] 00000781 66.86171722 [3980] ********* Exception occured. Exception is System.ArgumentOutOfRangeException: Index out of range. The index must be a positive number, and its size should not exceed the size of the collection. 00000782 66.86171722 [3980] Parameter name: index 00000783 66.86171722 [3980] in System.ThrowHelper.ThrowArgumentOutOfRangeExceptio n (ExceptionArgument argument, |
Quote:
http://www.subsim.com/radioroom/pict...pictureid=5029 |
Quote:
There is one positive thing from this Undine: [3172] GR2 file path is C:\Games\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Undine\NSS_Undine.GR2 [3172] [3172] Current position in file is 0x0 [3172] [3172] Reading file header data starting at 0x0 [3172] Magic string=)ÞlÀº¤S+%õ·¥öfâî 0x10 [3172] File list start offset (from file beginning)=0x1C8 0x14 where the file list header starts [3172] Unknown1=0x0 0x18 [3172] Unknown2=0x0 0x1C [3172] Unknown3=0x0 0x20 [3172] Current position in file is 0x20 [3172] [3172] Reading info header data starting at 0x20 [3172] File format revision=0x7 0x24 [3172] File size in bytes=1720964 0x28 [3172] CRC value=0xC52FD13B 0x2C [3172] Bytes from offset to start of sections=0x48 0x30 bytes from start of this to first section [3172] Number of sections=8 0x34 [3172] Root object type (?)=0x6 0x38 [3172] Root object offset (?)=0x0 0x3C [3172] Unknown1=0x0 0x40 [3172] Unknown2=0x0 0x44 [3172] Tag=0x80000032 0x48 [3172] Current position in file is 0x68 [3172] [3172] Reading section 0 (arttoolinfo) data starting at 0x68 [3172] Unknown=0x0 0x6C always 0x0 [3172] Section file offset=0x468C 0x70 where this section starts in the file [3172] Compressed size=61184 0x74 compressed size and uncompressed sizes should equal for SH5 GR2s [3172] Uncompressed size=61184 0x78 compressed size and uncompressed sizes should equal for SH5 GR2s [3172] Alignment=0x4 0x7C what the alignment boundary is in the file [3172] Start of data fileoffset=0xBD9C 0x80 start of data [3172] Start of data fileoffset2=0xBD9C 0x84 start of data [3172] Pointers file offset=0x1C8 0x88 where the pointers for this section are located [3172] Number of pointers=1467 0x8C [3172] Pointer to unknown=0x468C 0x90 [3172] Unknown2=0x0 0x94 [3172] Current position in file is 0x94 if you look at section 0 under number of pointers is Pointer to unknown. I now know what this pointer to unknown is! It's the point just after the pointers.....The pointers file offset is 0x1C8. NUmber of pointers is 1467. 1467 * 3 * 4 = 0x44C4. 0x44C4 + 0x1C8 = 0x468C. Exactly where pointer to unknown points :DL |
Quote:
|
All times are GMT -5. The time now is 11:08 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.