Cheating in video games

Cheating in video games involves a video game player using various methods to create an advantage beyond normal gameplay, usually in order to make the game easier. Cheats may be activated from within the game itself (a cheat code implemented by the original game developers), or created by third-party software (a game trainer or debugger) or hardware (a cheat cartridge). They can also be realized by exploiting software bugs; this may or may not be considered cheating based on whether the bug is considered common knowledge.

History
The first cheat codes were put in place for play testing purposes. Playtesters had to rigorously test the mechanics of a game and introduced cheat codes to make this process easier. An early cheat code can be found in Manic Miner, where typing "6031769" (based on Matthew Smith's driving license) enables the cheat mode. Within months of Wizardry: Proving Grounds of the Mad Overlord's 1981 release, at least two commercial trainers appeared. 1983 advertisements for "The Great Escape Utility" for Castle Wolfenstein (1981) promised that the $15 product "remodels every feature of the game. Stop startup delays, crashes and chest waiting. Get any item, in any quantity. Start in any room, at any rank. Handicap your aim. Even add items".

In a computer game, all numerical values are stored "as is" in memory. Gamers could reprogram a small part of the game before launching it. In the context of games for many 8-bit computers, it was a usual practice to load games into memory and, before launching them, modify specific memory addresses in order to cheat, getting an unlimited number of lives, currency, immunity, invisibility, etc. Such modifications were performed through POKE statements. The Commodore 64, Amstrad CPC range and ZX Spectrum also allowed players with the proper cartridges or Multiface add-on to freeze the running program, enter POKEs, and resume. Some games tried to detect the Multiface and refused to load if it was present. The earliest models had no ability to "hide". Later revisions either included a switch, hid if the menu had been opened and closed before loading the game, or automatically hid.

For instance, with  in Knight Lore for the ZX Spectrum, immunity is achieved. Magazines such as Crash regularly featured lists of such POKE instructions for games. In order to find them a hacker had to interpret the machine code and locate the critical point where the number of lives is decreased, impacts detected, etc. Sometimes the term POKE was used with this specific meaning.

Cheating was exploited by technology-oriented players due to the difficulty of early cheats. However, a cheat industry emerged as gaming systems evolved, through the packaging and selling of cheating as a product. Cheat-enablers such as cheat books, game guides, cheat cartridges helped form a cheat industry and cemented cheating as part of gaming culture. However, cheating was not universally accepted in early gaming; gaming magazine Amiga Power condemned cheaters, taking the stance that cheating was not part of their philosophy of fairness. They also applied this in reverse; games should also not be allowed to cheat the player. Guides, walkthroughs, and tutorials are sometimes used to complete games but whether this is cheating is debated.

Later, cheating grew more popular with magazines, websites, and even a television show, Cheat!, dedicated to listing cheats and walkthroughs for consoles and computer systems. POKE cheats were replaced by trainers and cheat codes. Generally, the majority of cheat codes on modern day systems are implemented not by gamers, but by game developers. Some say that as many people do not have the time to complete a video game on their own, cheats are needed to make a game more accessible and appealing to a casual gamer. In many cases, developers created cheats to facilitate testing, then left them in the game as they expanded the number of ways people could play it. With the rise in popularity of gaming, cheating using external software and hardware raised a number of copyright legal issues related to modifying game code.

Many modern games have removed cheat codes entirely, except when used to unlock certain secret bonuses. The usage of real-time achievement tracking made it unfair for any one player to cheat. In online multiplayer games, cheating is frowned upon and disallowed, often leading to a ban. However, certain games may unlock single-player cheats if the player fulfills a certain condition. Yet other games, such as those using the Source engine, allow developer consoles to be used to activate a wide variety of cheats in single-player or by server administrators.

Many games which use in-game purchases consider cheating to be not only wrong but also illegal, seeing as cheats in such games would allow players to access content (like power-ups and extra coins) that would otherwise require payment to obtain. However, cheating in such games is nonetheless a legal grey area because there are no laws against modifying software which is already owned, as detailed in the Digital Millennium Copyright Act.

Cheat codes
The most basic type of cheat code is one created by the game designers and hidden within the video game itself, that will cause any type of uncommon effect that is not part of the usual game mechanics.

Cheat codes are usually activated by typing secret passwords or pressing controller buttons in a certain sequence. Less common activation methods include entering certain high score names, holding keys or buttons while dying, picking up items in a particular order and otherwise performing unintuitive actions. Some games may also offer a debug console that can be used to edit game parameters. Effects might include unlocking a character or improving a character's performance: for example providing a car with greater acceleration, or just visual gags such as "big-head mode" in GoldenEye 007. Some games humorously penalise the player for using another game's cheat codes. For example, using cheat codes from Doom in Heretic gives the opposite of the desired effect, such as instant death instead of invulnerability or stripping weapons instead of providing them.

Unlike other cheating methods, cheat codes are implemented by the game developers themselves, often as a tool to playtest certain aspects of the game without difficulty. One of the earliest known examples of this type of cheat is the Konami Code, created in 1986 by Konami developer Kazuhisa Hashimoto as he worked on porting the 1985 arcade game Gradius for use on the Nintendo Entertainment System. Hashimoto is quoted as saying "The arcade version of Gradius is really difficult, right? I never played it that much, and there was no way I could finish the game, so I inserted the so-called Konami Code."

Bots
A bot is a type of artificial intelligence (AI)–based expert system software that plays a video game in the place of a human, to perform actions (repetitive or not) that enable advantages to be achieved.

Macros
Macros are files that, when played, will repeat inputs in a game. As an example, in the game Geometry Dash, there is a sizeable community of players who will use macros to showcase levels too difficult for them to complete, or simply too difficult for a human to do. When recording macros, generally software in the form of a mod is used. Often, these mods can slow down the game, reverse time, among other ways of making it easier to record. These are also often called Tool Assisted Speedruns, or TASs, in the speedrunning community or elsewhere.

Modification of runtime game data
Cheating can easily be achieved by modifying the game's data while it is running. These methods of cheating are often less reliable than cheat codes included in a game by its creators. This is due to the fact that certain programming styles or quirks of internal game logic, different release versions of a game, or even using the same game at different times or on different hardware, may result in different memory usage and hence the trainer program might have no effect, or stop the game from running altogether. Modifying game data usually constitutes a violation of a software license agreement that prohibits modifying the program at all.



Memory editing
Cheating via memory editing involves modifying the memory values where the game keeps its status information. The way to achieve this will vary depending on the environment in which the game is running.

Memory editing hardware
A cheat cartridge is attached to an interface port on a home computer or console. It allows a user to modify the game code either before or during its execution. An early example is the Multiface for the ZX Spectrum, and almost every format since has had a cheat cartridge created for it; such as Datel's range of Action Replay devices. Another popular example of this is Game Genie for Genesis, NES, Super NES, Game Boy, and Game Gear game consoles. Modern disc-based cheat hardware includes GameShark and Code Breaker which modify the game code from a large database of cheats. In later generation consoles, cheat cartridges have come to be replaced by cheat discs, containing a simple loader program which loads a game disc and modifies the main executable before starting it.

The legality of this type of devices has been questioned, such as in the case of Lewis Galoob Toys, Inc. v. Nintendo of America, Inc., in which Nintendo unsuccessfully sued Lewis Galoob Toys stating that its cheating device, the Game Genie, created derivative works of games and thus violated copyright law.

Memory editing software
The most basic way of achieving this is by means of memory editor software, which allows the player to directly edit the numeric values in a certain memory address. This kind of software usually includes a feature that allows the player to perform memory searches to aid the user to locate the memory areas where known values (such as the number of lives, score or health level) are located. Provided a memory address, a memory editor may also be able to "freeze" it, preventing the game from altering the information stored at that memory address.

Game trainers are a special type of memory editor, in which the program comes with predefined functions to modify the run time memory of a specific computer game. When distributed, trainers often have a single + and a number appended to their title, representing the number of modifications the trainer has available.

In the 1980s and 1990s, trainers were generally integrated straight into the actual game by cracking groups. When the game was first started, the trainer would typically show a splash screen of its own, sometimes allowing modifications of options related to the trainer, and then proceed to the actual game. In the cracker group release lists and intros, trained games were marked with one or more plus signs after them, one for each option in the trainer, for example: "the Mega Krew presents: Ms. Astro Chicken++".

Many emulators have built-in functionality that allows players to modify data as the game is running, sometimes even emulating cheating hardware such as Game Genie. Some emulators take this method a step further and allow the player to export and import data edits. Edit templates of many games for a console are collected and redistributed as cheat packs.

Emulators also frequently offer the additional advantage of being able to save the state of the entire emulated machine at any point, effectively allowing saving at any point in a game even when save functionality is not provided by the game itself. Cheating hardware such as "Instant Replay" also allows such behavior for some consoles.

Code injection
Somewhat more unusual than memory editing, code injection consists of the modification of the game's executable code while it is running, for example with the use of POKE commands. In the case of Jet Set Willy on the ZX Spectrum computer, a popular cheat involved replacing a Z80 instruction  in the program (which was responsible for decrementing the number of lives by one) with a , effectively granting the player infinite lives. On Microsoft Windows, a common type of video game hacking is through the use of DLLs. Users use a third party program to inject the DLL into their game of choice.

Saved game editors
Editing a saved game offers an indirect way to modify game data. By modifying a file in persistent storage, it is possible to effectively modify the runtime game data that will be restored when the game attempts to load the save game.

Hex editors were the most basic means of editing saved game files (e.g. to give the player a large sum of money in strategy games such as Dune II). However, as happened with game editors, dedicated game-editing utilities soon became available, including functions to effortlessly edit saved data for specific games, rendering hex editing largely obsolete for this purpose.

If a saved game is stored in multiple files, it may also be possible to cheat simply by mixing and matching these files. For example, if one file represents the items in a treasure chest, while another represents the player's inventory, then the player can save the game before and after picking up an item from the chest, and continue play using the treasure chest file before the item was picked up, and the inventory file from afterward -- allowing the player to pick up the item repeatedly, gaining multiple instances of the item, if the program's logic does not prevent them from having more than one of the item.

Network traffic manipulation
An alternative method for cheating in online games involves modification of inbound or outbound network traffic between the client and server.

One early implementation of this concept was seen with lag switches. A lag switch refers to any hardware or software mechanism that temporarily limits network traffic. They grew popular as, unlike most cheats, they could be used on the Xbox 1 and PS4 consoles. In first-person shooters, a common use for lagswitches was the ability to understand enemy positions without any risk to the player.

For example, if a player was unsure whether an enemy was present in a room, they could activate the lag switch to block network traffic momentarily. This would allow the player to enter the room and scout for enemies without their movements being transmitted to the game server. As a result, the player’s character technically remained in the safe position from the server’s (and enemy's) perspective. Once the player had gathered the necessary information about enemy locations, they could deactivate the lag switch and resume normal play. Many games have since implemented "anti-desync" measures to limit the effectiveness of lagswitches. This may include the client game preventing player movement if connection is lost.

More modern methods typically involve lower level packet editing or forgery in a "Man-in-the-middle attack" style. For example, symmetric encryption keys could be read from the game's memory, granting access to inbound packets. These packets could be edited to provide the client game with information that does not reflect the server's reality. I.e. if an enemy player uses an ability that should slow your movement, the packet detailing the slow factor could be modified to a lower value, manipulating the client game into applying the lower value. Techniques like this are not as common as simple memory manipulation and are typically only used in specific scenarios.

Countermeasures
In games having attainable achievements or high score records, or both, cheats by nature allow the player to attain achievements too easily or score point totals not attainable or extremely difficult to attain through legitimate means by a non-cheating player. Notable examples include the following:
 * The 32X version of Doom does not allow the player to finish the game if any cheat codes are applied; instead, after a cheating player defeats the game's penultimate level, the game simulates a program exit to DOS and displays a mock command prompt ("C:\>").
 * Some PC games and most Xbox games do not record player achievements if they are attained while cheat mode is activated. For example, Half-Life 2: Episode Two turns this barrier into a continuing obstacle if a player saves the game with cheats activated. The game will then record that fact in the save file and automatically cause subsequent reloads from the relevant save file to reactivate cheat mode.
 * If a player of Portal has any cheats activated when a chamber is completed in Challenge mode, the game will display "CHEATED!" above the performance summary screen for that level.
 * Several video game companies have sued cheat-makers for copyright infringement, with a successful trial or settlement. Bungie and Ubisoft both convinced cheat-makers to stop operating, at the threat of paying damages at trial. Take-Two was successful against a cheat-maker in an Australian court, who awarded damages to the publisher.

Cheating in online games
Cheating exists in many multiplayer video games. While there have always been cheat codes and other ways to make single-player games easier, developers often attempt to prevent it in multiplayer games. With the release of the first popular internet multiplayer games, cheating took on new dimensions. Previously it was rather easy to see if the other players cheated, as most games were played on local networks or consoles. The Internet changed that by increasing the popularity of multiplayer games, giving the players relative anonymity, and giving people an avenue to communicate cheats.

Examples of cheats in first-person shooter games include the aimbot, which assists the player in aiming at the target, giving the user an unfair advantage, the wallhack, which allows a player to see through solid or opaque objects or manipulate or remove textures, meshing, which is the action of pushing an item/npc/player into the graphic boundary of another object/player/location in a manner not intended by the game developer, and ESP, with which the information of other players is displayed. There are also cheats that increase the size of the target's hitbox, allowing shots striking close to the target to register as hits.

In online trading card games, creating multiple accounts by jailbreaking a device to get more rewards can be considered as cheating because it is unfair to players who have only one account.

In online multiplayer games, a player may use macro scripts, which automatically find items or defeat enemies. The prevalence of massively multiplayer online games (MMORPGs) such as World of Warcraft, Anarchy Online, EverQuest, Guild Wars, and RuneScape has resulted in the trading of in-game currency for real-world currency. This can lead to virtual economies. The rise of virtual economies has led to cheating where a gamer uses macros to gain large amounts of in-game money which the player will then trade for real cash. The Terms of Service of most modern online games now specifically prohibit the transfer of accounts or the sale of in-game items for 'real-world' money. The enforcement of these terms varies however from one company to another, many turning a blind-eye to such trading as detection and prevention requires resources and banning players also results in losses of revenue.

Cheating in online games is common on public game servers. Some online games, such as Battlefield 1942, include specific features to counter cheating exploits, by incorporating tools such as PunkBuster, nProtect GameGuard, or Valve Anti-Cheat. However, much like anti-virus companies, some anti-cheat tools are constantly and consistently bypassed until further updates force cheat creators to find new methods to bypass the protection.

In single-player games, there are a number of plug-ins available to developers to use to stop cheaters. An obfuscator will scramble code so it is unreadable by decompilers, rename events/properties/methods and even add fake code. An obscurer will encrypt variables in memory and mask out strings. Anti-cheat toolkits have a variety of tools such as: detecting speed hacks, encrypting player prefs, detecting time cheats, detecting wall hacks and more. These can be used in most multi-player games as well.