If you’re a millennial like me, I’d be willing to bet that you have either played or at least seen/heard of the game Duck Hunt. It is a basic shooter video game that was extremely popular back in the day when video game graphics weren’t so advanced, back when people relied on Nintendo video games that were all 2D. If you still can’t imagine the game in your head, here’s a picture to refresh your memory:
When I first played that game, I couldn’t have been more than 10 years old. Back then, I remember being completely dumbfounded by the sheer brilliance of how the game worked – I could simply point the gun at the TV screen, press the trigger and bam! I could shoot objects on the game screen. It was awesome!
However, it took me many years to understand how the whole thing actually worked, i.e., how the video game figured out where exactly I was pointing the gun. That’s precisely what we’re going to discuss in this article.
Before that, however, for people who haven’t played or even heard of this amazing game, here’s a bit of background:
What is Duck Hunt?
Duck Hunt is a light gun shooter video game developed by Nintendo for the NES video game console. The most notable thing about the game is that it can only be played with the NES Zapper gun. Also known more simply as the light gun, it’s used to shoot ducks in the game.
The game is very simple. When it starts, a duck appears from the bushes and flies (within the boundary of the frame) for 3-4 seconds before going out of frame. What you need to do is point the light gun at the duck and shoot it before it disappears. The more ducks you shoot, the higher your score. Easy!
What makes the game interesting is that, unlike a controller, which feeds information to the Nintendo device ‘directly’ (i.e., you don’t need to point the controller in a certain direction for it work), in the case of this game, you have to actually point the gun at the correct spot on the TV screen in order to shoot the duck.
There must be a nifty piece of engineering involved that helps the game determine if the gun was (or wasn’t) pointed at the right spot when the trigger was pulled.
Now, let’s take a look at how the game actually works.
How Duck Hunt works
The original version of Duck Hunt, which was launched back in 1984 (yes, it’s that old!), was designed in such a way that it would only work on CRT (cathode ray tube) screens, but not on LCD (liquid crystal display) ones. The reason behind that is related to the way CRT televisions and the game work together.
A CRT screen has pixels that glow when electrons hit it. The cathode ray tube sprays a stream of electrons across these pixels, which make the TV screen glow. This spray sweeps progressively from top to bottom, in a left-to-right fashion. This happens so fast (around 100 times per second) that our eyes simply see a normal-looking image on the screen, thanks to the persistence of vision that humans are blessed with.
Fun fact: if you have a very high-speed camera, you can actually point it at a CRT screen and observe the pixels being lit up in a left-to-right fashion, line by line. In fact, that’s why CRT computer screens look so different in pictures that they do in real life. We have even explained that strange phenomenon in this article: Why Do Computer Screens Look Different In Pictures Than In Real Life?)
How does the game know exactly where you pointed the gun?
Coming back to Duck Hunt, the light gun used in the game consists of a trigger and a light sensor (a photodiode). When you pull the trigger, the entire screen goes black for 1 frame. The light sensor detects that blackness and records it as a reference point, i.e., it understands that “okay, this is black.” In the next frame, only the area around the duck (as in, the duck’s position on the TV screen) is lit up as a white square, while the rest of the screen remains black.
Take a look at the following image to visualize the whole process better:
In that split second, when there’s a small white box around the duck, if the gun detects a shift from black to white, i.e., it saw a white color instead of a black one (i.e., because it saw a completely black screen in the previous frame, the game would know that you aimed at the right spot on the screen. Voila! The game would then report that you made a successful shot!
On the other hand, if the photosensor in the gun didn’t detect a shift from black to white, the game would know that you didn’t aim correctly at the target, meaning that you missed the shot.
In a nutshell, the small light sensor present in the gun does all the trickery, and is a crucial component of the gadgetry that made Duck Hunt a truly remarkable game. It might look basic compared to games today, but plenty of millennials will argue that it is a masterpiece in its own right!