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

Reply
 
Thread Tools Display Modes
Old 04-18-11, 07:34 PM   #1
Madox58
Stowaway
 
Posts: n/a
Downloads:
Uploads:
Default

Quote:
Originally Posted by TheDarkWraith View Post
This will document how to add/import new units to SH5. It will also document the damage/collision models present in SH5. I'm pretty certain this will get stickied as the information it contains is needed for ship builders/new unit builders/unit importers for SH5

Let's open up the NLL ship in the goblin editor (it's .GR2 file, .sim and .zon files):


Now I need to discuss the damage/collision models used in SH5. SH5 has two damage/collision models. One is for damage/collision with other units and the terrain. The other is for damage/collision with shells/torpedoes/DCs.

The damage/collision model for units and terrain can be seen by showing the damage for each hull part/part of the ship. Here we'll look at hull02 of the NLL ship. We view the sphere's for collision testing by selecting a hull part or another part of the ship (any part except the root of the tree which is NLL in this case) and right clicking and selecting Edit Damage:


Notice all the sphere's. These sphere's denote areas that can be collided with. Now when a collision happens with a sphere the game engine then looks to see if any boxes are located in that area and calculates which boxes are affected by the collision. Now you may be asking how do I see the boxes? It's easy. If you right click on the topmost object (NLL in this case) and select Edit Damage you'll see all the boxes for the unit:


Now when a collision happens with another unit/terrain the game engine looks to see which sphere's are affected and then looks to see which boxes are affected to calculate damage/flooding.

So one might be asking what are these boxes for? These boxes denote the compartments on the ship. Each box has a Type value which is drawn from the Zones.cfg file. This type value then tells the game engine how the compartment behaves flooding wise via the entries in the Zones.cfg file. It also tells the game engine which effects to play when the damage to that compartment exceeds certain defined values.

One thing to note is that boxes CANNOT be used for collision detection. They are for damage/flooding model only.

Now we need to talk about the other damage/collision model used in SH5. This model is used for collision detection of shells/torpedoes/DCs with units. This model, to me, seems to be very CPU intensive. This model exists, I'm almost 100% certain, because of the granny way of doing things. Instead of using sphere's for collision detection the game engine uses a 3D model. See why I say CPU intensive? It appears that the game engine uses the resulting bounding box from the 3D model as a first test for collision detection with shells/torpedoes. If that test passes then it goes down to a face level to see where the collision happened. How this is better than the sphere way is beyond me Once the face(s) have been determined then the game engine looks at which boxes are effected some how. I haven't quite figured out how it does this but I do know this is how it's done. Once the box(es) are determined then it goes about calculating the damage to the resulting boxes from the MinEF and MaxEF and MinRadius and MaxRadius of the shell/torpedo/DC.

Now you can probably see why the magnetic detonators don't work in SH5. As the granny way of doing things needs to see a collision happen and by nature magnetic detonators never collide with anything nothing ever happens! The torpedo just sails on underneath the unit

So how do we see this 3D model that is used for collision detection with shells/torpedoes/DCs? Once again it's quite easy. First let me bring to your attention an entry found in EVERY unit in SH5. This entry is viewable in Goblin editor and it starts with this 'DMG_col_x' where x is the name of the unit/part. This entry is always in bold and in an italics font. Now something special about this entry is that it's hidden (not viewable - hence the bold text and italicized text). Another thing that is interesting about this entry is that it contains a very simplified 3D model of the unit/part it represents (to minimize CPU time calculating which face(s) was/were intersected).

Now from above we looked at hull02 of the NLL ship. You saw the 3D model that is rendered in game. Now we're going to hide the actual 3D model used in game by right clicking on NLL_Hull02 and selecting Toggle Hide/View. Thus you should see the below:



Notice that hull02 is not viewable anymore. Now let's view the 3D model used for collision detection with shells/torpedoes/DCs by right clicking on DMG_col_NLL02 located under NLL_Hull02 and selecting Toggle Hide/View. You should see the below:


Notice the very simplified 3D model used for Hull02 in this case.

And that is the two damage/collision models used in SH5.

Using this information one can import/make new units for SH5 using .dat files. My next post in this thread will be about importing a unit from SH3 and porting it over to SH5.

FINALLY!

  Reply With Quote
Old 04-18-11, 10:50 PM   #2
Reece
CINC Pacific Fleet
 
Reece's Avatar
 
Join Date: Sep 2003
Location: Down Under
Posts: 11,223
Downloads: 171
Uploads: 0
Default

Quote:
Originally Posted by privateer View Post
FINALLY!

Yeh he's damned good!

The following formula applies: SH5 + TDW = Awesome
__________________

Sub captains go down with their ship!
Reece is offline   Reply With Quote
Old 04-19-11, 04:39 PM   #3
sirbum69
Navy Dude
 
Join Date: Feb 2010
Posts: 178
Downloads: 127
Uploads: 0
Default

Silent hunter 5...--Battle of TheDarkWraith--

Coming to PC soon, with no Internet required

sirbum69 is offline   Reply With Quote
Old 04-19-11, 04:50 PM   #4
stoianm
Ocean Warrior
 
Join Date: Dec 2010
Location: Montreal, Canada
Posts: 2,776
Downloads: 833
Uploads: 11
Default

Quote:
Originally Posted by sirbum69 View Post
Silent hunter 5...--Battle of TheDarkWraith--

Coming to PC soon, with no Internet required

I will tell you a secret... TDW is not a person ...is a computer ..
stoianm is offline   Reply With Quote
Old 04-19-11, 05:00 PM   #5
Stormfly
Serial Port Protector
 
Stormfly's Avatar
 
Join Date: Sep 2002
Posts: 1,424
Downloads: 370
Uploads: 0
Default

Quote:
Originally Posted by stoianm View Post
I will tell you a secret... TDW is not a person ...is a computer ..
lets hope then that we wont end up with "Skynet" then
__________________
Stormy......

Stormfly is offline   Reply With Quote
Old 04-19-11, 05:05 PM   #6
sirbum69
Navy Dude
 
Join Date: Feb 2010
Posts: 178
Downloads: 127
Uploads: 0
Default

funny my wife works for a place called Cray computers that make super computers used all over the world...I think if i remember right she was talking the other day about one they had rolled off the floor about 2 years ago....The name was ummm hmmm TheDarkWraith i believe
sirbum69 is offline   Reply With Quote
Old 04-22-11, 03:32 PM   #7
iambecomelife
Silent Hunter
 
Join Date: Apr 2005
Posts: 4,747
Downloads: 303
Uploads: 0


Default

I just tried importing a SH3 unit and it's crashing the game. I don't know what the problem could be; I added the node in the dat file, added the ship to the British roster, & checked the eqp file for any SH3 weapons. Everything seems to be OK but it won't work. In either Museum or missions.

I'll give it another go, I think.
iambecomelife 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 01:13 PM.


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