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 Try the site in https mode 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 35194 times)

0 Members and 1 Guest are viewing this topic.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 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: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • 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: 6882
  • Last login:March 26, 2024, 03:33:28 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: 19399
  • Last login:March 16, 2024, 05:59:16 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: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • 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: 6882
  • Last login:March 26, 2024, 03:33:28 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: 9226
  • Last login:March 25, 2024, 08:10:48 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: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • 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: 6882
  • Last login:March 26, 2024, 03:33:28 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.


ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
If a Mame game doesn't have in-game calibration, as long as Vjoy/Mouse plugin offset and axis is dialed in, should that mean the Mame game should play as if calibrated?  That would also mean in-game calibration is "extra" but not necessary?  These weren't showstoppers for me previously when M2/M3/Naomi emulators had solid in-game tuning.  Lethal Enforcers, to my surprise, just has a gun test but not a calibration mode.  Time Crisis 1 same thing.

Also: Carnevil is amazing.  Holy crap this game didn't make it to the States cause I don't remember it from back in the day.  Solid in-game calibration too.


edit:
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.


Re-read this part today and realized you answered this already.  Thanks.
« Last Edit: February 12, 2023, 11:14:29 pm by ZTylerDurden717 »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
If a Mame game doesn't have in-game calibration, as long as Vjoy/Mouse plugin offset and axis is dialed in, should that mean the Mame game should play as if calibrated? 

It will need to be played stretched widescreen.  You could also not stretch and set the offsets for the 4:3 image, but then widescreen games won't work.
This is the reason for the discussion earlier about changing offsets on the fly.  It is planned for a future update. (might already be an update, I haven't checked.)

I thought you had to be wrong about Lethal Enforcers not having calibration, but hell if I can find it.
Some of the older games have a DIP switch that needs turned on in MAME's in-game menu.
I thought it was just going to be the old Exidy games that lacked calibration.

As far as whether in-game calibration is necessary:

At the very least the "positional gun" games where the gun was mounted to the cab and used potentiometers (Terminator for example) will have to be calibrated.
There were no industry standards for analog controls, so different games had different pots, ranges of motion, digital steps, etc.
Trackball and spinner games need the sensitivity individually set for the same reason.  Different cabs had different step counts and gearing on the encoder wheels as does whatever device you are using with MAME.

For the true light gun games, it depends on how the input is handled in MAME.  Using a hacked version of MAME that allows fake mouse input should work fine for 1 player.  Using virtual joysticks will probably work fine on most games out of the box, but there could be outliers.  It is probably "good enough" while individually calibrating would be best practice.

Last time I had two guns fully integrated, it was a CRT screen and both guns (Act Labs) showed up as individual mice.
I've got a lot to learn setting them up as joysticks and using troubleshooter/demulshooter.

CarnEvil rocks!

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!

Last time I had two guns fully integrated, it was a CRT screen and both guns (Act Labs) showed up as individual mice.



I had an act labs gun as well.  It worked really dang well.  I thought I would keep it, but CRT's are way too burdensome when I've got LCD's everywhere around the house.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Btw guys I'm very much still in the mix on this one but I was in a car wreck last week and I'm still recovering.  No major injuries, but I cracked my sternum and the doc won't let me bend over or leift anything heavy.    Guess who has a 50" tv they want to use on this project in the floor of their living room.... :banghead: :banghead: :banghead:

Regardless I'm still working on the stuff I can work on.   I ordered another nyko perfect shot shell and I think I've got a plan of attack to convert those into using micro switches.  I'll probably do that tomorrow.   I'll also solder up my led harness, although I won't be able to really test until I can get that tv where it needs to go.  New mofsets and all the misc junk I'll need to build my guns are incoming.   Once I get the hardware built, I'll start a new thread and I'll start posting config files for each game as I add them.   I'll add quickie lightgun support to checkered flag/pac-fe.   I know most people won't want to use something so basic, but it'll give a proof-of-concept example.   

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Btw guys I'm very much still in the mix on this one but I was in a car wreck last week and I'm still recovering.  No major injuries, but I cracked my sternum and the doc won't let me bend over or leift anything heavy.

Dang dude that's wild.  Glad you pulled through.

Looks like 3 of us have nyko perfect shots. 


I tested 2 player Lichtknarre on a 65 inch using the gun4ir vendor's IR LED wire harness.  They push enough light and work great from 8 feet away, and probably more.  I'm gonna assume the aliexpress ones will do the job too, especially their 15 light cluster variant.


Only thing is the distance of the Wiimote's IR blaster view.  You gotta use a wide angle or fish eye lens to play closer to the TV.  Otherwise, expect about 8 feet back for the tracking to remain stable for a display that size when hitting the corners.  From what I understand, wide angle and fish eye lenses are still being programmed for better precision to adjust for lens distortion.  My experience was still pretty solid, and best played when centered with the TV while the software gets optimized to play from other parts of where you may be sitting.

Dolphin, MAME and M3 played like champs after some initial setup.  PCSX2 (Time Crisis II) 2 player  is a no go at the moment since vjoy doesn't work with the nuvee plugin's mouse tracking.  Just a matter of time though before more plugins are added.

So cost breakdown for someone starting:
$20 - 2 Wiimotes
$10 - IR Harness
$20 - 2 Nyko Perfect Shots

$50 USD. For a 4 point light gun system. Hell of a party trick.

I lent it to my buddy and he hasn't stopped playing the past 2-3 days. 

« Last Edit: February 13, 2023, 06:25:30 pm by ZTylerDurden717 »

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
If anyone is looking for an awesome light gun front end, I highly encourage checking into SimpleTouchFE.

I played with it a bit many years ago, and it sprang to mind as being a perfect FE for this type of application.  I wasn't wrong.  There's even a light gun skin for 1080p displays available on the site now.  The only thing which gave me pause is that my virus checker kept flagging the download for malware. I assume this has something to do with the keyboard and mouse hooking features and it's a false positive, but that's for you to decide.  I fed it into VirusTotal and it was only flagged by a few of the checkers.  I'm also running it on an isolated and dedicated system, so I took the chance.  The latest version w/o Flash support seems to be working fine under Win10 and doesn't seem to interfere with the Lichtknarre software at all.

*edit* I should have given the caveat here that if the gun is using the vJoy plugin, you'll need a mouse to select the game.  While this doesn't bother me, as my favorites are happy to use the gun with the mouse plugin, you can get around this issue with some creative batch files/scripts, INI swapping, etc.  The FE has the ability to run setup code before launching the main executable in order to facilitate such things.
« Last Edit: February 15, 2023, 05:32:01 pm by RandyT »

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Randy,

What's the verdict on your V2 offset tool?  It looks useful.  Did it work for you too?  Values accepted in millimeters?  If I can leave offsets at 0 that'll make this more streamlined when I demo at friends places.

PS full screening everything.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
What's the verdict on your V2 offset tool?  It looks useful.  Did it work for you too?  Values accepted in millimeters?  If I can leave offsets at 0 that'll make this more streamlined when I demo at friends places.

PS full screening everything.

It's not really an "offset" tool.  It's more of a "IR LED Positioning" tool, made in the hopes of providing a visual reference for getting the LEDs positioned at the correct ratios, when the LEDs aren't able to be positioned at the exact screen edges.  My "verdict" is that it is useful in that circumstance.  I can't say much beyond that.  I used it on two different monitors, and both of them resulted in the calibration wizard requirements being easy to satisfy.  I've also not found the need to move the LEDs to a location different from where I placed them as a result of using the tool as a guide.

I think you will always need to tweak the IR offset numbers, as these numbers represent the distance between the edges of the addressable screen area and the center of the IR LED/cluster.  The only time this would theoretically not be necessary is if those centers are directly on that edge, and in that case, you wouldn't need to use any guides not already provided by the Lichtknarre software.

But to answer your question, yes, you can take your measurements using mm's, or any unit of measure, so long as you use the same unit for all measurements :)

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Understood.  Thanks a lot.

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Has anyone gotten Model 2 emulator's coin and start mapped to the wiimote using the vjoy plugin?  Trigger fire and reload work fine when mapped in demulshooter so it's totally playable.  However, the model 2 GUI controls config won't recognize my button presses when trying to map coin and start to my wiimote.

Input looks like this.  It's copied from some guy who demo'ed lichtknarre working with vjoy on youtube:

XInput=1         ;Enable support for Xbox360 compatible devices
EnableFF=0         ;Enable Force Feedback Effects
HoldGears=0         ;Set to 1 to return to Neutral in driving games when the gear shift key is released
UseRawInput=0         ;Read mouse through Rawinput, allowing 2 mice
RawDevP1=0         ;Assign specific RawInput devices to players. If you have more than 2 mice
RawDevP2=1         ;set which one is assigned to each player (0-based)



BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Try disabling xinput.  Pretty sure vjoy uses dinput.

I'm using a keyboard encoder for coin and start, so didn't try using the buttons on the gun.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
Also make sure you've enabled the buttons in vjoy.

Edit: This is also where Howard's Troubleshooter 2 or Demulshooter software comes in, but I haven't messed with it in a long, long time.

« Last Edit: February 17, 2023, 05:00:06 pm by BadMouth »

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Just posting this in hopes of saving someone else some headaches.

I'm not sure how many already know this, but the latest dev builds of PCSX2 have native GunCon2 support built-in and mouse emulation (single player only.)  Unfortunately, it doesn't work with Lichtknarre "out-of-the-box."  In it's default configuration, just running it will stomp all over Lichtknarre, even going as far as making the connected remote no longer visible in the test tab of the Lichtknarre software.

After a couple of hours messing with it, I realized that the SDL input driver, which is enabled by default, seems to have some built-in BT functionality to support DS3 controllers.  This creates a conflict with Lictknarre. But at least on my system, trying to disable SDL through the menus causes a hard crash, requiring task manager and/or a reboot to recover. 

Solution: Before running PCSX2, go into the configuration file (I believe it's located in a folder called "inis") and do a search for "SDL" in the inputs section.  It's set to "True" by default.  Change this to "False" and make sure directinput is set to "True".  Then save the file.  After doing this, it no longer walks over Lichtknarre.  The emulator also has great support for the current output methods used by Lichtknarre, so all of the remotes buttons even work properly in mouse mode.

This emulator works so well that I finally feel like I can stop beating on my old PS2 and it's optical drive, which I'm sure must be on the edge of collapse. :)
 

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Just posting this in hopes of saving someone else some headaches.

I'm not sure how many already know this, but the latest dev builds of PCSX2 have native GunCon2 support built-in and mouse emulation (single player only.)  Unfortunately, it doesn't work with Lichtknarre "out-of-the-box."  In it's default configuration, just running it will stomp all over Lichtknarre, even going as far as making the connected remote no longer visible in the test tab of the Lichtknarre software.

After a couple of hours messing with it, I realized that the SDL input driver, which is enabled by default, seems to have some built-in BT functionality to support DS3 controllers.  This creates a conflict with Lictknarre. But at least on my system, trying to disable SDL through the menus causes a hard crash, requiring task manager and/or a reboot to recover. 

Solution: Before running PCSX2, go into the configuration file (I believe it's located in a folder called "inis") and do a search for "SDL" in the inputs section.  It's set to "True" by default.  Change this to "False" and make sure directinput is set to "True".  Then save the file.  After doing this, it no longer walks over Lichtknarre.  The emulator also has great support for the current output methods used by Lichtknarre, so all of the remotes buttons even work properly in mouse mode.

This emulator works so well that I finally feel like I can stop beating on my old PS2 and it's optical drive, which I'm sure must be on the edge of collapse. :)

Excellent, that'll probably save me time when I get around to it.  Have you played Resident Evil: Dead Aim?  It's an absolute gem for light guns

By the sounds of it, I don't have to use the nuvee plugin anymore with native guncon2 support included in the latest builds.
« Last Edit: February 21, 2023, 12:52:59 pm by ZTylerDurden717 »

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
[Deleting comment]
« Last Edit: February 22, 2023, 01:49:55 pm by ZTylerDurden717 »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
So I'm finally back to near 100% and lots of parts came in from Chinese ebay, so I'm resuming work this weekend.   My new mosfet modules came in and they appear to work just fine.   Also the 7.5v power pack I have left over from the uzi shell seems to power the solenoid I picked out for the pistols just fine.  I'll wire one up this weekend, charge the cell and do some testing to see how they fair with the average game.   My guess is the charge will be adequate for pistol games but not so much for analog stick gun games where the recoil is constantly firing.   I bought a cheap buck converter to put in one of the guns to see how viable running the wiimote off the same 7.5v pack will be.

The solenoids for the machine guns came in and damn I hope I can hold these things.  They are almost as big as a wiimote and fairly heavy.  It'll be a challenge getting them in there along with a wiimote pcb.  I ordered black wiimotes as I'll be painting the nkyo pistols black and one of the sellers sent me a wiimote clone instead of the real deal.   It's one of those clones that look 100% identical except for the lack of a "wii" logo at the bottom.   The good news is, unlike the nyko wands they connect and work just like the real deal.  Black wiimotes are getting surprisingly hard to find at a good price, so that might save you some money.

Once I get what I feel is an easy to build hardware prototype built I'll start a new thread to keep from cluttering this one.   

One thing of note.  I was having problems getting the wiimotes to reconnect once powered off and assumed it was lichtknarre but apparently it was due to an interaction between it and mamehooker.   I hook the hid handles of the wiimotes to send them rumble data and while that works just fine if lichtknarre hooks the wiimotes first, it'll block lichtknarre from re-establishing a connection to a wiimote if those handles are still hooked.   The solution is fairly easy, I just close the handles after a game shuts down, but it will require a new version of mamehooker to be released to fix.   Of course a workaround right now would be to close mamehooker via a command line call prior to re-connecting and then launch it again afterwards.   

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Went over my buddies to test out some shooting on his 65".  Used the nunchuck for reload and threw some random mp3 to drown out the banter.   Don't mind the 60% accuracy I wasn't focusing before he hit record  ;D

Can't get over this damn software.


RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Can't get over this damn software.

Now that I have things tuned in, I'm still amazed.  I think the highest I achieved for accuracy on the first part of VC1 was 99%.  Then I figured out that just hit accuracy isn't the best way to get points.   But still, it's a great test of the system.

If you really want a grueling test, fire up some "Sport Shooting USA".  I think I'm addicted.  :lol

I think my biggest problem right now isn't related to the software.  The trigger-pull on the stock Nyko "Perfect Shot" is killing me, but I'll have that sorted shortly ;).

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Go to lowes/walmart/where ever and get some 6/32 x 1" machine screws. (Maybe 1/32 smaller but I like it nice and tight to avoid slop).  Using one of the nuts as a spacer you can get a standard arcade switch centered behind the blue pull rod.  Take off the grips and just drill holes and mount the switch with the screws. Then either remove the b trigger on the wiimote or cut off the little fin shaped tab at the end of the pull rod to keep the rod from catching on the wiimote so it only stops when hitting the switch.   A little soldering and you are done.  You may have to cut one of the supports but half of those are redundant anyway.

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Go to lowes/walmart/where ever and get some 6/32 x 1" machine screws. (Maybe 1/32 smaller but I like it nice and tight to avoid slop).  Using one of the nuts as a spacer you can get a standard arcade switch centered behind the blue pull rod.  Take off the grips and just drill holes and mount the switch with the screws. Then either remove the b trigger on the wiimote or cut off the little fin shaped tab at the end of the pull rod to keep the rod from catching on the wiimote so it only stops when hitting the switch.   A little soldering and you are done.  You may have to cut one of the supports but half of those are redundant anyway.

Practical. Definitely wanna see this in action.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
I appreciate the tips, but I've already done the problem-solving steps.  What works great is a mini-microswitch with a long-ish lever.  If you bend the lever at a hard 90 a little less than halfway along the length of the switch body and then bend the end of the lever downward with a bit of a rounded profile, it places the switch in the open area in the top rear of the shell and the curved end of the lever contacts the back part of the bar.  At that point, the screws and nuts for spacers to mount is a good approach, or even a pile of hot melt if one is lazy.

I also think the best way to handle the trigger bar is to just cut off any part of it which isn't necessary.  Silicone grease helps a LOT in that channel, but just getting rid of anything which can add friction solves it permanently.  The goal, for those who haven't guessed it, is to actuate the switch well before the trigger bottoms out, to prevent the actuation from pulling the front of the gun off-target....which is what happens too often with these types of shells.

The reason I haven't completed the mods on this one, is because I am working on 2 other shell candidates at the same time, one of which may end up being a better general-purpose solution.  So that one is getting the attention at the moment, while I playtest with the other Nyko I haven't torn apart yet :).

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:March 07, 2024, 10:26:15 am
  • sup dudes?
Hi new version is now available with following features:

version: 0.9.10.15
download: https://geekonarium.de/en/lichtknarre-lightgun/

- commandline with interprocess communication: https://geekonarium.de/en/common-informations-about-lichtknarre/
- show scrollbars+fullscreen : for small monitor resolutions the user is now able to resize the window and have scrollbars. (not on this screenshot)
- Hold home button for 5 sek to switch connector plugin. its configurable:



No one had time to test so i put it online blind :D Please call me back if someone find a bug or something. I will add bug reporting possibility somewhere soon.

Here a list of actual commands:

Code: [Select]
Lichtknarre - help
##################

You can use Lichtknarre.exe even if it is already running and executed.
Thanks to the IPC communication the commands are always sent to the main
process. But only 1 command can be executed every 5 seconds.

 Keep the numerical limits of the commands otherwise this could lead to crashes.
If you have misconfigured reinstall the application or delete all ini files from
the folder.
# List of all commands from the Lichtknarre main program:

set connectorplugin {player index} {connector plug identifier}
  Explaination: set connector plugin for player
  Example: Lichtknarre.exe --set connectorplugin 1 mouseConnector
  Possible connector plugin identifiers: vJoy2Connector, mouseConnector
  playerindex begins at 1
  You can only edit players which are available in the tool.

# List of all commands from all Connector Plugins:

mouseConnector adjustAxisForPlayer {playerIndex} {adjustX} {adjustY}
     Explaination: Set adjust X,Y for player.
     Example: Lichtknarre.exe --mouseConnector adjustAxisForPlayer 1 -1.3 2.5
     playerindex begins at 1
     You can only edit players which are available in the tool.
     Floating values are with dot format. Maximal value:200 Minimal value:200

vjoyConnector adjustAxisForPlayer {playerIndex} {adjustX} {adjustY}
     Explaination: Set adjust X,Y for player.
     Example: Lichtknarre.exe --vjoyConnector adjustAxisForPlayer 1 -1.3 2.5
     playerindex begins at 1
     You can only edit players which are available in the tool.
     Floating values are with dot format. Maximal value:200 Minimal value:200

# List of all commands from all Tracker Plugins:

wii4LEDTracker set defaultIrGameOffset {Left Offset} {Right Offset} {Top Offset} {Bottom Offset}
     Explaination: set default IR game offset for Wii 4 LED tracking system
     Example: Lichtknarre.exe --wii4LEDTracker set defaultIrGameOffset 1.2 1.5 2.3 1.2
     Floating values are with dot format. Maximal value:40 Minimal value:-40

wii2LEDTracker set defaultIrGameOffset {Left Offset} {Right Offset} {Top Offset} {Bottom Offset}
     Explaination: set default IR game offset for Wii 2 LED tracking system
     Example: Lichtknarre.exe --wii2LEDTracker set defaultIrGameOffset 1.2 1.5 2.3 1.2
     Floating values are with dot format. Maximal value:120 Minimal value:-20

this will grow in future.
« Last Edit: March 27, 2023, 04:45:00 am by Fusselkroete »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9226
  • Last login:March 25, 2024, 08:10:48 pm
  • ...
 :applaud:

I was afraid you had stopped working on it.

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:March 07, 2024, 10:26:15 am
  • sup dudes?
Does someone know a good tool/script to run a programm as admin without UAC admin prompt? nirsoft tool or something? I want suggest this for cab users on the website :) Maybe someone has cool technique already.
« Last Edit: March 27, 2023, 05:12:37 am by Fusselkroete »

lilshawn

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7377
  • Last login:Today at 04:40:51 pm
  • I break stuff...then fix it...sometimes
dude, just disable UAC. it's dumb and pointless on a game machine. just slide that mother all the way to the bottom and forget about it.

right click the program and go in to the properties, and then the compatibility tab...click run as administrator.

FUGGEDABOUTIT

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:March 07, 2024, 10:26:15 am
  • sup dudes?
It seems that Dolphin 5 has problems to work together with Lichtknarre. Both tools try to get the handle from the wiiremote, when connecting by holding 1 and 2. Someone would have to tell Dolphin as an issue on github that they should turn off the BT functionality completely when all functionalities to record real Wiiremote are turned off. Otherwise this leads to incompatibilities.
Another idea I would have is to write a tool with C# that hooks into the target program and blocks blutooth.

Or maybe someone can recommend a tool for this job? To block BT for certain tools?

But Dolphin 4 works very well.
« Last Edit: April 01, 2023, 03:47:14 am by Fusselkroete »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Since your program uses vjoy to make a virtual joystick anyway, the obvious choice would be to just disable wiimotes in dolphin completely and then map the virtual joystick manually.   I can confirm that it's possible to write (NOT READ) to the wiimote from other programs while yours has the wiimotes hooked so rumble and led control would still be doable.  I can post some samples of code if you guys think it'd be helpful.   

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 38
  • Last login:March 07, 2024, 10:26:15 am
  • sup dudes?
Since your program uses vjoy to make a virtual joystick anyway, the obvious choice would be to just disable wiimotes in dolphin completely and then map the virtual joystick manually.   I can confirm that it's possible to write (NOT READ) to the wiimote from other programs while yours has the wiimotes hooked so rumble and led control would still be doable.  I can post some samples of code if you guys think it'd be helpful.

That's exactly what I did. Everything disabled for real wii remotes. No scanning etc. Still I could not connect the wiimote to Lichtknarre by holding the 1 and 2 buttons, as long as Dolphin was still open. Maybe very rarely it worked. When I closed dolphin it worked wonderfully again. Closing Dolphin is no solution. For example, if someone needs to replace the battery in the middle of the game, then they have to restart Dolphin.

But I think this BT blocker tool could help. This needs to be developed. With other emulators that support real WiiRemotes the same could happen. The tool is then hooked into the running emulator in the case Dolphin and the functions for BT are overwritten. I hope that Dolphin then no longer tries to connect to the Wii, because Dolphin is not informed about the devices. hope it works.

What code do you have there?

« Last Edit: April 01, 2023, 04:56:35 am by Fusselkroete »

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 6882
  • Last login:March 26, 2024, 03:33:28 pm
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Thanks for hanging in there with the updates!  Especially the scrollable windows interface for those of us with lower res CRTs :)

Closing Dolphin is no solution. For example, if someone needs to replace the battery in the middle of the game, then they have to restart Dolphin.

While it would be nice for the authors to fix it, or find a workaround, I don't think it's a huge issue so long as the user is aware of it happening with that one version.  I'm not sure if it can do it, but most emulators allow for a game progress snapshot, so if batteries need to be changed, it's just a matter of saving the game and rebooting with the fresh batteries. If one is using a gun with an internal battery, they'd be done playing for a few hours anyway :).

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
Does anyone know if PCSX2's latest SDL RAW Input would allow for 2 players via vjoy with lichtknarre?  I don't think so, but looking for confirmation.

ZTylerDurden717

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 188
  • Last login:January 07, 2024, 12:52:28 pm
  • I want to build my own arcade controls!
One thing I wanted to mention that I find fascinating is that Lichtknarre is probably the only solution for line-of-sight 2 player for Wii games that don't support in-game calibration.  These games don't natively feature in-game calibration so you're s*** out of luck aiming without crosshairs unless you mess around with the emulator's ini on a per-game basis.  Fortunately, the good folks working on the Sinden LG wiki provide the calibration ini for those games that Lichtknarre can leverage for 2 player.  Sinden can utilize them too obviously--but limited to one player!  An indirect gift, no doubt.

I highly recommend Resident Evil Darkside Chronicles as an example.  It's an awful light gun game at stock settings but with crosshairs removed and a rapid fire hack enabled, it's a ---smurfing--- blast.
« Last Edit: April 03, 2023, 08:47:12 pm by ZTylerDurden717 »