Exploits

This page documents some well-known and little-known tricks that might break your maps.

General

 * By mashing the jump and use buttons, physics objects can be used to climb walls, or even to fly in midair.

Demonstration. Portal 2 fixes this issue by implementing a long cooldown on, and making objects non-solid when held by the player.


 * Water cancels fall damage.

If you can't alter code, a possible solution is to use s. Appropriate damage amounts depends on the height of the fall and the depth of the water. Unless the height of the fall would kill the player instantly, use an  output to disable the trigger after hurting the player once, and also add necessary logic to disable the trigger if the water is approachable by a safer route, and to enable it again when the player reaches a dangerous height. Clearly this can quickly become very complex.

Versions of Source with VScript could possibly control the damage of the trigger based directly on the player's Z speed.

For coders, open gamemovement.cpp and look for this where  is defined: Delete it entirely, and also remove the else statement below it (not the code inside it, just the ).

Vehicles

 * When punted the right way with the gravity gun, the buggy and airboat may send a player flying very high up, sometimes over the maximum distance an antlion can jump, and in very rare cases, enough to launch from the sea level in Lost Coast to the lift near the top of the map.

This can be a major issue when your level design is vertical, and could also allow the player to jump or shoot over some obstacles. Falling from heights like this can do major fall damage, but see above about water. Damage can also be alleviated by entering the vehicle before hitting the ground, or landing the right way on a slope. Possible fixes are simply designing your maps to accompany for this, or making vehicles less jumpy, possibly by increasing their mass in. (This can also affect acceleration and jumping abilities, so don't increase it too much.)


 * The airboat's shape makes it a very quick and useful ramp.

The best fix for this is simply to design your map to accompany that height (about 200 units, including jumping and crouching). You can also use player clips, but be careful as it might diminish realism.


 * The airboat is rather light. It is very easy to push out of reach with the gravity gun.

With the vehicle out of reach, a player would have to load from a previous save, or possibly start over an entire chapter. Increase the airboat's mass in. You can also use clip brushes, but be careful as it might diminish realism. An extra smart player could also punt the airboat and then press the use key to enter it before it leaves their reach, which can give them a huge advantage.


 * Standing on a large vehicle outsmarts some NPCs, especially ones that cannot use bullets or other projectiles.

NPCs do not consider vehicles to be ground that can be stood on, meaning the player is out of their reach.


 * When a player enters a vehicle, they aren't actually sliding into the vehicle how it appears. They are teleported from where they were before entering into the driver's seat/final camera destination. This allows a poorly-placed trigger to skipped, also known as Enter Clipping.

Unless your trigger needs to be a very specific size, just make the trigger larger, or have it detect vehicles too. Only change code if you find it to be absolutely necessary.

Weapons

 * The force of explosions created by weapons can boost players. (Like rocket jumping in Team Fortress 2)

The force from explosions is mostly horizontal, not vertical. Also, explosions that are forceful enough to propel the player significantly are also pretty damaging to them, so repeated uses aren't very doable. Design your maps to account for the possible distances. You can also use player clips, but be careful as it might diminish realism.


 * Players can stand on physics objects, punt them downwards with the gravity gun, and be propelled upward.

This is probably preventable by having moving objects ignore the gravity gun when a player is standing on them. If you cannot alter code in your situation, careful level design is the next best bet.

Not every prop is as equally exploitable. Here are props known to boost particularly well:


 * NPCs that can be moved via the gravity gun can be used to clear medium to large gaps if the player stands on one, and jumps at the same time as they punt the NPC.

This only concerns headcrabs and antlions. This can probably be fixed similar to the last issue, by having NPCs ignore the gravity gun when a player is standing on them. If you cannot alter code in your situation, careful level design is the next best bet. A better solution might be to simply make the player not take inertia from NPCs they stand on.


 * NPCs such as striders, helicopters, and gunships can be hurt by more than just rockets. A player killing one of these in an unintended time and place can have unwanted consequences depending on the situation.

This isn't really a bug, in fact Valve intended this. Any of these can be used to hurt large enemies:
 * Frag grenades (which can be aided by the gravity gun)
 * SMG grenades
 * Any Combine energy ball (also aimable with the gravity gun)
 * Physics damage

Problems with this aren't usually encountered in Half-Life 2 because Valve accounted for it as best as possible, but imagine how this could have affected gameplay on and, where progression relies heavily on strider NPCs dying and using scripted cannon shots. If Valve did not consider the possibility of a player killing a strider before reaching the place they want the player to go, the player could potentially be trapped.

The best method of avoiding issues with this is to ensure the player doesn't have those mechanics as an option (probably through scarcity), or simply plan for the possibility.

Water

 * Some coast maps have a sweet spot in the water where antlions can't go without drowning, but leeches are still farther out in the water.

This is an issue seen multiple times in Highway 17 and Sandtraps. This makes it easy for a player to travel without a vehicle, and take virtually no damage. To prevent this, keep all water shallower than 32 units, (the maximum water level an antlion can move in) and extend your to anywhere deeper than that. This solution isn't 100% effective. Antlions usually won't go directly at the player, and they can't change trajectory once they begin flying (for players that duck or suddenly change velocity). 32 units is also unusually shallow water for leeches to swim in.

A code-based solution would be to let antlions go deeper in water, but this may look odd.


 * A poorly placed can be swum over.

This is an issue in Half-Life 2: Lost Coast. In this map, the trigger is placed slightly below the surface. If the player jumps and crouches at the surface of the water, they can continuously jump in and out of the trigger before they get hurt, enabling the player to access areas of the map they shouldn't be in.

This is not an issue in any Half-Life 2 maps, as the triggers in those maps actually go a long way above the surface, too.

Portals

 * When a portal is shot somewhere currently containing a different portal, the first portal is usually placed to the side of that other one. This can happen even through barriers, such as glass.

Put a on the barrier to prevent portal bumping. Also try using and.


 * In Portal 1, portal shots take time to travel. In that amount of time, the player can cross through a portal before the shot lands on another wall.

Demonstration Portal 2 fixes this problem by making portals be placed instantly when the gun fires. Portal 2 has a similar issue, but it requires more precise timing, and the camera's orientation has to change when crossing the portal. The Portal 2 iteration of this bug has no (good) fixes available to mappers.

Gel
See also: Controlling gel


 * When a player collides with a cube, it can cause them to be nudged upward. When repulsion gel is added to the equation, it lets the player reach any height, due to repulsion gel not simulating a terminal velocity.

There's not much of a way to stop this, except for making cubes nonsolid. Better puzzle design would be recommended, however. There is no way to simply set a maximum bouncing height.


 * When a player crouches on propulsion gel, moves forward, and uncrouches, they will instantly accelerate to the maximum gel speed.

Situations where this is a problem are rare. It's best to just adjust the dimensions of the map if it's an issue.


 * When a player throws a cube while running on propulsion gel, the cube's velocity is magnified greatly, including upward.

This just means that they can throw a cube really high, and really far. Careful level design is the answer to this, if it ever is a problem.

Excursion Funnels

 * Due to some crouch status issue, an excursion funnel can be used to trick the game into giving the player a noclip-like state.

This bugged state can be preserved across map loads. See this page for more information.