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 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 11-10-10, 04:12 PM   #16
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

Quote:
Originally Posted by Anvart View Post
IIRC, MeshAnimationData2 has been conceived for characters...
MeshAnimationData - for other objects...
Hi Anvart,

Thank mate for the clarification on this controller but what would be really helpful for the community is a list of what controllers are usable for modding sh3 i look at all of them and some i think are not usable via S3D editor i might be wrong but i would like to know the one that work.

Best regards Hans
__________________




Hans Witteman is offline   Reply With Quote
Old 11-10-10, 09:12 PM   #17
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Export the MeshAnimationData2 rawchunk.
Open it with a Hex editor.
Change the SubType from 0X8005 to 0x5.
So change the hex values 0580 at address 1C
to 0500

Now import to the dat.
S3D now sees it as MeshAnimationData and exports properly.
  Reply With Quote
Old 11-11-10, 05:43 AM   #18
divingbluefrog
Medic
 
Join Date: Jan 2006
Posts: 164
Downloads: 63
Uploads: 1
Default

You're right. It works fine. I should have imported it on an already modified mesh. My bad.
Hex editing the mesh, I can delete the third channel and import it back. No problem in game. Of course it's always easier to cut than to modify, but it's a first step.
The bad news is that Blender wracks the .obj produced by S3D.
divingbluefrog is offline   Reply With Quote
Old 11-11-10, 08:27 AM   #19
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

MeshAnimationData2 is technically identical to MeshAnimationData. The import sequence in S3D is the same. The only difference is a bitflag in the first section of the data (look at privateer's post above 0x5), and as previously stated seems to be used for crew. I needed to make this a seperate controller in S3D to support this bitflag but it in fact is the same controller in game. The game knows the difference only because of that flag.
skwasjer is offline   Reply With Quote
Old 11-11-10, 08:29 AM   #20
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Another tip is you can also simply copy/paste the chunk, so unless you need a rawchunk for hexeditting purposes, I suggest do the easy way and just CTRL+C/CTRL+V
skwasjer is offline   Reply With Quote
Old 11-11-10, 08:31 AM   #21
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

You can drop uv3 channel. It is not needed, nor is 4th channel. Only the first channel (diffuse) is required and the 2nd is optional (occlude).
skwasjer is offline   Reply With Quote
Old 11-11-10, 08:38 AM   #22
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

MeshAnimationData works as follows:

Take the base mesh, and for each frame, and for each vertex, compute the delta translation.
For the computed delta's get the lower and upper bound. This is your resolution (or range). Then pack each vertex with this resolution as signed short. The narrower the resolution, the finer the accuracy of the animation. Store the resolution and the packed vertices (or texture coordinates, you can also animate textures!!), and you are done.

Take note that whenever the base model changes, the animation goes whack! Without the base mesh, you can't 'restore' the animation frames...

All the above is exactly what S3D does during import/export, and why it needs to be tied to the base model for import/export to work! Additionally, when using S3D to modify a stock animation, take additional note that S3D has more advanced compression routines than stock, so the index tables can also go out of sync requiring you to reimport not only the animation, but also the base model! Stock, no compression is done on any model, so many models contain alot of duplicate vertices and texture coordinates. This is why you sometimes see a model having 20K vertices and after reimport without modifying it suddenly has 12k vertices. This is S3D's optimization/compression feature. You CAN and perhaps should (!) turn it off during import/export (it's an option). Keep this in mind!

[edi] I wrote unsigned, but of course this should be signed...

Last edited by skwasjer; 11-11-10 at 09:27 AM.
skwasjer is offline   Reply With Quote
Old 11-11-10, 09:04 AM   #23
Anvart
Admiral
 
Join Date: Jan 2006
Location: Russia ®
Posts: 2,492
Downloads: 122
Uploads: 1
Default

Quote:
Originally Posted by Hans Witteman View Post
Hi Anvart,

Thank mate for the clarification on this controller but what would be really helpful for the community is a list of what controllers are usable for modding sh3 i look at all of them and some i think are not usable via S3D editor i might be wrong but i would like to know the one that work.

Best regards Hans
Hi, Hans.
I think Skwasjer already have answered your question... and has made it on good English...
__________________
Alex ®


Moses said: "Don't create yourself an idol"...
Anvart is offline   Reply With Quote
Old 11-11-10, 11:47 AM   #24
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

Quote:
Originally Posted by skwasjer View Post
MeshAnimationData works as follows:

Take the base mesh, and for each frame, and for each vertex, compute the delta translation.
For the computed delta's get the lower and upper bound. This is your resolution (or range). Then pack each vertex with this resolution as signed short. The narrower the resolution, the finer the accuracy of the animation. Store the resolution and the packed vertices (or texture coordinates, you can also animate textures!!), and you are done.

Take note that whenever the base model changes, the animation goes whack! Without the base mesh, you can't 'restore' the animation frames...
Hi skwasjer,

First i like to thank you for your intervention in this thread and i am glad to see you are still following the SH3 mod forum an honor to have you here
It clarify a lot but i might sound like a newb on this one i mean what is the delta is it in s3d because when i do morphing in max i have a delta option in the controller menu?

And second when you say take the base mesh does it mean we cannot add a new custom character mesh?

Also i remember i post you a pm earlier this year on animation and i didn't reply because of health problem just want to apologize for not answering back now health is better fortunately

Best regards Hans
__________________




Hans Witteman is offline   Reply With Quote
Old 11-11-10, 11:49 AM   #25
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

Quote:
Originally Posted by Anvart View Post
Hi, Hans.
I think Skwasjer already have answered your question... and has made it on good English...
Hi Anvart,

No problem mate i think your English is enough clear for me i am not so good either in English

Best regards Hans
__________________




Hans Witteman is offline   Reply With Quote
Old 11-11-10, 12:53 PM   #26
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Quote:
Originally Posted by Hans Witteman View Post
Hi skwasjer,

First i like to thank you for your intervention in this thread and i am glad to see you are still following the SH3 mod forum an honor to have you here
It clarify a lot but i might sound like a newb on this one i mean what is the delta is it in s3d because when i do morphing in max i have a delta option in the controller menu?

And second when you say take the base mesh does it mean we cannot add a new custom character mesh?

Also i remember i post you a pm earlier this year on animation and i didn't reply because of health problem just want to apologize for not answering back now health is better fortunately

Best regards Hans
No problem, good to have you in good shape.

I was just 'tech' babbling on how the actual animation frames are stored in the DAT-file. It's not really anything you should worry about. But if you want to know, the delta is a value that is computed based on the position of a specific vertex A, in frame 1 vs the same vertex A in frame 2 (where frame 1 is the base model/frame). It's basically subtraction, and you end up with a value called delta. All delta's are compared for the highest and lowest, and this final 'range' can then be used to determine the resolution, translation and initial offset. The initial offset (float) is a value that all vertices 'inherit', the translation is a factor (short) of resolution (float), which is added to the initial offset (for each component xyz). The final value is then the actual (new) position of the vertex. The finer the resolution (which is just computed using an algoritm, and depends on each model/frame), the more 'lossless' the compression is. As you can see, this can save quite a few bytes of data, since per frame the initial offset and resolution are just merely taking up 8 bytes of data, and each vertex only 6 bytes, whereas normally each vertex would take up 12 bytes + index table. This is a factor of > 2 compression. I don't have the details (nor do I have SH + S3D installed), but I remember quite alot of space savings was achieved this way. The biggest downside of this approach though, is to uncompress, expensive multiply operations are needed. But I'm sure the devs made the right tradeoff between load times and overall game size... Todays computers shouldn't really feel the pain though, this is a decided upon like what 6 years ago?

I'll save you from how my algorithm specifically computes all this, because it is a bit more complex and not really interesting.

The option in Max has nothing to do with this specifically, but the term delta can be explained in similar way, you probably specify the maximum allowed range of the morph algorithm (I am no Max expert, and don't know this controller).

Last edited by skwasjer; 11-11-10 at 01:08 PM.
skwasjer is offline   Reply With Quote
Old 11-12-10, 08:02 AM   #27
divingbluefrog
Medic
 
Join Date: Jan 2006
Posts: 164
Downloads: 63
Uploads: 1
Default

skwasjer, thank you again for this priceless software that is S3D, and for your help.
With your detailed informations on MeshAnimation controller, I found a way to modify the original mesh without screwing up the animation.

I did it in Hex editing because Blender doesn't give me the .obj file I'm expecting and I don't want to deal with the python scripts for importing/exporting .obj files now.
First I remove the third channel, then I only keep the 2432 first vts.
Then, as animations deal only with vertices, I remove the faces I want to delete but keep the associated vertices. Some become isolated vertices, but it seems not to be a problem.
It's how I have now in game a mesh without the faces linked to Rank-Deco informations and animations go as expected.
divingbluefrog is offline   Reply With Quote
Old 11-12-10, 12:34 PM   #28
Hans Witteman
Kaleun of U-3
 
Join Date: Sep 2008
Location: somewhere in 1939
Posts: 1,816
Downloads: 123
Uploads: 0
Default

Quote:
Originally Posted by skwasjer View Post
No problem, good to have you in good shape.



The option in Max has nothing to do with this specifically, but the term delta can be explained in similar way, you probably specify the maximum allowed range of the morph algorithm (I am no Max expert, and don't know this controller).
Hi Skwasjer,

Thank for your clear explanation i learn stuff this way and i like it

This thread is worth gold

Best regards Hans
__________________




Hans Witteman is offline   Reply With Quote
Old 11-12-10, 04:44 PM   #29
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

No problem, glad to help. Animations have been supported for a while by S3D, but I never got to do some tutorials due to lack of time so it's good that people try and discuss so the 'word gets out' on how to work with them.

Quote:
Originally Posted by divingbluefrog View Post
Then, as animations deal only with vertices, I remove the faces I want to delete but keep the associated vertices. Some become isolated vertices, but it seems not to be a problem.
Correct, this is not a problem. It's not optimal, but it works, so good job! It surely isn't the first 'workaround' in the mod-scene
skwasjer is offline   Reply With Quote
Old 11-12-10, 04:51 PM   #30
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

Quote:
Originally Posted by Hans Witteman View Post
And second when you say take the base mesh does it mean we cannot add a new custom character mesh?
When talking about characters that walk on other surface vessels, yes you can because these are simple mesh animations, but full new NPC's living on your boat can't be done with S3D, at least not easily and it will require much hexwork and borrowing from stock models. This is the only missing feature in S3D. I only managed to 'decode' about 75% of how those characters (and animations) are stored in the DAT-file, so it never made it into S3D... So you're basically only able to do specific adjustments using current supported features in S3D.
skwasjer is offline   Reply With Quote
Reply


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

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

Forum Jump


All times are GMT -5. The time now is 05:35 PM.


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