SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 09-15-13, 06:38 PM   #16
Bubblehead1980
Navy Seal
 
Join Date: Apr 2009
Location: Florida USA
Posts: 6,922
Downloads: 550
Uploads: 42


Default

I am clueless on this but good luck, it could unlock a lot of things for this sim of ours.Let me know if can be of any help
Bubblehead1980 is offline   Reply With Quote
Old 09-16-13, 03:04 PM   #17
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Just renewed my license for 010 Editor and upgraded to version 5.
It rocks!

They added a whole bunch of new stuff that makes things so much easier now.

Also contacted another of the original Devs for SH4 with a question.
He's told me he'll see if he can get the answer to that question.


Those Guys are just to Cool! I may have to move to Romania!
  Reply With Quote
Old 09-17-13, 01:04 PM   #18
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

The responce I received this morning confirms I'm working in the right direction.

The scripts I've got for 010 do the crudest of conversions at this point so it may be awhile before I release them to the public. I take the info and still do a lot by hand rather then wast time scripting what I'm not sure of.
So they are pretty useless to most people.
If you really want to play with them and have fun laughing at my crude scripting skills just PM me and I'll send them.
  Reply With Quote
Old 09-18-13, 11:36 AM   #19
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Back when skwasjer was working on S3D many of the Hex Editor Guys helped him with info in many areas. One big one being animations in SH3.
None of us had much of a clue about the skeletal animations in SH4 at the time sadly.

I'm going to start getting 'Hex technical' now as to the SH4 Biped and animations as used by Secondary characters.
Those are the itty bitty people you see on Ships and such.


Open the SECONDARY.dat with S3D and find the BodyParts.
Under that is 2 Unknowns. Export the BodyParts and the 2 unknowns as chunks. We will be talking about those. Make sure the header box is checked when you export.
There's info there We need to understand that does not follow standard SH structures as We 'knew' them.

One thing I did do?
I contacted my Friend Anvart and made him aware of this WIP.
He is the only one I can think of still active that WILL double check me.
And correct me as needed.
He is also one of my Mentors for all things Hex in SH Games.

Last edited by Madox58; 09-18-13 at 12:06 PM.
  Reply With Quote
Old 09-19-13, 03:35 PM   #20
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

When I exported the rawchunks I named them as below.
BodyParts
Body
BodyEnd
I'll be useing those names so re-name or remember how you named them.
It's easier to work with those chunks rather then the whole Secondary.dat by the way.

I'll be useing 010 with scripts to do alot of the 'heavy lifting' but I'll do my best to answer questions if you use a 'lesser' Hex Editor.


BodyParts contain the names, in order, of the biped I'm after. (Who would of thunk that! )

Body contains the positional elements to build the biped.
The X Y Z RX RY RZ W data that SH4 uses as the base position/stance of the biped.

BodyEnd I suspect is how the parts are connected as to Parent-Child?
(Corrections welcome)

We have the basic structure of SH files as to it's 'Node' ID, info size etc in each.
What We do have is a different Parent-Child ID structure. It's no longer 8 bytes but 4 bytes.
Look at the BodyParts in Secondary.dat and you'll see the ID listed but no Parent ID. That's right and wrong for this reason.
BodyParts has no Parent but it's ID is NOT 8 bytes long. It also has no place for a Parent ID as it IS the Top most Parent.
S3D will not show those Parent-Child ID's in the Unknowns so lets look at them in Hex.

BodyParts
02 D1 66 5A 00 00 00 00 = Node type 1516687618/0
C3 01 00 00 = 451 (how much data we need to read AFTER this float)
41 FF 53 59 = ID of this whole chunk.
1F 00 00 00 = 31. Number of parts! NOT the Parent as there is no Parent!
All data after that is just the names of the 31 parts to a standard Biped.
(I posted those earlier so you might want to copy and paste from that post)

Body
72 15 7B 30 00 00 00 00 = Node type 813372786/0
6C 03 00 00 = 876 (how much data we need to read AFTER this float)
D5 F4 B6 D0 = ID of this whole chunk.
41 FF 53 59 = Parent Chunk! See the change here? Check the ID above!!
(SH Games have used an 8 byte ID structure since SH3 at lest to my knowledge. Now it's different which may have contributed to earlier fails at breaking the animations. Not the only one though!)

BodyEnd
You should be able to see the info with a clear understanding at this point.

Last edited by Madox58; 09-19-13 at 03:51 PM.
  Reply With Quote
Old 09-19-13, 04:38 PM   #21
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Working with Body.rawchunk in this post..........

Now that We are past the basic stuff let's look at the actual data and how to read it.

4 x 7 x 31!! Remember that and it starts comeing together.
A float is 4 bytes long.
Multiply by 7 and then by how many parts the Biped has (31) we get a number.
It all fits to the size We found as to data included.

Here's where it does get a bit tricky for export/import purposes and I'm pretty sure We missed this fact when S3D was being created!

I'll define a few things first.
Transitional = add the results to Parent positional information.
Non-Transitional = Absolute position of the BodyPart with no regard to Parent position.

The Biped base stance/position as coded is Non-transitional!
To export to a useable format We need to subtract Child positional information from Parent positional information.
(If you know of a format different from Dae that will handle this information? TELL ME!)

Body.rawchunks translated looks like this. Note there are 31 lines to end of data.

0.0000000 0.09770422 -4.270787e-09 0.0000000 0.7071063 0.0000000 0.7071072
0.0000000 -0.0001444198 -4.270787e-09 0.0000000 0.0000000 0.0000000 1.0000000
0.0000000 0.09770422 -4.270787e-09 0.7071063 0.7071072 9.539226e-07 9.539226e-07
-1.32366e-11 0.1078124 1.008526e-05 0.7071067 0.7071067 -0.0002820579 0.000281024
0.00878975 0.09770422 2.984445e-09 0.7337838 -0.6723919 0.04614115 -0.08556522
-0.00878975 0.09770422 -2.006759e-08 -0.6723919 0.733784 0.08556433 -0.04614018
-1.308529e-11 0.1204893 9.969311e-06 0.7071067 0.7071067 -0.0002820579 0.000281024
0.01330656 0.04861388 -0.002336935 0.7255116 -0.677575 0.1191668 -0.01801055
0.01539599 0.009963792 0.003475701 0.6984613 -0.6984613 0.1102352 -0.1102352
0.01940245 -0.0001444203 -0.008900804 -0.5718348 0.4159387 0.4159387 0.5718348
0.01980851 -0.0001444204 -0.01015518 -0.3025436 0.4159387 -0.4159387 0.5718348
-0.01330656 0.04861388 -0.00233697 -0.6775749 0.7255118 0.01800967 -0.1191659
-0.01539602 0.009963794 0.00347566 0.6984615 -0.6984615 -0.1102343 0.1102343
-0.01940244 -0.0001444188 -0.008900856 -0.4159394 0.5718343 0.5718342 0.4159394
-0.0198085 -0.0001444189 -0.01015523 -0.4159394 0.5718343 0.5718342 0.4159394
-2.216505e-11 0.1330212 1.689299e-05 0.7071067 0.7071067 -0.0002820579 0.000281024
-6.570578e-12 0.1585746 4.999525e-06 0.7071067 0.7071067 -0.0002820579 0.000281024
0.0000000 0.1648673 -1.147737e-08 0.7071068 0.7071068 -4.214689e-08 -9.918541e-07
0.01105861 0.1542489 -6.979116e-09 0.0000000 -6.556511e-07 0.0000000 1.0000000
-0.01105861 0.1542489 -3.598148e-08 -6.556511e-07 0.0000000 1.0000000 0.0000000
4.188843e-14 0.1855232 1.626536e-08 0.7071068 0.7071068 -4.214689e-08 -9.918541e-07
0.01934231 0.1542489 3.883316e-09 -0.04582797 -0.01994291 -0.3985133 0.9157997
0.03731502 0.1350498 0.001926369 0.1173631 0.347953 -0.383587 0.847358
0.04816611 0.1217452 -0.01398395 0.8035617 -0.1635095 -0.4349111 0.372029
0.0544094 0.1153025 -0.0203268 0.692152 -0.4045 -0.3953384 0.4483445
0.05732315 0.1079048 -0.02181984 0.692152 -0.4045 -0.3953384 0.4483445
-0.01934231 0.1542489 -4.684392e-08 0.0199417 0.04582849 0.9157998 -0.3985133
-0.03731502 0.1350498 0.001926271 -0.3479541 -0.1173626 0.8473576 -0.3835872
-0.04816607 0.1217452 -0.01398408 -0.163509 0.8035612 -0.3720292 0.4349121
-0.05440934 0.1153025 -0.02032694 -0.4044994 0.6921515 -0.4483451 0.3953393
-0.0573231 0.1079048 -0.02181999 -0.3023349 0.5862651 0.2727683 0.4667423

If you grabbed the Biped names like I told you to? You can paste this info and see the structure.

31 Biped names.
31 lines of positional data.
All Non-Transitional.

Last edited by Madox58; 09-19-13 at 04:52 PM.
  Reply With Quote
Old 09-19-13, 05:01 PM   #22
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

How do We convert this mess?
He know the Parent-Child from the Names list is how I go about it.
(Look at the image capture of a basic biped I did in posts above!)
I subtract each line from it's Parent down through the chain till chain end.
That's pasted to a standard .dae file and I get the base Biped in SH4.
If I can do it by hand? It can be programmed.
  Reply With Quote
Old 09-20-13, 06:24 PM   #23
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

By no posts with questions I can only assume you..............
A.) Understand every thing I said above.
B.) Don't care but it all looks logical.
C.) Wonder if it will work with (Insert mod name here).
D.) I can't answer because I put you on Ignore.


I will accept
E.) You're brilliance has me stunned.
  Reply With Quote
Old 09-20-13, 08:28 PM   #24
virtualpender
Sonar Guy
 
Join Date: Apr 2007
Posts: 381
Downloads: 281
Uploads: 0
Default

Definitely E!

I have no idea what this is all about but your enthusiasm is bloody contagious!

Onward and upward!
virtualpender is offline   Reply With Quote
Old 09-20-13, 09:41 PM   #25
TorpX
Silent Hunter
 
Join Date: Sep 2010
Posts: 3,975
Downloads: 153
Uploads: 11
Default

Speaking for myself alone, I know nothing about hex editing. I was hoping I might learn a little from your posts, but I'm afraid it's a bit too much for me.

I'm glad somebody understands it, though.
TorpX is offline   Reply With Quote
Old 09-23-13, 10:47 PM   #26
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Got tied up with some computer work for a client and I'm now out in New York state for a few days work.


I did download some Collada stuff for programming that I need to go through.
I'm also thinking Noesis would be a good platform to code the needed stuff.
It imports and exports the dae format as it is now and you can view things with it.
So a bit of work in Python would be all it takes.

Last edited by Madox58; 09-23-13 at 11:52 PM.
  Reply With Quote
Old 09-25-13, 01:45 PM   #27
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Here's the link to the latest version of Noesis.
http://oasis.xentax.com/index.php?content=downloads

Knowing what it can do I'm going to work with it for all the heavy lifting of the animations stuff.
It's also an all around good viewer/converter and I used it to break the SWTOR meshes and did some work on PT Boats meshes.
(SHHH!!!)

I'll add a download to several test files soon. Those will allow you to see all the nonsense stuff I talk about.


I'm currently working on a python script for Noesis to read the Secondary.dat directly as it is.
  Reply With Quote
Old 10-20-13, 09:28 PM   #28
Rosomaha
Loader
 
Join Date: Nov 2012
Location: Russia
Posts: 83
Downloads: 72
Uploads: 1
Default

I will watch with interest for this work. topic is actually necessary and very useful.
I hope someday we will see something like this in SH4:

(I mean 1:57-3:61 time movie)
Rosomaha is offline   Reply With Quote
Old 10-20-13, 10:50 PM   #29
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Oh yes it's possible!
I've had little time to work on it all due to real life job demands but I know the format and how to export/import.
I just need time to work on it all.
I can also see exporting the animations from SH5 to SH4 to save time.
(Yes I do have some basic code to export the animations from SH5 in the works)
  Reply With Quote
Old 10-21-13, 04:51 PM   #30
JoeCorrado
Weps
 
Join Date: Apr 2005
Location: Illinois
Posts: 366
Downloads: 176
Uploads: 5
Default

Quote:
Originally Posted by privateer View Post
By no posts with questions I can only assume you..............
A.) Understand every thing I said above.
B.) Don't care but it all looks logical.
C.) Wonder if it will work with (Insert mod name here).
D.) I can't answer because I put you on Ignore.


I will accept
E.) You're brilliance has me stunned.
Definately "E" - although if it were available, I could have as easily selected "F" - or even WTF are you even talking about? I haven't a clue about this stuff.

Wouldn't it have been easier for the Devs to have simply used sprites like they did way back in the days of the original Doom?

Keep up the good work- it sounds quite promising and the possibilities are exciting.
__________________
=============



My Game starts with GFO - Keepin' it real as it needs to be!
JoeCorrado is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:51 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.