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 63965 times)

0 Members and 1 Guest are viewing this topic.

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Was making some edits when you posted, hope its useful as i'm in a rush  :-[

The PCSX2 one is very similar, might try and do that later :)

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
No hury dude :D Take your time. Make your edits and ping me :D

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Think that's about right :)

I use Launchbox/Bigbox to unzip Playstation roms which is handy as Duckstation doesn't like zipped files.

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
A rough guide to setup pcsx2 (i used pcsx2-v2.3.39) for the Lichtknarre software :)

Like i mentioned a few posts back this and Duckstation are very similar so read carefully.

Download and install pcsx2 to the location of choice (mine is - G:/Launcbox/Emulators/Playstation 2 LIGHTGUN, before running it create a blank text file called portable.ini and place that in the root folder of pcsx2, what this does is make it portable and any files that pcsx2 creates will be in the same folder and not in Documents, makes it much easy to move about AND in my case I've created 2 installs of pcsx2, one just for Lightgun games and one for normal controller ones, for me it just makes it quicker and easier than trying to mess about getting all the controllers to work together, Oh Don't forgot the Bios files ;)

Run pcsx2 so it creates the files it needs, exit then run Lichtknarre with the Vigem Plugin, connect your wiimote as you normally would, leave that running then start pcsx2 ->

pcsx2 -> settings -> Controllers

In the new window change the settings to the ones in the attached pictures (Don't know how to get the attachments inline in this forum  :-[)

Like i said in a previous post i had trouble setting up the relative aiming with the Wiimote so manually edited the PCSX2.ini file which is found in the inis folder which is located in the root folder of pcsx2, make sure pcsx2 is shutdown then open the file, scroll down to [USB1] and change the relative positions to these, your DInput might be a different number to mine so change accordingly.

guncon2_RelativeLeft = DInput-1/-Axis0
guncon2_RelativeRight = DInput-1/+Axis0
guncon2_RelativeDown = DInput-1/+Axis1
guncon2_RelativeUp = DInput-1/-Axis1

Save the file then restart pcsx2, of course your controllers maybe in a different order but once set up correctly you should now be able to play Lightgun games with your Wiimote and Lichtknarre  ;D

You can change how you like your buttons, i've since added the Time Crisis proof of concept pedal i made months ago, plugged it into a test joystick with a zero delay encoder (shows as DInput-2: Generic usb stick) it works a treat :)

**edit i added the same cursors from Duckstation, setup is the same, just didn't take a screenshot**

Hope the above makes some kinda sense :)

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
Nice Tutorials (i had no time to test)... and now go for RetroArch :cheers:
« Last Edit: December 06, 2024, 01:45:01 pm by Fusselkroete »

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Thanks  :)

Will leave Retroarch for a while :o  instead i got model 3 working by using the awesome guide from the Launchbox forum - https://forums.launchbox-app.com/files/file/3857-sega-model-3-supermodel-git-everything-pre-configured-inc-controls-for-pc-controller-mouse-light-guns-test-menus-configured-free-play-all-games-in-english-2-player-mouse-support-audio-adjusted-layout-imagesthe-whole-9-yards/

Great respect to Warped Polygon for all the man hours they put into sorting it all out  :notworthy:  :notworthy:  :notworthy:

Used the DInput config then all i did was swap round the trigger and A for the Wiimote on the gun games then changed the Gas and Brake as they were set to the right stick on my Xbox 360 controller.

The Wiimote does come up as gun/player 2 but i can live with that for now, should be easy enough to swap round :)

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
LK is work in Progress.
Sooner or later there will be configurationprofiles and other stuff :)

BTW BigBen WiiGun Lens Adapter:  https://www.thingiverse.com/thing:6856444
« Last Edit: December 06, 2024, 04:03:33 pm by Fusselkroete »

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
forgot to add, Model3 crosshair isn't that smooth when using the wiimote as it is in other emulators, guess it's just how the emulator registers the joystick as a light gun, have yet to switch to mouse API but assume it would be smoother.

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
More interesting Stuff:

3D Lightgun print: https://makerworld.com/de/models/867328

A fork of pcsx2 for lightguns: https://github.com/nixxou/pcsx2

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7005
  • Last login:January 17, 2025, 10:20:04 am
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
3D Lightgun print: https://makerworld.com/de/models/867328

I often see these 3D printed items incorporating a lens and have to wonder if the designers took the time to disassemble their Wiimote (and re-assemble it) to find the exact center of the camera lens.  If they didn't, it's probably wrong and it will likely affect sight accuracy without very good software correction.  Hint:  it's not centered in the window :)
« Last Edit: December 10, 2024, 12:47:12 pm by RandyT »

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
hi dude :D

i tryed several wii motes with this guncase. seems to work the same for every wiimote.

https://forum.arcadecontrols.com/index.php/topic,169046.0.html

Maybe your right. Just my experiences.

if it doesn't sit quite right in front of the camera, then every IR light tends to be scaled/distorted in one direction. It should therefore be possible to compensate for this with adjust x and adjust y in the software. Perhaps the larger the screen, the more significant the effect?
« Last Edit: December 10, 2024, 01:48:21 pm by Fusselkroete »

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7005
  • Last login:January 17, 2025, 10:20:04 am
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
hi dude :D
...
if it doesn't sit quite right in front of the camera, then every IR light tends to be scaled/distorted in one direction. It should therefore be possible to compensate for this with adjust x and adjust y in the software. Perhaps the larger the screen, the more significant the effect?

Back at ya! :)

If the lens is off the center axis, it can introduce parallax in the image.  Obviously, the further off axis and the more powerful the magnification, the worse the effect will be.  I have a hunch that a larger screen, which places the references into the higher distortion areas of these inexpensive lenses, will exacerbate the problem, but I haven't thought about that part specifically.  Ideally, the best case scenario would be to have all elements of the optical system (that's what is being created) exactly on axis with one another.

A simple offset in the X and/or Y will probably not be enough to compensate for parallax, as it distorts the entire image and that distortion will change the position of the reference LEDs, depending on where the camera is pointed within those boundaries.

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
Ah yes i remember. We had this topic a while ago and all kind of solution to map the magnification offcenter.
A method with different magnification rings around the center which can be moved offset from the center. A raster mapping method etc. Still have this stuff in my backhead.
Different lences needs different methods. i bet the wii remote camera has itself some kind of magnification.

:D thanks again for the brainstorming.
One simple magnification method is already implemented:
https://docs.google.com/document/d/117MScFdwIa9OmT3HLUYOvgB_TzmynupzVe_1zai4rFo/edit?usp=sharing << "How does it work with the lenses?"

i should also add center offset and offer more options in future! the centeroffset needs to be intutive to figure out for the user in some ways. still thinking about this.

« Last Edit: December 10, 2024, 03:44:47 pm by Fusselkroete »

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7005
  • Last login:January 17, 2025, 10:20:04 am
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
While I think that it could be corrected with some advanced algorithms, I also think that a poorly designed optical system should not be the concern of the software.  This type of thing isn't the same as sort of getting the lens in front of a cell phone camera to take a picture.  If it's off a little one way or the other, or slightly distorted, you'll still get a half-decent snapshot. 

And yes, the camera needs some kind of lens of it's own to focus the incoming light onto the sensors.  Distance between lenses is also important.  These cell camera lenses expect to be pretty close to a camera lens, as is typical with cell phones.  There is probably 2 to 3 (or more) times that distance when used on a Wiimote.  This is likely to affect focus and could also result in vignetting or trying to use parts of the lens which are not ideal. 

I just wanted to underscore the importance for people to do their due-diligence before throwing more lenses into the optical path.  It might technically work, but there might also be some unintended side effects which affect overall accuracy.  With optics, things need to be correct to give the system the best chance to work as intended.

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Just trying a test batch file to shut down then restart Lichtknarre after a emulator, found a basic file and edited it to match the file locations -

taskkill /IM Lichtknarre.exe /F

Pause

start/wait "Dolphin" /B  "G:\LaunchBox\Emulators\Dolphin\Dolphin.exe" %1

Pause

start "Lichtknarre" /B "C:\Program Files\Lichtknarre\Lichtknarre.exe"

Pause

exit

when its run I get this -

C:\Users\Retro-pc\Desktop>taskkill /IM Lichtknarre.exe /F
ERROR: The process "Lichtknarre.exe" with PID 8752 could not be terminated.
Reason: Access is denied.

Tried it with other programs and it works as it should, any ideas how to easily solve as when i googled a solution my brain hurt   :o
 


Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
While I think that it could be corrected with some advanced algorithms, I also think that a poorly designed optical system should not be the concern of the software.  This type of thing isn't the same as sort of getting the lens in front of a cell phone camera to take a picture.  If it's off a little one way or the other, or slightly distorted, you'll still get a half-decent snapshot. 

And yes, the camera needs some kind of lens of it's own to focus the incoming light onto the sensors.  Distance between lenses is also important.  These cell camera lenses expect to be pretty close to a camera lens, as is typical with cell phones.  There is probably 2 to 3 (or more) times that distance when used on a Wiimote.  This is likely to affect focus and could also result in vignetting or trying to use parts of the lens which are not ideal.  Maybe the ppl should build a realy big 90° wooden angle. xD

I just wanted to underscore the importance for people to do their due-diligence before throwing more lenses into the optical path.  It might technically work, but there might also be some unintended side effects which affect overall accuracy.  With optics, things need to be correct to give the system the best chance to work as intended.



I see two problems (For now we ignore lens rotation). Bad lens centerpoint and bend camera. Both can be compensated to a degree. But to find an intuitive method for the user is hard, since the camera only can see IRs.

For the first problem, you could place the IR LEDs in each corner of the screen and place the Wii 90° in front of the screen to see the difference between the top and bottom distance. But the user has to be 100% accurate. Aim from the center of the screen and 90° perfectly to the screen. Poor user experience imop. For the other problem, maybe you could use the same approach. Maybe people need to build a big 90° angle out of wood or 3D print one :D The 3D print could be mountable. Maybe you don't need the screen at all and make a 3D print where the Wii can be mounted exactly. Hey that could be the solution...




Sorry for my bad paint skills :( Maybe i design this and offer this tool. The Tool also could help to detect if your camera bending is too extrem to fix by software.

Btw the one who made this 3D Print (https://makerworld.com/en/models/867328
) like to join the forum, but registration is disabled. Who i have to ask for registration? He gave me his emailadress.
« Last Edit: December 11, 2024, 07:35:20 am by Fusselkroete »

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
Just trying a test batch file to shut down then restart Lichtknarre after a emulator, found a basic file and edited it to match the file locations -

taskkill /IM Lichtknarre.exe /F

Pause

start/wait "Dolphin" /B  "G:\LaunchBox\Emulators\Dolphin\Dolphin.exe" %1

Pause

start "Lichtknarre" /B "C:\Program Files\Lichtknarre\Lichtknarre.exe"

Pause

exit

when its run I get this -

C:\Users\Retro-pc\Desktop>taskkill /IM Lichtknarre.exe /F
ERROR: The process "Lichtknarre.exe" with PID 8752 could not be terminated.
Reason: Access is denied.

Tried it with other programs and it works as it should, any ideas how to easily solve as when i googled a solution my brain hurt   :o

Your Batch script do not run as administrator. Look for tools which helps you to evaluate the batch script as administrator.

RandyT

  • Trade Count: (+14)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7005
  • Last login:January 17, 2025, 10:20:04 am
  • Friends don't let friends hack keyboards.
    • GroovyGameGear.com
Lol.  I never stated that the people who design these didn't do everything they should, only that I wonder if they did.  The reason is that, intuitively, one would be tempted to only center the lens on the aperture of the window and proceed.  In this case, that is not ideal.  But it is enough to take the controller apart to see where the camera lens center actually is (a micrometer is fine for doing this) and use whatever references they want in their design to find the appropriate center location for the optic.  Horizontal center is is probably a safe bet just using the window, but not vertical.

As a side note, a 3rd party camera module could be in an entirely different place.  That window is huge compared to the camera aperture, so there's lots of room for it to be in different place and still work just fine in stock form ;)

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Just trying a test batch file to shut down then restart Lichtknarre after a emulator, found a basic file and edited it to match the file locations -

taskkill /IM Lichtknarre.exe /F

Pause

start/wait "Dolphin" /B  "G:\LaunchBox\Emulators\Dolphin\Dolphin.exe" %1

Pause

start "Lichtknarre" /B "C:\Program Files\Lichtknarre\Lichtknarre.exe"

Pause

exit

when its run I get this -

C:\Users\Retro-pc\Desktop>taskkill /IM Lichtknarre.exe /F
ERROR: The process "Lichtknarre.exe" with PID 8752 could not be terminated.
Reason: Access is denied.

Tried it with other programs and it works as it should, any ideas how to easily solve as when i googled a solution my brain hurt   :o

Your Batch script do not run as administrator. Look for tools which helps you to evaluate the batch script as administrator.


Ran it has a admin, it closes Lichtknarre then loads Dolphin but when i exit Dolphin Lichtknarre doesn't reload,any ideas how to fix it ?

I even reinstalled Lichtknarre to a different drive and still the same result :o

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
What do you mean by not reloading?

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
From the batch file, when you exit Dolphin it should then load Lichtknarre, which it doesn't  :-[

Tried the same batch file with fatmatch.exe (first program i picked from my utils folder) and that reloads, that file doesn't need the batch file to run as admin though.

On my retro-pc i disabled UAC so don't think its that.

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
Yes because Pause says you have to press a button to continue the batch script? Im not an batch script expert. would be nice if you post the solution if you figured it out. :)

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Yes because Pause says you have to press a button to continue the batch script? Im not an batch script expert. would be nice if you post the solution if you figured it out. :)

Should have said, tried it without the pauses and it still doesn't load Lichtknarre again after Dolphin, will do some research when i get the chance :)

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Made a AHK file instead of a batch file and used this code -

Process, Close, Lichtknarre.exe

runwait "G:\LaunchBox\Emulators\Dolphin\Dolphin.exe"

run "G:\LaunchBox\0-UTILS\Lichtknarre\Lichtknarre.exe - Shortcut.lnk"

Had to make a shortcut so it would load after Dolphin closes, works now :)

Hope it comes in handy for someone.

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
Amazing  :cheers:

Now retroarch :)

zenaro147

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:January 07, 2025, 06:52:49 pm
  • I want to build my own arcade controls!
3D Lightgun print: https://makerworld.com/de/models/867328

I often see these 3D printed items incorporating a lens and have to wonder if the designers took the time to disassemble their Wiimote (and re-assemble it) to find the exact center of the camera lens.  If they didn't, it's probably wrong and it will likely affect sight accuracy without very good software correction.  Hint:  it's not centered in the window :)

Hi 😀

I actually edit the design to center with the wiimote camera, since after disassemble my control, I notice that the camera is not centered with the black window. Do you think it's better to center with the window instead the camera?

firedance

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 347
  • Last login:Yesterday at 05:52:04 pm
Amazing  :cheers:

Now retroarch :)

I did look at a few cores for NES in Retroarch but they seem to be hard coded to use the mouse only for the lightgun/zapper :(

Fusselkroete

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 57
  • Last login:January 07, 2025, 04:18:26 pm
  • sup dudes?
Hi a user with the name of Away8777 of the Geekonarium Discord server made a tutorial for model3. See pdf in attachment.

Little hint from Luftwaffles side is: his vjoy's were player 1 and player 3 because he had some other virtual device installed on windows taking 2nd player.
I hope this will help ppl to net get confused.
« Last Edit: January 07, 2025, 03:53:56 pm by Fusselkroete »