SUBSIM Radio Room Forums

SUBSIM Radio Room Forums (https://www.subsim.com/radioroom/index.php)
-   SH5 Mods Workshop (https://www.subsim.com/radioroom/forumdisplay.php?f=249)
-   -   GR2 Editor/Viewer/Extractor/Importer (https://www.subsim.com/radioroom/showthread.php?t=188290)

TheDarkWraith 10-31-11 07:25 PM

Quote:

Originally Posted by Vanilla (Post 1777807)
That's just awesome progress! Well done!

As of problems: I cannot open \data\Characters\CharacterBodyParts.gr2 due to errors in section 0 endpointersfileoffset being not equal to filesizeinbytes.
When I try to open NSS_Uboat*.gr2 files - the EVEI gives me a lot of
Code:

Exception
C:\Ubisoft\Silent Hunter 5\data\Submarine\NSS_Uboat2a\NSS_Uboat2a.GR2 closed
********* Exception while presenting
Exception is ***1054;***1096;***1080;***1073;***1082;***1072; ***1074; ***1087;***1088;***1080;***1083;***1086;***1078;***1077;***1085;***1080;***1080;.
-2005530516 (D3DERR_INVALIDCALL)
  ***1074; Microsoft.DirectX.Direct3D.Device.BeginScene()
  ***1074; TheDarkWraith.SilentHunter5.Graphics.Render() *********
...

which goes in endless loop. (WindowsXP 32 locale is RU)

None of the animations' gr2s can be opened either due to skeleton's data absence, but I recon - animations are thing of the future as of yet. When I open 'waypoints' files - I see nothing but no errors either, though I guess this is normal.
I am still hoping to create fully functioning crew and it appears that only you can make it possible, TDW, thanks for all your hard work.

I will look into these problems :up: Nothing for animations has been coded yet. The hard part is figuring out how the animations work in GR2 files. I know how to read animations from dat files but GR2 is a whole different story.

As far as the waypoint files you need to turn the bones on. They have no models or meshes, they are strictly bones :up: EDIT: ok just tried it myself and nothing showed. Will look into this.

The animation ones made me laugh when I just tried to open one up. Of course it has no skeleton, it's all animation data. At least my error checker is working as programmed. I'll correct this.

TheDarkWraith 10-31-11 08:03 PM

The bones problem has been fixed for those GR2 files that contain nothing but bones (waypoint files). A side benefit from this is that I finally figured out why the rendering was so slow when you enabled the bones on some GR2 files. I had the bones being rendered everytime a mesh was being rendered :nope: This means the bones were sometimes rendered >=20+ times which really slowed things down. Problem fixed and FPS back up where it should be :up:

Fixing the no skeleton ones now.

Adding lighting to the app. Should be able to take some cool screenshots of models with the lighting that I'm adding. You'll be able to add as many lights as your video card supports. You can add directional, spotlights, and point lights. You can also turn on ambient lighting if you wish. You can control the ambient, diffuse, and specular color of each light. You also can set the specular strength. For spotlights you can change the attenuation, inner and outer cone angles, and fade. For those lights that have position and direction you'll be able to specify those also.

The app now reads the material properties from the extendeddata of the materials assigned to the mesh. It then applies these when rendering now (this was needed for lighting) :up:

THE_MASK 10-31-11 08:03 PM

If i want to look at animations in goblin i have to open the CharacterBodyParts GR2 file and then merge the CharacterBodyParts CHR file then merge the animations .

TheDarkWraith 10-31-11 08:05 PM

Quote:

Originally Posted by sober (Post 1777994)
If i want to look at animations in goblin i have to open the CharacterBodyParts GR2 file and then merge the CharacterBodyParts CHR file then merge the animations .

that's correct :up: I'll probably start looking into reading of the animation data next week :DL

EDIT:

Those GR2 files without models and/or skeletons is no longer a problem. That problem has been fixed.

Madox58 10-31-11 08:54 PM

Your doing great so far on SH5 type files.
:yep:
Of course that is the main aim at this point.
But if you ignore other GR2 files from other Games?
You may miss how this all adds up.

TheDarkWraith 10-31-11 09:19 PM

v1.0.357.0 released. See post #1.

This version addresses the problems posted above.

Side benefit of looking into those problems was I fixed the 'stuttering' when the bones are enabled :yeah:

Should be able to open all SH5 GR2 files now except for bunker_lights.GR2. It's a completely different beast as far as the pointers go :hmmm:

I was working on lighting but it's not complete yet. This version has some code for lighting in it but it's not complete and thus disabled still :yep:

Vanilla 11-01-11 06:31 AM

Quote:

Originally Posted by sober (Post 1777994)
If i want to look at animations in goblin i have to open the CharacterBodyParts GR2 file and then merge the CharacterBodyParts CHR file then merge the animations .

The other way is to open the CharacterBodyParts.GR2 and simultaneously all the animations in Granny Viewer, I've described it somewhere... aha, found it here.

[praise for TDW's work on]
Thing with animations is that we need to add way more animations if we want a more or less realistic crew. Right now many animations even the very basic ones like running, climbing ladders (no, the bunker lamp-changing animation will not do :)) or infamous going-through-hatch are absent. More to that: adding or editing animation waypoints is a cumbersome process requiring hex-editing and juggling files trying to trick SH5 into using them and after that you aren't able to see the end result in Goblin so you have to load SH5 mission everytime you want to check your changes... :damn: So when problems with animations are further compounded by limited and buggy crew scripting - this can turn even die-hard modders away. When TDW will crack the GR2 exporting problem (and I am 99% sure he will as he is a genius :up:) it will greatly simplify crew modding as well. So hopefuly it is not only new ships and environment we'll see.
[praise for TDW's work off]

urfisch 11-01-11 11:15 AM

thank you for your great succes so far, tdw!

:up:

Vanilla 11-01-11 12:09 PM

I've tried the last version and it seems to stop working for me completely. On trying to open almost any file I get this:
Code:

Silent Hunter 5 GR2 Editor/Viewer v1.0.357.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to C:\Ubisoft\Silent Hunter 5
GR2 file path is C:\Ubisoft\Silent Hunter 5\data\Sea\CMD_small_boat\LifeBoat.GR2
********* Exception while presenting
Exception is ***1054;***1096;***1080;***1073;***1082;***1072; ***1074; ***1087;***1088;***1080;***1083;***1086;***1078;***1077;***1085;***1080;***1080;.
-2005530516 (D3DERR_INVALIDCALL)
  ***1074; Microsoft.DirectX.Direct3D.Device.GetTransform(TransformType state, Int32* result)
  ***1074; Microsoft.DirectX.Direct3D.Device.GetTransform(TransformType state)
  ***1074; Microsoft.DirectX.Direct3D.Transforms.get_World()
  ***1074; TheDarkWraith.SilentHunter5.GR2Bone.Render(Graphics& graphics)
  ***1074; TheDarkWraith.SilentHunter5.GR2Model.Render(Graphics& graphics)
  ***1074; TheDarkWraith.SilentHunter5.GR2File.Render(Graphics& graphics)
  ***1074; TheDarkWraith.SilentHunter5.Graphics.Render() *********

Maybe the problem is on my side... :hmmm:

TheDarkWraith 11-01-11 05:56 PM

Quote:

Originally Posted by Vanilla (Post 1778369)
I've tried the last version and it seems to stop working for me completely. On trying to open almost any file I get this:
Code:

Silent Hunter 5 GR2 Editor/Viewer v1.0.357.0 by TheDarkWraith
Reading in cfg file...
DirectX initialized
SH5 install path set to C:\Ubisoft\Silent Hunter 5
GR2 file path is C:\Ubisoft\Silent Hunter 5\data\Sea\CMD_small_boat\LifeBoat.GR2
********* Exception while presenting
Exception is ***1054;***1096;***1080;***1073;***1082;***1072; ***1074; ***1087;***1088;***1080;***1083;***1086;***1078;***1077;***1085;***1080;***1080;.
-2005530516 (D3DERR_INVALIDCALL)
  ***1074; Microsoft.DirectX.Direct3D.Device.GetTransform(TransformType state, Int32* result)
  ***1074; Microsoft.DirectX.Direct3D.Device.GetTransform(TransformType state)
  ***1074; Microsoft.DirectX.Direct3D.Transforms.get_World()
  ***1074; TheDarkWraith.SilentHunter5.GR2Bone.Render(Graphics& graphics)
  ***1074; TheDarkWraith.SilentHunter5.GR2Model.Render(Graphics& graphics)
  ***1074; TheDarkWraith.SilentHunter5.GR2File.Render(Graphics& graphics)
  ***1074; TheDarkWraith.SilentHunter5.Graphics.Render() *********

Maybe the problem is on my side... :hmmm:

If you could send me the output of the DbgView that would be great. I haven't had any reports of problems with the app so I'm fairly certain the problem is with your system. I would still like to review the DbgView output.
Is your DirectX up to date? Try running the web updater for it at Microsoft's website. If you're using Win7 and have never ran the web updater then that is most likely where the problem is. Win7 comes with DirectX10 and I'm targeting DirectX9 (currently). You have to install DirectX9 from Microsoft for Win7. Yes it sounds strange but it's true. And don't worry DirectX9 and DirectX10 can live together on your system (they are completely different assemblies) :yep:
Has this problem been there with every version I have released? If not, what version did it start?

TheDarkWraith 11-02-11 01:34 AM

v1.0.366.0 released. See post #1

This version adds lighting to the app. You can add ambient lighting, direct lighting, point lights, and spotlights. It will let you add as many lights as your video card supports (GTX590 should be 10 cause that's what it showed for me). You control every aspect of the light - ambient color, diffuse color, specular color, direction, position, etc. Not every light has the same parameters though (Direct lighting doesn't have a position - it only has direction).

The direction parameter is a vector.
If you want to know what each parameter is/does google search them. You'll need to search for the light type (direct light, spotlight, point light) and add DirectX after it.

There are two new tabs in the tabcontrol box, Rendering and Lighting. The cullmode and shademode has been moved to the Rendering tab. Anything dealing with lighting is under the Lighting tab. To add a light click on the buttons in the Add light box. To remove a light select the light from the treeview and the click Remove in the Remove light box. To temporarily 'remove' a light uncheck it in the treeview. If it's checked then DirectX is using it for lighting calculations. To edit the parameters of a light double click it in the treeview. This will bring up the Add/Edit light page.
To add ambient lighting click on Enable (make it checked) under Ambient lighting. You can also change the color of the ambient light by clicking the Color button in the ambient lighting box.

Each light (except ambient light) has 3 colors - Ambient, Diffuse, and Specular. To change the color of each one click the button in the Ambient, Diffuse, or Specular box.

I'm setting the renderstate material properties according to what was read for the mesh's material's extendeddata.

I haven't added a screenshot button to the app but that will be in next version.

Next version will hopefully have the ability to render using the programmable pipeline (shaders). Currently all rendering is being done using the fixed-function pipeline in DirectX. I'm going to let the user choose which rendering style they want to use - programmable or fixed-function.

I'm also going to add the ability to import other objects to the current object. Those @LNK entries? I'm going to try and make the app automatically load those objects. I'm going to try and do the same for those cfg# entries.

Lots of work to do still. This just adds some 'fluff' to the app :cool:

:|\\

tonschk 11-02-11 09:57 AM

Quote:

Originally Posted by TheDarkWraith (Post 1778743)

I'm going to let the user choose which rendering style they want to use - programmable or fixed-function.

:|\\


:yeah: Very Good :DL Thank you A Lot :salute: TheDarkWraith :sunny:

TheDarkWraith 11-02-11 08:39 PM

v1.0.373.0 released. See post #1

This version I started coding in the ability to edit the skeleton/bone's parameters. To edit the skeleton/bone's parameters double click the skeleton or bone in the bones tab's treeview display. That will bring up this window:

http://www.subsim.com/radioroom/pict...pictureid=5076

Currently the only thing you can change is the LODType for the skeleton. The numbers in parenthesis after the LODType is section number / offset in section / position in file. This same information is found in the bones part when you expand the node.

Once focus has left the box you edited the change is immediately written to the file.

For the entries in the bones part of the new window they will act the same way. You will double click the item and a new window will appear that will allow you to edit it's value(s). Still coding in that part :up:

If you spot anything that looks irai on this new window let me know :yep:

THE_MASK 11-02-11 09:19 PM

How do i get a better view of the object ?
http://img843.imageshack.us/img843/6164/19350491.jpg

TheDarkWraith 11-02-11 09:51 PM

Those are basically sprites being rendered onto a quad. You can't get a better picture than what you have. You can go to FillMode tab and select solid. If you want the texture to show ensure Texture is checked.
Under the Meshes tab you can choose which meshes to render. That will make viewing a single mesh (object) much easier.

If you're asking how to zoom in/out then right mouse click and hold and move mouse fwd/backward.

If you're asking about something else then please clarify :up:

If you want to change their size then you'll need to change the scaling of the mesh (might work for bone also). As I haven't finished coding that part yet you'll have to edit the file manually. The app will tell you where the addresses are though so using the hex editor will be much easier to do.


All times are GMT -5. The time now is 02:00 AM.

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