User Tools

Site Tools


arma:modeling:damage_model

This is an old revision of the document!


Vehicle Damage Model

Törni: With DamageHide selection (not a LOD) you can hide parts of the model when the it is destroyed. Just what I did with the BMD-1 2.0 addon. The only addon in which the texture swapping is currently working is BTR80 and the model can be opened with O2.

Armored_Sheep (BIS dev): New ArmA Damage visualisation by animating materials on surface is defined in config.cpp (class damage). Model must contain at least selection “zbytek” that will contain all faces that are animated. You can also use other selections bind in config.cpp in class Hit* as visual=. On top of that the selection must be defined as “section” in model.cfg.

“Zbytek” is czech word for “the rest” meaning remaining parts. In case HIThull - “karoserie” in czech - is used, you might not find “zbytek” it the model. All selection names are anyway defined in config.

Hiding animation bind to damage controler is also defined in model.cfg. Each animated part must be well configured in skeleton hierarchy. Model_Config

As you can see in config each turret has its own hitzone definition (class HitTurret, class HitGun) so if you have diferent named selections for each turret.

passThrough = 1 means that the hitzone is vital to the complete model, so if this “weakspot” is destroyed (he might be just 30% of the whole armor) the whole vehicle blows up. passThrough = 0 means that destroyed hitzone does some effect (windows textures changed, wheeles not turning), but the vehicle does not blow up.

Armored_Sheep: For working animated material that is bind to vehicle damage you need:
1) Selection on your model that contains faces with animated material (switch one rvmat to another)
2) Damage materials
3) Section defined in model.cfg for the animated selection
4) Hitzone definition in config.cpp in class HitPoint* where the selection is written
5) Class dammage in config.cpp where switching materials are defined
6) Model and all its sources must be binarised (packed) in PBO

Linker_Split: The rvmats you are using must point also to the texture you are using.

Example: Your model got a texture named: front_door_co.paa.

Then the Rvmat you define in the config must also point to this texture, otherwise the engine will not recognize the texture and will not replace it with the destruct one.

BIS Example config

Here is example damage config from BIS A10 aircraft.

dammageHalf[] =
{
	"\ca\a10\data\a10_glass_ca.paa",
	"\ca\a10\data\A10_glassBR1_CA.paa"
};
dammageFull[] =
{
	"\ca\a10\data\A10_glass_CA.paa",
	"\ca\a10\data\A10_glassBR1_CA.paa"
};

class Damage
{
	tex[] = {};
	mat[] =
	{
		"ca\a10\data\A10_01.rvmat",
		"ca\a10\data\A10_01.rvmat",
		"ca\a10\data\A10_01_destruct.rvmat",
		"ca\a10\data\A10_02.rvmat",
		"ca\a10\data\A10_02.rvmat",
		"ca\a10\data\A10_02_destruct.rvmat"
	};
};

[APS]Gnat Example

[APS]Gnat example:

Warrior0_destruct.rvmat file:

ambient[]={1.0,1.0,1.0,1.0};
diffuse[]={1.0,1.0,1.0,1.0};
forcedDiffuse[]={0.0,0.0,0.0,0.0};
emmisive[]={0.0,0.0,0.0,1.0};
specular[]={1.0,1.0,1.0,0.0};
specularPower=40.0;
PixelShaderID="NormalMapMacroASSpecularDIMap";
VertexShaderID="NormalMapAS";
class Stage1
{
	texture = "GNT_PiperWII\Warrior0_NOHQ.paa";
	uvSource = "tex";
	class uvTransform
	{
		aside[]={1.0,0.0,0.0};
		up[]={0.0,1.0,0.0};
		dir[]={0.0,0.0,0.0};
		pos[]={0.0,0.0,0.0};
	};
};
class Stage2
{
	texture = "ca\data\destruct\vehicle_destr1024_1024_mc.paa";
	uvSource = "tex";
	class uvTransform
	{
		aside[]={1.0,0.0,0.0};
		up[]={0.0,1.0,0.0};
		dir[]={0.2,0.0,0.0};
		pos[]={0.2,0.0,0.0};
	};
};
class Stage3
{
	texture = "#(argb,8,8,3)color(1,1,1,1)";
	uvSource = "tex";
	class uvTransform
	{
		aside[]={1.0,0.0,0.0};
		up[]={0.0,1.0,0.0};
		dir[]={0.0,0.0,0.0};
		pos[]={0.0,0.0,0.0};
	};
};
class Stage4
{
	texture = "ca\data\destruct\vehicle_destr1024_1024_smdi.paa";
	uvSource = "tex";
	class uvTransform
	{
		aside[]={1.0,0.0,0.0};
		up[]={0.0,1.0,0.0};
		dir[]={0.0,0.0,0.0};
		pos[]={0.0,0.0,0.0};
	};
};

And the main Config now has;

class cfgModels
{
	class Plane;
	class PWII: Plane
	{
		skeletonName = "GNT_PiperWIIBones";
		sectionsInherit="";
		sections[]=
		{
			"vrtule staticka",
			"vrtule blur",
			"clan","clan_sign",
			"zbytek"
		};
.........
.........
class CfgVehicles
{
	class All {};
	class AllVehicles: All {};
	class Air: AllVehicles {};
	class Plane: Air
	{
		class NewTurret;
		class AnimationSources;
	};
	class GNT_PiperWII: Plane
	{
..........
..........
	class Damage
	{
		tex[] = {};
		mat[] =
		{	"GNT_PiperWII\Warrior0.rvmat",
			"GNT_PiperWII\Warrior0.rvmat",
			"GNT_PiperWII\Warrior0_destruct.rvmat",
			"GNT_PiperWII\Warrior1.rvmat",
			"GNT_PiperWII\Warrior1.rvmat",
			"GNT_PiperWII\Warrior1_destruct.rvmat",
			"GNT_PiperWII\Warrior2.rvmat",
			"GNT_PiperWII\Warrior2.rvmat",
			"GNT_PiperWII\Warrior2_destruct.rvmat",
			"GNT_PiperWII\Warrior3.rvmat",
			"GNT_PiperWII\Warrior3.rvmat",
			"GNT_PiperWII\Warrior3_destruct.rvmat"
		};
	};

And for each Resolution LOD of the model I did a Select-All and named the selection “zbytek”. It works quite nice!

The P3D file in O2 needs to have this bit added for each texture used. The Face Properties need the Materials definition to point to the rvmat file

tactical.nekromantix.com_images_wiki_gnat_damage_rvmat_1.jpg

And to clarify, all these files are needed (until experiementation proves otherwise) to enable damage textures.

tactical.nekromantix.com_images_wiki_gnat_damage_rvmat_2.jpg

Best of luck :)

arma/modeling/damage_model.1209791465.txt.gz · Last modified: 2008-05-03 05:11 (external edit)