Bullet Penetration in Counter-Strike: Source: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 130: Line 130:
== Concluding Remarks ==
== Concluding Remarks ==


While the results show that properly bullet-proof thin glass may not be in our reach, it is useful to know that glass becomes more resistant when it is included in an entity. It is also possible to sandwich toolsblockbullets on either side or in between two glass brushes. However, sandwiched layers contained in the same entity: {|||} is less effective at stopping bullets than having each layer in a seperate entity: {|}{|}{|}.
While the results show that thin bullet-proof glass may not be in our reach, it is useful to know that glass becomes more resistant when it is included in an entity. It is also possible to sandwich toolsblockbullets on either side or in between two glass brushes. However, sandwiched layers contained in the same entity: {|||} is less effective at stopping bullets than having each layer in a seperate entity: {|}{|}{|}.


In general, sandwiching without entity use is no more efficient than a single thick block. For example: you need seven 1 inch panels of concrete with 2 inch spacing to stop an AWP round. The total thickness is 7*1+6*2=19 inches, which is 1 inch thicker than a solid block needs to be.
In general, sandwiching without entity use is no more efficient than a single thick block. For example: you need seven 1 inch panels of concrete with 2 inch spacing to stop an AWP round. The total thickness is 7*1+6*2=19 inches, which is 1 inch thicker than a solid block needs to be.


For brushes with different materials on each face the penetration depth seems to match the value for the material through which the bullet entered the brush. My test example was a brush entity of depth 18 inches with one side glass and the other toolsblockbullets. AWP rounds penetrated the brush when shot from the glass side (entity penetration depth 24), but were stopped when shot from the toolsblockbullets side.
For brushes with different materials on each face the penetration depth seems to match the value for the material through which the bullet entered the brush. My test example was a brush entity of depth 18 inches with one side glass and the other toolsblockbullets. AWP rounds penetrated the brush when shot from the glass side (entity penetration depth 24), but were stopped when shot from the toolsblockbullets side.

Revision as of 17:49, 23 August 2005

This document aims to provide detailed information about what parameters affect the penetration depth of bullets from the various weapons in Counter-Strike:Source. The most important result from this study is the fact that there is no simple way to make a 1 inch thick wall that stops any bullet. It is concievable that this could be achieved using code modifications, which remains a topic for future study.

Rudimentary Results

The following table gives the shallowest depth of a sigle brush that completely blocks the incoming bullet. The brushes were six faced with dimensions 80x104xN and with each face set to the given material.

Weapon glass/prodwndwa tools/toolsblockbullets
tools/toolsnodraw
M3 1 1
XM1014 1 1
USP 15 6
Mac-10 15 6
UMP 15 6
TMP 20 8
Glock 21 9
Elites 21 9
MP5 21 9
P228 25 10
Five-Seven 30 12
P90 30 12
Deagle 30 12
Galil 35 14
Famas 35 14
M4-A1 35 14
SG 552 35 14
SG 550 35 14
M249 35 14
AK-47 39 16
Scout 39 16
Aug 39 16
G3SG1 39 16
AWP 45 18

The results of this are somewhat troubling: Toolsblockbullets does not live up to its name. Even worse is the fact that nodraw is just as good at stopping bullets. Perhaps the material definitions reveal values that can be changed to affect the penetration distance.

Dependence on SurfaceProperties.txt

Upon further testing, it has become clear that the penetration depth depends on the gamematerial field of the surface property entry of the given material.

The table below was generated by adding a new entry to scripts/surfaceproperties_cs.txt:

"toughstuff"
{
	"density"	"1000000000"
	"elasticity"	"1000000000"
	"friction"	"1000000000"
	"dampening"	"1000000000"

	"stepleft"		"Glass.StepLeft"
	"stepright"		"Glass.StepRight"
	"scraperough"	"Glass.ScrapeRough"
	"scrapesmooth"	"Glass.ScrapeSmooth"
	"impacthard"	"Glass.ImpactHard"
	"impactsoft"	"Glass.ImpactSoft"
		
	"bulletimpact"	"Glass.BulletImpact"
	
	// "strain"		"Glass.Strain"
	"break"			"Glass.Break"

	"audioreflectivity" "0.66"
	"audiohardnessfactor" "1.0"

	"audioroughnessfactor" "0.0"
	"gamematerial"	"D"
}

During testing the density, elasticity, etc. were modified and shown to have no effect of penetration depth. The only property that affected the penetration depth was gamematerial.

To use this new surfaceproperty, materials/glass/bulletproof.vmt was created:

LightmappedGeneric
{
	"$basetexture"	"glass\prodwndwa"
	"$translucent" "1"
	"$nocull" "1"
	"$envmap" "env_cubemap"
	"$envmapmask" "glass\offwndwb_ref"
	"$surfaceprop" "toughstuff"
	"$crackmaterial" "glass\offwndwb_break"
}

Finally, several brushes ranging from a depth of 45 to 14 were created and each gamematerial type found in scripts/surfaceproperties.txt tested for penetration depth.

AWP inches gamematerial general description
18 C Concrete
18 P Computer
23 D Dirt
23 V Vent
30 T Tile
45 -,B,F,G,H,I,L,M,O,S,T,X,Y Everything Else: Flesh, Grates, Plastic, Metal, Liquids, Glass...
>45 W Wood

Brush entities require the smaller of 24 inches and the value associated with the gamematerial. For example a brush of toolsblockbullets texture is used in a func_breakable. Since toolsblockbullets is type C, 18 is less than 24 so we use 18. This was tested on a subset of gamematerial types and using func_breakable and func_wall entities.

Note surfaceprop "default" has gamematerial C. Thus bullets penetrate nodraw, blockbullets, etc. as if they were hitting concrete.

Concluding Remarks

While the results show that thin bullet-proof glass may not be in our reach, it is useful to know that glass becomes more resistant when it is included in an entity. It is also possible to sandwich toolsblockbullets on either side or in between two glass brushes. However, sandwiched layers contained in the same entity: {|||} is less effective at stopping bullets than having each layer in a seperate entity: {|}{|}{|}.

In general, sandwiching without entity use is no more efficient than a single thick block. For example: you need seven 1 inch panels of concrete with 2 inch spacing to stop an AWP round. The total thickness is 7*1+6*2=19 inches, which is 1 inch thicker than a solid block needs to be.

For brushes with different materials on each face the penetration depth seems to match the value for the material through which the bullet entered the brush. My test example was a brush entity of depth 18 inches with one side glass and the other toolsblockbullets. AWP rounds penetrated the brush when shot from the glass side (entity penetration depth 24), but were stopped when shot from the toolsblockbullets side.