Exploits: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(still working on this)
(added pretty much everything i wanted, pictures/videos coming soon)
Line 1: Line 1:
Source has been around for over a decade. Half-Life was in a previous millennium. No doubt, games that have existed that long usually have a long list of known bugs, glitches, and tricks by now, and any speedrun video will show you that people know how to use them (but, most speedrunners use older versions of the games, cause many bugs have been patched by Valve). If you're the by-the-book kind of modder/mapper, take a look at some unfixed things a smart (or absentminded) player can do to break your maps, escape/become trapped, or skip gameplay. Any mapper might be interested in reading this, as some exploits can literally give a player a bird's eye view of a map, which could mean more visual work for you.
{{stub|}}
Source has been around for over a decade. Half-Life was in a previous millennium. No doubt, [https://wiki.sourceruns.org/wiki/Main_Page games that have existed that long usually have a long list of known bugs, glitches, and tricks by now], and any speedrun video will show you that people know how to use them (but, most speedrunners use older versions of the games, cause many bugs have been patched by Valve). If you're the by-the-book kind of modder/mapper, take a look at some unfixed things a smart (or absentminded) player can do to break your maps, escape/become trapped, or skip gameplay. Any mapper might be interested in reading this, as some exploits can literally give a player a bird's eye view of a map, which could mean more visual work for you.
{{tip|Perhaps instead of limiting players, consider using this information to hide an [[Wikipedia:easter egg (media)|easter egg]] or something like that.}}
{{tip|Perhaps instead of limiting players, consider using this information to hide an [[Wikipedia:easter egg (media)|easter egg]] or something like that.}}
<!---please sort as chronologically as possible. General is issues across engines.--->
<!---please sort as chronologically as possible.--->
==General==
==General==
'''2 units of water is enough to cancel all fall damage.'''
;*2 units of water is enough to cancel all fall damage.


A possible solution is to use <code>[[trigger_hurt]]</code>s. Appropriate damage amounts depends on the height of the fall and the depth of the water. Unless the height of the fall from would kill the player instantly, use an <code>OnHurt</code> output to disable the trigger after hurting the player once, and also add necessary logic to disable the trigger when the water is approached safely, and to enable it again when the player reaches a dangerous height.
A possible solution is to use <code>[[trigger_hurt]]</code>s. Appropriate damage amounts depends on the height of the fall and the depth of the water. Unless the height of the fall from would kill the player instantly, use an <code>OnHurt</code> output to disable the trigger after hurting the player once, and also add necessary logic to disable the trigger when the water is approached safely, and to enable it again when the player reaches a dangerous height.
Line 13: Line 14:
==Half-Life 2==
==Half-Life 2==
===Vehicles===
===Vehicles===
'''Wheeled vehicles tend to allow the player to stand on the right spot and then punt the vehicle at the right angle, which will send the player flying high in the air, sometimes over 1200 units! (For reference, that's a bit more than the maximum [[antlion]] jump distance.)'''
;*Wheeled vehicles tend to allow the player to stand on the right spot and then punt the vehicle at the right angle, which will send the player flying high in the air, sometimes over 1200 units! (For reference, that's a bit more than the maximum [[antlion]] jump distance.)


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 <code>scripts\vehicles\</code>. (This can also affect acceleration and jumping abilities, so don't increase it too much.)
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 <code>scripts\vehicles\</code>. (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 [[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).
The best fix for this is simply to design your map to accompany that height (about 200 units, including jumping and crouching).


'''The airboat is rather light. It is very easy to push out of reach with the gravity gun.'''
 
;*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 <code>scripts\vehicles\</code>.
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 <code>scripts\vehicles\</code>.


'''Standing on a large vehicle outsmarts some [[NPCs]], especially ones that cannot use bullets or other projectiles.'''
 
;*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. {{todo|Solutions? There's probably a reason vehicles and NPCs don't like to touch.}}
NPCs do not consider vehicles to be ground that can be stood on, meaning the player is out of their reach. {{todo|Solutions? There's probably a reason vehicles and NPCs don't like to touch.}}


'''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.'''
 
;*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.
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===
===Weapons===
'''Players can stand on physics objects, punt them downwards with the [[gravity gun]], and be propelled upward.'''
;*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.
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.


'''NPCs that can be moved via the gravity gun can be used to clear medium-sized gaps if the player stands on one, and jumps at the same time as they punt the NPC.'''
 
;*NPCs that can be moved via the gravity gun can be used to clear medium-sized 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.
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.


'''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.'''
 
;*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:
This isn't really a bug, in fact, Valve intended this. Any of these can be used to hurt large enemies:
Line 55: Line 62:


===Water===
===Water===
'''Some coast maps have a sweet spot in the water where antlions can't reach without dying, but leeches are still farther out in the water.'''
;*Some coast maps have a sweet spot in the water where antlions can't reach without dying, 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 <code>[[trigger_waterydeath]]</code> to anywhere deeper than that.
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 <code>[[trigger_waterydeath]]</code> to anywhere deeper than that.
Line 61: Line 68:
This solution isn't 100% effective. Antlions usually won't go directly at the player, and they don't change trajectory for moving or ducking targets. 32 units is also unusually shallow water for leeches to swarm in.
This solution isn't 100% effective. Antlions usually won't go directly at the player, and they don't change trajectory for moving or ducking targets. 32 units is also unusually shallow water for leeches to swarm in.


'''A poorly placed <code>[[trigger_waterydeath]]</code> 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, and if the player jumps and crouches at the surface of the water, they can continuously jump in and out of the trigger, 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.
;*A poorly placed <code>[[trigger_waterydeath]]</code> 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, 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.
 
==Portal 2==
===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 <code>[[func_portal_bumper]]</code> on the barrier to prevent portal bumping.
 
===Gel===
;*When a player collides with a [[prop_weighted_cube|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 [[Wikipedia:terminal velocity|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. Try one of these:
*Console command <code>sv_speed_paint_max</code>. Affects maximum gel speed, even when done the intended way, however. Requires reload for full effect.
*Redesign your map so that the speed isn't 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. 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.
 
{{todo|There's no known prevention for this.}} This bugged state can be preserved across map loads. [https://wiki.sourceruns.org/wiki/Excursion_Funnel_Flying See this page for more information.]

Revision as of 23:55, 6 June 2018

Stub

This article or section is a stub. You can help by expanding it.

Source has been around for over a decade. Half-Life was in a previous millennium. No doubt, games that have existed that long usually have a long list of known bugs, glitches, and tricks by now, and any speedrun video will show you that people know how to use them (but, most speedrunners use older versions of the games, cause many bugs have been patched by Valve). If you're the by-the-book kind of modder/mapper, take a look at some unfixed things a smart (or absentminded) player can do to break your maps, escape/become trapped, or skip gameplay. Any mapper might be interested in reading this, as some exploits can literally give a player a bird's eye view of a map, which could mean more visual work for you.

Tip.pngTip:Perhaps instead of limiting players, consider using this information to hide an easter egg or something like that.

General

  • 2 units of water is enough to cancel all fall damage.

A possible solution is to use trigger_hurts. Appropriate damage amounts depends on the height of the fall and the depth of the water. Unless the height of the fall from would kill the player instantly, use an OnHurt output to disable the trigger after hurting the player once, and also add necessary logic to disable the trigger when the water is approached safely, and to enable it again when the player reaches a dangerous height.

As you can imagine, this can quickly become an unfavorable solution when multiple height levels or bodies of water are involved.

Todo: code-based solutions? Versions of Source with VScript could possibly control the damage of the trigger based directly on player z-axis speed.

Half-Life 2

Vehicles

  • Wheeled vehicles tend to allow the player to stand on the right spot and then punt the vehicle at the right angle, which will send the player flying high in the air, sometimes over 1200 units! (For reference, that's a bit more than the maximum antlion jump distance.)

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 scripts\vehicles\. (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).


  • 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 scripts\vehicles\.


  • 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.

Todo: Solutions? There's probably a reason vehicles and NPCs don't like to touch.


  • 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

  • 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.


  • NPCs that can be moved via the gravity gun can be used to clear medium-sized 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.


  • 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
    Confirm:seen in Transmissions: Element 120 on striders. check to make sure that was genuine damage, not scripted.

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 d3_c17_12b and d3_c17_13, 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 reach without dying, 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 trigger_waterydeath to anywhere deeper than that.

This solution isn't 100% effective. Antlions usually won't go directly at the player, and they don't change trajectory for moving or ducking targets. 32 units is also unusually shallow water for leeches to swarm in.


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, 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.

Portal 2

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 func_portal_bumper on the barrier to prevent portal bumping.

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. Try one of these:

  • Console command sv_speed_paint_max. Affects maximum gel speed, even when done the intended way, however. Requires reload for full effect.
  • Redesign your map so that the speed isn't 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. 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.
Todo: There's no known prevention for this.

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