Light gun

A light gun is a pointing device for computers and a controller for arcade and video games. Early light gun games used small targets (usually moving) onto which a light-sensing tube was mounted; the player used a gun (usually a rifle) that emitted a beam of light when the trigger was pulled. If the beam struck the target, a "hit" was scored. Modern screen-based light guns work on the opposite principle—the sensor is built into the gun itself, and the on-screen target(s) emit light rather than the gun.

Light guns in video games


The video game light gun is typically modeled on a ballistic weapon (usually a pistol, but occasionally a shotgun, sniper rifle, or sub-machine gun) and is used for targeting objects on a video screen. With force feedback, the light gun can also simulate the recoil of the weapon.

Light guns are very popular in arcade games, but have never caught on in the home video game console market. This may be because people are reluctant to buy more than one extra controller for their system, let alone a special-purpose and often expensive peripheral, or because light guns are less satisfactory to use with the small television screens in peoples homes than on the large screens in arcade game cabinets.

The most popular example of the light gun is Nintendo's Zapper gun for the Nintendo Entertainment System, though there are also light guns for Sony PlayStation, Microsoft Xbox, Magnavox Odyssey and many other console and arcade systems. Recent light gun video games include Time Crisis 3, Virtua Cop 3, and The House of the Dead III.

Design
Targets in light gun shooters may be threatening antagonists such as criminals, terrorists or zombies,  or they may be innanimate objects such as apples or bottles. Although these games may be played without a light gun, the use of more conventional input methods has been deemed inferior. Light gun shooters typically feature generic action or horror themes, though some later games employ more humorous, self-referential styles.

Light gun shooters primarily revolve around shooting large numbers of enemies attacking in waves. The protagonist may be required to defend himself by taking cover, or by shooting incoming thrown weapons, such as axes or grenades. The player may also compete against the clock, however, with some games also featuring boss battles. Games may also reward the player for accurate shooting, with extra points, power-ups or secrets. Games which do not pit the player against antagonists instead feature elaborate challenges constructed mainly from inanimate objects, testing the player's speed and accuracy. More conventional games may feature these types of challenges as minigames.

Light gun shooters typically feature "on-rails" movement, which gives the player no control over the direction the protagonist moves in; the player only has control over aiming and shooting. Some games however, may allow the protagonist to take cover at the push of a button. Other games may eschew on-rails movement altogether and allow the player to move the protagonist freely around the game's environment; still others may feature a static environment. Light gun shooters utilise a first-person perspective for aiming, though some games may allow the player to switch to a third person perspective in order to maneuver the protagonist.

Not all gun games use light guns for input. Many arcade gun games also use positional guns, mounted to the cabinet on a swivel that allows the player to aim the gun. These work quite differently to optical light guns, which are tethered and stored in a mounted holster. A positional gun is essentially an analog joystick that records the position of the gun to determine where the player is aiming on the screen. Arcade gun games that use positional guns include Silent Scope, Space Gun, and Revolution X.

How light guns work
The "light gun" is so named because it uses light as its method of detecting where on screen you are targeting. The name leads one to believe that the gun itself emits a beam of light, but in fact all light guns actually receive light through a photoreceptor diode in the gun barrel. The diode uses light reception to do its targeting, in conjunction with a timed mechanism between the trigger of the gun and some rather smart graphics programming.

There are two versions of this technique that are commonly used, but the concept is the same: when you pull the trigger of the gun, the screen is blanked out to black, and the diode begins reception. All or part of the screen is painted white in a way that allows the computer to judge where the gun is pointing, based on when the diode detects light. The user of the light gun notices nothing, because the period in which the screen is blank is very short.

Method one
The first detection method, used by the Zapper, involves drawing each target sequentially in white light after the screen blacks out. The computer knows that if the diode detects light as it is drawing a square (or after the screen refreshes), that is the target the gun is pointed at. Essentially, the diode tells the computer whether or not you hit something, and for n objects, the sequence of the drawing of the targets tell the computer which target you hit after 1 + ceil(log2( n )) refreshes (one way to determine if any target at all was hit and ceil(log2( n )) to do a binary search for the object that was hit).

An interesting side effect of this is that on poorly designed games, often a player can point the gun at a light bulb, pull the trigger and hit the first target every time. Better games account for this by not using the first target for anything.

The second method, used by the Super Nintendo Entertainment System's Super Scope and computer light pens is more elaborate but more accurate.

Method two
The trick to this method lies in the nature of the cathode ray tube inside the video monitor (it does not work with LCD screens, projectors, etc.). The screen is drawn by a scanning electron beam that travels across the screen starting at the top until it hits the end, and then moves down to update the next line. This is done repeatedly until the entire screen is drawn, and appears instantaneous to the human eye as it is done very quickly.

When the player pulls the trigger, the game brightens the entire screen for a split second, and the computer (often assisted by the display circuitry) times how long it takes the electron beam to excite the phosphor at the location the gun is pointed at. It then calculates the targeted position based on the monitor's horizontal refresh rate (the fixed amount of time it takes the beam to get from the left to right side of the screen).

Detection
Once the computer knows where the gun is pointed at, it can tell if it coincides with the target or not. However, many guns of this type (including the Super Scope) ignore red light, as red phosphors have a much slower rate of decay than green or blue phosphors.

A game that uses more than one gun reads both triggers continuously and then, when one player pulls a gun's trigger, the game polls that gun's diode until it knows which object was hit.

Positional guns
In arcades, positional guns are fairly commonplace. A positional gun appears as a gun mounted to the cabinet on a swivel that allows for aiming. These are often confused with light guns but work quite differently. These guns may not be removed from the cabinet like the optical counterparts, which are tethered and stored in a mounted holster. They are typically more expensive initially but easier to maintain and repair. Games that use positional guns include the popular Terminator 2: Judgment Day (although, of course, the console ports used light guns).

A positional gun is essentially an analog stick that records the position of the gun to determine where the gun is aiming. The gun must be calibrated, which usually happens after powering up. Also, some games even have mounted optical guns (e.g., Exidy's Crossbow), perhaps to make them less attractive to potentially destructive youths.

History
Mechanical light guns existed before the emergence of electronic video games. The first mechanical light guns appeared in the 1930s, following the development of light-sensing vacuum tubes. It wasn't long before the technology began appearing in arcade shooting games.

Electro-mechanical era (1966-1972)
The earliest known mechanical gun game was the Seeburg Ray-O-Lite in 1936. Games using this toy rifle were mechanical, in which the rifle fired beams of light at targets wired with sensors. These games evolved throughout subsequent decades, culminating in electro-mechanical games such as Sega's Periscope  (the company's first successful game, released in 1966), which required the player to target cardboard ships. Periscope was the first arcade game to cost a quarter per play. Sega later produced gun games which resemble first-person light gun shooter video games, but were in fact electromechanical games that used rear image projection in a manner similar to the ancient Chinese zoetrope to produce moving animated targets on a screen that the light gun shoots at. The first of these games was Duck Hunt, which Sega released in 1969; it featured animated moving targets on a screen, printed out the player's score on a ticket, and had sound effects that were volume controllable. That same year, they released Missile, which featured electronic sound and a moving film strip to display targets on screen, with a gun that was controlled using a joystick. Sega's final electromechanical game (before moving onto video games) was the 1972 release Killer Shark, a light gun game that was known for its appearance in the 1975 Steven Spielberg film Jaws. Throughout the 1970s, mechanical arcade games were gradually replaced by electronic video games, following the release of Pong in 1972, with 1978's Space Invaders dealing a yet more powerful blow to the popularity of mechanical games.

Early video games (1972-1983)
Light guns used in electronic video games work in the opposite manner to their mechanical counterparts: the sensor is in the gun and pulling the trigger allows it to receive light from the on-screen targets. Computer light pens had been used for practical purposes at MIT in the early 1960s. Nintendo released an early solar-powered light gun, the Nintendo Beam Gun, in 1970; this was the first commercially available light-gun for home use, produced in partnership with Sharp. 

In 1972, the first commercially available video game console, the Magnavox Odyssey, had a light gun accessory. This was the first involvement of Nintendo in video games. According to video game historian Martin Picard: "in 1971, Nintendo had -- even before the marketing of the first home console in the United States -- an alliance with the American pioneer Magnavox to develop and produce optoelectronic guns for the Odyssey (released in 1972), since it was similar to what Nintendo was able to offer in the Japanese toy market in 1970s".

Nintendo released the Laser Clay Shooting System, which used solar-powered light guns, in 1973, followed in 1974 by the arcade game Wild Gunman, which used optical light guns and full-motion video projection from 16 mm film to display live-action gunslinger opponents on screen. Around the same time, Sega released the early co-operative arcade shooter video games Balloon Gun (1974) and Bullet Mark (1975), where the players use Tommy-inspired light guns to hit a variety of moving targets displayed on the monitor, with lower points given for slower targets such as balloons and tanks, and higher points for faster targets such as pirates and jets, while points are deducted for misses, which also varies depending on which targets are missed.

The first gun games controlled using positional guns, as opposed to light guns, also began appearing at around the same time in the 1970s. An early example was Sega's 1972 arcade game Sea Devil, an electromechanical game similar to Killer Shark but featuring a mounted positional gun, which shot at moving targets whose motions and reactions are displayed using back image projection onto a screen. Positional guns were later used in shooter video games, with an early example being Taito's co-operative shooter Attack in 1976, followed in 1977 by Taito's Cross Fire and Nintendo's Battle Shark.

Popularization (1984-1993)
Light guns first became popularly used for video games in the mid-1980s, with Nintendo's Duck Hunt being a much-loved example. It was followed by variations such as scrolling shooters that used positional guns, like Taito's Cycle Shooting (1986) and Operation Wolf (1987), and forward-scrolling rail shooter gun games, like Sega's Gangster Town (1987), a Light Phaser game for the Master System that featured forward-scrolling car chase sequences. Namco's StarBlade (1991) featured real-time 3D graphics.

Taito's Gun Buster (1992) was a unique first-person shooter gun game, using a joystick to move and positional gun to take aim. Lethal Enforcers was a 1992  Konami shooter released for arcades and consoles that featured in-game graphics consisting entirely of digitized photographs. This caused controversy as it allowed players to shoot photorealistic representations of enemies.

Golden Age (1994-1999)
Sega's Virtua Cop, released in arcades in 1994, broke new ground, popularized the use of 3D polygons in shooter games, and led to a renaissance in the popularity of arcade gun games. The game was influenced by the Clint Eastwood film Dirty Harry as well as a coffee advertisement in which a can of coffee grew larger in a gun's sights; in Virtua Cop the player had to shoot approaching targets as fast as possible. Other contributions of the game include position-dependent hit reactions and headshots, which would later have a major influence on first-person shooters such as GoldenEye 007 (1997), which incorporated Virtua Cop features such as a "gun that only holds 7 bullets and a reload button, lots of position dependant hit animations, innocents you shouldn’t kill, and an aiming mode."

The acclaimed Time Crisis by Namco, released in Japanese arcades in 1995 and Sony's PlayStation console in 1997, introduced innovations such as simulated recoil and a foot pedal which when pressed caused the protagonist to take cover, which would later have a major influence on third-person shooters. The game's light gun controller, the GunCon, was also acclaimed. Namco also released Point Blank for the PlayStation in 1998 (previously available in Japanese arcades as Gun Bullet since 1994), a 2D sprite-based game featuring a unique minigame structure and quirky, humorous tone. The game was critically acclaimed and received two sequels, both for the PlayStation console. Namco's Gunmen Wars for the Super System 22 GMEN arcade game system in 1998 featured true light gun based 3D third-person shooter gameplay, with the camera always positioned behind the player character. Its control scheme was also innovative, using a mounted, rotary, analog light gun, capable of both aiming the weapon and moving the character (including both strafing and rotation). 

Light guns were suppressed for a time in the U.S. after the 1999 Columbine High School massacre and its attendant controversy over video games and gun crime. Since the late 1980s light gun controllers have been generally manufactured to look like toys by painting them in bright colours. In Japan, which lacks the gun crime found in the U.S. and in which civilians cannot legally own guns, more realistic light guns are widely available.

Decline (2000-2009)
Light gun shooters are less popular in the new millennium than in the 1990s, with new games in the genre seen as "old school". The Time Crisis and House of the Dead franchises continued to receive acclaimed installments, with the arcade machine for the latter's         House of the Dead 4 Special (2006) featuring large screens enclosing the player, as well as swivelling, vibrating chairs. In 2000, the arcade light gun shooter Police 911 introduced a unique motion sensing control system, sensing body movement rather than requiring the player to move individual controls; the player's "real world" actions are reflected by the player character within the game. It also featured a unique cover system, where the player takes cover by physically ducking for cover rather than pressing a button.

Some games attempted to incorporate elements of first-person shooter or survival horror games through the use of less restricted character movement and exploration, with varying degrees of success. Examples of this approach include several Resident Evil survival horror light gun games, such as 2000's Resident Evil: Survivor which incorporates first-person shooter elements and 2003's Resident Evil: Dead Aim which incorporates third-person shooter elements, and 2007's Time Crisis 4 which features a first-person shooter mode played with the GunCon 3 peripheral, which uses two analog sticks for movement and camera control and the pointer for aiming. Others, however, unashamedly paid homage to 1990s arcade gameplay, even embracing a somewhat parodic style.

In 2007, the light gun shooter 2 Spicy introduced a unique cover system, where players use foot pedals to move from one destructible cover to the next. It also allows to players to face-off against each other using such a cover system.

Modern era (2010-present)
Light guns are not compatible with modern high-definition televisions, leading developers to experiment with hybrid controllers, particularly with the Wii Remote for the Nintendo Wii, as well as the PlayStation 3's GunCon 3 peripheral used with Time Crisis 4. Recent Light Gun games such as Time Crisis: Razing Storm, The Shoot and the upcoming House of the Dead Overkill are beginning to utilise the PlayStation Move motion control system. In 2012, Square Enix's Taito Type X3 arcade game Gunslinger Stratos is a third-person shooter with light gun controls, featuring two gun controllers that can be fired separately or combined together into a more powerful weapon. The game features hundreds of different guns which can be purchased using a point system and can save data using a NESiCA card. It is a multiplayer video game that can be played with up to 8 players offline or more players online.