|MadSci Network: Computer Science|
Hi Ambi! I don't know how old YOU are, but Duckhunt and Hogans alley weren't even an idea yet when I started playing computer/arcade games. OUR generation was brought up on "Pong" and "Space Invaders". So, considering your obvious irreverence for us "Senior Citizens", I feel compelled to answer your questions thusly - How do video game "guns" work? Answer: Quite well, thank you! and "Is my theory even close? Answer: It depends on how good your aim is! There. Now that I've gotten that off of my chest, I'll try to answer your question in a little more seriously. Basically, there are two types of "arcade" style games. Those that use an active matrix display, a specialized CRT, and those that don't. By active matrix, I'm referring to a CRT which has a matrix of photodiode 'areas' built into it behind the phosphor dots. So yes, you were pretty close in that respect. Each photodiode covers several pixels of the screen, to (1) reduce the manufacturing cost of the CRT, and (2) make it possible to hit the target. If it were done on a single pixel basis, your chances of making a hit would be very difficult indeed! When you fire the gun, a light beam, usually infrared, strikes the screen and, if the target happens to be in close proximity to where your beam strikes, you score a hit. The internal programming knows where each target is at any point in time, so your shot must arrive when that portion of the screen is active, or no hit is recorded. Additionally, the light beam is encoded, much like a remote control device for a television set. A particular digital code tells the program which 'fire' button you used - one code for a mortar round, another for a bazooka shot, etc. That also prevents you from cheating by using a laser pointer or infrared light emitting diode to fool the system. Most home type games, like Nintendo and computer games, must rely on a different method of determining the position of the shot fired at the screen. The reason is simple: Television sets and computer CRT's don't have any sensing devices (photodiodes) built into their screens. The solution is equally simple: the joystick or other controller mechanism, functions like a computer mouse. By moving it up/down or left/right, corresponding pulses are sent to the game program which moves the aiming point to a particular position on the screen; just like your cursor. The program 'maps' the position of each target on the screen and, if you fire your gun while the game has a target mapped to the same area of the screen as you have aimed, you score a hit! The same type of coded signal (or a seperate wire from each button on your joystick) tells the game which weapon you used. I hope this has helped you understand the principals behind gaming devices. While there are more sophisticated methods already being employed, they are highly specialized and very costly - definitely not for home use. Happy gaming, Ambi! Sincerely, Karl Kolbus - Your not-so-mad scientist.
Try the links in the MadSci Library for more information on Computer Science.