Bullet Penetration in Counter-Strike: Source

From Valve Developer Community
Jump to: navigation, search
English (en)한국어 (ko)
... Icon-Important.png

This document aims to provide detailed information about what parameters affect the penetration depth of bullets from the various weapons in Counter-Strike: Source. One of the nicest results of this study is a method to produce a 2-inch thick bulletproof object.

Warning.pngWarning:Some of this may have changed in the latest patch... the notes mentioned fixes incorrect calculations for concrete and grate materials.

Rudimentary Results

The following table gives the shallowest depth of a single 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, XM1014 1 1
USP, Mac-10 , UMP 15 6
TMP 20 8
Glock, Elites, MP5 21 9
P228 25 10
Five-Seven, P90, Deagle 30 12
Galil, Famas, M4-AI,
SG 552, SG 550, M249
35 14
AK-47, Scout, Aug, 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 18 is used. 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.

Layer Sandwiching for Bulletproofing

The above results are none too encouraging for people who want to create thin bullet-proof surfaces. However, the behavior of sandwiched entity brushes is a bit weird, and provides us a method.

To create truly bullet-proof glass, you need to use two 1 inch thick brushes with glass texture on all sides. Each brush must be in its own entity (tested with func_wall and func_breakable) and no empty space can separate the brushes. That's it. So simple it's so easy to miss. You can use any combination of textures on any of the faces and not destroy the bullet-proof property of this configuration. Here is a sample map.

Concluding Remarks

In general, sandwiching with space between brushes is no more efficient than a single large block. The property of entity brushes to reduce bullet penetration depth for most materials is a particularly useful result. Putting walls that should be resistant to bullets into func_wall entities would be a good trick to employ throughout many maps.

It is important to note that sandwiched brush entities are only stronger when the layers are in separate entities: {|}{|}{|}. Making a single entity of three sandwiched brushes {|||} is no more effective than a single brush entity of the same width.

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. The 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. This can be used actually for mimicking certain ultra-modern types of bulletproof glass that can be shot through from one side only, like bullet-proof windows of an armoured car.