Soldier Protection – Arma 3

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 2: Line 2:
[[Category:Arma 3: Editing]]
[[Category:Arma 3: Editing]]
{{Stub}}
{{Stub}}
The current state of the documentation only covers the basics of the implementation. Additional details will be added soon.
The current state of the documentation only covers the basics of the implementation, some information might be inaccurate. Additional details will be added soon.
<!-- == General ==
== General ==
todo
This system allows the definition of the protection level of various [[LOD#Hit-points|hit-points]] (head, face, neck) in a given piece of equipment (I.e. Headgear, vest). To do so, the system supports the following hit points: head, face, neck, chest, diaphragm, abdomen, pelvis, arms, hands and legs.
 
Each equipment item which should have a certain level of protection should have the necessary hit point configured (see examples bellow)


==Functionality==
For the story, the old system was able to cover only one hit-point, as shown hereafter:
{|
!
!
|- style="vertical-align:top;"
| <center>[[File:soldierProtectionOld.jpg|250px]]</center>
| <center>[[File:soldierProtectionCurrent.jpg|250px]] </center>
|- style="vertical-align:top;"
| <syntaxhighlight lang="cpp">class ItemInfo
{
    hitPointName    = "HitBody";
    armor          = [0,∞];
    passThrough    = [0,1];
};</syntaxhighlight>
| <syntaxhighlight lang="cpp">class ItemInfo
{
    class HitpointsProtectionInfo
    {
        class Chest
        {
            hitpointName    = "HitChest";
            armor          = [0,∞];
            passThrough    = [0,1];
        };
        class Diaphragm
        {
            hitpointName    = "HitDiaphragm";
            armor          = [0,∞];
            passThrough    = [0,1];
        };
    };
};</syntaxhighlight>
|}
<!-- ==Functionality==
todo
todo


== Implementation ==
-->== Implementation ==
=== In the model ===
As described hereafter, various properties (hitpoint) need to be defined in the config to fully benefit from the soldier protection.
The first step is to set the selection in the model wherein the soldier protection should be implemented. To do so, you will need to add some selection to your model. In the following example, the V_PlateCarrierSpec_rgr is used and we will detail the selection named spineN (from 1 to 3, left to right).
 
You will need to add the selections you want to your model. The available selections are hereafter in the man base class, identified by "name" and can/should be defined in any models which should have a protection.
 
[[File:soldierProtectionSpine1.jpg|300px]]
[[File:soldierProtectionSpine2.jpg|300px]]
[[File:soldierProtectionSpine3.jpg|300px]]
-->
=== At the config level ===
The second step of the implementation is at the config level. As described hereafter, various properties need to be defined in the config to fully benefit from the soldier protection.
==== Unit base class ====
==== Unit base class ====
The following code is example of a custom man base class containing every config parameters relevant to the soldier protection. Its values represents the state of the soldier protection without any equipment, each piece of gear can increase the protection level of one of these hit points, provided it is configured. This class is just here to help you understanding the relation between the configuration of a gear item and the base class.  
The following code is example of a custom man base class containing every config parameters relevant to the soldier protection. Its values represents the state of the soldier protection without any equipment, each piece of gear can increase the protection level of one of these hit points, provided it is configured. This class is just here to help you understanding the relation between the configuration of a gear item and the base class.  
Line 201: Line 226:
class Chest  
class Chest  
{
{
hitpointName = "HitChest"; // Will impact the protection of the selection "spine3" as defined in the man base class "HitChest".
hitpointName = "HitChest";  
armor = 24;  
armor = 24;  
passThrough = 0.1;  
passThrough = 0.1;  
Line 207: Line 232:
class Diaphragm
class Diaphragm
{
{
hitpointName = "HitDiaphragm"; // Same as the previous class but will impact the selection "spine2"
hitpointName = "HitDiaphragm";
armor = 24;
armor = 24;
passThrough = 0.1;
passThrough = 0.1;
Line 213: Line 238:
class Abdomen
class Abdomen
{
{
hitpointName = "HitAbdomen"; // Same as the previous class but will impact the selection "spine3"
hitpointName = "HitAbdomen";  
armor = 24;
armor = 24;
passThrough = 0.1;
passThrough = 0.1;

Revision as of 09:37, 4 December 2015

Template:Stub The current state of the documentation only covers the basics of the implementation, some information might be inaccurate. Additional details will be added soon.

General

This system allows the definition of the protection level of various hit-points (head, face, neck) in a given piece of equipment (I.e. Headgear, vest). To do so, the system supports the following hit points: head, face, neck, chest, diaphragm, abdomen, pelvis, arms, hands and legs.

Each equipment item which should have a certain level of protection should have the necessary hit point configured (see examples bellow)

For the story, the old system was able to cover only one hit-point, as shown hereafter:

soldierProtectionOld.jpg
soldierProtectionCurrent.jpg
class ItemInfo
{
    hitPointName    = "HitBody";
    armor           = [0,];
    passThrough     = [0,1];
};
class ItemInfo
{
    class HitpointsProtectionInfo
    {
        class Chest
        {
            hitpointName    = "HitChest";
            armor           = [0,];
            passThrough     = [0,1];
        };
        class Diaphragm
        {
            hitpointName    = "HitDiaphragm";
            armor           = [0,];
            passThrough     = [0,1];
        };
    };
};

Implementation

As described hereafter, various properties (hitpoint) need to be defined in the config to fully benefit from the soldier protection.

Unit base class

The following code is example of a custom man base class containing every config parameters relevant to the soldier protection. Its values represents the state of the soldier protection without any equipment, each piece of gear can increase the protection level of one of these hit points, provided it is configured. This class is just here to help you understanding the relation between the configuration of a gear item and the base class.

Note: Good practice is not to edit or update the base class but create a new class which inherits from the vanilla class.

class CfgVehicles
{
	class Man;
	class CAManBase: Man
	{
		class HitPoints
		{
			class HitHead;
			class HitBody;
			class HitHands;
			class HitLegs;
		};
	};
	class TM4_CAManBase: CAManBase
	{
		class HitPoints: HitPoints
		{
			class HitFace: HitHead
			{
				armor               = 1; // Keep constant so that the hit point armor remains on the same scale
				material            = -1;
				name                = "face_hub"; // Selection name
				passThrough         = 0.1; // Damage resistance
				radius              = 0.08;
				explosionShielding  = 0.1; // Protection against explosive damage
				minimalHit          = 0.01; // Minimal damage value that can be applied
			}
			class HitNeck: HitFace
			{
				armor               = 1;
				material            = -1;
				name                = "neck";
				passThrough         = 0.1;
				radius              = 0.1;
				explosionShielding  = 0.5;
				minimalHit          = 0.01;
			}
			class HitHead: HitNeck
			{
				armor               = 1;
				material            = -1;
				name                = "head";
				passThrough         = 0.1;
				radius              = 0.2;
				explosionShielding  = 0.5;
				minimalHit          = 0.01;
				depends             = "HitFace max HitNeck"; // Returns the greater of HitFace and HitNeck.
			};
			class HitPelvis: HitBody
			{
				armor               = 1;
				material            = -1;
				name                = "pelvis";
				passThrough         = 0.1;
				radius              = 0.2;
				explosionShielding  = 1;
				visual              = "injury_body";
				minimalHit          = 0.01;
			};
			class HitAbdomen: HitPelvis
			{
				armor               = 1;
				material            = -1;
				name                = "spine1";
				passThrough         = 0.1;
				radius              = 0.15;
				explosionShielding  = 1;
				visual              = "injury_body";
				minimalHit          = 0.01;
			};
			class HitDiaphragm: HitAbdomen
			{
				armor               = 1;
				material            = -1;
				name                = "spine2";
				passThrough         = 0.1;
				radius              = 0.15;
				explosionShielding  = 6;
				visual              = "injury_body";
				minimalHit          = 0.01;
			}
			class HitChest: HitDiaphragm
			{
				armor               = 1;
				material            = -1;
				name                = "spine3";
				passThrough         = 0.1;
				radius              = 0.15;
				explosionShielding  = 6;
				visual              = "injury_body";
				minimalHit          = 0.01;
			};
			class HitBody: HitChest
			{
				armor               = 1000; //not supposed to take damage directly
				material            = -1;
				name                = "body";
				passThrough         = 0.1;
				radius              = 0.16;
				explosionShielding  = 6;
				visual              = "injury_body";
				minimalHit          = 0.01;
				depends             = "HitPelvis max HitAbdomen max HitDiaphragm max HitChest";
			};
			class HitArms: HitHands
			{
				armor               = 1;
				material            = -1;
				name                = "arms";
				passThrough         = 1;
				radius              = 0.1;
				explosionShielding  = 1;
				visual              = "injury_hands";
				minimalHit          = 0.01;
			};
			class HitHands: HitArms
			{
				armor               = 1;
				material            = -1;
				name                = "hands";
				passThrough         = 1;
				radius              = 0.1;
				explosionShielding  = 1;
				visual              = "injury_hands";
				minimalHit          = 0.01;
				depends             = "HitArms";
			};
			class HitLegs: HitLegs
			{
				armor               = 1;
				material            = -1;
				name                = "legs";
				passThrough         = 1;
				radius              = 0.12;
				explosionShielding  = 1;
				visual              = "injury_legs";
				minimalHit          = 0.01;
			};
		};
 
		armor= 2;//keep constant so that the hit point armor remains on the same scale
		armorStructural= 0.4;// [*] must be adjusted for each model to achieve consistent total damage results
		explosionShielding = 0.04;// [*] for consistent explosive damage after adjusting = ( armorStructural / 10 )
		minTotalDamageThreshold = 0.001;//minimalHit for total damage
		impactDamageMultiplier= 0.5;//multiplier for falling damage
		// * adjusted for each model
	};
};

Armored vest

The following vest config will provide protection for the neck, arms, chest, diaphragm abdomen and body.

	// Carrier Special Rig (Green)
	class V_PlateCarrierSpec_rgr: Vest_NoCamo_Base
	{
		/* other properties */	
		class ItemInfo: ItemInfo
		{	
			/* other properties */	
			class HitpointsProtectionInfo
			{
				class Neck
				{
					hitpointName	= "HitNeck"; // Defined in the man base class
					armor		= 8; // Armor value of this hitpoint
					passThrough	= 0.5; // Penetration resistance of the hitpoint
				};
				class Arms
				{
					hitpointName	= "HitArms";
					armor		= 8;
					passThrough	= 0.5;
				};
				class Chest 
				{
					hitpointName	= "HitChest"; 
					armor		= 24; 
					passThrough	= 0.1; 
				};
				class Diaphragm
				{
					hitpointName	= "HitDiaphragm";
					armor		= 24;
					passThrough	= 0.1;
				};
				class Abdomen
				{
					hitpointName	= "HitAbdomen"; 
					armor		= 24;
					passThrough	= 0.1;
				};
				class Body
				{
					hitpointName	= "HitBody";
					passThrough	= 0.1;
				};
			};
		};
	};

Headgear

This headgear increases the protection of the Head only, for example it doesn't provide additional protection for the face, so the value from the base class (above) will be used as they are defined.

	class H_HelmetB: ItemCore
	{
		/* other properties */			
		class ItemInfo : HeadgearItem
		{
			/* other properties */	
			class HitpointsProtectionInfo
			{
				class Head
				{
					hitpointName	= "HitHead"; // Defined in the man base class
					armor		= 6; // 
					passThrough	= 0.5; // 
				};
			};
		};
	};