Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Lichtknarre: Unmodified Wii remote as a sight accurate Lightgun using 2/4 LEDs  (Read 8747 times)

0 Members and 2 Guests are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19376
  • Last login:Today at 08:11:19 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Well I figure that even if this doesn't pan out the way I want it I can always convert them to jaybee/gun4ir guns cheaply.   I'm bound and determined to finally get a nice lightgun solution even if I have to code it myself.  I'm making my harness tonight and yeah I can throw a resistor on there just for good measure.   

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 151
  • Last login:Yesterday at 09:08:22 am
  • I want to build my own arcade controls!
What's your step by step to calibrate offset?  I feel like I'm going in a loop changing values and not understanding the precision movements.  I just know the aim isn't perfect and I'm assuming offset fine tuning is the solution.

My bezels are all exactly the same size.  Does that mean all offset values should theoretically be the same? I need some kind of method to follow.
« Last Edit: January 28, 2023, 01:26:50 pm by ZTylerDurden717 »

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6744
  • Last login:Today at 01:23:16 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
What's your step by step to calibrate offset?  I feel like I'm going in a loop changing values and not understanding the precision movements.  I just know the aim isn't perfect and I'm assuming offset fine tuning is the solution.

My bezels are all exactly the same size.  Does that mean all offset values should theoretically be the same? I need some kind of method to follow.

Left and right are usually pretty close to the same, but top and bottom may vary a bit.  The way I did it was to use the mouse plugin and cursor as a reference, get into the rough area where you will be using the gun and aim at the edges of the screen, one axis at a time.  Then note the difference between your aim and the mouse cursor point.  From there, it's just a matter of adjusting the IR offsets until all sides line up at the edges when you aim at them.  You will likely need to "shift" your offsets one way or another to balance the differences.  I.e. if the difference between each side is roughly the same and in the same direction, add or subtract the same amount from each side to get things centered and tweak some more after this if necessary.

It's a little fiddly in the beginning, but so long as nothing moves (LED, screen positions) you will only need to do it once.  So it pays to get it as close as possible in the beginning, before you start to calibrate within  individual games/apps.  Consider the LED offsets to be the foundation upon which everything you do thereafter is built.  Sadly, there will be some titles for which it seems impossible to get good linearity, and this is most likely due to the difference in resolution and/or aspect ratio.  Currently, there is no automated way to deal with that situation, so to play those games well, it will require fiddling with the IR offsets, as this appears to define your linearity.  So it's a good idea to write down the values before tweaking them for a specific title you want to play.  For others, with little to no decent calibration routines built-in, you can use the plug-in offset sliders,  These work well for vJoy and MAME, where the linearity is usually acceptable, but the cursor doesn't line up perfectly with your aim.

At some point, Fusselkroete will likely have some app sensing and automatic profile selection built-into the software to automate a lot of this.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19376
  • Last login:Today at 08:11:19 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
I mean I was working on this prior to my current job and the 4:3/16:9 issue should be solvable with simple math.   If you have a 16:9 screen and have calibrated it then a 4:3 game would be the same bounds with a shorter x axis.   If you have a 4:3 monitor and want to play 16:9 (I guess it could happen.) it'd be the same deal only with a shorter y axis instead of x.   I had planned to have the 4:3/16:9 modes switchable via the d-pad.   

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 151
  • Last login:Yesterday at 09:08:22 am
  • I want to build my own arcade controls!

Left and right are usually pretty close to the same, but top and bottom may vary a bit.  The way I did it was to use the mouse plugin and cursor as a reference, get into the rough area where you will be using the gun and aim at the edges of the screen, one axis at a time.  Then note the difference between your aim and the mouse cursor point.  From there, it's just a matter of adjusting the IR offsets until all sides line up at the edges when you aim at them.  You will likely need to "shift" your offsets one way or another to balance the differences.  I.e. if the difference between each side is roughly the same and in the same direction, add or subtract the same amount from each side to get things centered and tweak some more after this if necessary.


Thanks! So let's say I'm aiming at the top of my monitor edge and my mouse is incorrectly appearing under my sights.  Am I adjusting the "top" offset in lichtknarre to -2 or 2 (assuming 2/-2 is the magic number).

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6744
  • Last login:Today at 01:23:16 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Thanks! So let's say I'm aiming at the top of my monitor edge and my mouse is incorrectly appearing under my sights.  Am I adjusting the "top" offset in lichtknarre to -2 or 2 (assuming 2/-2 is the magic number).

I guess the best way to put it is "don't overthink it too much."  When clicking on the up or down buttons next to the input fields, the cursor will move slightly.  If it moves in the direction you want, keep clicking it.  But yes, if you are looking at the top edge through your sights, then you want to be adjusting the "top" offset.   

This isn't necessary info for setting things up, but I've tried to analyze what each part of the software does.  I've come to the conclusion that the IR offsets are basically giving the software the start and end points for each axis.  It then should follow that it divides the total distance into equidistant chunks of space which are subsequently considered, taking the screen resolution into account, when mapping the cursor position.  This provides information for proper linearity and position extrapolation.  Assuming that this is true, it's important to make sure that the offset is correct to the edge of the screens addressable space (i.e. the real estate upon which things are actually being displayed and not, say, an overscan border on a CRT, as this is non-addressable space which is not part of the screens resolution.)  If this step is done poorly, there will be not only deviation from the sights, but that deviation will be non-linear as the cursor is moved across the screen.  Ideally, and it may not be 100% possible if your LEDs are positioned badly, you want that mouse cursor point to stay relatively consistent across the screen.  Without the smoothing mode active, some very minor jitter and deviation is to be expected and won't affect your gameplay to any great extent, as the hit boxes are usually large enough not to require perfection.

The other sliders next to the input plugin space are straight-up linear offsets for dealing with games which don't have decent calibration functions.  But they can't fix a poorly set-up IR arrangement or calibration thereof.

It should also be noted that in-game calibration sometimes needs to be "fooled" into lining things up correctly.  This is usually accomplished by not aiming directly at the calibration targets, but offset in the direction needed to compensate. It can take a few tries to get things good enough, but again, it only needs to be done once for each game as this data is saved so that the next run works just like you had it set up previously.

I've only run into a couple of instances (so far) which would benefit from being able to tweak those IR offsets on a per-game basis.  But YMMV, based on the type of monitor and the titles you want to play.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9107
  • Last login:Today at 07:45:32 pm
  • ...
What's your step by step to calibrate offset?  I feel like I'm going in a loop changing values and not understanding the precision movements.  I just know the aim isn't perfect and I'm assuming offset fine tuning is the solution.

My bezels are all exactly the same size.  Does that mean all offset values should theoretically be the same? I need some kind of method to follow.

The instructions for the software do state that games need to be ran fullscreen.  It should work, but the bezels are throwing a wrench in the works.
Also be sure to familiarize yourself with MAME's analog options unless you are running a hacked version of MAME to use them as mice instead of joysticks.  Minimize the deadzone (default is 30%!), increase saturation to 1 (100%), increase sensitivity until the crosshairs don't lag, & calibrate in the game's original service menu.  The service menu calibration can correct for a lot and is available on all but the very old (mostly Exidy) games.

Technically, offset should be how far (in mm) the center of the LEDs are from the edge of the screen.  In theory, that should be your starting point.

In practice though, at least in my case, it is correcting for some oddball behavior in my guns.  They both read centered when they are slightly right of center.

I could be wrong, but here is how I believe it works....
Everything is based on ratios (as it has to be to work on various size monitors).  The software assumes 74% of of the distance between the top and bottom LEDs is above the side LEDs and 26% is below the side LEDs.  When you change the offset of the top LED (changing the location of the top LED as far as the software is concerned), the distance between the top and bottom LEDs have increased.  26% of this larger distance results in the bottom LED shifting a bit as well.  Hence the back and forth until it is dialed in.

I just spent a long time going back and forth, but I always ended up with pretty much the same number on each direction only one was negative and the opposite was positive.
If doing it again, I'd change both simultaneously increasing one and decreasing the other instead of stepping back and forth.
That's what would work for my guns anyway. 

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 151
  • Last login:Yesterday at 09:08:22 am
  • I want to build my own arcade controls!
Thanks!

It ended up being Top: 0 Right: 3.0 Bottom: 8.0 Left: 2.0

No negatives? Whatever, it works.  Haven't tested on the big screen yet but so far on my 24" monitor it's great.

Just doing Wii emulator for now because of its ease with 2 player.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6744
  • Last login:Today at 01:23:16 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Technically, offset should be how far (in mm) the center of the LEDs are from the edge of the screen.  In theory, that should be your starting point.

In practice though, at least in my case, it is correcting for some oddball behavior in my guns.  They both read centered when they are slightly right of center.

I'm not convinced that's the case.   Mine are a good 2 inches away, and the numbers don't reflect this distance in mm.  To me, it seems more like a percentage of the total which is "dead space".  This would make sense, as the software has no idea what the actual physical size of the screen might be.  So, it makes sense that it would need to use relative units, or percentages, for everything.

Also, at least in MAME with vJoy, I think I am seeing the same thing as you, with the cursor being offset a bit to the left of the sights for some reason.  I use the sliders for the vJoy plugin to correct for this.  It sounds like this might be some sort of issue with the interactions of MAME and/or vJoy, as I don't see this with the mouse plugin.