This article's documentation is for anything that uses the Source engine. Click here for more information.

Working ladders: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(→‎Brush Ladders: added info and image about sideways dismounting ladders)
m (some formatting and punctuation fixes.)
Line 1: Line 1:
{{otherlang2
{{lang|Working Ladders}}{{source topicon}}[[Category:Level Design Tutorials]]
| es    = Working Ladders:es
| ko    = Working Ladders:ko
| ru    = Working Ladders:ru
| zh-cn = Working Ladders:zh-cn
}}
{{back | Category: Level Design | Level Design}}
{{back | Category: Level Design | Level Design}}
{{toc-right}}
{{toc-right}}


In all [[Source | Source Engine]] games (with a few exceptions) a ladder in-game consists of the prop or brush that the player perceives as the ladder, and the invisible entity/brush system in front of it that actually makes the ladder climbable. This gives the illusion that the player is climbing the visible ladder, where in fact he is scaling the invisible ladder entity/brush just in front of it. To create the visible ladder, you can either use:
In most {{Source|4}} engine games (with a few exceptions), a ladder in-game consists of the prop or brush that the player perceives as the ladder, and the invisible entity/brush system in front of it that actually makes the ladder climbable. This gives the illusion that the player is climbing the visible ladder, where in fact he is scaling the invisible ladder entity/brush just in front of it. To create the visible ladder, you can either use:
* [[prop_static]] entity with a ladder model (like ''models\props_c17\metalladder001.mdl'')
* A {{ent|prop_static}} entity with a ladder model (like <tt>models\props_c17\metalladder001.mdl</tt>)
* [[brush]] with a ladder texture (like ''metal/metalladder001a'').
* A [[brush]] with a ladder texture (like <tt>metal/metalladder001a</tt>).
The ladder's climbing system is created depends on which Source game it is intended for. Ladders in Half-Life 2 and Half-Life 2: Deathmatch are created a little differently than those of earlier games to provide better control for the level designer and player alike, while ladders in Counter-Strike: Source and Day of Defeat: Source are implemented pretty much the same way as the older games.
The ladder's climbing system is created depends on which Source game it is intended for. Ladders in {{hl2|2}} and {{hl2dm|2}} are created a little differently than those of earlier games to provide better control for the level designer and player alike, while ladders in {{css|2}} and {{dods|2}} are implemented pretty much the same way as the older games.


{{clr}}
{{clr}}


== Ladder entities ==
== Ladder Entities ==
===Creating the ladder===
===Creating the Ladder===
Used in: {{hl2}} [[Half-Life 2]], {{sin}} [[Sin Episodes]], {{dm}} [[Dark Messiah of Might and Magic]]
''Used in:'' {{hl2|4}}, {{sin|4}}, {{dmmm|4}}


To create a ladder you must define the volume in which the player will move through space while on the ladder. This volume can be defined in two ways: Using the {{ent|func_useableladder}} entity, or using the deprecated {{ent|func_ladderendpoint}} entity (which is only briefly described below to provide understanding of the workings of older maps).


To create a ladder you must define the volume in which the player will move through space while on the ladder. This volume can be defined in two ways: Using the [[func_useableladder]] entity, or using the deprecated [[func_ladderendpoint]] entity (which is only briefly described below to provide understanding of the workings of older maps).
The <tt>func_useableladder</tt> entity can be divided into two sub-entities: a starting point and an ending point (''see Fig. 1a''). Their positions can be typed into the keyvalue fields, or more typically the ladder volume can be defined using the visual ladder tool, by dragging its center circle that is visible when the entity is selected (''see Fig. 1b''). Using this tool, you can drag the start and end points of the ladder into appropriate positions in the 2D view. The ladder's start and ending points may be of arbitrary orientation and length (''see Fig. 1c''). Simply pull the endpoints where you want them, and the player will move between these points while on the ladder.
 
The func_useableladder entity can be divided into two sub entities: a starting point and an ending point ''(See Fig. 1a)''. Their positions can be typed into the keyvalue fields, or more typically the ladder volume can be defined using the visual ladder tool, by dragging its center circle that is visible when the entity is selected ''(See Fig. 1b)''. Using this tool you can drag the start and end point of the ladder into appropriate positions in the 2D view. The ladder's start and ending point may be of arbitrary orientation and length ''(See Fig. 1c)''. Simply pull the endpoints where you want them and the player will move between these points while on the ladder.


{| border=0 cellspacing=0 cellpadding=0
{| border=0 cellspacing=0 cellpadding=0
Line 30: Line 24:
|}
|}


As you place the endpoints, make sure that you place them a couple of units away from the visible ladder brush (or any other brush or model) because if any four sides of the ladder volume is even touching against a surface of a brush or a model, this will make that part of the ladder volume unclimbable.
As you place the endpoints, make sure that you place them a couple of units away from the visible ladder brush (or any other brush or model), because if any four sides of the ladder volume are even touching against a surface of a brush or a model, this will make that part of the ladder volume unclimbable.


The now obsolete func_ladderendpoint entity just consists of a single endpoint. A ladder volume is created by linking two func_ladderendpoints together using their properties. A ladder volume is created between two func_ladderendpoints by naming one of the endpoints and having the other endpoint point to its name in its ''Other'' value. (It is not necessary for the second endpoint to point back at the first as stated in properties.)
The now-obsolete <tt>func_ladderendpoint</tt> entity just consists of a single endpoint. A ladder volume is created by linking two <tt>func_ladderendpoint</tt> together using their properties. A ladder volume is created between two <tt>func_ladderendpoint</tt>s by naming one of the endpoints and having the other endpoint point to its name in its <tt>Other</tt> value. (It is not necessary for the second endpoint to point back at the first as stated in properties.)


=== Dismounts ===
=== Dismounts ===
[[File: hammer_ladders4.jpg | thumb | left | Fig. 2 - Dismounts]]
[[File: hammer_ladders4.jpg | thumb | left | Fig. 2 - Dismounts]]


Along with the volume of movement, you can also provide dismount points for the ladder ''(See Fig. 2)'' to allow easier and more controlled dismounts. These points are marked using the [[info_ladder_dismount]] entity. While next to and facing one of these markers, the player can press his use key to dismount to the position of the marker (typically when ladders run between more than two floors). If he has reached one of the ends of the ladder, he can also simply walk off the ladder by facing one of the markers nearby and walking forward.
Along with the volume of movement, you can also provide dismount points for the ladder (''see Fig. 2'') to allow easier and more controlled dismounts. These points are marked using the {{ent|info_ladder_dismount}} entity. While next to and facing one of these markers, the player can press his use key to dismount to the position of the marker (typically when ladders run between more than two floors). If he has reached one of the ends of the ladder, he can also simply walk off the ladder by facing one of the markers nearby and walking forward.
You can use multiple info_ladder_dismount markers for each dismount place to provide more directions to exit the ladder in.
You can use multiple <tt>info_ladder_dismount</tt> markers for each dismount place to provide more directions to exit the ladder in.


To avoid possible confusion between nearby ladders using different dismount markers, each info_ladder_dismount entity has a property value called ''LadderName'' which can be used to contain the name of the ladder it belongs to.
To avoid possible confusion between nearby ladders using different dismount markers, each <tt>info_ladder_dismount</tt> entity has a property value called <tt>LadderName</tt>, which can be used to contain the name of the ladder it belongs to.


Like the ladder volume, the dismount points must be free of obstruction and allow the player to stand at their position without intersecting solid world geometry.<br style="clear:left;"/>
Like the ladder volume, the dismount points must be free of obstruction and allow the player to stand at their position without intersecting solid world geometry.<br style="clear:left;"/>
Line 47: Line 40:
{{clr}}
{{clr}}


=== In-game testing ===
=== In-Game Testing ===
 
Once you have created your ladders, you can compile your map and test them. If you wish, you can also display the ladder entities in-game along with some debug information by opening the console and typing <code>sv_showladders 1</code> to enable this, and then load or reload (by typing <tt>restart</tt>) the map you wish to view.
Once you have created your ladders, you can compile your map and test them. If you wish, you can also display the ladder entities in-game along with some debug information by opening the console and typing <code>sv_showladders 1</code> to enable this, and then load or reload (by typing <code>restart</code>) the map you wish to view.
This will show you all the start and end points of the ladders (<tt>func_useableladder</tt> and <tt>func_ladderendpoint</tt> entities), as well as the dismount points (<tt>info_ladder_dismount</tt> entities; ''see Fig. 3a''). It can also help you determine if these entities are set up properly if ladder entities are colliding with solid world geometry or the prop model of the ladder itself (''see Fig. 3b'') and which <tt>func_ladderendpoint</tt> entities connect to each other.
This will show you all the start and end points of the ladders (func_useableladder and func_ladderendpoint entities), as well as the dismount points (info_ladder_dismount entities) ''(See Fig. 3a)'', and can help you determine if these entities are set up properly, if ladder entities are colliding with solid world geometry or the prop model of the ladder itself ''(See Fig. 3b)'', and which func_ladderendpoint entities connect to each other.


{| border=0 cellspacing=0 cellpadding=0
{| border=0 cellspacing=0 cellpadding=0
Line 57: Line 49:
|}
|}


=== How ladders work in-game ===
=== How Ladders Work In-Game ===
The safest way to mount a ladder is to approach its invisible ladder volume and, within reaching distance, press the use key. This will automatically position you on the ladder. (You can also walk into the ladder volume, with greater risk of missing it and falling down any holes.)


The safest way to mount a ladder is to approach its invisible ladder volume and within reaching distance press the use key. This will automatically position you on the ladder. (You can also walk into the ladder volume, with greater risk of missing it and falling down any hole.)
To dismount a ladder you can always either jump off or press your use key. If the ladder has <tt>info_ladder_dismount</tt>s, you can also simply walk off from its endpoints, and pressing your use key while next to and facing an <tt>info_ladder_dismount</tt> will also allow more controlled dismounts anywhere on the ladder.
 
To dismount a ladder you can always either jump off, or press your use key. If the ladder has info_ladder_dismounts, you can also simply walk off from its endpoints, and pressing your use key while next to and facing an info_ladder_dismount will also allow more controlled dismounts anywhere on the ladder.


== Brush Ladders ==
== Brush Ladders ==
=== Object brush based ladders===
=== Object-Brush–Based Ladders===
[[File: Cssladderprop01a.png | thumb | right | Fig. 4 - [[func_ladder]] textured with '''tools/toolsinvisibleladder''' in front of a [[prop_static]] ladder.]]
[[File: Cssladderprop01a.png | thumb | right | Fig. 4 - {{ent|func_ladder}} textured with <tt>tools/toolsinvisibleladder</tt> in front of a {{ent|prop_static}} ladder.]]
[[File: Func_ladder_Sideways_Dismount.png | thumb | right | Example of a ladder top that dismounts to the side, showing that the top of the ladder is 56 units above the new floor you dismount to. ]]
[[File: Func_ladder_Sideways_Dismount.png | thumb | right | Example of a ladder top that dismounts to the side, showing that the top of the ladder is 56 units above the new floor you dismount to.]]


Used in: {{l4d}} [[Left 4 Dead]], {{l4d2}} [[Left 4 Dead 2]], {{css}} [[Counter-Strike: Source]], {{dods}} [[Day of Defeat: Source]], {{GMOD}} [[Garry's Mod]], {{vtmb}} [[Vampire The Masquerade - Bloodlines | Vampire: The Masquerade - Bloodlines]], {{ship}} [[The Ship]]
''Used in:'' {{l4dseries|4}}, {{css|4}}, {{dods|4}}, {{Gmod|4}}, {{vtmb|4}}, {{ship|4}}


Create another brush in front of the object/brush you want to be climbable, as close as you can to it, but without touching it. Make sure that the face is the same width/height as the climbable object. Assign the material {{ent|Tool textures|alt=tools/toolsinvisibleladder}} to this brush, then tie it to an entity (via {{key|Ctrl|T}}). Select {{ent|func_ladder}} from the Object Properties dialog. You now have a climbable face in front of the object/brush. While on a ladder in ''Counter-Strike: Source'', your shooting accuracy will be significantly reduced.


Create another brush in front of the object/brush you want to be climbable, as close as you can to it, but without touching it. Make sure that the face is the same width/height as the climbable object. Assign the material '''tools/toolsinvisibleladder''' to this brush and then tie it to an entity {{key|CTRL|T}}. Select [[func_ladder]] from the Object Properties dialog. You now have a climbable face which is in front of the object/brush. While on a ladder in CS:S your shooting accuracy will be significantly reduced.
Ladders can also be dismounted sideways. For example, climbing a ladder that dismounts to the left side of the ladder prop, as opposed to climbing over the <tt>func_ladder</tt> brush.<br>
 
Ladders can also be dismounted sideways. For example: Climbing a ladder that dismounts to the left side of the ladder prop, as opposed to climbing over the func_ladder brush.<br>
Those ladders should have the ladder brush extend about 56 units above the floor it will dismount to, but not touch any roof above the ladder.<br>
Those ladders should have the ladder brush extend about 56 units above the floor it will dismount to, but not touch any roof above the ladder.<br>
If the func_ladder does not reach high enough, you can not dismount onto the floor and fall down instead. If the func_ladder comes too close to a roof, or any solid prop above, the AI will stick to that roof/prop because AI always climbs to the very top of a ladder and won't think about when dismounting makes most sense.
If the <tt>func_ladder</tt> does not reach high enough, you cannot dismount onto the floor and fall down instead. If the <tt>func_ladder</tt> comes too close to a roof, or any solid prop above, the AI will stick to that roof/prop, because AI always climbs to the very top of a ladder and won't think about when dismounting makes most sense.


{{note | [[L4D_Level_Design/Versus_Maps#Making_Infected_Ladders_Visible | Infected only Ladders]] in the Left 4 Dead Series uses the 'tools/climb_versus' texture, see also how to [[L4D_Level_Design/Ladders|create ladders for the Left 4 Dead series.]]}}
{{note|[[L4D_Level_Design/Versus_Maps#Making_Infected_Ladders_Visible|Infected-only ladders]] in the {{L4dseries|2}} use the <tt>tools/climb_versus</tt> texture; see also how to [[L4D_Level_Design/Ladders|create ladders for the ''Left 4 Dead'' series.]]}}
{{note | Vampire Bloodlines ladders use the 'tools/toolsinvisible' texture.}}
{{note |{{vtmb}} ladders use the <tt>tools/toolsinvisible</tt> texture.}}
{{note | Similar ladders are used in {{hl1}} [[Half-Life]], but here the 'AAATRIGGER' texture is used instead.}}
{{note | Similar ladders are used in {{hl|2}}, but there the <tt>AAATRIGGER</tt> texture is used instead.}}
{{note| Ladders that touch each other will be turned into one single ladder. If you need to block navigation on one ladder, it would block navigation on both ladders. Add gaps between ladders.}}
{{note| Ladders that touch each other will be turned into one single ladder. If you need to block navigation on one ladder, it would block navigation on both ladders. Add gaps between ladders.}}
{{bug|If the brush crosses any water surfaces, the player interacting with it can exhibit weird behavior, teleport the player while in the water to the end of the ladder. This has been encountered in a partial submersion of the ladder brush.}}
{{bug|If the brush crosses any water surfaces, the player interacting with it can exhibit weird behavior, teleport the player while in the water to the end of the ladder. This has been encountered in a partial submersion of the ladder brush.}}
Line 86: Line 76:
{{clr}}
{{clr}}


===Non-object brush based ladders===
===Non-Object Brush-Based Ladders===
[[File: CSGO_Ladder.PNG | thumb | 300px | right | [[Brush | func_detail]] textured with 'tools/toolsinvisibleladder' in front of a [[prop_static]] ladder.]]
[[File: CSGO_Ladder.PNG | thumb | 300px | right | {{ent|func_detail}} textured with <tt>tools/toolsinvisibleladder</tt> in front of a {{ent|prop_static}} ladder.]]


Used in: {{csgo}} [[Counter-Strike: Global Offensive]], {{INFRA}} [[INFRA]]
''Used in:'' {{csgo|4}}, {{INFRA|4}}


This ladder type is set up and works in exactly the same way as object brush ladders, but it shouldn't be tied to a <tt>func_ladder</tt> entity, or it will make the ladder nonexistent in-game. To make it, create a brush in front of the object/brush you want to be climbable, as close as you can to it but without touching it.


This ladder type is set up and works in exactly the same way as object brush ladders, but shall not be tied to a func_ladder entity or it will make the ladder non-existent in-game. To make it, create a brush in front of the object/brush you want to be climbable, as close as you can to it, but without touching it.  
Make sure that the face is the same width/height as the climbable object and then assign the material <tt>tools/toolsinvisibleladder</tt> to this brush. You now have a climbable face which is in front of the object/brush. No other setup is required for your ladder to work in game.


Make sure that the face is the same width/height as the climbable object and then assign the material 'tools/toolsinvisibleladder' to this brush. You now have a climbable face which is in front of the object/brush. No other setup is required for your ladder to work in game.
{{note | Since <tt>tools/toolsinvisibleladder</tt> still cuts [[visleafs]], make sure to tie the ladder brush to a <tt>func_detail</tt> or other brush entity.}}
 
{{tip |<tt>tools/toolsinvisibleladder</tt> will make the entire brush act like a ladder, even if it is only on a single face of the brush. Other faces of the brush will still show their textures in game.}}
{{note | Since 'tools/toolsinvisibleladder' still cuts [[visleafs]], make sure to tie the ladder brush to [[func_detail]].}}
{{tip | 'tools/toolsinvisibleladder' will make the entire brush act like a ladder, even if it is only on a single face of the brush. Other faces of the brush will still show their textures in game.}}
{{clr}}
{{clr}}


=== Brush based ladder workaround ===
=== Brush-Based Ladder Workaround ===
Used in: {{tf2}} [[Team Fortress 2]], {{portal2}} [[Portal 2]]
[[File:TF2 ladder.png|thumb|left|300px|A series of small <tt>toolsclip</tt> blocks will replicate a ladder without requiring ladder entities.]]
 
''Used in:'' {{tf2|4}}, {{portal2|4}}


Some Source games does not support the standard ladder entity, however it is possible to fake a ladder by creating a very narrow staircase.
Some Source games do not support the standard ladder entity; however, it is possible to fake a ladder by creating a very narrow staircase.


To start off make a prop_static and set the world model to models/props_c17/metalladder002.mdl. If you not happy with this particular model, open the model browser and type in ladder to search for some, there are a few different models. You can also make a ladder prop out of brushes or use the ladder texture on a single brush face.
To start off, make a <tt>prop_static</tt> and set the world model to <tt>models/props_c17/metalladder002.mdl</tt> or similar. You can also make a ladder prop out of brushes or use a ladder texture on a single brush face.


Next, create a brush 16 units high using the player clip texture. Use the player clip bushes to make a stack of blocks making sure each higher block is one unit "behind" the lower one. The players will climb these 16 unit high brushes as stairs. Too keep them from going too far out once you reach the bottom select the no clip blocks group them and then compress them as long as the top step sticks out past where the prop ends and each block still has a small lip it will work just fine. There you have it a good looking climbable ladder.
Next, create a brush 16 units high using a [[clip texture]]. Use the clip brushes to make a stack of blocks, making sure each higher block is one unit "behind" the lower one. The players will climb these 16-unit-high brushes as stairs. To keep them from going too far out once you reach the bottom select the no clip blocks group them and then compress them as long as the top step sticks out past where the prop ends and each block still has a small lip it will work just fine. There you have it—a good-looking, climbable ladder.


Video Showing how to create it: [https://www.youtube.com/watch?v=58YF5OXVYgQ TF2 mapping: Ladders in TF2]
Video Showing how to create it: [https://www.youtube.com/watch?v=58YF5OXVYgQ TF2 mapping: Ladders in TF2]
 
{{clr}}
{{todo | Add an image showing how to create this type of ladder in hammer for TF2.}}
 
== Optimizing Ladders ==
== Optimizing Ladders ==
The ladder props, like every prop_static, default to using [[VPhysics]] for collision detection, which will provide more detailed physics collisions, but in some cases this might not be preferable. In multiplayer maps and very resource demanding maps using VPhysics props costs precious resources, and you might want to sacrifice good physics to avoid potential lag. Here are some good methods to minimize resource cost:
The ladder props, like every <tt>prop_static</tt>, default to using [[VPhysics]] for collision detection. This will provide more detailed physics collisions, but in some cases this might not be preferable. In multiplayer maps and very resource-demanding maps, using VPhysics props costs precious resources, and you might want to sacrifice good physics to avoid potential lag. Here are some good methods to minimize resource cost:
 
*If the ladder is for {{Hl2|2}} or {{Hl2dm|2}}, and the ladder is straight, the best method depends on whether somebody is going to be able to shoot through the ladder. If they are not (like if the ladder is against a wall), you could simply change the <tt>Collisions</tt> keyvalue to "Use Bounding Box." If they are, you could change the keyvalue to "Not Solid" and place an invisible Clip brush to detect collision with it instead.
*If the ladder is for HL2 or HL2:DM, and the ladder is straight, the best method depends on whether somebody is going to be able to shoot through the ladder. If they are not (like if the ladder is against a wall) you could simply change the ''Collisions'' keyvalue to ''Use Bounding Box''. If they are, you could change the keyvalue to ''Not Solid'' and place an invisible Clip (''toolsclip'') to detect collision with it instead.
*If you are creating a slanting ladder for {{Hl2|2}} or {{Hl2dm|2}}, a bounding box will not rotate with the prop, and will obstruct the climbing system, in which case you are better off making the ladder prop ''Not Solid'' and place an invisible, rotated Clip- or Player Clip–textured brush alongside the ladder. Alternatively, you may turn off SmartEdit and set the prop's <tt>solid</tt> keyvalue to 3, which will cause it to use a properly-rotated version of the prop's bounding box.
 
*If the ladder is for a {{css|2}} or {{dods|2}} map, you could change the <tt>Collisions</tt> keyvalue to "Not Solid" and make the <tt>func_ladder</tt> brush cover the ladder prop, rotating it if necessary.
*If you are creating a slanting ladder for HL2 or HL2:DM, a bounding box will not rotate with the prop, and will obstruct the climbing system, in which case you are better off making the ladder prop ''Not Solid'' and place an invisible, rotated Clip (''toolsclip'') or Player Clip (''toolsplayerclip'') textured brush alongside the ladder (depending on whether or not somebody is going to be able to shoot through it).
 
*If the ladder is for a CS:S or DoD:S map, you could change the ''Collisions'' keyvalue to ''Not Solid'' and make the func_ladder brush cover the ladder prop, rotating it if necessary.
 
In multiplayer maps it's also an understood expectation to be able to move freely parallel to the surface that a ladder covers. When it comes to brush based ladders, you can get away with turning the ladder brush into a non-solid [[func_brush]] to avoid players getting temporarily "stuck" against the side of the ladder, but when it comes to prop ladders, they are often too protruding from the wall to make a player standing inside a ladder believable. In that case you are probably better off using two Player Clip textured wedges at the sides of the prop, guiding the player to the front of the prop.


If nothing else, you could turn a brush ladder into a [[func_detail]] to avoid unnecessary brush leafs.
In multiplayer maps, it's also an understood expectation to be able to move freely parallel to the surface that a ladder covers. When it comes to brush based ladders, you can get away with turning the ladder brush into a non-solid {{ent|func_brush}} to avoid players getting temporarily "stuck" against the side of the ladder, but when it comes to prop ladders, they often protrude from the wall too much to make a player standing inside one believable. In that case, you are probably better off using two Player Clip–textured wedges at the sides of the prop, guiding the player to the front of the prop.


== See also ==
If nothing else, you could turn a brush ladder into a {{ent|func_detail}} to avoid unnecessary visleafs.
*[[func_useableladder]]
*[[func_ladderendpoint]]
*[[info_ladder_dismount]]
*[[func_ladder]]


[[Category:Level Design Tutorials]]
== See Also ==
*{{ent|func_useableladder}}
*{{ent|func_ladderendpoint}}
*{{ent|info_ladder_dismount}}
*{{ent|func_ladder}}

Revision as of 09:44, 30 May 2022

English (en)Deutsch (de)Español (es)한국어 (ko)Polski (pl)Русский (ru)中文 (zh)Translate (Translate)
Level Design

In most Source Source engine games (with a few exceptions), a ladder in-game consists of the prop or brush that the player perceives as the ladder, and the invisible entity/brush system in front of it that actually makes the ladder climbable. This gives the illusion that the player is climbing the visible ladder, where in fact he is scaling the invisible ladder entity/brush just in front of it. To create the visible ladder, you can either use:

  • A prop_static entity with a ladder model (like models\props_c17\metalladder001.mdl)
  • A brush with a ladder texture (like metal/metalladder001a).

The ladder's climbing system is created depends on which Source game it is intended for. Ladders in Half-Life 2 Half-Life 2 and Half-Life 2: Deathmatch Half-Life 2: Deathmatch are created a little differently than those of earlier games to provide better control for the level designer and player alike, while ladders in Counter-Strike: Source Counter-Strike: Source and Day of Defeat: Source Day of Defeat: Source are implemented pretty much the same way as the older games.

Ladder Entities

Creating the Ladder

Used in: Half-Life 2 Half-Life 2, SiN SiN, Dark Messiah of Might and Magic Dark Messiah of Might and Magic

To create a ladder you must define the volume in which the player will move through space while on the ladder. This volume can be defined in two ways: Using the func_useableladder entity, or using the deprecated func_ladderendpoint entity (which is only briefly described below to provide understanding of the workings of older maps).

The func_useableladder entity can be divided into two sub-entities: a starting point and an ending point (see Fig. 1a). Their positions can be typed into the keyvalue fields, or more typically the ladder volume can be defined using the visual ladder tool, by dragging its center circle that is visible when the entity is selected (see Fig. 1b). Using this tool, you can drag the start and end points of the ladder into appropriate positions in the 2D view. The ladder's start and ending points may be of arbitrary orientation and length (see Fig. 1c). Simply pull the endpoints where you want them, and the player will move between these points while on the ladder.

Fig. 1a - Ladder points
Fig. 1b - Changing orientation
Fig. 1c - Slanted ladder points

As you place the endpoints, make sure that you place them a couple of units away from the visible ladder brush (or any other brush or model), because if any four sides of the ladder volume are even touching against a surface of a brush or a model, this will make that part of the ladder volume unclimbable.

The now-obsolete func_ladderendpoint entity just consists of a single endpoint. A ladder volume is created by linking two func_ladderendpoint together using their properties. A ladder volume is created between two func_ladderendpoints by naming one of the endpoints and having the other endpoint point to its name in its Other value. (It is not necessary for the second endpoint to point back at the first as stated in properties.)

Dismounts

Fig. 2 - Dismounts

Along with the volume of movement, you can also provide dismount points for the ladder (see Fig. 2) to allow easier and more controlled dismounts. These points are marked using the info_ladder_dismount entity. While next to and facing one of these markers, the player can press his use key to dismount to the position of the marker (typically when ladders run between more than two floors). If he has reached one of the ends of the ladder, he can also simply walk off the ladder by facing one of the markers nearby and walking forward. You can use multiple info_ladder_dismount markers for each dismount place to provide more directions to exit the ladder in.

To avoid possible confusion between nearby ladders using different dismount markers, each info_ladder_dismount entity has a property value called LadderName, which can be used to contain the name of the ladder it belongs to.

Like the ladder volume, the dismount points must be free of obstruction and allow the player to stand at their position without intersecting solid world geometry.

In-Game Testing

Once you have created your ladders, you can compile your map and test them. If you wish, you can also display the ladder entities in-game along with some debug information by opening the console and typing sv_showladders 1 to enable this, and then load or reload (by typing restart) the map you wish to view. This will show you all the start and end points of the ladders (func_useableladder and func_ladderendpoint entities), as well as the dismount points (info_ladder_dismount entities; see Fig. 3a). It can also help you determine if these entities are set up properly if ladder entities are colliding with solid world geometry or the prop model of the ladder itself (see Fig. 3b) and which func_ladderendpoint entities connect to each other.

Fig. 3a - In-game visualization
Fig. 3b - Endpoint stuck in floor

How Ladders Work In-Game

The safest way to mount a ladder is to approach its invisible ladder volume and, within reaching distance, press the use key. This will automatically position you on the ladder. (You can also walk into the ladder volume, with greater risk of missing it and falling down any holes.)

To dismount a ladder you can always either jump off or press your use key. If the ladder has info_ladder_dismounts, you can also simply walk off from its endpoints, and pressing your use key while next to and facing an info_ladder_dismount will also allow more controlled dismounts anywhere on the ladder.

Brush Ladders

Object-Brush–Based Ladders

Fig. 4 - func_ladder textured with tools/toolsinvisibleladder in front of a prop_static ladder.
Example of a ladder top that dismounts to the side, showing that the top of the ladder is 56 units above the new floor you dismount to.

Used in: Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series, Counter-Strike: Source Counter-Strike: Source, Day of Defeat: Source Day of Defeat: Source, Garry's Mod Garry's Mod, Vampire: The Masquerade – Bloodlines Vampire: The Masquerade – Bloodlines, The Ship: Murder Party The Ship: Murder Party

Create another brush in front of the object/brush you want to be climbable, as close as you can to it, but without touching it. Make sure that the face is the same width/height as the climbable object. Assign the material tools/toolsinvisibleladder to this brush, then tie it to an entity (via Ctrl+T). Select func_ladder from the Object Properties dialog. You now have a climbable face in front of the object/brush. While on a ladder in Counter-Strike: Source, your shooting accuracy will be significantly reduced.

Ladders can also be dismounted sideways. For example, climbing a ladder that dismounts to the left side of the ladder prop, as opposed to climbing over the func_ladder brush.
Those ladders should have the ladder brush extend about 56 units above the floor it will dismount to, but not touch any roof above the ladder.
If the func_ladder does not reach high enough, you cannot dismount onto the floor and fall down instead. If the func_ladder comes too close to a roof, or any solid prop above, the AI will stick to that roof/prop, because AI always climbs to the very top of a ladder and won't think about when dismounting makes most sense.

Note.pngNote:Infected-only ladders in the Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series use the tools/climb_versus texture; see also how to create ladders for the Left 4 Dead series.
Note.pngNote:Vampire: The Masquerade – Bloodlines ladders use the tools/toolsinvisible texture.
Note.pngNote: Similar ladders are used in Half-Life Half-Life, but there the AAATRIGGER texture is used instead.
Note.pngNote: Ladders that touch each other will be turned into one single ladder. If you need to block navigation on one ladder, it would block navigation on both ladders. Add gaps between ladders.
Icon-Bug.pngBug:If the brush crosses any water surfaces, the player interacting with it can exhibit weird behavior, teleport the player while in the water to the end of the ladder. This has been encountered in a partial submersion of the ladder brush.  [todo tested in ?]
Todo: In what circumstances exactly does it happen?

Non-Object Brush-Based Ladders

func_detail textured with tools/toolsinvisibleladder in front of a prop_static ladder.

Used in: Counter-Strike: Global Offensive Counter-Strike: Global Offensive, INFRA INFRA

This ladder type is set up and works in exactly the same way as object brush ladders, but it shouldn't be tied to a func_ladder entity, or it will make the ladder nonexistent in-game. To make it, create a brush in front of the object/brush you want to be climbable, as close as you can to it but without touching it.

Make sure that the face is the same width/height as the climbable object and then assign the material tools/toolsinvisibleladder to this brush. You now have a climbable face which is in front of the object/brush. No other setup is required for your ladder to work in game.

Note.pngNote: Since tools/toolsinvisibleladder still cuts visleafs, make sure to tie the ladder brush to a func_detail or other brush entity.
Tip.pngTip:tools/toolsinvisibleladder will make the entire brush act like a ladder, even if it is only on a single face of the brush. Other faces of the brush will still show their textures in game.

Brush-Based Ladder Workaround

A series of small toolsclip blocks will replicate a ladder without requiring ladder entities.

Used in: Team Fortress 2 Team Fortress 2, Portal 2 Portal 2

Some Source games do not support the standard ladder entity; however, it is possible to fake a ladder by creating a very narrow staircase.

To start off, make a prop_static and set the world model to models/props_c17/metalladder002.mdl or similar. You can also make a ladder prop out of brushes or use a ladder texture on a single brush face.

Next, create a brush 16 units high using a clip texture. Use the clip brushes to make a stack of blocks, making sure each higher block is one unit "behind" the lower one. The players will climb these 16-unit-high brushes as stairs. To keep them from going too far out once you reach the bottom select the no clip blocks group them and then compress them as long as the top step sticks out past where the prop ends and each block still has a small lip it will work just fine. There you have it—a good-looking, climbable ladder.

Video Showing how to create it: TF2 mapping: Ladders in TF2

Optimizing Ladders

The ladder props, like every prop_static, default to using VPhysics for collision detection. This will provide more detailed physics collisions, but in some cases this might not be preferable. In multiplayer maps and very resource-demanding maps, using VPhysics props costs precious resources, and you might want to sacrifice good physics to avoid potential lag. Here are some good methods to minimize resource cost:

  • If the ladder is for Half-Life 2 Half-Life 2 or Half-Life 2: Deathmatch Half-Life 2: Deathmatch, and the ladder is straight, the best method depends on whether somebody is going to be able to shoot through the ladder. If they are not (like if the ladder is against a wall), you could simply change the Collisions keyvalue to "Use Bounding Box." If they are, you could change the keyvalue to "Not Solid" and place an invisible Clip brush to detect collision with it instead.
  • If you are creating a slanting ladder for Half-Life 2 Half-Life 2 or Half-Life 2: Deathmatch Half-Life 2: Deathmatch, a bounding box will not rotate with the prop, and will obstruct the climbing system, in which case you are better off making the ladder prop Not Solid and place an invisible, rotated Clip- or Player Clip–textured brush alongside the ladder. Alternatively, you may turn off SmartEdit and set the prop's solid keyvalue to 3, which will cause it to use a properly-rotated version of the prop's bounding box.
  • If the ladder is for a Counter-Strike: Source Counter-Strike: Source or Day of Defeat: Source Day of Defeat: Source map, you could change the Collisions keyvalue to "Not Solid" and make the func_ladder brush cover the ladder prop, rotating it if necessary.

In multiplayer maps, it's also an understood expectation to be able to move freely parallel to the surface that a ladder covers. When it comes to brush based ladders, you can get away with turning the ladder brush into a non-solid func_brush to avoid players getting temporarily "stuck" against the side of the ladder, but when it comes to prop ladders, they often protrude from the wall too much to make a player standing inside one believable. In that case, you are probably better off using two Player Clip–textured wedges at the sides of the prop, guiding the player to the front of the prop.

If nothing else, you could turn a brush ladder into a func_detail to avoid unnecessary visleafs.

See Also