View Full Version : GR2 Editor/Viewer/Extractor/Importer
Pages :
1
[
2]
3
4
5
6
7
8
9
10
11
THE_MASK
11-23-11, 02:33 PM
Nice work :yeah:
I downloaded GR2EditorViewer_v1_0_402_0
Dont know really what i am doing .
I opened the undersea GR2 and edited the meshes scale for the rocks to 3 . I can see the larger rocks in the viewer ok . When i exit out of the viewer and then open up undersea again the GR2 file is the vanilla size again .
1.5 looks nice for the KGV hull .
If i try to open NBB_Nelson the message says Name was not found for mesh in pointers .
Madox58
11-23-11, 06:01 PM
The mesh changes are currently not written to the file
2 posts up from yours Mate.
TheDarkWraith
11-23-11, 06:01 PM
Nice work :yeah:
I downloaded GR2EditorViewer_v1_0_402_0
Dont know really what i am doing .
I opened the undersea GR2 and edited the meshes scale for the rocks to 3 . I can see the larger rocks in the viewer ok . When i exit out of the viewer and then open up undersea again the GR2 file is the vanilla size again .
1.5 looks nice for the KGV hull .
If i try to open NBB_Nelson the message says Name was not found for mesh in pointers .
Yes they will be vanilla size again. Reason is because I'm currently not letting the app write the mesh changes to the file. Once I get a little feedback from everyone that nothing strange is happening (weird colors or shapes) after editing meshes I'll enable the writing of changes to file :up:
Right now you get to safely 'play' and experiment with them :DL
I am going to change the way you input rotations. Most, if not all, don't know what a quaternion is or how to specify rotations with it. I'm going to make it the standard pitch, yaw, and roll so it will be much easier to rotate meshes and bones.
I'll look into the NBB_Nelson and see what's going on.
TheDarkWraith
11-23-11, 06:42 PM
If i try to open NBB_Nelson the message says Name was not found for mesh in pointers .
This was a good find :yeah: My parser set the pointer type for strings with the first character of '_' as the wrong pointer type. It has been corrected and the NBB_Nelson now loads correctly without error :up: Will be available in next version.
THE_MASK
11-23-11, 06:53 PM
I opened up C:\Ubisoft\Silent Hunter 5\data\Terrain\Textures_and_Vegetation\0.Taigas and Dry Lands\vegetation GR2 .
I was looking at the Tree 1 Mesh extended data .
Displacement Max Triangles .
Tried changing this value from 10000 to 5000 but ctd .
THE_MASK
11-23-11, 07:01 PM
Tried to open
C:\Ubisoft\Silent Hunter 5\data\Terrain\Locations\CustomAreas\malta\Wall GR2
Could not find texture file harbor_malta_zid_ao.dds
Madox58
11-23-11, 07:47 PM
That's cause it does not exist.
Another mistake by the Dev's.
:yep:
THE_MASK
11-23-11, 08:15 PM
That's cause it does not exist.
Another mistake by the Dev's.
:yep:More mess to clean up then .
Madox58
11-23-11, 08:18 PM
If it's an AO mapping problem?
I can extract the AO's and you could make the texture if you wish.
:yep:
THE_MASK
11-23-11, 08:41 PM
ah ok , its an ao file . Got it .
TheDarkWraith
11-24-11, 02:38 AM
v1.0.406.0 released. This just fixes problems that were posted with v1.0.402.0
Working on the writing of the vertex data to file currently. Not going as smooth as I thought it would...
urfisch
11-24-11, 03:40 AM
so far, good work anyway!!!
:up:
TheDarkWraith
11-24-11, 11:52 PM
v1.0.409.0 released. See post #1
Any changes made to a mesh (position, rotation, scaling) is now saved to the file :yeah: I would make a backup copy before editing any file just to be safe :yep: I've tested it on many files and didn't have any problems.
I was pulling my hair out for nearly 2 days trying to figure out why when I would write the updated vertex data to the file and then close the app, reopen the app, and load the file I made the mesh edits to the mesh was trashed. My code was perfect so I was really stumped. Ended up being that when I let DirectX optimize the mesh it was removing verticies, reordering verticies, and sometimes even splitting verticies for those meshes who had more than 1 subset. Now I don't let DirectX split verticies, remove verticies, or reorder verticies when it optimizes the mesh and everything works perfectly :D
The next version I'll change the way user inputs rotations from quaternions to the more familiar pitch, yaw, and roll.
Let me know if you encounter any problems editing/moving/rotating/scaling any meshes with this version. If so, please let me know which file you were editing :yep:
THE_MASK
11-25-11, 06:08 PM
Noob question
If i wanted to move the position of the cloud models GR2 nimbostratus 01 to a lower position would that be x y or z .
THE_MASK
11-25-11, 06:13 PM
If in the future i wanted to release a mod would this be ok as an example .
[REL]sobers undersea rock mod
Made using GR2 Editor/Viewer/Extractor/Importer by TDW .
What other credits ?
TheDarkWraith
11-25-11, 08:33 PM
Noob question
If i wanted to move the position of the cloud models GR2 nimbostratus 01 to a lower position would that be x y or z .
A lower position would be a smaller y value. If you have the origin axis on (it's on by default) then the green line is the +y direction, the red line is the +x direction and the blue line is the +z direction
If in the future i wanted to release a mod would this be ok as an example .
[REL]sobers undersea rock mod
Made using GR2 Editor/Viewer/Extractor/Importer by TDW .
What other credits ?
I think it would be ok without the made using :up: There's no reason to credit the app or me as I/it didn't do the work, it/I just made it possible for you to do the work :yep:
Hello Guy's.
Well you are all a very talented lot. I don't know anything at all about computers, I really are only at kindergarten level, however I have read all your postings and replies, there is just so much to it and I admire you all. I've had a lot of help from kylania who, without his help, I would have fired this sim away forever. I have also got you all on DVD's and being a pensioner I have the time to study and try and get myself up to date a little.
I would like to congratulate and thank you all for the fun I am getting, and just wish one of you would settle next door to my house!!
Again many many thanks.
Jim. zl2bmh.
TheDarkWraith
12-11-11, 04:48 PM
Been working a lot on the app. I have shaders implemented and boy does it really make a difference! :D
You'll see from the screenshots that many new features have been added. I just have to code in the ability to disable the AO map and then a new version will be ready for release
I had three lights enabled with these screenshots: a directional light, a point light, and a spotlight. Play around with the lights, you can get some really cool scenes...
King George V with just AO enabled using shaders:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5170
same but with specular enabled:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5169
same with bump enabled:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5168
Notice that the rivets really stand out. Our SH5 models should be looking like this in-game!!
You can switch between fixed-function pipeline rendering and shaders. If your video card doesn't support vertex shader model 2.0 and/or pixel shader model 3.0 then you are forced with fixed-function pipeline.
I'm going to try and add shadows via shaders but I've almost maxed out my instruction limit in the pixel shader...
All lighting is done per-pixel with the shaders.
TheDarkWraith
12-11-11, 07:39 PM
Coded in the ability to choose which maps (diffuse, AO, bump) to render. I wanted this because I wanted to see what some of the unit's AO maps looks like. I think some are not even near correct and now we have the ability to look and see :D
You can have lighting enabled or disabled with any combination of these maps. This lets you see what's 'going on'.
If you feel like playing around with the shaders you can. Edit the shaders and when you're ready to see the changes press 'R' to recompile the shaders and start rendering with them (provided you have 'Programmable (Shaders)' selected in the rendering panel). If you have errors in the shaders a dialog box will tell you what the errors are so you can fix them. If errors are encountered it will switch to fixed-function pipeline rendering. Once you've fixed the errors press 'R' to recompile and try again :DL Once error free select 'Programmable (Shaders)' from the rendering panel to render with them.
nVidia's FX Composer 2.5 is an awesome free app to use to edit/view/play around with shaders :yep:
Here is King George V's AO map with no lighting and using shaders (looks the same using fixed-function pipeline also):
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5171
Just a couple more bugs to work out...
I'm also going to add a way that you can press a key and have the model updated (reload textures, meshes, etc.). This will allow you to make changes to the textures or whatever and then see the results in real time.
TheDarkWraith
12-11-11, 11:04 PM
v1.0.429.0 released. See post #1
I have a type of pixel fog that is available when programmable (shaders) mode is selected. You'll find the fog parameters in the render tab.
Added a new menu item 'Shaders' that has an entry 'Recompile'. When activated it will recompile the shaders and start rendering with them (if programmable (shaders) mode is selected). You can also press the 'R' key to do the same thing.
You can pan the camera now using the W,A,S, and D keys.
Still might implement another camera model.
In order to use shaders your video card has to be vertex shader mode 2.0 or higher and pixel shader mode 3.0 or higher. If your video card doesn't meet these requirements then you are stuck in fixed-function pipeline mode. That mode does everything shaders does but shaders does lighting calculations per pixel. I could let you use the reference mode....:hmmm:...have to think about that one.
:|\\
iambecomelife
12-11-11, 11:29 PM
Beautiful. Thank you for your hard work. Sadly I know next to nothing about adding bump maps & shaders to models - this inspires me to look for a good tutorial. I'm tired of my models having a "washed out" look in SH4 and SH5.
Madox58
12-12-11, 01:23 AM
You don't add shaders to the model. Those are for rendering in Game.
The Bump or 'Normal' textures are just converted from the base texture.
Photoshop will do them as will Gimp.
SH5 uses the Blue looking ones you get right off the bat.
SH4 swizzles the Blue and Green channels so you get the green looking ones.
The normals are mapped to channel 1 so no more UV mapping is needed from the base UV's.
TheDarkWraith
12-12-11, 09:14 AM
Beautiful. Thank you for your hard work. Sadly I know next to nothing about adding bump maps & shaders to models - this inspires me to look for a good tutorial. I'm tired of my models having a "washed out" look in SH4 and SH5.
You have shaders in SH4 unlike SH3. The shaders control the final pixel colors you see in-game. The great thing about shaders is you can make them do just about anything you want. I would suggest playing around with the shaders in SH4 to get rid of the washed out look. It's more than likely a post-processing effect that's controlling the final look of the game.
Shaders don't have to just control final pixel color in rendering. You can have them write to a texture and then you can use that texture later on in another shader (a type of shadows does this). You can do many things with them once you understand what you have available to you. I would read up on any DirectX books dealing with shaders you can find. Real time rendering is a great book but it's geared to the intermediate and up levels. A great first book is 'Introduction to 3D Game programming with DirectX 9.0c A shader approach' by Frank D. Luna. It was the first book I read when starting to learn about shaders and what you can do with them. Knowledge of C++ is needed for that book. I now write just about everything in C# and only use C++ when I need raw speed or when C# can't do what I need it to do. Microsoft made a managed library called Managed DirectX for C# but then quickly abandoned it. Why I don't know as it works quite well. That's what I'm using in this app (Managed DirectX) despite everyone saying don't use it.
DX10 and DX11 really opened up the power of shaders. With those you can generate verticies in the shaders! You can also do a great many things that DirectX9 shaders won't let you do. I have yet to read up on DX10 and DX11 shaders.
nVidia's FX Composer 2.5 is a great free app for shaders. Has a little bit of a steep learning curve to use but once you understand it you can litterly spend hours experimenting with different shaders and making your own and testing the changes. The great thing about it is it will verify your shaders for errors. It's fine to write them with Notepad but you get no error checking. FX Composer will find your typos and missing references.
Hi TDW,
with your shader know how, would it be possible to change the unrealistic blurry look of sh4 to the more greyish atlantic look of sh3? the sh3 look is way more authentic in my view... atm the big plus of sh3 is the most immersive ingame look.
greetz, Jaeger
TheDarkWraith
12-12-11, 08:13 PM
Hi TDW,
with your shader know how, would it be possible to change the unrealistic blurry look of sh4 to the more greyish atlantic look of sh3? the sh3 look is way more authentic in my view... atm the big plus of sh3 is the most immersive ingame look.
greetz, Jaeger
Should be fairly easy to do. It's more than likely a post-process effect. A post-process effect works on the frame buffer (everything that was rendered for the scene). I'll have to look and see what SH4 has for post-process effects...I see some likely candidates that could be doing it located in \data\Filters. I'll play around with them :up:
It wasn't a post-process effect like I thought. It was a compound filter! Anyways I have it looking SH3 like now. Making a mod of it and going to put in SH4 threads. User has option to choose between 4 different rendered 'scenes' by simply editing a text file.
Here's the link to the mod for those interested: http://www.subsim.com/radioroom/showpost.php?p=1804398&postcount=1
I can change the rendered scene color to anything...if you want it more biased to red, blue, green, or any other color just let me know
you are genius, tdw!,
its a pity i cant test. will be back home in two weeks and test it!
TheDarkWraith
12-17-11, 01:31 AM
been working heavily on this app:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5186
Now I remember why I don't use shadow maps....Point lights :damn: I was coding in the ability to cast shadows from the lights and all was well till I enabled a point light (a directional light would've been a problem also since one has to change how the camera 'sees' the scene and has to move the camera to a position from the light's perspective and that position has to encompass the view frustum) :-? Now I have to go back and remove the shadow maps code and change it to shadow volumes instead. Yes they are heavier on the fill rates but with such a simple 'scene' being rendered here it should be no issue.
I gave the app the ability to render the mesh's bounding sphere and/or bounding box. Currently these are the computed ones by DirectX but I'll add the ability to use the bounding box defined in the GR2 file.
Multi-sampling was added (up to 8X). The app will check what the capabilities of your video card is and set the appropriate multi-sampling.
Text overlays have been added. Pressing H will show the overlay on the upper right. Press T will show the overlay on the upper left.
The upper left overlay shows total verticies rendered (including those for the fog depth map and (upcoming) shadow volumes). It also shows the total time (in milliseconds) to render a frame (the scene). The scene is not automatically updated because there is no game loop and no message pump per se. But clicking on the model area and moving mouse back and forth will cause the 'scene' to be re-rendered.
I also added camera frustum culling to help with rendering HUGE meshes. The current number of meshes culled by the camera from it's current viewpoint is shown. Culling is done by testing AABBs against the camera frustum planes.
Fixed some bugs in my shader code dealing with lighting.
Going to add the ability to change text overlay color and bounding box/bounding sphere colors. Currently they are linked to the Render tabs solid color.
When you are using the shaders as the renderer I'm using a post-process shader to render the final image. This way I can add fog effects to the scene based on the fog depth map.
Might add the ability to set an environment cube map so you can have a 'scene'. Thought about adding water or some kind of terrain so a true scene can be had...
:|\\
tonschk
12-17-11, 07:30 AM
This is Really Very Good :DL , Well Done :yeah: TheDarkWraith
Vanilla
12-17-11, 04:30 PM
I wonder what is this huge outermost bounding sphere is there for?
mobucks
12-17-11, 04:40 PM
I guess those are the pointlight vertexes he was talkin bout.. No idea really. Anyway looks like a lot of work, thanks for doing this!
TheBeast
12-17-11, 04:46 PM
I am using v1.0.429.0
Not sure if this is Supported yet.
I am trying to move the Position of a Node I added but changing the X,Y,Z Coordinates does not move the Node.
http://img685.imageshack.us/img685/920/gr2exporter.jpg
Regards!
TheBeast
TheDarkWraith
12-17-11, 07:41 PM
I am using v1.0.429.0
Not sure if this is Supported yet.
I am trying to move the Position of a Node I added but changing the X,Y,Z Coordinates does not move the Node.
You double click the line to bring up the editor screen? If so and you change the position and it tells you position was changed successfully? If so and you don't see any change? If so can you send me the file in question so I can test it :06:
I'll try moving a bone in one of the files on my end and see what happens. Maybe I'm not updating the bones and only updating meshes...hope not.
TheDarkWraith
12-17-11, 07:48 PM
I wonder what is this huge outermost bounding sphere is there for?
That's the bounding sphere DirectX calculated for the hull of the bismark. What's interesting is that I would've thought the sphere would touch the front and back at one spot. It does this for the back but the front is WAY out in front of the hull. The hull is centered on the origin and about the same size front and rear of the origin. This can only mean there are some verticies in the mesh that aren't being used and they are located WAY up in front.
When you ask DirectX to calculate the bounding sphere of a mesh you pass in the verticies of the mesh as one of the parameters. You get back the center point (Vector3) and the radius (float) of the sphere. I take that center point and radius and use them to create the sphere (it's an intrinsic mesh in DirectX). When I render it I set up a matrix that is this center point and the model/world transform so it's located where it needs to be on the model.
Madox58
12-17-11, 08:30 PM
The bounding sphere is not relevent for SH5 that I could prove.
Maybe in a LOD situation? But Granny takes over there so it should be a depricated feature of your program.
Don't confuse users with bells and whistles at this point!
Most people don't even understand what a Vert nor it's postional data means.
Let alone the Tangents and Normals stuff.
Remember the basic rule? KISS
TheDarkWraith
12-17-11, 10:25 PM
I am using v1.0.429.0
Not sure if this is Supported yet.
I am trying to move the Position of a Node I added but changing the X,Y,Z Coordinates does not move the Node.
I loaded the Uboat_Sensors file in the app and was able to move bones around. So in order to figure out why you're having problems I need to use the file you tried.
I did though find errors in the code that handles the TreeView for these bones. To draw the TreeView the code does this:
for every file (app has ability to have more than 1 GR2 file loaded though that feature is currently disabled)
- draw a node and update file index counter
---- for every model in the file (you see this as skeleton since models only have 1 skeleton)
----- draw a node and update model index counter
-------- for every bone in the model (skeleton)
--------- draw a node and update bone index counter
Problem was I was never resetting the model or bone index counters whenever a new model or file was used! I have corrected the problem and will be available in next version :up:
TheDarkWraith
12-18-11, 02:26 AM
Implemented picking. Currently you can 'pick' a mesh on the screen by double clicking it's bone origin and:
- render is set so solid or solidwire
- lighting is disabled
I will convert it over to just being able to double click the mesh itself but I just wanted to see if my idea worked or not. The stipulations of render set to solid or solidwire and lighting disabled will still hold
The item 'picked' will turn a beige color and the meshes tab will show the item as the currently selected item. If you select another item in the meshes tab then the currently 'picked' item will change to the item selected. A message is posted in the status box letting you know that you 'picked' a mesh:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5190
Double click an empty part of the screen to 'unpick'.
I will implement picking for verticies also so I can implement the ability to edit/change verticies of a mesh. I will have it coded that in order to 'pick' a vertice you have to be in a render mode that has points (because each point is a vertice).
TheBeast
12-18-11, 10:11 PM
I loaded the Uboat_Sensors file in the app and was able to move bones around. So in order to figure out why you're having problems I need to use the file you tried.
I did though find errors in the code that handles the TreeView for these bones. To draw the TreeView the code does this:
for every file (app has ability to have more than 1 GR2 file loaded though that feature is currently disabled)
- draw a node and update file index counter
---- for every model in the file (you see this as skeleton since models only have 1 skeleton)
----- draw a node and update model index counter
-------- for every bone in the model (skeleton)
--------- draw a node and update bone index counter
Problem was I was never resetting the model or bone index counters whenever a new model or file was used! I have corrected the problem and will be available in next version :up:
The File I was trying to edit was the data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_00.GR2 file.
TheDarkWraith
12-19-11, 02:05 AM
have all the picking done. You can select an object by double clicking on it.
If a render mode contains solid then double click any object.
If a render mode conatins solid and you have bones enabled then you have to double click the bone origin to select the object
If a render mode contains points then double clicking a point will select the vertice.
Now for the fun part: use the mouse to drag/rotate the object/vertice to it's new position/rotation :D You can now deform the mesh by dragging verticies to new positions.
I currently have one problem that is a matrix problem that I can't figure out. It deals with rotations. Say you double click the funnel on top of the King George V. Now you yaw the mesh 90 degrees. Now let's say you want to pitch the mesh 90 degrees. What should happen is it pitches on it's yawed coordinate system (since we yawed it 90 degrees +x is now where +z was and +z is now facing down -x). But I can't make this happen. I've tried to figure out how to do this but keep running into a ro*******. I have everything working except for this :damn:
more to come...
Sorry to be dumb. Keep getting
Exception is:
Error in the application. *********
********* Exception while presenting
I've had this with all the latest versions. Set SH5 path to top level SH5 directory (one above data) as in screenshots. Whatever GR2 file I try opening I get the error.
Any help would help.
MLF
TheDarkWraith
12-19-11, 03:26 PM
Sorry to be dumb. Keep getting
Exception is:
Error in the application. *********
********* Exception while presenting
I've had this with all the latest versions. Set SH5 path to top level SH5 directory (one above data) as in screenshots. Whatever GR2 file I try opening I get the error.
Any help would help.
MLF
If you don't have any GR2 files open can you rotate the camera with the mouse without error? Does that problem only happen when a GR2 file is loaded?
Figured out my matrix problem :rock: After sleeping on it I woke up realizing that I had to treat each axis of the selected object's rotation offset individually. Think of it like camera control - you compute a rotation matrix for each axis based on a combination of up, look, and right vectors. When you want to rotate the camera you change the up, look, and right vectors then compute the new viewmatrix. Well instead of it being a viewmatrix it's a rotation offset matrix. Ah the simple things allude us sometimes...:shifty:
If you don't have any GR2 files open can you rotate the camera with the mouse without error? Does that problem only happen when a GR2 file is loaded?
Yeah - I can rotate the camera (position and Rotation) no problems.
When I load up the editor the status panel shows:-
Silent Hunter 5 GR2 Editor/Viewer v1.0.429.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to E:\SH5
Then try loading, for example, Bunker.gr2 and :-
Silent Hunter 5 GR2 Editor/Viewer v1.0.429.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to E:\SH5
GR2 file path is E:\SH5\Data\Terrain\Locations\bunker.gr2
********* Exception while presenting
Exception is:
Error in the application. *********
********* Exception while presenting
Exception is:
Error in the application. *********
Directx Version = 9.0c 4.09.0000.0904
Thanks for all your work on this application.
MLF
TheDarkWraith
12-19-11, 04:30 PM
Yeah - I can rotate the camera (position and Rotation) no problems.
When I load up the editor the status panel shows:-
Silent Hunter 5 GR2 Editor/Viewer v1.0.429.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to E:\SH5
Then try loading, for example, Bunker.gr2 and :-
Yes I noticed that problem with the bunker in the last version. I have fixed that in upcoming release. Try and see if you can load the King George V. Then try a sub.
I'll have the new version ready here soon :up:
Hi TDW,
I have tried Bismark, KG5, Scharnhorst, Hipper..... usw usw.
Same result.
regards
MLF
TheDarkWraith
12-19-11, 05:06 PM
Hi TDW,
I have tried Bismark, KG5, Scharnhorst, Hipper..... usw usw.
Same result.
regards
MLF
Are you using shaders or the fixed-function pipeline for rendering? On the Rendering tab switch it to Fixed. Disable lighting. Disable bones (On bones tab in the bones box uncheck Show). On the FillMode tab select Solid and uncheck Texture. Close the app down File-->Exit. Then restart app. This way the cfg file is updated with the changes when you restart the app.
You probably had it set to shaders and are missing the \Shaders folder or it can't find the shaders folder and/or the .fx files.
Are you using shaders or the fixed-function pipeline for rendering? On the Rendering tab switch it to Fixed. Disable lighting. Disable bones (On bones tab in the bones box uncheck Show). On the FillMode tab select Solid and uncheck Texture. Close the app down File-->Exit. Then restart app. This way the cfg file is updated with the changes when you restart the app.
You probably had it set to shaders and are missing the \Shaders folder or it can't find the shaders folder and/or the .fx files.
I changed settings as above but still get the same error - funny, on the earlier versions all was OK. As nobody else is reporting this, must be something with my setup. GR2EditorViewer.exe and GR2EditorViewer.cfg are in the SH5 root folder with the shaders folder coming off that. When I start the app, the shaders compile without errors. Probably something to do with Directx?? Any chance on on a log file being written?
Regards
MLF
TheDarkWraith
12-19-11, 05:48 PM
I changed settings as above but still get the same error - funny, on the earlier versions all was OK. As nobody else is reporting this, must be something with my setup. GR2EditorViewer.exe and GR2EditorViewer.cfg are in the SH5 root folder with the shaders folder coming off that. When I start the app, the shaders compile without errors. Probably something to do with Directx?? Any chance on on a log file being written?
Regards
MLF
No, I'm not outputting any debug info with this app :-?
Anything change in your system since then? DirectX updated? Microsoft .NET 3.5 installed?
TheDarkWraith
12-19-11, 07:54 PM
Now I need to tell you all about the new changes:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5196
1 = Name of GR2 file opened (has always been there)
2 = Name of object or vertice selected
3 = Camera locked or not. Pressing C will lock/unlock camera. Useful when you don't want to disturb the image accidentally. Also camera has to be locked in order to move/rotate an object/vertice
4 = Coordinate system reference. If no item is selected then this will say Camera. Once an item is selected:
- if camera is not locked then this will say Camera (so you can move the camera around with the item locked)
- if camera is locked then this will say Object. Now you are free to move the item around, rotate it, scale it, etc. with the mouse
5 = Current axis of freedom.
- XYZ means you have all axis available and can move in any direction
- X means only X axis is free to move
- Y means only Y axis is free to move
- Z means only Z axis is free to move
- you can have any combination of the XYZ, i.e. XY, YZ, ZX, etc.
- You can toggle an axis of freedom on/off by:
- for X press X
- for Y press Y
- for Z press Z
Now some may ask what's with this axis of freedom stuff? It's really handy. Say your moving an object and you only want to move it in the Y direction. Disable X and Z axis and you don't have to worry about it moving in any other direction but Y.
6 - This is what the color of the object will turn to when selected. NOTE: if you are selecting a vertice then it will not change color. A lock diamond of this color will appear around the vertice.
The default 4 arrow cursor has changed. Now when the render surface is active (you click on it) the cursor will change from default to a + symbol. This means you are ready to select something. Once an item is selected the cursor will change depending on what axis of freedom you have enabled.
To select an object/vertice double click on it. Once an item is selected an axis origin will appear on it showing you it's orientation in the world. This is needed so you know how to move/rotate the unit.
Note: if you have bones enabled (shown) then you have to double click the bone origin itself to select an object. The object 'tied' to that bone will be selected.
To select objects you must be in a render mode of:
- solid
- solid & wire
To select vertice you must be in a render mode of:
- point
- wire & point
- solid & point
- solid & wire & point
You can select objects/vertice with lighting enabled or disabled. I recommend lighting be disabled so you can see the color change.
Once an object/vertice is selected you are free to change the render mode to anything you want. This is handy for when you select a vertice. After selecting it set the render mode to solid. Now when you drag the vertice around you can see the mesh deform in real time.
By clicking on the Meshes tab you bring up a list of the meshes. When you click on one it will also select the object on the screen (you'll get the color change). This means the object is selected and ready to moved/rotated.
To clear a selection (unselect) press spacebar.
Pressing T will show stats (time it takes to render a frame, number of verticies rendered, number of objects culled)
Pressing H will show the help screen. This help screen is dynamic. It can change based on whether you have an object selected or not and some other things.
There are two screenshots available. Pressing W will take a screenshot of only the rendered 'world' on your screen. Pressing A will take a screenshot of the application itself (everything you see about the app). You get to specify a name and location to save these. NOTE: they can only be saved as .dds files.
These screenshots can be used to take a screenshot of a problem or something you were doing so you can give me more information about it.
I might code in the ability to select a wide range of output formats for the screenshots...
EDIT:
I did. You can save in bmp, dds, jpg, png, or tga format.
more to come...
Madox58
12-19-11, 10:26 PM
Nice!
:up:
On the sleep on it thing? I know the feeling well!
After several days of mulling it over? I broke the compression of modified GR2 files for SWTOR.
:)
TheDarkWraith
12-19-11, 11:58 PM
After testing it out I needed to make another change:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5197
I was repositioning Decal31 from the bunker with the mouse. The mouse has many shared functions on it. This was really annoying sometimes. So I made a way you can turn off certain items the mouse can do. You can let the mouse translate, rotate, or scale by pressing the R, T, or S keys. Number 1 in the screenshot shows that I currently only have Translation (repositiong) turned on.
Number 1 in that screenshot can show:
R - rotations enabled
S - scaling enabled
T - translations enabled
any combination of those letters. These only apply when an item is selected.
2 in the screenshot above allows you to choose the output format for the screenshot files.
3 in the screenshot above is another way you can choose what the mouse can do with the selected item.
4 in the screenshot above is the poster I had framed in the screenshot earlier. It's picture is gone because it's selected (and thus has the selected color). You'll also notice the axis attached to the item that shows it's orientation. I moved it away from the wall using the mouse :D
Notice in the bottom that it says that the camera is locked (cause I was moving the poster) and it shows the selected object's name: Decals31. It says object because we are using the object's coordinate system for any repositioning/rotating/scaling.
All the axis were available for repositioning/rotationg/scaling (XYZ) and the mouse could only do translations (T) with the selected item.
I also enabled all the help screens. Pressing H will show the one in the top right. Pressing U will show the one in the top left. Pressing M will show the one under it. The M menu shows all the combinations for the mouse. This menu is dynamic based on what you have selected (object or vertice) or not selected.
TheDarkWraith
12-20-11, 01:14 PM
Advanced German technology:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5198
Able to get away in a hurry...:DL
Was getting some CTDs when I would select a vertice to modify. Couldn't figure out why...cryptic message of "Execution engine has encountered a problem". After some in-depth searching on Google and finally at Microsoft's website this can happen if the garbage collecter (this is a managed app) tries to 'collect' while your app is doing something 'heavy'. So I had to force GC collections while the app is trying to figure out what you wanted to select. This results in about a 1-3 second delay from when you double click something to when it shows as being selected. Minor annoyance...
Trevally.
12-20-11, 01:16 PM
Advanced German technology:
Able to get away in a hurry...:DL
:haha:
:up:
Anything change in your system since then? DirectX updated? Microsoft .NET 3.5 installed?
I have now tried it on another PC and get the same error. Did notice that the meshes are loaded but nothing is being displayed. The error multiplies as I move the cusor (presumably controlling the camera) within the screen after trying to load the GR2 file.
TheDarkWraith
12-20-11, 07:11 PM
I have now tried it on another PC and get the same error. Did notice that the meshes are loaded but nothing is being displayed. The error multiplies as I move the cusor (presumably controlling the camera) within the screen after trying to load the GR2 file.
I'll add some debug output to the render function that will spit out some stuff if it encounters any errors. This way I can see what's going on :up:
I'll add some debug output to the render function that will spit out some stuff if it encounters any errors. This way I can see what's going on :up:
:yeah: That would be good. Thanks.:salute:
MLF
TheDarkWraith
12-21-11, 02:04 AM
:yeah: That would be good. Thanks.:salute:
MLF
Added :up:
v1.0.450.0 available for testing: http://www.gamefront.com/files/21105452/GR2EditorViewer_v_1_0_450_0_zip
You cannot save anything to the files - it won't let you. This is just to test all the new features and the ability to move objects/vertices around with mouse. I haven't coded in the ability to move bones yet. Need to know this is working ok for everyone before proceeding on :yep:
Working on a 'reset' for the mesh/verticies so you can 'reset' them back if you don't like what you did currently...
Looking to know if there are any errors/bugs, typos, whether the movement of the objects with mouse is smooth or jerky, when you edit the item's parameters and it 'rebuilds' the mesh does it take forever or not, when selecting verticies does it take forever to 'register', etc...
Any changes you make are not automatically saved to the file anymore. I have an ingenious way of doing this now.
THE_MASK
12-21-11, 02:43 AM
Downloading now :salute:
Have downloaded and tried loading the Fletcher class. Same error. I'm starting to wonder whether its my SH5 install that's up the creek.:hmmm:
Think I will re-install SH5 :zzz:
Where is the de-bug stuff saved?
MLF
TheDarkWraith
12-21-11, 06:38 PM
Have downloaded and tried loading the Fletcher class. Same error. I'm starting to wonder whether its my SH5 install that's up the creek.:hmmm:
Think I will re-install SH5 :zzz:
Where is the de-bug stuff saved?
MLF
You can use the DbgView app found in my UIs mod.
TheBeast
12-21-11, 09:11 PM
I just tried v1.0.450.0
Agian I tried to move node (http://www.subsim.com/radioroom/showpost.php?p=1806762&postcount=281) and in the GR2 Exporter View it is Moved but when loaded in GoblinEditorApp the node is still at original location.
What am I actually moving when moving a Bone?:06:
REPRO STEPS:
Used Hex Editor to rename cfg#C02 to cfg#SNK on Conning_7B_00.GR2 and save.
Start GR2 Editor and Load Conning_7B_00.GR2 file. GR2 Editor correct CRC error from Step 1 above. (Very Cool BTW:up:)
Located Bone for cfg#SNK and change position from Deck Watch location to just below Main Deck, just foreward of Conning Tower and to Port.
Verify Bone is moved and exit GR2 Editor.
Start GoblinEditorApp and load Conning_7B_00.GR2
RESULT:
cfg#SNK is still located up at original location.
Start GR2 Editor, load Conning_7B_00.GR2 and cfg#SNK is location where I put it.
What did I actually move?
What am I missing?
I even tried this without renaming cfg#C02 with same results.
Regards!
TheBeast
TheDarkWraith
12-21-11, 09:33 PM
I just tried v1.0.450.0
Agian I tried to move node (http://www.subsim.com/radioroom/showpost.php?p=1806762&postcount=281) and in the GR2 Exporter View it is Moved but when loaded in GoblinEditorApp the node is still at original location.
What am I actually moving when moving a Bone?:06:
REPRO STEPS:
Used Hex Editor to rename cfg#C02 to cfg#SNK on Conning_7B_00.GR2 and save.
Start GR2 Editor and Load Conning_7B_00.GR2 file. GR2 Editor correct CRC error from Step 1 above. (Very Cool BTW:up:)
Located Bone for cfg#SNK and change position from Deck Watch location to just below Main Deck, just foreward of Conning Tower and to Port.
Verify Bone is moved and exit GR2 Editor.
Start GoblinEditorApp and load Conning_7B_00.GR2
RESULT:
cfg#SNK is still located up at original location.
Start GR2 Editor, load Conning_7B_00.GR2 and cfg#SNK is location where I put it.
What did I actually move?
What am I missing?
I even tried this without renaming cfg#C02 with same results.
Regards!
TheBeast
No changes are being written to the file in this version. I disabled it. I made too many changes in this version and before I re-enable the ability to save changes to file I need to know there are no major issues. I didn't see any problems when I tested it but you all always seem to find those that I miss/overlook :yep:
TheBeast
12-21-11, 10:03 PM
No changes are being written to the file in this version. I disabled it. I made too many changes in this version and before I re-enable the ability to save changes to file I need to know there are no major issues. I didn't see any problems when I tested it but you all always seem to find those that I miss/overlook :yep:
Thats what testers are for:03:
@TheDarkWraith
I would like to thank you for all this work. Thank you for sharing all that with us.
Perhaps, most of us, we stay silent ("only" 311 post in 3 months), but we follow your effort, here and in other areas of SH-5 or SH-3/4.
I wish you merry Christmas and a peaceful new year 2012.
:Kaleun_Salute:
tonschk
12-22-11, 03:38 PM
@TheDarkWraith
I wish you merry Christmas and a peaceful new year 2012.
:salute: Me too :yeah:
TheDarkWraith
12-23-11, 04:58 PM
I'm so aggravated right now :damn: The TreeView control in Visual Studio 2008 is bugged badly. If you enable checkboxes for the treenodes and you hook the event aftercheck according to the documentation it's supposed to fire when you change the checked state (either by code or by mouse click or keyboard). That all works. What isn't supposed to happen is this aftercheck event being fired when you select a treenode with the mouse. Which is exactly what's happening :nope: Now I have to find a different solution and change a huge amount of code :damn:
Madox58
12-23-11, 05:05 PM
TreeView has been a problem from 2005 to 2008 for C# as I understand?
TheDarkWraith
12-23-11, 06:40 PM
TreeView has been a problem from 2005 to 2008 for C# as I understand?
Nope. User error as usual :shifty: TreeView control still working as documented by MS.
I was inadvertantly triggering the event through some firing of events of mine. Very hard to track down when you have multiple events being fired :dead:
The ability to select bones by double clicking on them in the render window with mouse added. This allows you to drag them around with mouse just like the meshes and vertices. Now just writing the code to 'save' these.
TheDarkWraith
12-24-11, 12:35 AM
v1.0.464.0 released. See post #1
You can now select bones by double clicking on them in the render window. Use mouse to reposition. All bones that reference the bone being repositioned will be automatically repositioned (there is a parent-child relationship after all!)
In order to save changes to bones:
- bone has to be selected (lock diamond around it)
- click the bones tab
- Under the changes box press Update. This will store your changes.
- After pressing update the save button should become available.
- Press Save to save to file
- Note: ExtendedData for bones is currently not being saved as I haven't coded it yet
This version now enforces the flags parameter of the bone in the GR2 file. If the flags parameter says the bone has no position data then you can't move it. If you want to change that behavior then change the flags value (either double click a bone/mesh in their tabs to bring up editor window or while mesh/bone is selected press enter)
Meshes - you can select, reposition, rotate, etc. You can store your changes by pressing the Update button under the changes box on the meshes tab. You currently cannot save as that function isn't finished yet.
Vertices - you can select and reposition. That's about all you can do with them currently. Note: repositionining a vertice will deform the mesh it's attached to.
I have yet to code in an 'as-loaded values' for the resets for the positions, rotations, and scale. This will allow you to revert back to 'as-loaded' values if you screw up. Note: when the save button is pressed the current stored values become the new 'as-loaded' values.
To remove a selection (unselect bone/mesh/vertice) press spacebar.
Let me know of any errors/bugs. There were some major changes in this version so I expect a few bugs/errors :yep:
@ TheBeast - you should be able to reposition the rwr you've been wanting to do
You could now use this to alter waypoints and/or make new waypoints :yep:
urfisch
12-24-11, 07:03 AM
youre doing nice work, tdw. thanks for that so far...
:up:
TheDarkWraith
12-24-11, 01:32 PM
found some logic errors in the meshes and bones treeview controls. Update coming here soon...
Should have the extended data writing done also by that time :DL
EDIT: the writing of any objects extended data works correctly :rock: With just one problem: I need to flag when extended data has changed so that the app will enable the save button.
TheDarkWraith
12-24-11, 03:21 PM
v1.0.467.0 released. See post #1.
This fixes some logic bugs in the bones and meshes treeview controls
The writing of extended data for bones has been enabled. Everything can write extended data but I haven't gotten to everything except the bones yet.
The bones are the most critical in SH5 as they control visibility, shadows, etc. for the meshes.
:|\\
TheBeast
12-24-11, 04:20 PM
Using either of last 2 versions I am getting error trying to load data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_01.GR2 file.
******** Spring pointer missing for Datatype definition ********
******** Failed to read ArtToolInfo ********
And model is not loaded.
This happens when trying to load stock unchanged SH5 Model.
GoblinEditorApp and GoblinViewer load this model without any error message.
I was able to successfully reposition cfg#SNK node on Conning_7B_00.GR2 and Conning_7B_02.GR2 files.
TheDarkWraith
12-24-11, 07:25 PM
Using either of last 2 versions I am getting error trying to load data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_01.GR2 file.
******** Spring pointer missing for Datatype definition ********
******** Failed to read ArtToolInfo ********
And model is not loaded.
This happens when trying to load stock unchanged SH5 Model.
GoblinEditorApp and GoblinViewer load this model without any error message.
I will investigate. Thanks for the bug report :up:
EDIT: What's interesting is granny viewer can't even load that stock SH5 file (and it's not because of CRC32 error) :hmmm:
Madox58
12-24-11, 07:57 PM
That's weird as I can open it with several different versions of GrannyViewer.
:hmmm:
I have a saved folder of untouched files and it opens fine with all versions.
Even the 'Special' version.
:03:
TheDarkWraith
12-24-11, 09:24 PM
That's weird as I can open it with several different versions of GrannyViewer.
:hmmm:
I have a saved folder of untouched files and it opens fine with all versions.
Even the 'Special' version.
:03:
Yep, you're correct. User error once again :oops: I tried opening it with Granny Viewer when my app had a lock on it. Kill the app and granny viewer loads it just fine :up:
Now that I can 'see' what granny viewer sees I see a bug in my app that I need to fix :up:
TheDarkWraith
12-24-11, 09:50 PM
okay, problem TheBeast reported is fixed. The problem was I assumed that if a string pointer wasn't found then there was an error in the file. After examining the file in Granny Viewer it said (null) for the values. This told me that null pointers (which is what a string pointer that wasn't found in the app is) are valid and legal. So I adjusted the app to handle these and not report them as errors.
I loaded up the 7B_01 conning GR2 and noticed some odd things:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5207
Look at where cfg#O02 and cfg#O03 are....it just hit me....those are the scopes! Ok, makes sense now.
There are some that don't make sense to me:
- Reflect_Conning_7b_01
- Collision_CT_EXT
- dmg_col_turm
They just don't seem to be located in the correct places to me :hmmm:
I'll have new version available here soon with the fix in it...
I also just realized that it does make sense to let you rotate bones...I had locked that out but now looking at the 7b_01 GR2 file I don't know why I thought it didn't make any sense. I'll correct that also.
Madox58
12-24-11, 09:59 PM
Nice work Mate.
:up:
I always enjoy following this WIP.
Just remember when you go to do the export part?
Negate the V Texcoords!
:03:
TheDarkWraith
12-25-11, 01:57 AM
v1.0.469.0 released. See post #1
Fixed problem reported by TheBeast
Remove the lock on bones not being able to be rotated. You can now freely rotate them :DL
Added the Reset button to changes. Pressing this button will take that object (mesh, vertice, bone) selected back to as-loaded values (this means everything - flags, position, rotation, scaling, etc.). Pressing Save writes the changes to the file as updates the as-loaded values with the current settings. Pressing Update stores the current values in case you mess up reposition, rotating, or scaling (then pressing the reset buttons on the rotations, scaling, or translation takes you back to where you last pressed Update or Save)
Added a new tab called Status. All status information is relayed to this tab. Double click anywhere inside the tab to erase current information.
Added the ability to squelch the debug output under the misc tab. A new box was added called Debug. It's default value is disabled (unchecked).
That's all that comes to mind currently :yep:
THE_MASK
12-25-11, 03:25 AM
Merry christmas .
Sartoris
12-25-11, 04:12 AM
Watching TDW working on improving SH5 is the best Christmas present!
:yeah:
Kaicokid
12-25-11, 04:49 AM
Watching TDW working on improving SH5 is the best Christmas present!
:yeah:
+1:yep:
Seasons Greetings to all.
Thanks for the latest version TDW.
Unfortunately, I am still getting the error and it now appears before I try to load anything. It is slightly different, as follows:-
"Exception is:
Error in the application. *********
********* Exception caught in OnPaint"
When I ran DbgView I also noticed quite a few lines with the following error message:-
00000714 13.52196884 [4080] LODError 0x10B3C (0x10D04)
Any ideas, please?
I also note that the application window doesn't fit on my resolution (1440 x 900) - what resolution do you run at?
Regards
MLF
TheBeast
12-25-11, 10:17 AM
Merry XMass to all.:Kaleun_Party:
Using new version I was able to edit the Conning_7B_01.GR2 file.:salute:
@ TDW
Do you know when adding new Node's will be implemented?:06:
I currently see refferences that suggest this functionality is being worked on.
Regards!
TheBeast
TheDarkWraith
12-25-11, 11:49 AM
@ TDW
Do you know when adding new Node's will be implemented?:06:
I currently see refferences that suggest this functionality is being worked on.
It's continually being worked on. Once I find an algorithm that works then I can finally start adding new items to GR2 files. The algorithm that I'm looking for is the order in which to redo the pointers (that I know of - there may be more pointers that I'm not aware of which would invalidate the algorithm all together).
TheDarkWraith
12-25-11, 11:59 AM
Unfortunately, I am still getting the error and it now appears before I try to load anything. It is slightly different, as follows:-
"Exception is:
Error in the application. *********
********* Exception caught in OnPaint"
When I ran DbgView I also noticed quite a few lines with the following error message:-
00000714 13.52196884 [4080] LODError 0x10B3C (0x10D04)
Any ideas, please?
I also note that the application window doesn't fit on my resolution (1440 x 900) - what resolution do you run at?
The app is set to run at 1200 X 1025.
That LODError is from a file. It appears you tried to load a file. It's something it read from the file.
I'd like to see the full DbgView output if possible. What I'd like to see from it is you run the app. After it's loaded don't try to load anything. Move the camera around with the mouse for a little bit. Then try to load a file. Ensure Debug is enabled (under Misc tab)
I might also code up something that will read your video card's capabilities and output it all to text file so I can see if there's something I've coded in thinking will work with anyone's video card that actually isn't and have you run it :hmmm:
Can you run my SH map viewer app found in \data\Applications of my UIs mod without problem?
Vanilla
12-25-11, 02:50 PM
I've tried to open CharacterBodyParts.gr2 in /data/Characters it gave a lot of 'this app cannot open image...' errors then complained about unknown 'BoneWeight' vertex.
Is it yet to early to open this file in GR2EVI?
TheDarkWraith
12-25-11, 03:36 PM
I've tried to open CharacterBodyParts.gr2 in /data/Characters it gave a lot of 'this app cannot open image...' errors then complained about unknown 'BoneWeight' vertex.
Is it yet to early to open this file in GR2EVI?
I'll look into it and see what's going on :up:
TheDarkWraith
12-25-11, 05:04 PM
Have the unknown vertex component names added - all is good there.
The bad: what I interpreted bone bindings as was which bone (only 1) the mesh was bound to. This was a totally incorrect assumption from trying to load the \data\CharactersCharacterBodyParts.gr2 :shifty: Now I see what the purpose of these bone bindings are: for skinned meshes.
This causes me to rethink many things I assumed when creating this...
I think the assumption I made about the bone binding (only 1) still holds true for how a mesh is placed in the world. But this makes me question if SH5 is following this rule :hmmm: Has anyone tried moving a bone (say a funnel or something) and seeing what the effects are in-game yet? :06:
TheDarkWraith
12-25-11, 06:08 PM
this little 'find' has cleared up something I've always wondered why I had to do. When I'm reading mesh data I read the number of bone bindings. Usually it was just 1. I would then find the pointer to the bone binding(s). I passed this pointer to my bone bindings class. Now this is where it didn't make any sense: my bone bindings class had to dereference that pointer to get it's actual pointer. Never could figure out why. Now I understand why. Since there can be multiple bone bindings this first bone bindings pointer points to where the list of bone bindings are at :yep:
TheDarkWraith
12-25-11, 06:46 PM
This characters gr2 file is turning out to be a gold mine of information :D Once again I assumed that all vertex data is located in section 1. This file has proved me wrong again. Vertex data can be found in section 3 also (this looks like skin mesh data :yep:)
tonschk
12-25-11, 08:00 PM
Watching TDW working on improving SH5 is the best Christmas present!
:yeah:
:sunny: +1 :yeah:
TheDarkWraith
12-25-11, 11:12 PM
Well after getting schooled hard by this characters GR2 file I finally can read and render it :rock:
I learned so much from this one file...it was like a xmas present in itself.
It exposed a bug in my ExtendedData parser, this was a serious bug. Would've never found it without trying to load this file.
It exposed multiple errors in my assumptions of where data is located. I thought vertex and index data were located in only certain sections but boy was I wrong. This file made me code my app to read those magical pointers once again and have them tell we where the data can be found. That alone was well worth digging into this file.
Now I just have to figure out how to read the embedded image data in the GR2 file and the meshes can be rendered with textures. Here is the file rendered in wireframe:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5211
:|\\
THE_MASK
12-25-11, 11:23 PM
Quite a few editions ago i could open the C:\Ubisoft\Silent Hunter 5\data\Env\cloud_models
Cannot open with the latest ones though .
TheDarkWraith
12-25-11, 11:38 PM
Quite a few editions ago i could open the C:\Ubisoft\Silent Hunter 5\data\Env\cloud_models
Cannot open with the latest ones though .
Just opened it with Visual Studio's debugger. The problem is happening when it goes to create the bounding box and bounding sphere for box53. Looking into why currently...
THE_MASK
12-25-11, 11:56 PM
Here is another strange file . Strange as in i dont know what it does .
C:\Ubisoft\Silent Hunter 5\data\Lights\lumini_marinar_x2
Also the 2 files in the Manip folder .
TheDarkWraith
12-25-11, 11:59 PM
Here is another strange file . Strange as in i dont know what it does .
C:\Ubisoft\Silent Hunter 5\data\Lights\lumini_marinar_x2
I'll look at it here in a sec.
You can open up clouds again. The bounding sphere it was trying to make was too large and DirectX didn't like it. I had to put some code in to limit the amount of slices and such for the sphere so it could make it.
Tip when looking at meshes that are large like these clouds: turn culling for the camera off (under the camera tab) :yep: Couldn't figure out why they kept vanishing as I was moving the camera. Then I remembered I added camera culling to the app...
TheDarkWraith
12-26-11, 12:18 AM
That characters file also sorted out my mesh bindings. I never thought I was reading them totally correctly ;)
Here's the skeleton of our crew members:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5212
skinned characters I've never coded before. I have the bone weights and indicies for each vertex now I have to do some serious reading on skinning. Amazon delivered me 8 new books just recently on real time rendering, skinning, shaders, shadows, etc. I feel like I'm back in school...
You'll notice that when these characters render they are small, very small. I'm going to code in a global scale under the world tab. This way you can adjust the world scale without having to scale any meshes or anything.
TheDarkWraith
12-26-11, 01:32 AM
v1.0.474.0 released. See post #1
Includes fixes for errors found while trying to load the characters gr2 file
Added a world zoom (%) to the world tab page. You can zoom +- 1000%. Default is obviously 100. Reset button also added to quickly take you back to 100. This will make it much easier to view small objects (like the characters)
Fixes bug of not being able to open the clouds GR2 file. This was due to DirectX complaining about the size of the bounding sphere it had to generate.
TheBeast
12-26-11, 04:30 AM
I thought I would give a go at changing the Control Room ObsPeriscope Height Position to raise it from Belt level to Eye Level.
When I tried to raise the height of this node +0.02 from stock.
The Interior ObsPeriscope renders on top and aft of the Control Room.
Returning to original value for "Y" Position does not return ObsPeriscope to starting Position.
I think I am attempting to move the wrong Node but I not really sure.:oops:
Any Suggestions?:06:
Please Advise!:doh:
TheBeast
TheDarkWraith
12-26-11, 04:56 PM
I thought I would give a go at changing the Control Room ObsPeriscope Height Position to raise it from Belt level to Eye Level.
When I tried to raise the height of this node +0.02 from stock.
The Interior ObsPeriscope renders on top and aft of the Control Room.
Returning to original value for "Y" Position does not return ObsPeriscope to starting Position.
I think I am attempting to move the wrong Node but I not really sure.:oops:
Any Suggestions?:06:
Please Advise!:doh:
TheBeast
I wasn't able to change the height position but I did change where it stops when lowering. I adjusted cfg#O02 up. This caused the periscope to stick out of it's holder up top when viewed from the bridge.
Not sure how to adjust that look glass to eye level :hmmm: What node were you trying to move?
TheBeast
12-26-11, 09:32 PM
I wasn't able to change the height position but I did change where it stops when lowering. I adjusted cfg#O02 up. This caused the periscope to stick out of it's holder up top when viewed from the bridge.
Not sure how to adjust that look glass to eye level :hmmm: What node were you trying to move?
I was trying to move the parent node of the data\Submarine\Common\Parts\Room_CR - Periscop + Anim.GR2 file to raise eye piece to eye level.
TheDarkWraith
12-26-11, 10:45 PM
v1.0.477.0 released. See post #1.
File-->Save added. Yep, it's time to start writing data to these files :DL
The saving ability will become available if you modify a file in some way (extended data, mesh, bone, etc.).
You can now have fun with meshes. They can be saved to file with changes.
ExtendedData is saved for everything. So if you modify an item's extendeddata you can now save the changes.
:|\\
TheDarkWraith
12-27-11, 01:28 PM
I sit in front of my computer, Visual Studio 2008 open waiting for me to tell it what to do. I ponder the choices when it comes to exporting mesh data...obj, x, fbx, and possibly others I don't know about. I google each to 'remember' how to use them. With my memory jogged the best format still seems to be Microsoft's .X format. But there is a problem with this: it seems that Microsoft is 'killing' their own X format. Support for it seems next to nothing in the 2010 SDK (it seems they have a new format - sdkmesh. Looks like the kiddies using XNA game studio needed a new, simpler format that they could understand :nope:).
The obj format is 'weak' in that you can't save tangent or binormal data to the file. Yes one could compute the TBN basis vectors from the UV coordinates and Normal I suppose...I can't find anything with Google relating to saving bone weights and bone indicies in obj files...
It's one thing to export mesh data. It's another to read it back in. I'm looking for a format that will allow me to do both and keep all the mesh data 'in tact'. The .X format is still the clear choice if I can even still use it.
Any input from anyone on this? :06:
Madox58
12-27-11, 01:51 PM
Last I saw on the SDKMesh..............
// File: SDKMesh.cpp
//
// The SDK Mesh format (.sdkmesh) is not a recommended file format for games.
// It was designed to meet the specific needs of the SDK samples. Any real-world
// applications should avoid this file format in favor of a destination format that
// meets the specific needs of the application.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
TheDarkWraith
12-27-11, 02:07 PM
Last I saw on the SDKMesh..............
// File: SDKMesh.cpp
//
// The SDK Mesh format (.sdkmesh) is not a recommended file format for games.
// It was designed to meet the specific needs of the SDK samples. Any real-world
// applications should avoid this file format in favor of a destination format that
// meets the specific needs of the application.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
Yes this seems like something microsoft made quickly to support some new features they needed for their new SDK examples. Why they are abandoning the X format blows my mind. It was flexible and perfect for game/industrial/commercial/etc. applications. I think it has to do with XNA Game studio and DirectX10 and 11.
Have you ever looked at XNA game studio code? It looks like DirectX code scaled down for a toddler. I mean even the wording for some of the functions sounds like it's geared for kiddies :nope:. When you make something 'simpler' you take away it's power.
Madox58
12-27-11, 02:11 PM
On the .X format.........
3D Max has no support for that format and no 'real' importer for it is out there that's worth wasteing time with.
KWXport is probably the best exporter for Max.
I've read of alot of problems with the Blender plug-ins and as far as I saw yesterday, none for the latest version.
Don't know about Wings3D support, haven't checked.
Milkshape supports .X but I don't know to what extent.
TheDarkWraith
12-27-11, 03:48 PM
On the .X format.........
3D Max has no support for that format and no 'real' importer for it is out there that's worth wasteing time with.
KWXport is probably the best exporter for Max.
I've read of alot of problems with the Blender plug-ins and as far as I saw yesterday, none for the latest version.
Don't know about Wings3D support, haven't checked.
Milkshape supports .X but I don't know to what extent.
In your opinion then what's the best format to export to?
v1.0.478.0 released. See post #1.
I was using my own app and I switched over to Photoshop to do some image editing. Came back to the app and the status box was filled with errors and nothing was being rendered. This had me puzzled. Reopened the app in Visual Studio and set some breakpoints on things to figure out why this was happening. :eek: I never finished coding the user switching! This fixes this horrendous oversight :shifty:
Madox58
12-27-11, 04:15 PM
I'd think you'll have to make a trade off in some ways to allow the formats that most free 3D programs can handle.
The .SMD format seems to be the most popular for the animations as Blender, Milkshape, and the SoftImage Mod tool can handle it. Valve created the plug-ins for Blender and SoftImage, Milkshape has it built in.
Most programs create the normals and such if they are missing on import.
So for static meshes the .obj format may be the best way to go as nearly any program can handle them.
On import, you could calculate the needed Normals, Tangents, and Bitangents.
OpenCollada may be the best for non-static meshes.
The biggest complaint is the size of the files which are known to crash alot of the free modeling programs.
Just my thoughts as I've been working with different model formats and a wide range of users of different programs.
As very few people actually do animations around here?
I'd start with the static mesh stuff as it would allow new Units in a big hurry!
:yep:
Then move towards the animations.
TheDarkWraith
12-28-11, 04:25 AM
v1.0.479.0 released. See post #1
Added ability to export meshes to obj format. I can't get a single one to load in Wings3D that I export though. Maybe someone can look at the generated files and tell me what I'm doing wrong :06:
I followed the obj spec so I can't seem to figure out what's wrong.
Madox58
12-28-11, 07:10 AM
I don't have Wings3D installed, but...........
http://i108.photobucket.com/albums/n12/privateer_2006/Junkers_Ju-87B_Stuka_body.jpg
add # in front of o Junkers_Ju-87B_Stuka_body and try again in Wings3D.
Add 1 to every face so 1720/1720/1720 becomes 1721/1721/1721 as an example.
Try this example file in Wings3D.
http://www.mediafire.com/?04zfl727v27y25g
TheDarkWraith
12-28-11, 02:19 PM
Add 1 to every face so 1720/1720/1720 becomes 1721/1721/1721 as an example.
Yes I forgot one critical detail of the OBJ format:
"Vertex
A valid vertex index starts from 1 and matches the corresponding vertex elements of a previously defined vertex list. Each face can contain more than three elements."
OBJ formats are 1 based not zero based like DirectX :oops:
Exports load in Wings3D now :D
Just a little more clean-up to do with the exports now. Have to code in the writing of the .mtl file.
TheDarkWraith
12-28-11, 04:13 PM
Have it where you can export certain subsets of a GR2 mesh now. Everything working well on the exporter. Wings3D crashes when it tries to open an obj file with too many verticies (King George V hull for example) :nope:
TheDarkWraith
12-28-11, 07:06 PM
Successful export of NVV and viewed in Wings3D:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5219
TheDarkWraith
12-28-11, 08:28 PM
v1.0.481.0 released. See post #1
You can now export meshes to OBJ format. You have the option as to whether the textures are made also.
Some things to note about the exporting:
- all exports come from what's in memory! This means that if you deform a mesh and you want to export that deformation without saving to file you can!
- when I allow you to deform textures the same thing will happen
- you currently can only export one mesh at a time (you can not export a whole model at a time)
- each export is assigned it's own .mtl file and .obj file
- exports are placed in ..\Exports\model name by default (a dialog box will pop up asking if you want to save to default location)
- textures are saved in TGA format
- stock SH5 meshes need the V coordinate flipped (so leave that checked!)
- be careful with stock SH5 textures as the alpha channel has data! Delete the alpha channel to render correctly (looks like junk in it anyways) :yep:
- currently only the first set of texture coordinates are exported. If someone can show me a document on how to export multiple texture coordinates in the OBJ format I'll be more than happy to add that ability :yep:
- the mesh's vertices, normals, and texture coordinates 0 are exported
- you have the ability to export specific subsets of a mesh. Whatever subsets are checked in the Meshes tab for that mesh are exported
- a mesh has to be visible (root node has to be checked in the Meshes tab) in order to export
I'm working on the importer now :D
Madox58
12-28-11, 08:48 PM
Export the same mesh but assign the 2nd set of UV's.
Then add AO to the name.obj
Easiest and most cross application friendly way.
TheDarkWraith
12-28-11, 09:28 PM
Export the same mesh but assign the 2nd set of UV's.
Then add AO to the name.obj
Easiest and most cross application friendly way.
Easy enough :DL
I'd rather have it all in one. That's one reason I don't like the OBJ format.
Forgot to add the bump map to the .mtl files. Will be available in next version :up:
TheDarkWraith
12-29-11, 12:37 AM
v1.0.483.0 released. See post #1
You now have the option to export the AO also (if the mesh has 2nd texture coordinates and AO map)
If mesh has normal bump map then entries added to .mtl file denoting this. Also adds the normal bump map to the export folder.
I tried open GR2 Editor and...
value of 35 is not valid for Value 35. Value should be between Minimum and Maximum.
Parameter name: Value
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.ArgumentOutOfRangeException: Value of '35' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.
Parameter name: Value
at System.Windows.Forms.NumericUpDown.set_Value(Decim al value)
at TheDarkWraith.SilentHunter5.GR2EditorViewer.SetCfg FileEntries(Boolean verbose)
at TheDarkWraith.SilentHunter5.GR2EditorViewer.GR2Edi torViewer_Shown(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnShown(EventArgs e)
at System.Windows.Forms.Form.CallShownEvent()
at System.Windows.Forms.Control.InvokeMarshaledCallba ckDo(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallba ckHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Objec t userData)
at System.Runtime.CompilerServices.RuntimeHelpers.Exe cuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(Exec utionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Windows.Forms.Control.InvokeMarshaledCallba ck(ThreadMethodEntry tme)
at System.Windows.Forms.Control.InvokeMarshaledCallba cks()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GR2EditorViewer
Assembly Version: 1.0.483.0
Win32 Version: 1.0.483.0
CodeBase: file:///D:/GR2/GR2EditorViewer.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.DirectX.Direct3DX
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.3900
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
----------------------------------------
Microsoft.DirectX.Direct3D
Assembly Version: 1.0.2902.0
Win32 Version: 9.05.132.0000
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.30729.1 built by: SP
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Microsoft.DirectX
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.2904
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Microsoft.VisualC
Assembly Version: 8.0.0.0
Win32 Version: 8.00.50727.3053
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualC/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualC.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
What is my problem ?
TheDarkWraith
12-29-11, 06:32 PM
I tried open GR2 Editor and...
value of 35 is not valid for Value 35. Value should be between Minimum and Maximum.
Parameter name: Value
I always forget about those not using the American way of decimal notation. Darn localizations :damn: I will fix.
This does not include the fix:
v1.0.486.0 released. See post #1
You now have limited import ability. What I mean by limited is:
the OBJ file you pick to import into a mesh has to have:
- the same number of subsets (defined with g) as the current mesh
- the same number of materials (defined with usemtl) as the current mesh
- each subset should have the same indice order as the current mesh
- each subset should have the same number of faces (and thus vertices) as current mesh (within a g block these are defined with f)
The OBJ file does not have to have normals specified. It does have to have vertices and texture coordinates specified. If normals are not specified then the existing normals in the mesh for each vertice will be used. I am NOT recalcuting the binormal or tangent vectors currently.
This allows you to export a mesh, open up in 3D modeller program, make changes to it (deform it while keeping vertice count for each subset the same and number of subsets the same, change texture coordinates (re-uv map it, etc) and then import it back into the mesh. Then press File-->Save to save to GR2 file.
I have more work to do on it. My end goal is:
- allowing you to change almost everything relating to the mesh
I have many things to work out before I can do this :yep:
I want to make sure that this part of the importer is working solid before adding to it.
TheDarkWraith
12-29-11, 07:45 PM
v1.0.487.1 released. See post #1
This fixes the localization problem posted a few posts up
TheDarkWraith
12-30-11, 02:37 AM
Meet Franken-NVV:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5226
Something look odd/different about this NVV? It should. I took the NLL and exported hull 03 out of it. Then I loaded NVV and imported the NLL's hull 03 into NVV hull 03 (notice that status text on the import) :rock: Each mesh had totally different number of vertices. You all can't do this yet as this version hasn't been released. This was a 'theory to practice' as they say in my line of work :D
As I've been working with the GR2 files I've noticed many things about them that can be exploited. This is using one of those exploits :cool:
:|\\
urfisch
12-30-11, 06:56 AM
import works...nice to know, keep up the good work, rb.
Echolot
12-30-11, 08:52 AM
Thank you for the big amount of time and knowledge you put in this project, TDW.
Thank you too, privateer und all people supporting this project through testing and reporting.
SH5 is not dead, the child grows up.
:up:
Keep up the good work and a happy new year to you all.
Regards.
Echol:sunny:t.
Sartoris
12-30-11, 02:12 PM
Wow, so much progress in this thread, it's amazing :yeah:
I hope this means we'll soon see modders using TDW's new tool!:up:
The app is set to run at 1200 X 1025.
That LODError is from a file. It appears you tried to load a file. It's something it read from the file.
I'd like to see the full DbgView output if possible. What I'd like to see from it is you run the app. After it's loaded don't try to load anything. Move the camera around with the mouse for a little bit. Then try to load a file. Ensure Debug is enabled (under Misc tab)
I might also code up something that will read your video card's capabilities and output it all to text file so I can see if there's something I've coded in thinking will work with anyone's video card that actually isn't and have you run it :hmmm:
Can you run my SH map viewer app found in \data\Applications of my UIs mod without problem?
Hi TDW
Sorry for the delay in replying - family chrimbo type things took over.
I have tried on a 3rd PC and also on a vmware install and same problem. Directly it loads and shows the "Mickey Mouse" screen it errors in the status window.
One time I got the following when exiting:-
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at TheDarkWraith.SilentHunter5.GR2File.HasBeenModifie d()
at TheDarkWraith.SilentHunter5.GR2EditorViewer.tsmiFi le_DropDownOpening(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripDropDownItem.OnDropD ownShow(EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnDropDownS how(EventArgs e)
at System.Windows.Forms.ToolStripDropDownItem.ShowDro pDownInternal()
at System.Windows.Forms.ToolStripDropDownItem.ShowDro pDown(Boolean mousePush)
at System.Windows.Forms.ToolStripMenuItem.OnMouseButt onStateChange(MouseEventArgs e, Boolean isMouseDown)
at System.Windows.Forms.ToolStripMenuItem.OnMouseDown (MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseDown (MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventIntera ctive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(Event Args e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseDown(MouseEv entArgs mea)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.MenuStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
GR2EditorViewer
Assembly Version: 1.0.477.0
Win32 Version: 1.0.477.0
CodeBase: file:///E:/GR2EditorViewerLatest/GR2EditorViewer.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.DirectX.Direct3DX
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.3900
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
----------------------------------------
Microsoft.DirectX.Direct3D
Assembly Version: 1.0.2902.0
Win32 Version: 9.05.132.0000
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
----------------------------------------
System.Core
Assembly Version: 3.5.0.0
Win32 Version: 3.5.21022.8 built by: RTM
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Microsoft.DirectX
Assembly Version: 1.0.2902.0
Win32 Version: 5.04.00.2904
CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Microsoft.VisualC
Assembly Version: 8.0.0.0
Win32 Version: 8.00.50727.3053
CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualC/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualC.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
I cannot run SH map viewer without erroring.
All in all I'm up the creek without a periscope which is a shame as this application looks like the works as far as adding new units, and modifying others.
Don't like the feeling I'm missing something.....:cry:. What are the install instructions for the app - am I missing some dll or some-such.......
Regards
MLF
TheDarkWraith
12-30-11, 05:33 PM
Franken-NVV was successfully saved to GR2 file and reloaded :rock:
It even passed the Granny Viewer test (it loaded and loaded correctly) :D
Such a simple exploit...
TheDarkWraith
12-30-11, 06:55 PM
I cannot run SH map viewer without erroring.
All in all I'm up the creek without a periscope which is a shame as this application looks like the works as far as adding new units, and modifying others.
Don't like the feeling I'm missing something.....:cry:. What are the install instructions for the app - am I missing some dll or some-such.......
Regards
MLF
I'm still looking for the DbgView output from this...
TheDarkWraith
12-31-11, 12:42 AM
In order to verify that the texture coordinates are being written/read correctly I coded in something to view them. These are the first set of texture coordinates for the NVV hull 03. Something doesn't look right as they seem displaced a little to the right and down (things just don't line up right like the door below) :hmmm:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5227
I took the texture coordinates and subtracted 0.5f from X and added 0.5f to Y to get to screen coordinates (rendered as transformed primitives - thus already specified in screen space). I rendered them to a surface where the surface is the diffuse texture for NVV hull 03. I then saved this texture to a graphics stream and used that stream as input into creating an new image. The new window's background image was set to this image. I had the TextureLoader class save the texture (and thus the rendered surfaced) to file so I could display it here. Anyone have any ideas why it seems displaced? :06:
TheDarkWraith
12-31-11, 02:50 PM
Okay figured out my problem. The problem was due to perspective projection of camera (and not setting the camera before rendering to surface!). To fix I rendered the texture to a full-screen quad and drew that, then I drew the texture coordinates. Since all of this was being rendered to a surface I had a perfect texture to display when it was done (I added some new buttons that allow you to view the texture coordinates for a mesh's diffuse or AO map):
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5228
I was also being stupid about how to render the texture coordinates. After sleeping on it I realized that since I'm using transformed (screen space) coordinates to render the texture coordinates I don't have to do anything but multiply the texture coordinates by the screen resolution (actually the render to surface dimensions since it's technically the screen during the rendering of them)
You can change the color of the rendered texture coordinates via button. You can also save this image to file (double click anywhere in window - it will save as the type you have specified under the misc tab for screenshots).
In the display window title bar is tells you the mesh name : the texture name (texture type)
This window is resizable by using mouse like all other windows in windows (starting size is 600 X 600)
I have noticed that some of the AO maps seem to be not correct. Looking at the NVV Hull 03 you can see some problems in it.
TheBeast
12-31-11, 06:19 PM
Could it be possible to Export Maps to Clipboard?:06:
When working on skins it would be fantastic to have a layer showing where everything is located llike limber holes etc that is hidden prior to save.
TheDarkWraith
12-31-11, 06:58 PM
Could it be possible to Export Maps to Clipboard?:06:
When working on skins it would be fantastic to have a layer showing where everything is located llike limber holes etc that is hidden prior to save.
In what format? :06: Guess I don't understand what you're asking
Are you looking for something like a mask? Like an alpha layer?
TheBeast
12-31-11, 08:22 PM
In what format? :06: Guess I don't understand what you're asking
Are you looking for something like a mask? Like an alpha layer?
Format could be BMP, PNG, TGA. Silent 3ditor by Skwas exports in PNG format.
Not sure if it is UV or AO Map but it is the map that shows what part of the texture image is being used.
TheDarkWraith
12-31-11, 08:55 PM
Format could be BMP, PNG, TGA. Silent 3ditor by Skwas exports in PNG format.
Not sure if it is UV or AO Map but it is the map that shows what part of the texture image is being used.
So it shows the triangles only? Are the triangles in wireframe or are they solid? Is the information contained in an alpha layer or in the RGB channels?
I currently allow you to save the image shown though it's an app screenshot (it saves the whole window). The image is saved in whatever format is selected for screenshot under the misc tab. I could make it just save the rendered portion but then that would contain texture in it also. I guess I could add another button(s) - mask that would create 'masks' for the subsets.
Ran into another problem:
I currently coded the rendering of texture coordinates to allow you to render only the subsets shown (whatever subsets are checked in the meshes treeview for that mesh). It all works fine except for the second subset (if the mesh has more than 1 subset). The problem is those texture coordinates are outside the normal 0-1 boundary and I'm guessing they are supposed to wrap back around? I don't see where Granny defines a wrapping mode for the texture coordinates :hmmm:
Madox58
12-31-11, 09:21 PM
int32 UVW Tiling
Materials::Extended data
TheDarkWraith
12-31-11, 10:10 PM
int32 UVW Tiling
Materials::Extended data
I see says the blind man :up: Now I have to play around with the different values to figure out what they mean.
@TheBeast:
Something like this for the 'mask':
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5245
There is no alpha encoding in this. Just what you see. I could probably code something to make the black transparent via the alpha channel.
:06:
TheBeast
12-31-11, 10:43 PM
I see says the blind man :up: Now I have to play around with the different values to figure out what they mean.
@TheBeast:
Something like this for the 'mask':
There is no alpha encoding in this. Just what you see. I could probably code something to make the black transparent via the alpha channel.
:06:
Yes that is it. You add that as the Top Layer in the texture you are working on to help guide placement of rust, scratches, etc.
Select the black color only of that layer and delete. You are left with just the green wireframe only allowing you to see layer(s) below to edit.
Save all layers in .PDN for PaintDontNet or .PSD for Photo Shop for future editing.
When you are ready to Save the texture, you simply hide that layer with the Wire Frame so it is not saved to finished image texture.
TheDarkWraith
12-31-11, 10:45 PM
Yes that is it. You add that as the Top Layer in the texture you are working on to help guide placement of rust, scratches, etc.
When you are ready to Save the texture, you simply hide that layer so it is not saved to finished image texture.
So it needs transparency or not? If I don't have to code in an alpha channel that would be great :DL
TheDarkWraith
12-31-11, 11:04 PM
here's another question for everyone:
Usually texture coordinates are defined in the 0-1 range. You can exceed these ranges for special effects of if you want an image wrapped (values of 1+ and for every additional 1 after that cause x times wrapping).
When I display the texture coordinates do you want them all in one screen (all values in one screen) or do you want them split between screens (values 0-1 in one screen, values 1-2 in another screen, values -1-0 in another screen, etc)? The splitting between windows would be like how Wings3D shows texture coordinates that are outside the 0-1 range
:06:
TheDarkWraith
01-01-12, 12:58 AM
Let me show you the problems we face with these SH5 units:
NVV Hull03 subset 0:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5247
NVV hull 03 subset 1:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5248
I needed something visual to see what was going on with the texture coordinates. What you are seeing are the texture coordinates rendered based on their UV values. The UV values for X ranged from -1 to 9....yes 9!! (the AO maps are even worse) So you are seeing the same image tiled 10 times in the X direction and 10 times in the Y direction as the background that the texture coordinates were rendered on. Since subsets share the same texture coordinates that would be why subset 0 is still tiled 10 times in the X and Y directions. You may ask why did I have to tile the Y direction by the same amount as the X direction? To keep scale and so they were rendered correctly is why.
Now can someone explain to me why you would need to take texture coordinates any higher than 2? :06: I just don't get it :nope:
This makes it rather difficult to show the texture coordinates on one 'page'. They have to be split up into multiple pages if one wanted to 'see' them :shifty:
Here's v1.0.492.0 if you want to see these texture coordinates for yourself: http://www.gamefront.com/files/21141080/GR2EditorViewer_v1_0_492_0_zip
TheBeast
01-01-12, 01:44 AM
So it needs transparency or not? If I don't have to code in an alpha channel that would be great :DL
No Alpha channel required. Silent 3ditor didn't have one.
Once the texture has been added as layer the user can select global the background color that is not needed and delete it leaving wire frame in place.
Madox58
01-01-12, 02:39 AM
Now can someone explain to me why you would need to take texture coordinates any higher than 2? :06: I just don't get it :nope:
One trick many use when doing thier UV's is to take advantage of the Tiling so all the UV's don't cluter the main window while working.
Normally you correct this before sending it out to God knows where.
Many consider it sloppy work not to adjust the UV's to a 0 - 1 layout.
That does not seems to be the case more and more often now days.
Hard to say if this (SH5 UV's) was a time constrant cause or oversight.
rocker_lx
01-01-12, 07:52 AM
Wow, nice tool.
So I tried to open :\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2
GR2 editor showes "Loading..." for aprox 5 sec then writes
"c:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2 closed"
in the status message ??
I can succesfully open "C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_02.GR2"
I can also export this one to obj.
Although I'm not able to import it into lightwave. I can open the file in wings3d and then export to lightwave, which will then open the file.
I'm sure I'm just missing something here. Is it normal that the tool always compiles the shaders at launch?
Anyway I'm really impressed with your work, you sir are really talented.
Edit:
how to to rotate, zoom objects in viewer? I can't figue it out.
TheDarkWraith
01-01-12, 10:44 AM
Wow, nice tool.
So I tried to open :\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2
GR2 editor showes "Loading..." for aprox 5 sec then writes
"c:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\NSS_Uboat7b.GR2 closed"
in the status message ??
I can succesfully open "C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7b\Submarine Parts\Conning_7B_02.GR2"
I can also export this one to obj.
Although I'm not able to import it into lightwave. I can open the file in wings3d and then export to lightwave, which will then open the file.
I'm sure I'm just missing something here. Is it normal that the tool always compiles the shaders at launch?
Anyway I'm really impressed with your work, you sir are really talented.
Edit:
how to to rotate, zoom objects in viewer? I can't figue it out.
There are things that make you ho hmmm, and there are things that make you go hmmm even more. This is one of them (NSS_Uboat7b). With every mesh that is made the final thing that is done to it is it gets 'optimized'. It's really not optimized but a cheap way to get DirectX to assign attribute IDs to each vertice. I call this function:
mesh.OptimizeInPlace(MeshFlags.OptimizeAttributeSo rt | MeshFlags.OptimizeIgnoreVerts, adjac);
Usually it has no problems. But for this sub and some others it fails on attempt. So I said what if I call it again? I did and it worked. Things that make you go hmmm...:shifty:
So the problem is fixed and I'll have a new version out shortly :up:
I don't have a lightwave exporter. I currently only export to obj format.
Yes the tool always compiles the shaders at launch. This is because you are free to modify them at any time and recompile and use. Press the R key to recompile and use.
Press H to access help screen overlay.
To rotate click and hold left mouse button, move mouse.
To pan hold middle mouse button and move mouse
To zoom hold right mouse button and move mouse forward/backward
Once the camera is 'locked' things change. It depends on which axis of freedom you have granted and which axis's aren't locked. Press H key for help. The help screen is dynamic based on what you are currently doing. Once an object is locked the help screen will change.
rocker_lx
01-01-12, 11:55 AM
Ok, thanks.
I tried with the mouse to move and it didn't do anything, so I retried and now it works !? I wonder what I did wrong before.:doh:
I meant the .obj import into lightwave, it gave an error. You can't of course implement an export for every format. I also tried with XSI modtools opening the .obj which gave no error but the mesh was not shown, this could also be due that I don't know XSI enough.
TheDarkWraith
01-01-12, 01:35 PM
Ok, thanks.
I tried with the mouse to move and it didn't do anything, so I retried and now it works !? I wonder what I did wrong before.:doh:
I meant the .obj import into lightwave, it gave an error. You can't of course implement an export for every format. I also tried with XSI modtools opening the .obj which gave no error but the mesh was not shown, this could also be due that I don't XSI enough.
I use Wings3D to verify that the exporter is working correctly. If Wings3D opens it up correctly then I know the exporter is working correctly :up:
TheDarkWraith
01-01-12, 08:52 PM
v1.0.493.0 released. See post #1
Shaders precompiled now so app starts up quick. You can still recompile if you want if you modify them.
Fixed problem with bounding sphere class that would prevent some units from loading
Fixed problem in Mesh class that would sometimes prevent the chosen file from being loaded (i.e. NSS_Uboat7b.GR2)
Fixed bugs in rendering of texture coordinates. I wasn't taking into account the possibility of V values exceeding 1 or being less than 0.
Did some cosmetic fixes to the window(s) shown when texture coordinates are rendered. Unmaximizing the window now returns it to it's former state. Double clicking the status bar at the bottom of the window sets the window back to it's default (starting) size (even if maximized).
Double clicking the rendered area of the rendered texture coordinates allows you to save the image.
Still have to 'cut' the rendered texture coordinates into subdivisions for those who U or V value(s) exceed 1 or are less than 0.
Re-enabled the import function. This is the first import style I coded (I'm still working on finishing the other importer). So previous restrictions apply when importing back into the GR2 file.
Fixed some bugs in the exporter. Bugs had to do with when the mesh had more than one subset and the first subset was disabled exceptions would be thrown.
Fixed some other minor bugs
:|\\
TheDarkWraith
01-02-12, 01:18 AM
v1.0.495.0 released. See post #1
The texture coordinates now render a tiled image showing you the 'overall' texture coordinates layout and then it breaks those down into individual windows (those grids that have a valid face rendered in them). This will bring a new age to skinning in SH5 :D
This part I coded I had to pat myself on the back about. Rarely do I ever make something this slick :yep:
Planning your app really does pay off. I had about a month of planning of it and boy was I itchin to code. I'm not one to plan, I shoot from the hip usually.
Work continues on the new importer. If everything goes as planned I'll be patting myself on the back again :cool: Everything's looking good so far...
In this screen shot I had the NRTW loaded up. I had selected Hull 01 mesh. I asked the app to render texture coordinates 0 for subsets 0 and 1:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5256
What we have is the overall texture coordinate layout in the topleft for subset 0. Those images to the right of it are the grid breakdowns.
In the bottom left we have the overall texture coordinate layout for subset 1. Those images to the right of it are the grid breakdown.
Notice that in the overall layout it tells you the grid structure.
In the grid breakdowns it tells you the U and V range of that grid.
I have to say that I did complain about texture coordinates being outside of the 0-1 range initially. Now I'm quite fond of the idea :yep: This makes skinning so much easier to do!
On the grid breakdowns: A grid will render if it has a valid face of the mesh rendered in it. This means you can get 'garbage' grids if the grid contains garbage but that garbage is a valid mesh face (as told by the mesh's indicies)
Every texture coordinate window is an individual. That means you can save each one if you want or discard it by clicking the red X in the upper right corner. To save double click anywhere in the rendered part.
Next thing I plan to do with the texture coordinates is let you select individual faces of a mesh (if fillmode selected has wireframe in it) by double clicking the face and exporting those. This will allow you to pinpoint exactly the place where you want to skin or change the texture. You'll be able to select multiple faces of a mesh (a face is a triangle of the mesh in case you didn't know). When you switch to a fillmode that has wireframe in it you are seeing the 'faces' of each mesh.
When you ask the app to render the texture coordinates by pressing 1 or 2 in the Show box of the meshes it will first ask you if you are creating a mask. A mask does not render the background image, it only renders the 2D texture coordinates. So if you say yes to this question you will only get the 2D texture coordinates (masks are used to make/edit skins). If you answer no to this question the material for the texture coordinates will be rendered then the 2D texture coordinates. Either way the name and path of the material for the texture coordinates being rendered in the window appears at the bottom of the window.
:|\\
urfisch
01-02-12, 05:33 AM
good job, rb!
TheDarkWraith
01-02-12, 01:06 PM
just realized that if you want to save the rendered texture coordinates to file you probably want to know what the current image size is. I'm going to add another status entry in the window's bottom status line that will tell you the current dimensions of the render area of the window. The optimum size is currently fixed at 1024 X 1024 as that is what I render the texture coordinates to (it's what the render to surface's 'backbuffer' is). I'll edit this with screenshot when added.
EDIT:
good thing I did this. I wasn't calculating a 'square' render area when you resized the window :shifty:
Here's the change:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5265
You'll notice something about the screenshot ability of the windows: ensure that dialog box isn't near the window being saved! This only happens when saving the full window. This will not happen and does not apply to saving render window as the render window is actually a texture being shown.
So you have the path to the material used with these texture coordinates on the bottom left. Double clicking this will set the window to the default starting size (render window area of 500 X 500).
On the bottom right you have the current render window size. As you resize the window this shows you the size of the render window, not the window itself! Double clicking this will set the render window to the optimum size (whatever size the render to surface's backbuffer was - currently fixed at 1024 X 1024). I might add the ability to select the size in case someone wants to make higher resolution skins. We'll see.
New version releasing soon with changes.
Face picker about complete but won't be in new version
I'm still looking for the DbgView output from this...
I tried PM'ing this to you but failed - too big. Not sure how to get it to you, really:cry:. Email?
I had dbgview output for V1.409 when it errored on loading a GR2 file - that's what I'm trying to send. However I cannot get any dbgview output for later versions which error on loading the app (before loading a GR2) and when moving the mouse.
Should I be able to run this app just by clicking on GR2EditorViewer.exe from any location on my PC?
Regards,
MLF
TheDarkWraith
01-02-12, 01:54 PM
I tried PM'ing this to you but failed - too big. Not sure how to get it to you, really:cry:. Email?
I had dbgview output for V1.409 when it errored on loading a GR2 file - that's what I'm trying to send. However I cannot get any dbgview output for later versions which error on loading the app (before loading a GR2) and when moving the mouse.
Should I be able to run this app just by clicking on GR2EditorViewer.exe from any location on my PC?
Regards,
MLF
Zip it up first to decrease the size. Use 7Zip's brutal compresssion :yep:
Then you can upload the zipped file to www.megaupload.com (http://www.megaupload.com) or something similar and send me the link.
Yes you should be able to run the app by just clicking on the exe file from any location on your PC. Be sure that the location has the shaders folder with it :yep:
You do have at least .NET 3.5 installed right? I just thought of that as a possible reason why it won't load for you. The app also uses Microsoft's abandoned Managed DirectX (so stupid to abandon - XNA is a kiddy language and SlimDX is an option to use) so maybe forcing an install of DirectX9 from Microsoft's website might also cure it.
TheDarkWraith
01-02-12, 02:07 PM
v1.0.496.0 released. See post #1
This fixes the problems and adds the features mentioned a few posts up
rocker_lx
01-02-12, 02:12 PM
Ok, this UV stuff makes my head turn. I have real problems grasping this UV space definition 0 to 1.
I noticed one small problem while exporting when I select "Yes" to specify save location, the save of the mtl and tga files fails. A small detail but perhaps you could fix this.:salute:
I can now successfully open the Uboat GR2 files, great.
I still have problems opening the obj file in lightwave. I opened it in another great free 3d editor called voidworld.
Download:
http://www.digitalfossils.com/
Newest builds:
http://voidworld.cmcproductions.co.uk/index.php/board,2.0.html
When I resave to .obj in voidworld I can successfully open it in lightwave.
Voidworld has the advantage that it keeps the name of the UV maps intact.
Wings3d renamed them to Winds3dUV or something like that.
There I noted that the scale is huuuuuuuge, i had to resize the mesh, probably thats why I didn't see anything in XSI.
This is so cool.
Keep up the great work.:up:
Here is a picture of it after import to Lightwave.
http://www.subsim.com/radioroom/picture.php?albumid=592&pictureid=5266
TheDarkWraith
01-02-12, 02:35 PM
I noticed one small problem while exporting when I select "Yes" to specify save location, the save of the mtl and tga files fails. A small detail but perhaps you could fix this.:salute:
I still have problems opening the obj file in lightwave. I opened it in another great free 3d editor called voidworld.
When I resave to .obj in voidworld I can successfully open it in lightwave.
Voidworld has the advantage that it keeps the name of the UV maps intact.
I will look into the problem when you say yes to save location. I've yanked v1.0.496.0 until I look into this. Thanks for reporting :up:
Can you send me the files produced by voidworld? I want to see what they do differently. If you can send me the files that lightwave makes I can probably code in an exporter for it also :yep:
rocker_lx
01-02-12, 03:22 PM
Hmm, Voidworld manages to sometimes screw up UV space, when I export with wings3d to obj the texture of the deck of the V7c41 is visible but with voidworld the texture mapping is lost. Also with wings3d the scale of the mesh is not of the charts after loading in Lightwave.
Thanks for your offer but I don't think that a Lightwave exporter is needed, import into GR2 editor is the thing which is needed.:D
BTW 3dsMax also seems to have problems reading the file, it just shows a line although the number of reported polygons and vertexes seems to match. The Wings3d file here also imports nicely. (But again I don't know max enough for being sure)
I will investigate some more. I already heard on other modding forums that .obj can be a bitch sometimes.:hmmm: Objects exported from cryengine2 editor for example also caused a lot of problems for some tools, but can normaly be fixed with some notepadding.
I will compare GR2 editor obj files with wings files, perhaps I can even rename the UV map via notepad in the wings3d file.
Edit:
Ha......
found it.... it's a localisation problem I guess, I opened the .obj file in notepad++ and compared with the wings3d .obj file GR2 Editor saves the data with wrong punctuation, probably due to regional settings in windows.
GR2 Editor
# Exported by GR2Editor/Viewer v1.0.495.0
# Exported from GR2 file C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat7c41\NSS_Uboat7C41.GR2
#
mtllib NSS_Uboat7c41_hull.mtl
o NSS_Uboat7c41_hull
# 2 subsets, 11533 vertices, 15572 faces
v 0,018258890 -0,422333400 -0,012335560
v 0,018258890 -0,443254500 -0,012335970Wings3d:
# Exported from Wings 3D 1.4.1
mtllib deck-wings.mtl
o NSS_Uboat7c41_deck
#750 vertices, 677 faces
v -4.4170910e-2 0.19822740 3.18659600
v -8.0950110e-2 0.17744700 2.52884100
v -5.0900000e-7 9.4104280e-2 -3.31079400The same Problem also caused voidworld to lose the UV mapping and scale the mesh to mega size. I guess voidworld was only taking the value behind the "," which gave those huge numbers.
Edit2:.
Yep I can successfully import the object file in lightwave when I change my separator to "." in my regional settings, but this causes an other error when loading NSS_Uboat7C41.GR2. (see screenshot)
http://www.subsim.com/radioroom/picture.php?albumid=592&pictureid=5268
After I click "OK" the GR2 file loads after a few seconds.
Edit3:
After trying again the bounding box error did not reappear.
TheDarkWraith
01-02-12, 04:11 PM
Ah crap I did it again. I forgot about regional settings. I always forget about those of you not using the American decimal notation....I'll fix :up:
So do I need to force decimal places as . or , ? Or let the app decide based on regional settings? I think I need to force the . decimal notation...
rocker_lx
01-02-12, 04:55 PM
Yes I think "." is the way to go.
TheDarkWraith
01-02-12, 04:59 PM
Yes I think "." is the way to go.
I did one better. I included a new menu item:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5269
If this is unchecked it will use US regional settings (thus the . for decimal notation). If this is checked then it will use your current regional settings. This gives the most flexibility :up:
This is saved to the cfg file at app end and read from cfg file and applied at app start.
and with that....
v1.0.499.0 released. See post #1
Let me know if the export problem is fixed and whether this decimal 'problem' is cured or not :up:
Also fixed the problem that the texture coordinates were not being saved to the current size of the render window when you selected to save render window.
fromhell
01-03-12, 01:59 AM
fantastic stuff TDW:salute::salute::salute:
TheDarkWraith
01-03-12, 02:30 AM
It's only going to get better :D
Now you can select individual faces and render the texture coordinates just for those faces. This opens up another new age for skinning - pinpoint skinning. Man am I having fun now :rock:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5270
I'll finish coding the opacity part of the selected faces tomorrow. I'm tired. Time to sleep...
v1.0.501.0 released. See post #1
:|\\
Vanilla
01-03-12, 04:26 AM
It's only going to get better :D
Now you can select individual faces and render the texture coordinates just for those faces. This opens up another new age for skinning - pinpoint skinning. Man am I having fun now :rock:
....
Wow. That's very impressive!
fromhell
01-03-12, 07:33 AM
that is absolutly fantastic, hats of to you TDW. :yeah:
will we be able to produce an IX Boat soon?:D
please please.:woot::salute:
TDW, please check your PM. Thank you.:salute:
TheDarkWraith
01-03-12, 10:13 AM
that is absolutly fantastic, hats of to you TDW. :yeah:
will we be able to produce an IX Boat soon?:D
please please.:woot::salute:
That all depends on the outcome of my next importer that I'm still working on. Lots of little details to still work out :yep: You'll see some of those details being implemented in upcoming versions...
TheDarkWraith
01-03-12, 10:26 AM
TDW, please check your PM. Thank you.:salute:
When I was playing around with that sub on the bottom thing I was moving one bone up in the sub:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5271
For the 7b this was Room_EXT. I simply moved it up till it was in centerline of the sub.
If you're going to do this please fix the other bones on this sub. There are many that are way out of position...Something doesn't look right...
EDIT:
Granny Viewer confirms that I have a problem with bones. Now I have to figure out why :hmmm:
For the 7b this was Room_EXT. I simply moved it up till it was in centerline of the sub.
If you're going to do this please fix the other bones on this sub. There are many that are way out of position...Something doesn't look right...
Answered initially by PM, but here's my findings in the thread as well: I already moved the Room_EXT bone (from -0.6 to -0.5, right at the bottom of the hull model) and the other bones that reference to it, in other GR2 files - there's a couple of them, in TRA and Waypoints, plus another in the NSS_Uboat7a.gr2 file). Still no go. The sub still hovers above the seafloor and cannot touch it:wah:
EDIT
Of course I will help fixing the other bones. That's the least I can do for all the work you put in this app. I'll get at it as soon as you confirm that the editor works alright.
LATER EDIT
TDW, could you please also code your GR2 Editor to scale at lower resolutions? If this is not asking too much, of course, but I, for one, prefer to work with the display at 1400x900, and the app is larger than the screen at this resolution. Anyway, if this means too much work, just ignore it.
TheDarkWraith
01-03-12, 10:53 AM
Answered initially by PM, but here's my findings in the thread as well: I already moved the Room_EXT bone (from -0.6 to -0.5, right at the bottom of the hull model) and the other bones that reference to it, in other GR2 files - there's a couple of them, in TRA and Waypoints, plus another in the NSS_Uboat7a.gr2 file). Still no go. The sub still hovers above the seafloor and cannot touch it:wah:
By all accounts moving that bone up should have moved a great many more up. I see a problem in my app that I have to fix regarding bones...When you move that bone cfg#M01 should move also but it doesn't.
Hartmann
01-03-12, 10:57 AM
Answered initially by PM, but here's my findings in the thread as well: I already moved the Room_EXT bone (from -0.6 to -0.5, right at the bottom of the hull model) and the other bones that reference to it, in other GR2 files - there's a couple of them, in TRA and Waypoints, plus another in the NSS_Uboat7a.gr2 file). Still no go. The sub still hovers above the seafloor and cannot touch it:wah:
I read in some place that is about a collision detection sphere :hmmm: moving the bone alone don´t make any effect.But i remember that there are side effects messing with that sphere.
but i lost what thread was .:wah:
I read in some place that is about a collision detection sphere :hmmm: moving the bone alone don´t make any effect.But i remember that there are side effects messing with that sphere.
but i lost what thread was .:wah:
Here is the thread. For some reason, it got archived...
http://174.123.69.202/~subsimc/radioroom/showthread.php?t=169382 (http://174.123.69.202/%7Esubsimc/radioroom/showthread.php?t=169382)
This was the only attempt - to my knowledge - to fix this very unrealistic issue.
I've been trying for some time to edit the collision spheres myself, but Goblin Editor does not seem the right tool to do it.
TheDarkWraith
01-03-12, 11:16 AM
Found the bug in my code relating to the bones :nope: When you go changing things you always introduce errors :shifty: I was a little short-sighted on what I needed from my GR2Coords class (it handles all the transforms, positions, rotations, etc. for anything requiring a transform) so I had to make some modifications to it. One was I needed the world transform of the object (no parent influence) and I needed a world transform that was influenced by a global transform. I coded those in and forgot to change what the bones were using when they updated their parent transforms. Their parent transforms were called World before. They are now RenderWorld and that is what I forgot to update :-?
Now with that fixed here's what you should've seen when you moved Room_EXT:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5272
All those other nodes move with it. This will cause problems if those other nodes are not placed back where they should be.
Now I have to release a bug fix version as this is a critical error on my part :dead:
TheDarkWraith
01-03-12, 11:24 AM
v1.0.502.0 released. See post #1
This is a critical update. A major error was found in the bones relating to bones with parents. Bones could possibly not be rendered correctly because of this bug. I introduced this bug when I had to make some changes to a class of mine. The bug has been fixed in this version :up:
Will-Rommel
01-03-12, 02:24 PM
Neat work :shucks:
TheDarkWraith
01-03-12, 03:22 PM
I see there is some confusion with some things in the app so I think I should clear them up:
- the bounding boxes are created from data read in from the actual GR2 file. How they are used in the game or app is defined by the game/app. I just let you see what they look like (so you can see if there's any problems). I also use these for 'collision detection' when you go to select something. These are my 'fine' selectors.
- the bounding spheres do not exist in the GR2 files. They are something that I created for:
1) to visually see what the bounding sphere would look like for the mesh
2) 'collision detection' for selecting. These are my 'coarse' selectors. I needed to visually see them so I can detect selecting problems in the app.
So the bounding spheres do not indicate damage zones or anything of the likes. They are purely reference only
:|\\
rocker_lx
01-03-12, 04:27 PM
I did one better. I included a new menu item:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5269
If this is unchecked it will use US regional settings (thus the . for decimal notation). If this is checked then it will use your current regional settings. This gives the most flexibility :up:
This is saved to the cfg file at app end and read from cfg file and applied at app start.
and with that....
v1.0.499.0 released. See post #1
Let me know if the export problem is fixed and whether this decimal 'problem' is cured or not :up:
Also fixed the problem that the texture coordinates were not being saved to the current size of the render window when you selected to save render window.
Yep, decimal problem is fixed also select save location now also exports mtl and tga files.
I still get the error with the bounding spere, but it does not cause a problem.http://www.subsim.com/radioroom/picture.php?albumid=592&pictureid=5273
TheDarkWraith
01-03-12, 04:47 PM
Yep, decimal problem is fixed also select save location now also exports mtl and tga files.
I still get the error with the bounding spere, but it does not cause a problem.http://www.subsim.com/radioroom/picture.php?albumid=592&pictureid=5273
Good to hear :up:
Yes I've noticed that error in some of the doors. I'm investigating why currently. So far it appears the mesh (as read from the file) is messed up...
TheDarkWraith
01-03-12, 10:48 PM
Started making the architectural changes necessary for the new importer. This is major reworking when it comes to coding :shifty: There really was no way to prevent it because during planning I had no idea I would make it to this stage.
When it's all said and done the new importer will allow you to import anything (note 1) into a GR2 file.
Now note 1:
The pointers used in the GR2 files are a godsend and a hinderance at the same time. I've been unable to come up with an algorithm that manages to remap every pointer needed 100% of the time for whatever you want to do. The number of different combinations of what one could do are hard to fathom. So I took a step back and took another look at what one could do. What we want to accomplish is:
- importing new vertex data to replace existing
- change material names to reflect material needed for new vertex data
- change bones to match new vertex data
We can already edit bones to reposition/rotate them. All that is really needed for this is ability to change names. The new importer will allow you to change names BUT the length of the name cannot exceed the length of the old name (shorter names are fine).
Same thing above applies to new material names. We'll use existing materials and edit them.
Vertex data...the biggie. Using the exploit I mentioned some posts ago this can be done. Now I haven't coded in this part yet but in theory it should work. If you think about how the GR2 file lays out vertex data you'll notice that it all sits in one big chunk of space (except for skin data and animations). There are pointers to data in there from PrimaryVertexData defines. These pointers are managable in regards to changing. By changing the PrimaryVertexData's pointers and using the exploit, theoretically, one can put anything they want in that chunk of space.
Above applies to indicies also.
So with this we can think of the GR2 file as a shell. We can hollow out a shell and fill it with what we need. If we don't use all the space no big deal.
I have added a new class to the app - Registry. Everything that gets made (read in/saved to file) or destroyed ('hollowed out') has to go through the registry (like Windows). Thus this class is the overall master of the file. It knows where everything is, how much space is between things, what can be added, what can be removed, how big something is, etc.
With this we can take a GR2 file and replace it's 'guts' with the new vertex data, indicies, and names required. Thus we are not making new GR2 files per se, we are using existing ones as a host.
That's my course of action that I'm heading down currently :DL
urfisch
01-04-12, 05:55 AM
sounds as if someone founds his destiny...
:know:
redcoat22
01-04-12, 05:10 PM
I follow this post with glee yet have little idea what everyone is saying. Good work lads.
TheDarkWraith
01-05-12, 03:10 AM
v1.0.507.0 released. See post #1
Almost all the architectural changes to the code are complete. I changed the name of the Registry class to Sentinel because it better describes what it's doing (looking out for and protecting the GR2 file).
Now when you open a file you will see the file's sentinel activated
The sentinel adds some overhead to loading, saving, and making changes. You'll see loading times increase some. It's needed though :yep:
If you want a small glimpse of what the sentinel is doing under the hood enable debug output under the misc tab. Once a file is loaded it will spit out what it's tracking (I disabled some items from the status report).
As there were a ton of changes I'm hoping for no bugs but realistically I expect some. Hopefully they are minor in nature.
Let me know if the sentinel is too sensitive (keeps 'barking' saying there's problems). It never 'barked' at me once and I tried many different files.
:|\\
TheDarkWraith
01-09-12, 01:36 AM
I found this very interesting:
Items in section -1:
No items found in registry
Section -1 is contiguous
Items in section 0:
arttoolinfo NRTW_NRTW_ArtToolInfo Starting offset=0x0 (0x1C8) Ending offset=0xA8 (0x270)
extendeddata NRTW_NRTW_ArtToolInfo_ExtendedData Starting offset=0xA8 (0x270) Ending offset=0x2C0 (0x488)
exporterinfo NRTW_NRTW_ExporterInfo Starting offset=0x2C0 (0x488) Ending offset=0x2DC (0x4A4)
pointer Texture Starting offset=0x2DC (0x4A4) Ending offset=0x2E0 (0x4A8)
pointer Texture Starting offset=0x2E0 (0x4A8) Ending offset=0x2E4 (0x4AC)
pointer Texture Starting offset=0x2E4 (0x4AC) Ending offset=0x2E8 (0x4B0)
pointer Texture Starting offset=0x2E8 (0x4B0) Ending offset=0x2EC (0x4B4)
pointer Texture Starting offset=0x2EC (0x4B4) Ending offset=0x2F0 (0x4B8)
texture E:\SilentHunter5\Units\_Common\Textures\ship_hull_ N02.dds Starting offset=0x2F0 (0x4B8) Ending offset=0x33C (0x504)
texture E:\SilentHunter5\Units\_Common\Textures\ship_hull_ T03.dds Starting offset=0x33C (0x504) Ending offset=0x388 (0x550)
texture E:\SilentHunter5\Units\_Common\Textures\ship_N04.D DS Starting offset=0x388 (0x550) Ending offset=0x3D4 (0x59C)
texture E:\SilentHunter5\Units\NRTW\NRTW_AO01.dds Starting offset=0x3D4 (0x59C) Ending offset=0x420 (0x5E8)
texture E:\SilentHunter5\Units\_Common\Textures\ship_T04.d ds Starting offset=0x420 (0x5E8) Ending offset=0x46C (0x634)
pointer Material Starting offset=0x46C (0x634) Ending offset=0x470 (0x638)
pointer Material Starting offset=0x470 (0x638) Ending offset=0x474 (0x63C)
pointer Material Starting offset=0x474 (0x63C) Ending offset=0x478 (0x640)
pointer Material Starting offset=0x478 (0x640) Ending offset=0x47C (0x644)
pointer Material Starting offset=0x47C (0x644) Ending offset=0x480 (0x648)
pointer Material Starting offset=0x480 (0x648) Ending offset=0x484 (0x64C)
pointer Material Starting offset=0x484 (0x64C) Ending offset=0x488 (0x650)
pointer Material Starting offset=0x488 (0x650) Ending offset=0x48C (0x654)
pointer Material Starting offset=0x48C (0x654) Ending offset=0x490 (0x658)
pointer Material Starting offset=0x490 (0x658) Ending offset=0x494 (0x65C)
pointer Material Starting offset=0x494 (0x65C) Ending offset=0x498 (0x660)
pointer Material Starting offset=0x498 (0x660) Ending offset=0x49C (0x664)
material Standard_3 Starting offset=0x49C (0x664) Ending offset=0x4B4 (0x67C)
extendeddata NRTW_NRTW_Standard_3_ExtendedData Starting offset=0x4B4 (0x67C) Ending offset=0x6DC (0x8A4)
material DMG Starting offset=0x6DC (0x8A4) Ending offset=0x6F4 (0x8BC)
extendeddata NRTW_NRTW_DMG_ExtendedData Starting offset=0x6F4 (0x8BC) Ending offset=0x91C (0xAE4)
material NM Starting offset=0x91C (0xAE4) Ending offset=0x934 (0xAFC)
extendeddata NRTW_NRTW_NM_ExtendedData Starting offset=0x934 (0xAFC) Ending offset=0x9E0 (0xBA8)
material NM Starting offset=0x9E0 (0xBA8) Ending offset=0x9F8 (0xBC0)
extendeddata NRTW_NRTW_NM_ExtendedData Starting offset=0xA00 (0xBC8) Ending offset=0xA24 (0xBEC)
material AO Starting offset=0xA24 (0xBEC) Ending offset=0xA3C (0xC04)
extendeddata NRTW_NRTW_AO_ExtendedData Starting offset=0xA3C (0xC04) Ending offset=0xAE8 (0xCB0)
material Diffuse Starting offset=0xAE8 (0xCB0) Ending offset=0xB00 (0xCC8)
extendeddata NRTW_NRTW_Diffuse_ExtendedData Starting offset=0xB00 (0xCC8) Ending offset=0xBAC (0xD74)
material cfg#TXRChila Starting offset=0xBAC (0xD74) Ending offset=0xBC4 (0xD8C)
extendeddata NRTW_NRTW_cfg#TXRChila_ExtendedData Starting offset=0xBDC (0xDA4) Ending offset=0xE04 (0xFCC)
material NM Starting offset=0xE04 (0xFCC) Ending offset=0xE1C (0xFE4)
extendeddata NRTW_NRTW_NM_ExtendedData Starting offset=0xE1C (0xFE4) Ending offset=0xEC8 (0x1090)
material NM Starting offset=0xEC8 (0x1090) Ending offset=0xEE0 (0x10A8)
extendeddata NRTW_NRTW_NM_ExtendedData Starting offset=0xEE8 (0x10B0) Ending offset=0xF0C (0x10D4)
material AO Starting offset=0xF0C (0x10D4) Ending offset=0xF24 (0x10EC)
extendeddata NRTW_NRTW_AO_ExtendedData Starting offset=0xF24 (0x10EC) Ending offset=0xFD0 (0x1198)
material Diffuse Starting offset=0xFD0 (0x1198) Ending offset=0xFE8 (0x11B0)
extendeddata NRTW_NRTW_Diffuse_ExtendedData Starting offset=0xFE8 (0x11B0) Ending offset=0x1094 (0x125C)
material cfg#TXRStructuri Starting offset=0x1094 (0x125C) Ending offset=0x10AC (0x1274)
extendeddata NRTW_NRTW_cfg#TXRStructuri_ExtendedData Starting offset=0x10C4 (0x128C) Ending offset=0x12EC (0x14B4)
pointer Skeleton Starting offset=0x12EC (0x14B4) Ending offset=0x12F0 (0x14B8)
bone NRTW Starting offset=0x1308 (0x14D0) Ending offset=0x13A0 (0x1568)
bone NRTW_hull_01 Starting offset=0x13A0 (0x1568) Ending offset=0x1438 (0x1600)
bone NRTW_hull_03 Starting offset=0x1438 (0x1600) Ending offset=0x14D0 (0x1698)
bone NRTW_hull_02 Starting offset=0x14D0 (0x1698) Ending offset=0x1568 (0x1730)
Finally have the sentinel working good. It's a seperate DOS like command window that you can type commands into. Right now it doesn't know too many commands - I have more to add. The above was a small tidbit of a status command on the arttoolinfo, material, texture, bone, pointer, and extendeddata sections.
I can now finally 'see' how the file is exactly laid out.
The reason there's a gap between the skeleton pointer and the first bone is because I didn't ask for status on skeleton in my request.
The gap between the end of the last material and the beginning of it's extended data is interesting. Wonder why?
Work continues...
EDIT:
ok, this is beyond hilarious...You would think I would know how to use my own app! Found the reason for the gap between the last material and it's extendeddata. If I include mapreference in the status command all is well:
material Diffuse Starting offset=0xFD0 (0x1198) Ending offset=0xFE8 (0x11B0)
extendeddata NRTW_NRTW_Diffuse_ExtendedData Starting offset=0xFE8 (0x11B0) Ending offset=0x1094 (0x125C)
material cfg#TXRStructuri Starting offset=0x1094 (0x125C) Ending offset=0x10AC (0x1274)
mapreference NRTW_NRTW_cfg#TXRStructuri_Diffuse Color Starting offset=0x10AC (0x1274) Ending offset=0x10B4 (0x127C)
mapreference NRTW_NRTW_cfg#TXRStructuri_Self-Illumination Starting offset=0x10B4 (0x127C) Ending offset=0x10BC (0x1284)
mapreference NRTW_NRTW_cfg#TXRStructuri_Bump Starting offset=0x10BC (0x1284) Ending offset=0x10C4 (0x128C)
extendeddata NRTW_NRTW_cfg#TXRStructuri_ExtendedData Starting offset=0x10C4 (0x128C) Ending offset=0x12EC (0x14B4)
Man this sure is handy :D
Zip it up first to decrease the size. Use 7Zip's brutal compresssion :yep:
Then you can upload the zipped file to www.megaupload.com (http://www.megaupload.com) or something similar and send me the link.
Hi TDW,
I've sent you a PM.
Regards
MLF
TheDarkWraith
01-12-12, 06:02 PM
Today the app with the help of the sentinel class registered everything contained in a GR2 file :DL This is big because now that I know where everything is, how it's laid out, and what the data structure is I can make my own GR2 files. I know every data structure (barring animations, morph targets, and other exotic things like that) needed to import new geometry into a new file with new materials/textures (100% of what we need to make new units for SH5).
Now I start writing the code for it to make new GR2 files. The first file it will make will contain nothing as far as bones, models, etc. It'll just be a shell with the ArtToolInfo data in it. If it can make that (and it passes the Granny Viewer test) I'm more than half-way there :yep:
lesec74
01-13-12, 02:37 AM
100% of what we need to make new units for SH5).
hello TDW,
You want to say a possibility to built new playable sub type?
thanks for your job:salute:
Echolot
01-13-12, 06:02 AM
Hello TDW.
I just want to say again: Hats off!
This is great progress and I want to thank you for your work and sharing your knowledge.
:sunny::sunny::sunny:
Regards.
Echol:up:t.
TheDarkWraith
01-13-12, 10:59 AM
100% of what we need to make new units for SH5).
hello TDW,
You want to say a possibility to built new playable sub type?
thanks for your job:salute:
The subs contain some additional data that I have yet to still figure out purpose and how to map it. Once I can register that data then I can move it around in the file. Currently I do nothing with it which clearly can't be the case anymore if I want to shuffle things around in the file/create new ones.
I wrote the code to adjust the pointers last night. Preliminary results are it works :rock:
Vanilla
01-13-12, 01:36 PM
Now I start writing the code for it to make new GR2 files. The first file it will make will contain nothing as far as bones, models, etc. It'll just be a shell with the ArtToolInfo data in it. If it can make that (and it passes the Granny Viewer test) I'm more than half-way there. :rock:
Then I guess we will be able to add waypoints for the crew without using a hex-editor as well! That's just incredible!
TheDarkWraith
01-13-12, 01:39 PM
Then I guess we will be able to add waypoints for the crew without using a hex-editor as well! That's just incredible!
I'm writing the allocater/deallocater currently. These two functions in my sentinel class will allocate or deallocate space in the GR2 file. This will allow one to add to and/or remove items from a GR2 file. Should be writing my first GR2 file with new information in it shortly. It has to pass the Granny Viewer test. If it passes then everything is working as it's supposed to :D
TheDarkWraith
01-13-12, 02:40 PM
The allocater successfully allocated 500 bytes in a GR2 file. One major step forward. There was a slight problem with remapping the pointers. I forgot a major pointer in a section (forgot to read it in when reading the file) and that hosed everything else up in that section (didn't pass Granny Viewer test). I just have to account for this major pointer and everything should be golden.
The allocater successfully allocated 500 bytes in a GR2 file. One major step forward. There was a slight problem with remapping the pointers. I forgot a major pointer in a section (forgot to read it in when reading the file) and that hosed everything else up in that section (didn't pass Granny Viewer test). I just have to account for this major pointer and everything should be golden.
Silent hunter 6 on its way! No wait, super mod I mean.
TheDarkWraith
01-14-12, 02:42 PM
Today v1.0.530.0 of the GR2Editor/Viewer graduated Kindergarten...it's growing up so fast! :D It wrote it's first GR2 file that passed the granny viewer test and has no anomolies or defects that I can find :rock:
I took the lifeboat GR2 file, allocated 0x500 bytes into it right after the first embedded string (so that it impacts the most pointers and all), and changed all the exporter info that you see in Granny Viewer. Here is the file is you want to verify for yourself:
http://www.megaupload.com/?d=SU4X5ZSP
Open it up in Granny Viewer and my app. Check out the Exporter Info data in Granny Viewer ;)
I couldn't find anything wrong with it. All names appeared ok in granny viewer, all the meshes rendered fine...if you can find something wrong let me know :D :|\\
So what does this mean? This means I can write new GR2 files. I can add/remove from existing GR2 files (via the allocater/deallocater in the sentinel class). I have much to do still on writing new bones, meshes, materials, etc. but the hard part is done - the updating of all pointers in the file :cool:
I'll work on adding new bones first. The process should be simple: allocate space in the GR2 file the size of the bone structure, add new pointers, update all pointers, add embedded string descriptors for the new embedded string describing the new bone name, update file contents, write file, done....
TheDarkWraith
01-14-12, 03:04 PM
I was feeling really bold so I said let's see how the app does on a very complex GR2 file - the NSS_Uboat7b.GR2. It's a 'special' GR2 file - it has pointers before data. It has additional data, it's a nightmare when it comes to parsing this file :yep:
I allocated 0x1000 bytes into the file after an embedded string and changed the exporter info.
The app handled it beautifully :rock:
Passed the Granny Viewer test also.
Verify for yourself: http://www.megaupload.com/?d=OGKNYJ0D
Pointers trip me up, always have and always will. They are the one thing in C++ that constantly gives me fits. That being said, the pointers in the GR2 files were tripping me up badly. I just couldn't put my head around how to update all the pointers (and all the data attached to them) - it seemed an impossible task.
I went back to programming 101: for any problem define the problem. Break problem down into steps. Break those steps into smaller steps. Keep reapeating until you get to manageable pieces/steps. The revelation came when I wrote the sentinel class. I made everything that was read from the file register with it. This way the sentinel was the master of the file. It knew if everything was read from the file or not, what blocks of the file were not read, what x block of data was and who it belonged to, etc. Once the file was read I asked sentinel to displayall for section 0 (I wrote a DOS like command shell to interface with the sentinel - a low-level utility). It spit out everything it knew about section 0. Once I could see the data as it was laid out in the file things started clicking and making sense.
Armed with how the data structures were actually laid out in the sections I started to tackle the next problem - how to update the pointers. After 3 days of writing pseudo-code I still couldn't get an algorithm together that worked. I put the GR2 editor/viewer to the side and opened up OllyDebug and started working on the CO2 bug problem again. A breakpoint triggered on a statement:
mov ESP, [EBP+EAX+offset]
Bingo!! Addressing modes. It all clicked right then. I closed OllyDebug and reopened Visual Studio. Fired up the GR2Editor/Viewer. Went and changed all my classes from using hard-coded offsets (they read offset from pointer and stored that value) to basing their offset from the pointer (kept a reference of the pointer with each class). This way everything contained in the class and referenced from the class was relative to the pointer. Problem solved :rock:
EDIT:
allocated multiple 'chunks' in the NSS_UBoat7b.GR2 file with no problems. Allocated chunks right before bone extended data, inbetween vertexdata structures, before model structure....doesn't matter where I place them nothing abnormal happens. They all pass Granny Viewer and my app (trying to reload them). Beautiful!
Now that what I thought was an impossible task has been realized I can set this aside for a day. Time to go snowboarding!!!!!!
fromhell
01-14-12, 03:20 PM
really really brilliant stuff.:salute:
your doing outstanding work,well done.
Sartoris
01-15-12, 04:53 AM
A fascinating read, as always!:yeah:
Will-Rommel
01-15-12, 09:38 AM
I really enjoy the detailed explanations you go trough, because it shows a path in troubleshooting/problems resolution that might come handy for me later in my life.
tonschk
01-15-12, 11:27 AM
I Agree :yeah:
for any problem define the problem. Break problem down into steps. Break those steps into smaller steps. Keep reapeating until you get to manageable pieces/steps.
I really enjoy the detailed explanations you go trough, because it shows a path in troubleshooting/problems resolution that might come handy for me later in my life.
TheDarkWraith
01-15-12, 02:33 PM
Today I decided to be really bold and add extended data to the exporter info section in the GR2 file (I was going to let you see the original granny exporter version used). I wrote the necessary entries into the required section but now I'm having problems when an item goes to read it's extendeddata. Obviously I have a code bug somewhere or there's something I don't fully understand about the extended data...:hmmm:
TheDarkWraith
01-15-12, 04:58 PM
found a source of my problem. Every section's pointers are located in section 6 (from what I've seen so far). I've only seen pointers for Section 0 and Section 6 defined also, no other sections. I added a new datatype definition so that a new menu entry would show in Granny Viewer for the exporter info's extendeddata (you'd be able to click on it and view the extended data in granny viewer). When I added the new datatype definition I adjusted the pointers in section 6 to reflect the size of the chunk I added to that section. What I did not do was update the PointersFileOffset and EndOfPointersFileOffset in all the sections prior to section 6 :shifty: Thus all those sections went looking for their pointers and was reading incorrect data. That problem solved.
Now I just have one little problem where some of section 6's section data isn't getting updated correctly. Tracking those down now and hopefully have this new menu entry ready for granny viewer here soon...
TheDarkWraith
01-15-12, 08:53 PM
This is a little funny...
I had everything coded in to show this new menu item in Granny Viewer for the exporter info. I hit Start Debugging in Visual Studio. I selected the lifeboat GR2 file. It started loading the file. Then a breakpoint was triggered...odd...new pointers found was the reason. Oh this is interesting :hmmm: Where did these come from? Hmm....okay let's account for them. I coded in a whole new set of pointers for this one section.
Started debugging again. Selected lifeboat GR2 file. Started loading the file. Lifeboat appeared onscreen. Cool. Alright let's go check what these new pointers were (I had sentinel spit them out to a file).
I opened them up and they looked very familiar. I checked another section and they were identical :o Wait a second...what's going on...:hmmm:
Looked in the DbgView output for both sections....yep pointer locations are different....wait...ah crap these pointers are the first sections pointers :damn:
Time to watch a movie...:DL
THE_MASK
01-15-12, 09:07 PM
I like to see these :yeah::up::rock:
I dont like seeing these :down::hmmm::damn:
TheDarkWraith
01-16-12, 01:47 AM
Finally figured out what we were calling root object type and root object offset are in the InfoHeader: they deal with the ArtToolInfo section in Granny Viewer. The first (root object type) is the section. Root object offset is the offset in that section to find the data :up:
Sartoris
01-16-12, 12:55 PM
:yeah::rock:
Yes you will get that error on non-SH5 GR2 files currently. I have it 'locked' to only SH5 GR2 file format for the time being. If I can get everything working with SH5 files then making it work with everything else should be easier. Key word being should.
Its great to see your progress. Out of curiousity how hard would it be to make an import/export script for Blender? I figure this might be the quickest way to get all the tools you are looking for. If you are not familar with a blender script I can post one.
Thank you for all your hard work.
TheDarkWraith
01-16-12, 04:06 PM
I thought that adding a new menu item to Granny Viewer would be a relatively easy task.....not even. I still don't understand how the Granny Viewer knows from the pointers that an item has extended data. I haven't been able to find a smoking gun yet. Without this smoking gun I can't add new bones, materials, etc.
I have tons of data on the pointers and now from the data descriptors for the Granny Viewer menu items contained in the GR2 file. Now it's just a matter of sifting through it all and figuring out what it all means.
I did make one discovery and I couldn't believe it was staring me in the face all along :nope: I wondered exactly how the GR2 file was laid out for the longest time. I wrote the sentinel class to tell me this info. After coorelating the data from it with the Granny Viewer it was quite evident that, once again, Granny Viewer tells you everything you need to know. Right there on that first screen when you select view in detail is how the file is laid out :shifty:
Now if I can just figure out how it knows an item has extended data...
TheDarkWraith
01-16-12, 04:08 PM
Its great to see your progress. Out of curiousity how hard would it be to make an import/export script for Blender? I figure this might be the quickest way to get all the tools you are looking for. If you are not familar with a blender script I can post one.
Thank you for all your hard work.
I'm not familiar with the Blender format. If you can give me documentation on it then I can see what I can do :up:
TheBeast
01-16-12, 04:23 PM
I thought that adding a new menu item to Granny Viewer would be a relatively easy task.....not even. I still don't understand how the Granny Viewer knows from the pointers that an item has extended data. I haven't been able to find a smoking gun yet. Without this smoking gun I can't add new bones, materials, etc.
I have tons of data on the pointers and now from the data descriptors for the Granny Viewer menu items contained in the GR2 file. Now it's just a matter of sifting through it all and figuring out what it all means.
I did make one discovery and I couldn't believe it was staring me in the face all along :nope: I wondered exactly how the GR2 file was laid out for the longest time. I wrote the sentinel class to tell me this info. After coorelating the data from it with the Granny Viewer it was quite evident that, once again, Granny Viewer tells you everything you need to know. Right there on that first screen when you select view in detail is how the file is laid out :shifty:
Now if I can just figure out how it knows an item has extended data...
So everything is not based on Node ID/Parent Node ID system?:06:
If Node/Data does not have Parent ID does it apply to entire Model?:06:
If Node/Data does not have Parent ID in current loaded Model, can Parent ID be in another attaching Model?:06:
i.e. Conning_7B_01_FX.GR2 file adding Nodes for FX placement on Type-VIIB Conning Towers.
Skwas S3D did not edit all data present in Models for SHIII/SHIV.
TheDarkWraith
01-16-12, 04:52 PM
So everything is not based on Node ID/Parent Node ID system?:06:
If Node/Data does not have Parent ID does it apply to entire Model?:06:
If Node/Data does not have Parent ID in current loaded Model, can Parent ID be in another attaching Model?:06:
i.e. Conning_7B_01_FX.GR2 file adding Nodes for FX placement on Type-VIIB Conning Towers.
Skwas S3D did not edit all data present in Models for SHIII/SHIV.
In a way yes for the 3D models. The ID is generated from the name of the object. There is no ID per se in the GR2 files.
For these granny viewer items you have pointers that describe the data. You also have what I call datatype definitions that define the menu items seen in the Granny Viewer. I can find all the ExtendedData menu items from what sentinel spit out about the datatype definitions but I cannot correlate how it knows that an item has extended data. There is no pointer or datatype definition that defines the actual data to show. I'm beginning to think it's from just the file layout.
The Granny Viewer knows where everything is in the file from the pointers. It knows how to build the menu items seen in it from the datatype definitions. Now if it knows that object A is at position X and object B is at position Y and object A's position + A's size != object B's position then it must have extended data defined. That's what I'm thinking is going on with the extended data...
TheDarkWraith
01-16-12, 05:52 PM
The more I work with this Granny system the more I like it :D Once you understand it (and I'm nowhere near close to fully understanding it) it all makes perfect sense and it's quite logical, it's actually quite brilliant :yep:
I took the data from sentinel on the datatype definitions and mapped it out on paper. I had the main menu from Granny Viewer (the one that shows when you right click and select view in detail) drawn out. I had branches from each menu item drawn to it's next node. I had branches from those nodes to their sub nodes. So on and so forth. Now I had a perfect tree that shows a) what the data looks like in those datatype definitions and b) how they all went together. Once I studied this tree it was quite evident that each node (and it's children) describe a 'page' in Granny Viewer (when you click on something). These entries define the entries to show when the item is clicked. Now whether those items have data associated with them is not located here. These are just the blueprint on how to make the menu entries. Good I understand that and it makes sense.
Now I should say that there is more data contained in these datatype definitions than just how to make a menu item. It also describes the type of data that the menu item requires. This is needed because once something is pointed to the start of a blueprint, the whole blueprint is read until what I call an end of data type definition record is read. Once that record is encountered then it knows that it doesn't require anymore data. Now as the blueprint is being read, the data type associated with the blueprint is also being read.
Think of the datatype definitions as XML in non-human readable form (Granny hex code). Sentinel converted the Granny hex code into human readable form so I could interpret it. I think I've spent more time and code writing code to interpret data than to actually use/modify it.
I went back and looked at my classes on how they read extended data. There are two pointers located at the end of every granny object - a pointer to a datatype definition and a pointer to a pointer (this pointer points to data). Just follow along. The first pointer - the datatype definition pointer - points to the start of the 'blueprint' - how Granny Viewer should display the extended data (what all the entries are). Now remember I said the blueprint doesn't define the data - it defines the menu entries to show in Granny Viewer. Okay so first pointer tells granny viewer what to display on screen when you click extended data for the object. Where does the data come from? That's where the second pointer shines. The second pointer points to where Granny Viewer will read the data from to fill in those menu items. Now in that data can be references to other pointers (or even null pointers - no data). That is why some items in granny viewer are not clickable - they have no data associated with them.
Brilliant, absolutely brilliant :yeah:
IF you can't see why this is brilliant it's because data is not duplicated. If two items have the same extended data then all you have to do it point their first pointer to the same blueprint. Point their second pointers to their respective data.
Now I know how to add menu items to Granny Viewer :rock:
See this whole thing is just one big puzzle....every piece you add furthers your understanding of the whole. I love puzzles.
TheDarkWraith
01-17-12, 01:26 AM
I think this is the first time Granny Viewer has ever seen extended data for the Exporter Info:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5301
Clicking the extended data locks up Granny Viewer so obviously there's something else I'm missing but it's a start. I can add menu items to a GR2 file. Now I just have to figure out this last little detail :D
I do believe that this is the first time an application has made changes to a GR2 file that didn't use ANY of RAD game tools SDK or tools or any exporter for 3DSMax or the likes :rock:
I'm not familiar with the Blender format. If you can give me documentation on it then I can see what I can do :up:
cool, thanks! If I sent you some of the import/export python scripts for obj, nif, and 3ds files would that help? I would post them now (combined its only 110kb) but I dont have priviledges to post attachments yet :wah:
TheDarkWraith
01-17-12, 01:34 AM
cool, thanks! If I sent you some of the import/export python scripts for obj, nif, and 3ds files would that help? I would post them now (combined its only 110kb) but I dont have priviledges to post attachments yet :wah:
zip them up and upload to www.megaupload.com (http://www.megaupload.com) Then just send me a link to it :up:
tonschk
01-17-12, 09:22 AM
:up: Me too :DL
I love puzzles.
TheDarkWraith
01-17-12, 12:50 PM
Got the new menu item to show in Granny Viewer :D When you click extended data for exporter info a new screen appears. There is currently one entry: Original Exporter. It's value is null because I'm missing a pointer but at least I got it to work :rock:
reaper7
01-17-12, 01:23 PM
Well Done TDW, Determination is your greatest tool :up:
Vanilla
01-17-12, 03:53 PM
When I tried to decypher gr2 in hex-editor I thought it would be plain and easy but now seeing your progress and reading about all the file structure intricacies and your clever insights on how to untwine it all.. oh mate am I impressed by your determination!
TheDarkWraith
01-17-12, 04:25 PM
I can add new menu items now without problems. I added extended data to the exporter info to have it show the original exporter since I replaced it with mine:
http://www.subsim.com/radioroom/picture.php?albumid=553&pictureid=5303
The problem I had before when I said granny viewer showed the extended data screen and the new menu item but null for the value was I didn't create an extended data section in the GR2 file for the exporter info. Then I had to link this section to the granny viewer data so it knew where to find it. I knew it was something simple (and I did say I was missing a pointer) :DL
I still decode GR2 file with hex editor. You have to. I just write tools inside the GR2 editor/viewer to decipher this hex code into human readable form. I'm not lying when I said I've spent more time writing code that deciphers data/interprets data than writing code to actually use it :yep: The sentinel class is the interface to these tools inside the app.
The sentinel class is just awesome, one of the coolest things I've made. The way you interface with this class is through a DOS like command window. If you like DOS this is right up your alley. Sentinel has full control over the file. You ask it for help (h or help) and it shows you the commands it 'knows'. Some of the commands require a password level. Those commands that require a password level are the really low-level commands that are allowed to slice and dice the GR2 file. Alas you all won't be getting that password, sorry. Everything you all will need to do will be done using the app itself and it's interface. This sentinel is more for me to see what's going on, what data is where, what data is contained in x block of the file, etc.
If you'd like to verify for yourself or try and figure out how I did it, here you go: http://www.megaupload.com/?d=0YIPC2Z1
:|\\
EDIT:
now my thinking is to encode data into the GR2 file pertaining to when the file was last updated (date and time), who updated it, who the original author is, etc. What data would you like to see encoded into the GR2 file for when you're making new ones?
TheDarkWraith
01-17-12, 04:48 PM
As it stands now the current version of the app will allow you to clone a GR2 file and rename anything you want in it (you could also replace the geometry with new geometry). This is great because you can then assign new textures to the clone to make new units (via new names). Aircraft are not be to cloned yet as I have to figure out all this trackgroup crap.
So I will concentrate on implementing this cloning ability and release an updated version so you all can start cloning units :up:
DrJones
01-17-12, 04:56 PM
As it stands now the current version of the app will allow you to clone a GR2 file and rename anything you want in it (you could also replace the geometry with new geometry). This is great because you can then assign new textures to the clone to make new units (via new names). Aircraft are not be to cloned yet as I have to figure out all this trackgroup crap.
So I will concentrate on implementing this cloning ability and release an updated version so you all can start cloning units :up:
Thanks for your huge effort for this and the hard work. It is something very important for the future of sh5
Thank you very much....
Best Regards DrJones:salute::salute::salute:
fromhell
01-17-12, 06:03 PM
may i also congradulate you on some outstanding and ground breaking work.
fantastic.:salute::salute::salute:
TheDarkWraith
01-17-12, 06:47 PM
Well Done TDW, Determination is your greatest tool :up:
Yes it is :up:
In the end it's nothing but a piece of software. Any piece of software can be mapped, taken apart, exploited, etc. with enough time, patience, and determination :yep:
pedrobas
01-17-12, 07:46 PM
http://i886.photobucket.com/albums/ac68/Hans_Witteman/Kaleun_Applaud-1.gif !! Congratulations !!http://i886.photobucket.com/albums/ac68/Hans_Witteman/Kaleun_Cheers-1.gifKeep up the good and hard work http://i886.photobucket.com/albums/ac68/Hans_Witteman/Kaleun_Thumbs_Up-1.gif. Perhaps now you can go tohttp://i886.photobucket.com/albums/ac68/Hans_Witteman/Kaleun_Sleep_White.giffor a while.
http://i886.photobucket.com/albums/ac68/Hans_Witteman/Kaleun_Salute-1.gif
zip them up and upload to www.megaupload.com (http://www.megaupload.com) Then just send me a link to it :up:
cool! here it is:
http://www.megaupload.com/?d=WF9GNSBQ
USS Drum
01-17-12, 09:40 PM
Could this be used to make a playable Type II?
TheBeast
01-17-12, 10:16 PM
Could this be used to make a playable Type II?
I think that will be possible at some point.
It will take a lot of work to import the Type-II interior that will fit inside the Type-II Model. Unlike SHIII/IV, in SHV the interior is actually inside the Hull of the boat.
Once that Interior is Imported, I am sure that a playable Type-II and Type-XXIII will follow.
fromhell
01-17-12, 11:01 PM
what about a IX boat skin but keeping the interior the same:woot:
TheBeast
01-18-12, 12:53 AM
what about a IX boat skin but keeping the interior the same:woot:
I think using the current Type-VII Interior in a Type-IX boat is very doable right now.
Maybe a IXC/40
http://www.subsim.com/radioroom/picture.php?albumid=255&pictureid=2911
If what I am seeing and reading about is leading to what I am hoping for. When I say import into SHV, I am talking about complete conversion to GR2 format.
Because the Type-VII Interior may be used in the Type-IX boat. I think this would be the first new playable class added.
I have a Type-XIV MilkCow model (Less Interior) made by a few members of the GWX team in 2010 that could possibley be added right now as AI unit for resupply missions. The reason this model was never released is they did not feel the model was at 100%.
This boat renders in Museum, Submerges and is mobile. From what I understand, when they tried to use it as playable unit they lost diving control and boat would just keep going down until crush. Why anyone would want to Play a Type-XIV is beyond me, it has not torpedo tubes. You are nothing but a stealthy supply ship that can submerge.
TheDarkWraith
01-18-12, 03:05 AM
I'm getting the app to the point that you will be able to replace geometry with whatever you want :yep: So theortically you could take a sub and replace it's whole geometry with a new one :up:
Just finished recoding the app to use pointers for everything, even my classes, even extended data (what a freakin nightmare that was!). Have some bugs to work out in the models class but that's expected when Visual Studio said I started with 897 errors when I started making the changes :dead:
I needed to shift to pointers for everything so that I can dynamically move anything, at anytime, in the GR2 file. This is what will make it possible to replace anything with anything :yep:
fromhell
01-18-12, 04:03 AM
i am so looking forward to this, i am on the edge of my seat.:salute:
Stormfly
01-18-12, 04:37 AM
OMG playable ship`s on horizon :sunny:
THANK YOU TDW !
:up: :up: :up: :up: :up: :up: :up:
Why anyone would want to Play a Type-XIV is beyond me, it has not torpedo tubes. You are nothing but a stealthy supply ship that can submerge.
:oops:I, for one, can understand the interest... if a TypeXIV campaign can be simulated as IRL. Rendez-vous with Uboats, being forced to stay surfaced for a looong time, until torps and fuel get transferred, doing this in hostile seas, communications with other Uboats and BdU, and the risk of being intercepted at any moment based on messages decrypted by the enemy might add a very interesting, even strategic dimension to the game.
Just my 2 cents...
impressive work, you're a genius.:salute:
cool! here it is:
http://www.megaupload.com/?d=WF9GNSBQ
sorry bump to tell what it is - here are the blender import/export scripts for obj and nif files
TheDarkWraith
01-18-12, 05:16 PM
sorry bump to tell what it is - here are the blender import/export scripts for obj and nif files
I've already downloaded them. I won't get to them until after I finish the current version of the app I'm working on (cloning and changing of materials/textures and possibly the ability to add new bones) :up:
I've already downloaded them. I won't get to them until after I finish the current version of the app I'm working on (cloning and changing of materials/textures and possibly the ability to add new bones) :up:
cool! Thanks!
TheDarkWraith
01-19-12, 04:33 AM
Been working heavily on optimizing the app on the loading sequence. So far I've cut the loading time in half :yeah: I'm diving into multi-threading now...More work to do...
TheDarkWraith
01-19-12, 02:00 PM
from first level optimizations and spawning background worker threads I've really cut down the loading times
King George V used to take 28 seconds to load on my system. Now it takes 8
NSS_Uboat7b used to take 35 seconds to load on my system. Now it takes 11
More profiling to do and more optimizations needed :yep:
TheDarkWraith
01-19-12, 02:33 PM
Going to make another huge change to the app. I was doing the optimizations and I was removing all the unneeded reference calls by defining a static variable of that call in the class when an idea hit me. I've been grappling with the best way to define how x is related to y in the gr2 file. I gave every object a pointer and just updated these pointers. While it's functional it's very complex and quite frankly awful coding. The solution: a linked list! If you don't know what that is google it.
All my object classes inherit from one base class: GR2Base. GR2Base defines the common functionality they all need: offset in file, size, whether modified or not, and a couple methods.
Using the linked list I'll add two new variables into GR2Base: prevObject and nextObject. These will both be of type GR2Base. Since anything that inherits from GR2Base is a GR2Base object I can put any object in these.
So using the linked list we start at the beginning of the file:
FileHeader. It reads it's data. Now it knows it's own offset in the file (which is 0x0) and it knows it's own size. I set prevObject to null to signify start of the linked list.
Next comes InfoHeader. I pass in a reference to FileHeader and set prevObject with it. I also set this FileHeader reference's nextObject to this (this is a reference to the current object - the InfoHeader). Now InfoHeader can figure out it's offset by adding prevObject's offset and size together. Once it knows it's offset it reads it's data.
Now we have a linked list of two objects. I continue this pattern for all objects. Now every object is relative to another.
Now the cool part: when I want to add or remove an object I simply remove it from the chain. Since everything is relative to everything I don't have to adjust any pointers because it's automatically taken care of. Clean and simple :yeah:
THE_MASK
01-21-12, 06:44 PM
Sorry for the noob question .
Quote ''FileHeader. It reads it's data''
Could this be done with the exe ?
TheDarkWraith
01-22-12, 12:46 AM
Sorry for the noob question .
Quote ''FileHeader. It reads it's data''
Could this be done with the exe ?
Not following you. What do you mean? :hmmm:
The monumental recoding effort is complete :rock: The code needed to be revamped because I've learned much more from when I first wrote it to now. Some things that were unknown or I was unsure about were resolved and coded in.
I've optimized it (only done one pass for optimizations so far - more profiling needs to be done to figure out the slow spots) and very pleased with the results. I can load the King George V in 7 seconds flat. Granny Viewer still blows me away on this but I'm getting better. The slowest part of the whole app is the reading of the verticies followed by the reading of extendeddata. That is where I will concentrate optimizing now.
I have the linked list in place code wise and items are added to it as they are read. I have more to code in for this though. I want it to tell me lots of data (whether list is contiguous, where the breaks are [and what they are], list of all x items, a visual map of the file, etc.
I have to put it through it paces to ensure I didn't break anything on the displaying of texture coordinates, importing/exporting objects, picking, and mesh transformations yet :yep: I've got a 4.5hr flight to Portland, OR tomorrow so plenty of time to test these things!
Work continues...:up:
Sartoris
01-22-12, 07:56 AM
Glad to see you're making more progress with every day! :yeah:
tonschk
01-22-12, 09:12 AM
:up: I agree 100%:yeah:
Thanks for your huge effort for this and the hard work. It is something very important for the future of sh5
Thank you very much....
Best Regards DrJones:salute::salute::salute:
Madox58
01-22-12, 05:50 PM
A Masterful job so far Mate.
:yep:
I'm nowhere near the programmer you are and what you are codeing
is what I can see and do in Hex.
:up:
But what We can do in Hex? Others would never try to duplicate.
:yep:
I salute your work with a dropped jaw and the highest respects!
:salute:
kapitan_zur_see
01-23-12, 11:36 AM
I second Privateer!
This thread has come to be quite like the only one I've been reading for the past months as SH5 modding now entirely depends on it (yes, entirely).
SH5 modding has come to an almost complete stop now, as everything doable right out of the box has been done, so to speak, and its only some refining of past breakthroughs.
Nothing new will come next unless you complete your promising tool!
People with extensive knowledge of Hex editing the like of Privateer don't come too often, and the effort it requires for each new modder to reinvent the wheel simply won't makes it go anywhere...
I'm simply amazed at your skill, your willingness to share, and the dedication you're putting into this marvelous piece of software you're coding.
Without you, modding SH5 will have permanently decayed as it has already began to.
Much thanks for letting us improve the game and the possiblity to unleash the community creativity!
:yeah::up:
Sammi79
01-23-12, 12:23 PM
Kudos to TDW and all modders here I have been watching this thread since I uninstalled SH5 - It seems the dreams of the past are becoming reality.
I have a question, if TDW or Privateer or anyone else who knows would indulge me, it is this :
When you folks talk about 'hex' do you mean machine code? (assembly using opcodes) or am I deluding myself?
I only ask as I recently started programming assembly on a Z80 emulator (purely for intellectual satisfaction you understand I know it has very few applications in the real world) and a dream of mine was to write games back in the 8-bit days, but as a child my brain couldn't cope with more than basic. and I am lately having success in that meager ambition. :har: yeah retro I know, but it is really good fun if you're me!
regards,
Sam.
Madox58
01-23-12, 12:40 PM
Working in Hex looks like this.
http://www.flexhex.com/docs/howtos/img/edit_window.png
The thing is, you need to figure out what all the stuff means!
:o
Sammi79
01-23-12, 12:48 PM
OK thanks Privateer, that is exactly what assembled machine code looks like, using hex numbers for ease rather than binary, each byte containing an 8-bit number represented in hex. I can see 'words' - N o r m a l - I assume they are strings for text passing, and the garbage in between is the opcodes/operands? or am I wandering down a dark alley here?
PS sorry TDW to off topic your thread like this, If it is a problem I shall zip it.
regards,
Sam.
Madox58
01-23-12, 01:17 PM
The in between stuff is what We have to figure out.
(That image is a random one from the 'Net)
Looking at an SH5 GR2 file in Hex and in GrannyViewer,
one can figure out what all this mess is.
Some are pointers, some are information of different kinds, etc.
It's the studying of files and file structures that throws people.
To most? It's a big mess of nothing in Enigma code!
To a few? It's all the information We need. We just have to learn what it all means.
Sammi79
01-23-12, 01:36 PM
Thank you kindly sir, to me each 2 digit hex number is easily recognisable as a number 0-255, In that example I would guess is machine code, though I guess in the .GR2 file which is essentially a data store? the codes are not equivalent to actual CPU opcodes, but to calls from software (game/granny viewer etc.)
warm regards and thanks again for your reply I will go back to my transparent sprite routine for my CPC6128 and stop clogging this game changing thread now! :salute:
Madox58
01-23-12, 05:14 PM
Correct.
The GR2 format is nothing more then a data file.
Just as dat files do nothing more then provide the information that the Game Engine uses to do what it does.
More complex at first glance, but once you understand them?
You can control them.
Exe's and Dll's are a different story.
Those have your op codes and such.
Sammi79
01-23-12, 05:53 PM
In that case, just looking at the size of the .GR2 files... WOW. that is a massive reverse engineering task you have taken on. I have been learning assembly in a similar fashion, but on a Z80 the task is not so massive. It can only address 64Kb of memory!
don't worry I will not be going near any .exe or .dll files :D I don't fully understand but am aware of the illegality of such things. (also I suspect the assembly instruction set is significantly different on these modern CPUs) Maybe when I'm totally comfortable with the Z80 I will move on to something more contempory.
Anyway, amazing work folks. Thank you for keeping my dream of an uber U-boat simulation alive.
Regards, Sam.
Madox58
01-23-12, 06:59 PM
Most of the GR2 files contain the 3D models.
That's where the size grows as they are not compressed in SH5 files.
Each vert is a 32 bit float.
As some models have massive amounts of verts and faces?
You get a large file size.
Had they compressed the files?
They would be much smaller.
Working on other GR2 files for other Games?
I figured out the compression used also.
:03:
Quit a piece of work for the most part those GR2 files.
:rock:
tonschk
01-24-12, 05:23 AM
:up::yeah::rock::DL:woot:
Thank you for keeping my dream of an uber U-boat simulation alive.
Regards, Sam.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.