SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997 |
02-03-12, 08:27 PM | #511 | |
Mate
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
|
Quote:
WIll it work with any Gr2s? or generic gr2s? |
|
02-03-12, 11:02 PM | #512 |
Black Magic
|
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... |
02-04-12, 01:09 AM | #513 |
Black Magic
|
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 |
02-04-12, 11:29 AM | #514 |
Mate
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
|
When you release it can you include a sample gr2 from subsim? I'd like to see how its working. thanks.
|
02-04-12, 12:15 PM | #515 | |
Black Magic
|
Quote:
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 |
|
02-04-12, 02:53 PM | #516 | |
Lieutenant
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
|
Quote:
|
|
02-04-12, 10:47 PM | #517 |
Black Magic
|
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
|
02-05-12, 04:03 AM | #518 | |
Lieutenant
Join Date: Nov 2006
Location: St. Petersburg, Russia
Posts: 264
Downloads: 72
Uploads: 0
|
Quote:
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! |
|
02-05-12, 09:32 AM | #519 |
Commodore
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
|
that TDW guy is a "one man army"
Keep up the good work! I can't wait to use your tool |
02-06-12, 08:13 PM | #520 |
Mate
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
|
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?
|
02-06-12, 08:49 PM | #521 | |
Seasoned Skipper
Join Date: Apr 2007
Location: Huelva, Spain
Posts: 664
Downloads: 301
Uploads: 0
|
Quote:
|
|
02-07-12, 12:09 AM | #522 | |
Mate
Join Date: Nov 2011
Posts: 53
Downloads: 4
Uploads: 0
|
Quote:
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 |
|
02-07-12, 12:40 PM | #523 |
Commodore
Join Date: Mar 2005
Location: France
Posts: 614
Downloads: 60
Uploads: 0
|
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 |
02-09-12, 02:51 AM | #524 |
Black Magic
|
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 |
02-09-12, 05:47 AM | #525 |
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 |
|
|