View Single Post
Old 05-05-15, 03:43 PM   #49
iambecomelife
Silent Hunter
 
Join Date: Apr 2005
Posts: 4,584
Downloads: 297
Uploads: 0


Default

Here's some precious information on .zon files for new ship modders that I found on another forum - All credit to Observer, NOT me:

*.ZON - This file is the file for the damage model for the applicable ship, submarine or aircraft. This file has two important parts which are collision spheres and damage boxes. The names describe the actual geometry of the applicable part. As the name implies, the collision spheres control how other objects interact with the zoned object. Collision spheres must be present in order for an object to receive and/or give damage. Generally, collision spheres should follow the object's 3D model as closely as possible, although sometimes this is difficult given the spherical shape of the collision spheres and the geometry of a given object.

The damage boxes are game engines method for converting collision detection (via the spheres) into damage to the 3D object. Zone definitions from the zones.cfg are assigned to the damage boxes in order to define additional characteristics beyond the armor setting. More on this below:

Here are some typical parameters for a zone definition and the meaning/application for each:
Category=Engines Room Special zone category that is used to define a special application. The application referenced here is as an Engine Room
Multiplier=1.000000 Damage multiplier
Flotability=0.000000 Represents a "sinking factor" for the zone due to flooding. As a thumbrule, 1.0 units of floatability = 10 tons of seawater
HitPoints=100 The amount of damage the zone is able to sustain before being destroyed
Destructible=No Will the zone, and associated 3D object, be destroyed - removed - when HP=0?
Armor Level=1.0 Zone armor setting. More on this below.
Critic Flotation=0.300000 The amount of the damage the zone must sustain before the zone starts flooding. In this case it is 30% damage or 30 HP damage.
Critical=Yes Will a hit from an impact torpedo result in a critical hit to the zone? If the zone sustains a critical hit, it will destroy the object.
Critical Chance=0.05 Probability of a critical hit. This value represents 5%. Note that only whole percents are valid entries.
Father=36 Links this zone to another as a child zone. When the parent zone - in this case zone index 36 or TorpedoRoomFront - is destroyed it will destroy this zone
Effect1=#dc_bubbles, 30 Indicates a special effect linked to the zone that plays based upon a certain level of damage to the zone. In this case the #dc_bubbles effect - found in the particles.DAT - will play when the zone is damaged to 30% or 30 HP. As with critical chance only 10% values are valid entries.
FloodingTime=120 Time to fully flood the zone if damaged at 100%, in seconds. This time increases as the damage to the zone is reduced.
CargoType=None A special cargo effect tied to the zone. This may be tied via effects from the particles.DAT.
CrashDepth=10 When the zone is deeper than crash depth, the zone will start to lose HP until destroyed or the zone depth is less than the crash depth

Collisionable object controller - this controller is another important and fundamental part of object damage modeling and includes many important parameters:
ArmorLevel - this is the object (ship/submarine/aircraft) level armor setting
Hit_Points - this is the object level HP setting. When the object HP are reduced to zero, the object will be destroyed.
CrashDepth - When the object goes below this depth, HP will be removed at the CrashSpeed (defined below) until either: (a) the objects depth is less than the crash depth, or (b) all HP have been removed and the object is destroyed.
CrashSpeed - the rate, in HP/sec, that HP are removed from the object when below crash depth.
Rebound - Coefficient used for collisions between objects. A high number means a higher objects rebound (rate objects move away from each other after a collision) and a smaller number is just the opposite.

Armor: This is an extremely important attribute as it helps define how likely weapons will penetrate and cause damage to the zone. While armor levels are expressed in CM of armor plating, the relative value when compared to various types of ammunition is more important than the armor thickness in cm. Also, armor is a very commonly misunderstood and misapplied attribute for damage modeling.

First, some armor basics. Armor can be applied at three levels: individual zone box, zone definition, or object level. Keep in mind the following: each zone box is unique, but a zone definition can be applied to many zone boxes, and an object (e.g. ship, submarine, or aircraft) will contain many zone boxes. As such the armor attribute has a hierarchy, and this hierarchy is very, very important. This is the armor hierarchy (from highest to lowest, top to bottom):

object (highest)
zone defintion (parent=object)
individual zone (lowest - parent=zone defintion)

Armor can have a variety of values. If armor value is >= 0 it has one decimal point of precision. If armor is < 0 only integers are acceptable.

Here are some armor values and their definitions:
10.0 - armor thickness of 10.0 cm. Ordinance with an Armor Penetration (AP) >= 10.0 will cause damage to the zone. If AP < 10.0 no damage will occur.
0.0 - armor thickness of 0.0 cm. In essence, the zone has no armor and all ordinance will cause zone damage.
-1 - the zone inherits the armor setting from its parent. If this setting is applied at the individual zone box level, then it will inherit the armor setting from the zone definition. If the zone definition also uses the -1 setting, then it will inherit the armor setting from the parent object.
-2 - the zone inherits the armor setting from the parent and doubles the armor setting. -3, -4, etc. are also valid values.

Example #1: This is the armor setting for each:
individual zone = -1
zone definition = -1
object = 12.5

The zone armor is 12.5.

Example #2: This is the armor setting for each:
individual zone = -1
zone definition = 5.0
object = 12.5

The zone armor is 5.0.

Example #3: This is the armor setting for each:
individual zone = 0.0
zone definition = 5.0
object = 12.5

The zone armor is 0.0.

The important concept is that even though armor is inherited from a parent, it is applied at the zone level at the lowest possible level. Therefore it is possible to have multiple zones with the same definitions, but different armor settings on the same object. This is a very important concept.

How does the game engine know if the weapons AP is sufficient to penetrate the zone armor? It is based on several formulas below:
Shells: Armor Penetration = (random number between 1-PT and 1+PT)*Shell AP + HP/ALF where
PT = Penetration Threshold. This is defined in the zones.cfg in the [Global Params] section and is 20% for RFB
Shell AP = the shell AP setting in the AmmoDamageInfo controller of the shells.ZON
HP = a random number between the minimum and maximum HP setting in the AmmoDamageInfo controller of the shells.ZON
ALF = Armor Leveling Factor. This is defined in the zones.cfg in the [Global Params] section and is 4 for RFB

Example:
PT = 20%
ALF = 4
Shell AP = 5
MinEF = 1
MaxEF = 3

1. What is the maximum armor this shell will penetrate?
Using the formula above: AP = (1+0.2)*5+3/4 = 6.75
Therefore this shell will penetrate any armor less than 6.7 and cause damage at least part of the time. It won't penetrate this armor every time since the HP and PT are random numbers.

2. What is the minimum armor this shell will always penetrate and cause damage?
Using the formula above: AP = (1-0.2)*5+1/4 = 4.25
Therefore this shell will always cause damage to anything with an armor setting of 4.2 or less every time a shell impacts the zone.

In the example above, if the zone armor is between 4.2 and 6.7 the shell will only cause damage part of the time. Understanding this results in a very handy way to control how much damage is applied to zones, especially for guns with high firing rates.

While I've never explicitly tested it, I believe bombs and torpedoes work in a manner similar to shells. In the case of torpedoes, this is irrelevant because the torpedo AP is very high (100 for RFB). In the case of bombs, and based on changes to the submarine damage model, the bomb AP is also high enough to not be important. Since I only cared about the AI vs. player interaction WRT bombs, I did not spend any time on them because their AP was high enough (~12 or so) to cause catastrophic damage to the submarine with a direct hit.

Depth Charges: DCs are different from penetrating ammunition. In the case of DCs, in order for the DC to penetrate the zone armor, the following equation is used:
AP = DC HP/4

Example:
MinEF = 2
MaxEF = 50

What is the maximum armor this DC will penetrate?
AP = 50/4 = 12.5
Therefore if the DC rolls 50 damage HP, it will damage zones with armor of 12.5 or less, but it will never be able to damage a zone with armor of 12.6.

What is the minimum armor this DC will penetrate?
AP = 2/4 = 0.5
Therefore this DC will always damage zones with an armor of 0.5 or less. If the zone armor is between 0.5 and 12.5, the DC may be able to damage the zone depending on the HP the DC randomly rolls (and the distance of the DC from the zone, but I'm not going to cover that now).

This is quite a bit of information for now (see...I said it would be lengthy! ). I would suggest reading the ship and submarine damage model sections of the RFB manual. They have some different information not covered here that may be useful.

I'll cover special zones and equipment damage tomorrow, and likely propulsion damage and the many-to-one and one-to-many zone relationships the following day.

...this was very useful to me with the "Lusitania" - now, my model has the coal bunkers more or less modeled correctly so that she gets a terrible list when she's hit where Walther Schweiger historically torpedoed her...the internal arrangements of her were a major design flaw in real life.
iambecomelife is offline   Reply With Quote