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 02-03-12, 08:27 PM   #511
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post

I hope to have a new test version available here real soon so you all can load GR2 files and ask sentinel to write a new file. I'll also have you ask Sentinal to getchainforsection x to see if the linked-list is complete or broken for each section. If a GR2 file's section has a broken chain I need to know so I can figure out why. Then you can load the new file in Granny Viewer to see if it's broke or not. Then you can further compare the original to the copy to see if the new writer has any problems with that GR2 file. If the new writer passes with flying colors then I'm in the home stretch. I can then write the remaining code to add new bones, materials, textures, meshes, etc. I can then also write the remaining code to modify (increase/decrease size) of items in the file (i.e. change geometry of meshes in GR2 file for instance)

WIll it work with any Gr2s? or generic gr2s?
Ekmek is offline   Reply With Quote
Old 02-03-12, 11:02 PM   #512
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Ekmek View Post
WIll it work with any Gr2s? or generic gr2s?
Currently I have it locked to accept only certain GR2 files (it's based on what it reads from fileheader)

The writer is complete and works like a champ . One problem though: when comparing the files written to their original there were some differences. These differences were in the extendeddata regions, namely the ArtToolInfo's extendeddata region. Upon investigation I know why there are differences but the solution to the why is more complex and haven't figured it out yet.
Open up NSS_Undine.GR2 in Granny Viewer. Click on ArtToolInfo. Click on ExtendedData. Click on SelectionSets. Now what we see are 4 entries: Name, Objects, Name, Objects. This is the problem - the duplication of entry names. When the writer goes to write extendeddata it asks the extendeddata class to find the value for the entry it needs to write. So the first Name and Objects are written correctly but the next Name and Objects are written incorrectly - because the extendeddata class returns the first one it finds of each .
One would probably ask why are these needed? The answer is because they are type granny char * (pointer to a string) and thus I have to write those string values to the new file at the correct place in the file.
I'll have to think this one over more...I don't want to screw up my extendeddata class because it works perfectly besides this one little error...
TheDarkWraith is offline   Reply With Quote
Old 02-04-12, 01:09 AM   #513
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

found one source of my problem with the extendeddata. The writer was writing some of the data from the data's offset vice it's file offset (file offset takes into account the section the data is in - HUGE difference in locations).

Received a question via PM. I thought it deserved a public answer. The question was basically don't I have working writer already? Why the need to make another one?

That is an excellent question. To answer that I have to go back to the reader. The reader reads in all the data from the file. All that data is stored in a memorystream buffer so that it's readily accessible and the file layout stays intact. This allowed for the early features of the app - the ability to change extendeddata, ability to change mesh positions, rotations, etc. The reason it allowed for the early features was because I had the whole file image in memory (via the buffer) so all I had to do was go to x location and change the value to what the user wanted. Now the first writer merely took the buffer and wrote it into a file. It didn't really have to do anything at all. The new writer actually has to work. It doesn't just take a buffer and write it to a file. It actually creates a new, blank GR2 file (0 bytes of data in it). Then it goes to the file's Sentinel and asks for the linked-list. Sentinel hands over the linked-list to the writer. The chain (linked-list) is nothing but links of classes strung together (the layout of the file). So the writer starts at the beginning of the chain and asks that class to write it's data to the file. It then goes to the next class and asks it to write it's data to the file. This class then asks the previous class for it's offset and size. The class then adds these together to determine where it needs to write it's data in the file at. Once it knows where to write it writes the data to the file. The writer then proceeds to the next class and so on and so forth until it reaches the end of the chain.
This new writer allows me to do what I've always wanted to do: slice and dice the GR2 file at will!

All I have left to do before I can release the new test version is figure out this multiple entry problem with my extendeddata
TheDarkWraith is offline   Reply With Quote
Old 02-04-12, 11:29 AM   #514
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

When you release it can you include a sample gr2 from subsim? I'd like to see how its working. thanks.
Ekmek is offline   Reply With Quote
Old 02-04-12, 12:15 PM   #515
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Ekmek View Post
When you release it can you include a sample gr2 from subsim? I'd like to see how its working. thanks.
How it's working? Don't follow you. If you mean what does it do it reads the entire file (except for animation and trackgroup data) and displays the contents to screen. You can move meshes around, edit extendeddata, basically you can do just about anything. The rest of the just about anything is almost complete

You can take the current version released @ post #1 and use it. It's functional and will display any GR2 file SH5 has. You can even export mesh data with it and import mesh data with it. You can reposition meshes, bones, etc. with it also. And you can edit extendeddata with it.

Finally got the extendeddata multiple entries bug fixed. Compared new file to original and everything is an exact copy except for the very small numbers contained in the bone's position, rotations, and inverse transforms. Some of these numbers when read from the GR2 file are 0.285E-08 (very small) and their precision is greater than a float's precision. When the reader reads these values they end up being 0x0 in memory since float precision is out to 6 decimal places. What I think I have to do is change their type to double or decimal so that I can keep the precision read from the file. That's what I'm working on now
TheDarkWraith is offline   Reply With Quote
Old 02-04-12, 02:53 PM   #516
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
How it's working? Don't follow you. If you mean what does it do it reads the entire file (except for animation and trackgroup data) and displays the contents to screen. You can move meshes around, edit extendeddata, basically you can do just about anything. The rest of the just about anything is almost complete

You can take the current version released @ post #1 and use it. It's functional and will display any GR2 file SH5 has. You can even export mesh data with it and import mesh data with it. You can reposition meshes, bones, etc. with it also. And you can edit extendeddata with it.

Finally got the extendeddata multiple entries bug fixed. Compared new file to original and everything is an exact copy except for the very small numbers contained in the bone's position, rotations, and inverse transforms. Some of these numbers when read from the GR2 file are 0.285E-08 (very small) and their precision is greater than a float's precision. When the reader reads these values they end up being 0x0 in memory since float precision is out to 6 decimal places. What I think I have to do is change their type to double or decimal so that I can keep the precision read from the file. That's what I'm working on now
I strongly believe those are meant to be zeroes! As far as I can remember Granny Viewer treats them as zeroes. Maybe just 'zeroize' those?
Vanilla is offline   Reply With Quote
Old 02-04-12, 10:47 PM   #517
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

Quote:
Originally Posted by Vanilla View Post
I strongly believe those are meant to be zeroes! As far as I can remember Granny Viewer treats them as zeroes. Maybe just 'zeroize' those?
I agree also. But it really troubles me as to why those values are in the GR2 file in the first place Maybe it's because 3DS Max stores position, rotation, and values of the sorts in doubles or decimal instead of floats
TheDarkWraith is offline   Reply With Quote
Old 02-05-12, 04:03 AM   #518
Vanilla
Lieutenant
 
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
Default

Quote:
Originally Posted by TheDarkWraith View Post
I agree also. But it really troubles me as to why those values are in the GR2 file in the first place Maybe it's because 3DS Max stores position, rotation, and values of the sorts in doubles or decimal instead of floats
I am pretty much sure that those E-08 came from 3ds max, alhough three things spring to mind: avoiding division by zero somwhere in the game engine, that numbers cannot be nought due to some convention either in the game or the 3ds, manualy moving all the models to (0, 0, 0) and doing it only that precise (which is good enough). Knowing how people do graphics, my guess the latter is true.
As of what to do with those: zeroize those, since converting everything to double would radically expand memory requirements of the GR2 EVEI, can slow it down for some complex models. If granny viewer considers zeroized files ok, I guess the game won't have problems either.
Though it is all just my wild guess.

TDW, as a side note, in my life I've seen many people (being one myself) saying: 'hey, I undestand how this is constructed and how it works and I hate routine things so I'll write a utility and it will do the routine for me!' and then in 99.99% of the cases no 'utility' comes out of it. You are one of not-so-many who are actually able to do it! Awesome work! I am deeply impressed!
Vanilla is offline   Reply With Quote
Old 02-05-12, 09:32 AM   #519
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

that TDW guy is a "one man army"

Keep up the good work! I can't wait to use your tool
__________________

kapitan_zur_see is offline   Reply With Quote
Old 02-06-12, 08:13 PM   #520
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

I tried going through the downloads section to see if there are any gr2 files and havent had luck. By any chance can someone recommend a file to download so I can test out this utility?
Ekmek is offline   Reply With Quote
Old 02-06-12, 08:49 PM   #521
pedrobas
Seasoned Skipper
 
Join Date: Apr 2007
Location: Huelva, Spain
Posts: 664
Downloads: 301
Uploads: 0
Default

Quote:
Originally Posted by Ekmek View Post
I tried going through the downloads section to see if there are any gr2 files and havent had luck. By any chance can someone recommend a file to download so I can test out this utility?
There you go: http://www.gamefront.com/files/21153...v1_0_507_0_zip

pedrobas is offline   Reply With Quote
Old 02-07-12, 12:09 AM   #522
Ekmek
Mate
 
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
Default

Quote:
Originally Posted by pedrobas View Post


Thanks but I actually need a gr2 file from SH5. I'm kind of trolling here looking for a granny tool to use on some other games
Ekmek is offline   Reply With Quote
Old 02-07-12, 12:40 PM   #523
kapitan_zur_see
Commodore
 
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
Default

Just had a look at the latest version since it's getting less and less a WIP.
However, I must say I'm a bit lost if not confused...

How is it that the then released tool will work (speaking of the workflow)?
Is it a tool just to add/alter mesh models?? Are bones will be interconecting with dat files, you know what I mean?

Like if I want to add some meshes and then altogether ties it to some data entry like a particle generator for example, will I be able to do that within your tool? Or say, will I have to add a bone in your tool, then quit, then launch the modified GR2 file in goblin, merge with dat files and etc., then somehow attach some behavior to the newly created bone?

I'm quite lost at how all kinds of files will be merged in the workflow and etc. Don't know if you get my point. Or is it because your test releases are merely depicting what your tool is gonna be and are just "viewers" to showcase the progress of deciphering GR2 files
__________________

kapitan_zur_see is offline   Reply With Quote
Old 02-09-12, 02:51 AM   #524
TheDarkWraith
Black Magic
 
Join Date: Jun 2007
Posts: 11,962
Downloads: 147
Uploads: 5


Default

I am finally able to arbitrarily add/remove bytes to the GR2 file (special or normal) whereever I want, whenever I want (new files written with these changes are perfect and pass Granny Viewer test)

I can add/change arttoolinfo, exporterinfo, pointers, datatype definitions, embedded strings, and extended data with no problems. Now I will work on adding new bones
TheDarkWraith is offline   Reply With Quote
Old 02-09-12, 05:47 AM   #525
BIGREG
Grey Wolf
 
Join Date: Oct 2005
Location: Bretagne-FRANCE
Posts: 813
Downloads: 155
Uploads: 0
Hello to any and all.

Sorry for my silence, but have not found a way to properly finish the texturing of the sonar / radio room (QR1) too much texture coordinate bug, despites the addition of textures and other tricks, I left on hold modding, while keeping an eye on the progression of many new mods.
Congratulation to all !

HI, TheDarkWraith and thank you for your work

Okay, so I have a question about your editor

- Added a full screen mode?
- Added a zoom on a selected meshe ? (I just do not get close enough in room)
- Addition of rotation axes ? (needles, levers) (to repair the fuel gauge in the diesel room)
- Possibility to reposition the texture coordinates ? It'll be a pleasure for me

a small bug report: the textures for common rooms do not load (in my opinion just a problem of location file)

Again, a big "Merci" to you TheDarkWraith, for your incredible work

Waiting for your next release

BigReg/BigRegOne

translate with google
BIGREG is offline   Reply With Quote
Reply


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 03:21 PM.


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.