Build Your Own Arcade Controls Forum

Main => Monitor/Video Forum => Topic started by: Sarver Systems on December 27, 2013, 03:20:34 pm

Title: Can someone Barney-style lightguns for me?
Post by: Sarver Systems on December 27, 2013, 03:20:34 pm
Can someone be kind enough to explain to me how a lightgun works?

I've multiple Deet Hunter games, and multitude of other shooting games that are coming down the line for me to repair.

I'm just not sure how the game knows where the gun itself is pointing.
Title: Re: Can someone Barney-style lightguns for me?
Post by: bimm25e on December 27, 2013, 04:25:27 pm
there are 2 types - CRT based and sensor based


CRT based use a lens that greatly magnifies the image received by the sensor (the sensor is a kind of opposite LED, it emits electricity when it receives light)
The sensor operates very quickly and returns an x,y type position based on the timing that the gun's sensor is receiving the brightest input, a calculation is done based on timing/refresh rate to determine where you're pointing based on what "time" in the screen refersh cycle is receiving the brightest image.

Things that will make it go wonky are
bad electronics - everything is based on very precise timing (its funny to say this but "it might be the crystals")
glare on the screen that is brighter than the screen stself
dirty screen
dirty lens/no lens in the gun to focus the sensor
essentially anything that would interfere with the sensor not being able to "see" the screen clearly - keep in mind ultraviolet and infrared light are at play here as well, just because you cant see it doesn't mean the sensor doesn't




sensor based games (typically HDTV or SEGA lightgun games)  work like WiiMotes -

the gun is a digital camera and there are sensors around the screen.  The gun returns an x,y position based on where its pointing in relation to the screen - for an okay example of this ina ction watch : HMN - Wii Sensor Bar Candle Trick (http://www.youtube.com/watch?v=9pZ0sAVbn30#ws)
pay attention to the way the camera in the wii mote "tracks" the sensor bar on his TV screen.
Title: Re: Can someone Barney-style lightguns for me?
Post by: Sarver Systems on December 28, 2013, 12:47:04 am
So the gun picks up a bright spot on the screen? OK, so the game itself generates that bright spot at pregenerated random points? Or is the bright spot always in the same place?
Title: Re: Can someone Barney-style lightguns for me?
Post by: bimm25e on December 28, 2013, 08:43:53 pm
CRT's draw the on screen image one pixel at a time top to bottom left to right....really really quickly about 15,000 times a second approximately.


the "bright spot" is the pixel that's currently being drawn - the game uses synchronized timing to determine where you're pointing based on what "time" in the cycle the bright flash occurs. so pretend there are only 100 pixels being drawn on screen, 10X10,  so we'll say a cycle contains 100 "time positions"  if the sensor detects the brightest flash at 57/100 then the game does the math and figures you're pointing at the coordinates 5,7

 
Title: Re: Can someone Barney-style lightguns for me?
Post by: Slippyblade on December 28, 2013, 09:08:19 pm
Basically what he is saying is that the sensor in the gun can see exactly where the laser that is drawing the picture on the screen is at the time of trigger pull.  And based on that info, can calculate where you are pointing.  That is why old light guns don't work on LCD and such TV's.  No scanline for the sensor to detect.  Can't tell you how many times I had to explain that when I sold NES systems to people...  "Why won't Duck Hunt work?"...

As far as the Wii type guns he is mostly right except that there are no sensors on the screen.  What most folks THINK are sensors are actually infrared LED's.  You can see them lit up if you use the viewer on any digital camera.  The sensor in the gun sees the LED's and using triangulation based on the LED's, calculates where you are pointing.
Title: Re: Can someone Barney-style lightguns for me?
Post by: bimm25e on December 29, 2013, 08:19:37 am
haha yeah when I said "on the screen, I meant "sitting ON top of the screen...or ON the sides of the screen".  And yes, despite being called the "sensor bar" there is no sensor its merely infrared lights that the camera in the controller picks up - guess I didn't explain clearly enogh


oh and if you want to be frustrated at product design people - they made the wii motes sensor "blink" the light source it thinks is the sensor bar - this creates a ~100ms period where the game has no clue where you're pointing the remote... this is one of the reasons the wii mote can seem jittery because they designed it to NOT TRACK for a tenth of a second every couple seconds... really really lame product development.
Title: Re: Can someone Barney-style lightguns for me?
Post by: Slippyblade on December 29, 2013, 02:04:54 pm
When we first got our Wii we played around with the "sensor bar".  You can completely remove it from the equation.  We've played our Wii using a pair of candles set on top of the TV.  My older kid even went so far as to place a pair of highly polished Christmas tree ornaments on top of the TV and then aimed a floodlight at them so the reflected the light back.  Basically anything will work as long as the sensors in the remote can pick out a pair of lights that are significantly brighter than the ambient light.
Title: Re: Can someone Barney-style lightguns for me?
Post by: Sarver Systems on December 29, 2013, 02:38:46 pm
I totally get how the wii sensors work. It was the arcade ones that had me with a big ? over my head.

Thanks guys, I understand how those work now too.