Clip texture

From Valve Developer Community
(Redirected from Clip textures)
Jump to navigation Jump to search
English (en)中文 (zh)Translate (Translate)

For a list of clip textures, see Tool textures (Source)#Clips.

Clip textures are invisible tool textures that limit movement, typically of the player(s). A brush used with a clip texture is generally termed a clip brush. However, any unrendered brush or model can fill this role.

Impacts on player experience

There are good techniques and there are bad techniques when it comes to using clip brushes to limit the player's movement.

Good techniques are the ones that keep the player away from possibly getting entangled and stuck in complicated brushwork such as in between a tree and a hill, or amidst the cracks of several rocks, forcing the player to restart. However, wedge-shaped clip brushes can also be used to prevent the player from getting stuck on small detail brushes like window sills or buttons while trying to run somewhere, and to prevent the player from jumping up on top of an all too narrow fence or window sill.

Bad techniques are known as invisible walls, that block the player from heading into a corridor that they are not "supposed" to enter. Apart from frustrating the player, this breaks down the illusion of an immersive world and reminds the player this is just a game. Instead, try designing visible blocks like furniture, rubble or locked doors. If this is necessary, use a visible warning to indicate to the player that this is not the correct way ahead. In Left 4 Dead 2 Left 4 Dead 2, there is a texture named wrongway_sign01 that is used in Dark Carnival to stop players from entering a small room where infected spawn.

A fence surrounded by both a playerclip and blocklos brush

The fence in the image is enveloped by a toolsplayerclip tool texture for two reasons: First of all it prevents the player from getting caught on the brushwork when running alongside it, and second of all it prevents the player from jumping over something that would be at least cumbersome to climb over in real life. Be aware that the player could acquire physics objects and pile them up against the fence, and through this jump over the brush. If this is the case, you could consider extending this clip brush all the way to the roof of the map, but as this would create an invisible wall, it would perhaps be better to replace the entire fence with a solid wall instead.

Available clip textures and entities

Clip world brushes

In the Source Source engine, the general dedicated clip texture is Clip, but alternatives are Player Clip and NPC Clip. Clip is the most general clip texture to use, for example to clip level bounds with vertical walls or to simplify the collisions of props, floors or other complex geometry. The other two have different use cases since they are more specific.

These textures are generally intended to be used on all sides of a world brush and get their properties through their %compileclip compile flag. They do not need to be tied to an entity and are not subject to optimization with func_detail because they do not cut visleafs.

In Hammer, these textures share the same "Clips" VisGroup category.

These materials use the default surface property, yielding concrete footstep sounds on it. To get other sounds, see below.

Texture
on world
brush
Visible
in-game
Solid to
bullets,
physics
Solid to
players
Solid to
NPCs
Solid to
bots
Solid for
Nav Mesh
Counter-Strike: SourceCounter-Strike: Global Offensive Left 4 Dead seriesLeft 4 Dead series
Solid to
C4
Solid to
hostages
Solid to
survivors
Solid to
infected
toolsclip No No Yes Yes Yes Yes Yes Counter-Strike: Source Yes
Counter-Strike: Global Offensive No
Yes Yes
toolsplayerclip No No Yes No Yes ?
Counter-Strike: Global Offensive No
Yes Counter-Strike: Source Yes
Counter-Strike: Global Offensive No
Yes No
toolsnpcclip No No No Yes Counter-Strike: SourceCounter-Strike: Global OffensiveCounter-Strike 2 Yes
Left 4 Dead seriesLeft 4 Dead seriesTeam Fortress 2 No
?
Counter-Strike: Global Offensive Yes
No No No Yes
Warning.pngWarning:Brushes that are not solid to the nav mesh (i. e. when the cursor in nav_edit 1 passes through them) are not suitable for blocking out the level or for clipping floors or props because the game's nav_generate is prone to generate areas that are unreachable, malformed or simply missing wherever they are used.

Clip brush entities

Apart from tool textures, there are also brush entities acting as clips. Create a nodraw or clip brush, tie it to an entity using Ctrl+T and change the class to one of the following. If you require the properties of two brushes, use two brushes inside each other, for example Clip and func_clip_vphysics.

Entity classname Solid to?
func_clip_vphysics Physics objects like dropped weapons etc.
script_clip_vphysics (only in Left 4 Dead 2)
func_vehicleclip Vehicles.
func_playerinfected_clip (only in Left 4 Dead seriesLeft 4 Dead series) Special Infected controlled by players during Versus. AI Controlled Special infected and Common infected may still pass.
func_playerghostinfected_clip (only in Left 4 Dead seriesLeft 4 Dead series) Player ghost infected
func_team_wall (only in Day of Defeat: Source) Specified team.
func_teamblocker (only in Day of Defeat: SourceInsurgencyDay of Infamy)
func_respawnroomvisualizer (only in Team Fortress 2) Team that doesn't own the linked team_control_point.
func_forcefield (only in Team Fortress 2) Teams that it doesn't belong to.

Clipping techniques in Hammer

Invisible Displacement

Alternative invisible displacement, for when clip brushes are too difficult to create.

In some cases, clip brushes are not an option, or too difficult to make an accurate clip brush around props.
For example, Left 4 Dead often used displacement brushes using invisible textures to make something like a clip, which covers rubble props.

Env_Player_Blocker

Another useful, but very limited alternative are env player blocker entities. These are rectangular point entities that block players in it's volume. This entity is mostly used in "Cleanup" activities via the Commentary System or LMP file edits after a map has been compiled already.

Clips with Surfaceprop

Counter-Strike: Global OffensiveGarry's Mod Red clip textures with different surface properties for footstep sounds

One issue with the generic red clip texture is that it inherits the default $surfaceprop which plays concrete footsteps when walked on. This is why some games, like Counter-Strike: Global Offensive and Garry's Mod, have multiple red clip tool textures that use specific material surface properties, such as concrete, dirt, glass, etc. This allows the clips to sound different when stepping upon and also make use of the surface properties, like the very low friction of SlipperySlide. Example uses of this is utilizing glass clips when working on glass catwalks, which would allow you to still hear glass noises when stepping onto the clip, whereas the generic clip texture would otherwise play a default concrete sound which would be out of place.

For games that do not have these clip textures, you could create your own or copy them from a game that has them. But that may not work in some games, as it will cause every single clip to use the surfaceprop of whichever clip your first interacted with. Left 4 Dead 2 for example causes this sound bug to occur.

Alternatively, you can (with more overhead) use the following workaround to avoid creating new material files: Build your brushwork for the clip using any texture that possesses the material properties you require. For example, glass/glasswindow007a, simply because it is glass. Turn the brushwork into a func_brush that is set to "Don't Render", "Always Solid", and "Solid BSP". This stops your brush from cutting Vis Leaves and becomes invisible, just like a clip brush would. However, depending on thickness, it will also block bullets and also physical props and projectile weapons, such as grenades, or arrows, because it is merely invisible brushwork.

You can also create your own material. For example, to get a wooden clip material, create a new text file 🖿<game>/materials/tools/toolsclip_wood.vmt, reuse the clip texture (or create your own to be able to distinguish clips in the editor) and set the $surfaceprop appropriately.

LightmappedGeneric
{
	$translucent   1                 // use texture transparency in Hammer (texture is invisible in-game)
	$basetexture   "tools/toolsclip" // image for 3D view and texture browser, good if it has transparency
	%compileclip   1                 // correct clip properties (invisible, solid to..., not solid to...)
	$surfaceprop   wood              // surface properties, affecting footstep sound
	%keywords      clip              // search keywords in texture browser, optional
}

See also