ThePolish Posted December 6, 2016 Share Posted December 6, 2016 (edited) I wanted to share this - after research I've managed to get full light guns working with light gun games in Mame. I've done this on windows 7 and now 8.1. I can't confirm it'll work on 10 (edit, it works on Windows 10. Also see bottom of this post for a link to a later post with info on later version of MAME) ***The below isn't depreciated per say but the very bottom has edits that are of note. I suggest you read and understand this original post, then read though the whole thread or at least THIS and then the linked post at the bottom forward. There has been forked a better version of touchmote for this purpose thanks to @Tomkun and this whole project now DOES work with mame 234 now, no need for an outdated version OR mame uifx - I don't want to remove anything from this first post though because it gives the groundwork for what has become a pretty cool project*** Requirements: Mayflash Dolphin Bar Wiimote(s) Tochmote Software (GIT Here) Mame UIFX Mame (not working with .180, but tested w/.174 and .175 dinput builds) It is a little tricky to get set up but I've been using it for awhile and I wanted to throw down a quick walk through of my settings and how I got it set up. Download required software and install. Keep dolphinbar on position 4 - this makes everything nice when you go to use other emulators - no change required . TURN YOUR CONTROLLERS ON IN THE WAY YOU WANT THEM ON WHENEVER YOU WILL BE PLAYING I cant stress this enough due to the way xnput handles slots. If you navigate lb/bb with xbox 360 controller then switch to this setup - you'll want your remotes in 2/3 slot. Otherwise you'll be resetting bindings all day everyday. I personally set mine to 1 and 2 and turn off my xbox controller when I'm going to play light gun games and nav with the keyboard. - one though - is if you want to nav with wiimote - think about setting arrow keys in the touchmote setup as well as one of your buttons for "enter" and another for escape. Touchmote Setup In Touchmote - pair your wii controller and set your motes up with Layouts- . Go to settings then controller config - and hit the plus. I have named mine Mame Light Gun 1 and Mame Light Gun 2. I would delete all but the default profile and just keep the 3 in the list of configs (more on why later). To set up profiles it is pretty easy - on the right side there is a list of outputs which you can filter by device. You can safely leave it in all, and just scroll the list. Remember when setting these - Green boxes are xinput controls, Yellow boxes are keyboard keys, Red are mouse controls. If you set set escape to a button, make sure to set it to one you will not be using in game obviously) Set up profiles like this - For Mame 1 you're going to want to set your pointer to "mouse cursor". You'll also need to set plus, minus a, b 1 and 2 to whatever keyboard keys or xinput buttons you want. Number pad works pretty well. For Mame 2 set your pointer to "left" or "right" stick under xbox 360 (green box) This will give your cause the left stick to function similar to a mouse for aiming your light gun. You'll cycle through these profiles after opening touchmote. When you're ready to play a game, open touchmote, hold "home" on the controller and use up or down dpad then a to select layout. You'll set 1 for P1 and 2 for P2. Mame Basic Setup Extract into your mame directory (you may want to make a new one just for these games and direct RL to use this emulator since you'll be messing with settings) the version of non uifx mame you want to use (I use .174 mame.) Extract over top of that the mame uifx (I use .175) Open Mameuifx64.exe - and find your light gun game, right click and edit properties (alt+g when selected). Under Controller - tick enable mouse, enable joystick, enable light gun, enable off screen reload. You'll also want to move your sliders for deadzone and saturation - this effects player 2's pointer set to a stick). mine are set to .06 deadzone and 0.50 saturation. Under Controller Mapping I set paddle, dial, adstick, trackball, pedal and positional to keyboard, mouse to mouse and lightgun to lightgun. Hit okay to close and save all changes. You can also set properties for these under "properties for XXXXcabinet the one if you right click on the game under the alt+g set properties" but do not do this unless you find yourself needing to trouble shoot that cabinet. I know it is not necessary for jaguar.cpp) Setting Controls Open Touchmote and pair controllers. Hold home on each wiimote and select "mame light gun 1" and "mame light gun 2" on your two remotes. Remember I usually set light 1 to 1 and light 2 to 2 to remember player 1 and 2. This is why you wanted to clear out layouts earlier - makes quick setting when you go to play. Open your game up in mame64uifx - hit tab, and hit input for this machine with your keyboard. You'll hit enter to set each control. So for example, set coin 1 to minus by hitting enter - then minus - you'll see the key/button you set in touchmote pop up. If you don't - check the toubleshooting section for ideas. Do this for trigger (sometimes called button 1), start, coins, any anything else how you want your settings done. For your light gun pointer - crosshairs on will probably help (I leave mine on all the time anyway since I'm not worried about competitive playing). To set crosshairs - hit enter on X analogue and Y analogue and move your wiimote swiftly in the X and Y directions (for Y point wiimote up/down, X side to side after hitting enter). Back out of menu and test by inserting coin and hitting start - you should be able to play in mameuifx at this point after calibration of the machine. Setting Up Mame/LB Add your light gun emulator mame64.exe (if you made a new one) to your usable emulators, import your light gun games to launch box. Set use emulator pointing to the new mame64.exe with launchbox for these games. With luck - the config files in that folder will already be set and you're good to go. To play - open Touchmote and set controller and select your game! First Play You'll need to calibrate your gun - this is a little trial and error. TAB and set dip switch to service mode (depends on game) Navigate to gun calibration (most games have you use a combination of p1 and p2 start and triggers) you may need to use your actual mouse first time around to select calibration on the screen) Follow on screen prompts (shoot at dots). Have Fun! - You should now have 2 player light guns working with mame using 2 wiimotes and a dolphinbar! Troubleshooting On first run - if your guns don't work opening from launchbox - try setting them inside mame opened from launchbox following the steps 4-8 under setting controls - this is hit or miss on the x and y axis', I've only ever been able to set the mouse pointer axis to set under mameuifx64. Make sure in the "gamename.ini" file there are 1s next to the control settings you set under mame basic setup above. 1 is a ticked box 0 is unticked in the ini files) - its an ugly way to do it but it works. If you can't set controls for x and y axis' - you might have to run though mameuifx again - sometimes the game.ini and game.cfg files won't stick - haven't figured out why yet. Check these files in your mame directory with notepad++ to see if configurations have changed. Again - the mouse on controller 1 is usually the one that gives issues. Also try opening mame64.exe directly and setting things if the above doesn't work (rather than opening though launchbox - this will give you the ability to use your esc key if you didn't bind one. If you can get stick working but not mouse (e.g. gun 1 doesn't work but 2 does) - it is a mame issue - check to make sure lightgun is set as lightgun in game ini or mameuifx. Try resetting your PC, reconnect controllers and play around - it does work but takes some fussing at times. Known Issues: Stick sensitivity for gun 2 leaves room to be desired- but Touchmote seems like a dead project at this point so I doubt they'll add an adjustment feature. To shoot off screen to reload - you may need to hit the edge of your screen (if crosshairs are on it becomes apparent what I mean) and mash fire. You get use to it after a little play and it's not that big of a deal. You may get it working and it just STOPS one day. Most likely its due to xinput slot changes. Rebind controls and move on. It sucks - but its part of life until someone can figure out how to assign device id to slot and prevent the system level changes. While this isn't an "aimtrack" setup - its cheap, dirty, and fun for the casual. I have my wiimotes in some no name handgun zappers and have also set up Supermodel for JP with this - lots of fun after some frustration. I hope this write-up, if not perfect - will at least get anyone who wants to try in the right dirrection. There wasn't much documentation on how to do this, but trial and error got me to a working setup. I have another thread open for some issues with using multiple controllers like this if anyone has advise on it - with regard to how xinput handles controllers after reset or plugging/unplugging. EDIT July 2021 - see this post for ideas later in the thread for getting this working with later version of mame / specifically 234b EDIT August 2021 - see page 14 for info on getting a much better setup for accuracy when using 2 guns using @Tomkun's build of touchmote - leaving the above up for learning Edited August 13, 2021 by ThePolish Added info at top and bottom of post due to major updates Aug 2021 6 2 Quote Link to comment Share on other sites More sharing options...
Lordmonkus Posted December 6, 2016 Share Posted December 6, 2016 Nice guide, added link to it in the Guides & Tutorials sticky found here: 1 Quote Link to comment Share on other sites More sharing options...
ThePolish Posted December 6, 2016 Author Share Posted December 6, 2016 6 minutes ago, lordmonkus said: Nice guide, added link to it in the Guides & Tutorials sticky found here: Great! Hope it helps people. Supermodel works using this too but is a pain and I still don't fully understand how I got it set up. The whole binding keys there is like pulling teeth. Quote Link to comment Share on other sites More sharing options...
Lordmonkus Posted December 6, 2016 Share Posted December 6, 2016 lol yeah Quote Link to comment Share on other sites More sharing options...
tsoukkis Posted May 19, 2017 Share Posted May 19, 2017 Hi there! Big thanks to ThePolish, which gave me the motive that light guns are doable with wiimotes. Below you will see how you will get your wiimote light guns perfectly lined up. 1. Follow exactly what ThePolish suggests in his opening post (exactly - do all the installation, they are needed) 2. After that, download - Visual Studio 2013 Express for Desktop and install it - My modified Touchmote source code from here https://github.com/tsoukkis/Touchmote/tree/tsoukkis-mss (MSS branch) 3. Open the Touchmote.sln in the MSS source code folder with VS2013 4. Build -> Build Solution (I built for x64 architecture in Windows 10) 5. In the MSS source code folder now, you will find bin/x64/Debug folder. Run the Touchmote from there and close it. 6. Go now to the settings.json file of the MSS source folder and edit the values pointer_limit_xxx, stickl_limit_xxx and stickr_limit_xxx 7. These values are specific to all the below factors - Size of TV - Distance from the TV - Dolphinbar position - Wiimote used Every wiimote will need slightly different values even if the TV setup is the same - keep a record of the right values for every wiimote! When the wiimote points the sensorbar, the value is 0.5. Aiming left or above the sensorbar decreases the value, right or down increases the value. For example, I have a 40" TV, the sensor bar is on top and I am standing around 1.7 m from the TV. Left and Right limits are 0.30 and 0.80 respectively, and Top and Bottom limits are 0.586 and 0.966 respectively. Use the above values as a starting point. If not lined up, close the modified Touchmote app, adjust the values and open it again. Do your testing in mouse mode first, to see the results really quick on the mouse. 8. After you get the values for every wiimote, assign them to pointer_limit_xxx for the wiimote that you will put in mouse mode, and stick?_limit_xxx (l or r) for the wiimote in stick mode. 9. In Mame generic settings, set the joystick saturation to 1.00 and deadzone to 0.0. Also, unlock the aspect ratio and spread it to fullscreen or else the lineup won't work near the edges. I didn't have the experience and I don't know how much better the actual light guns are, but wiimotes work super! Happy Shooting! 3 1 Quote Link to comment Share on other sites More sharing options...
Tomkun Posted May 24, 2017 Share Posted May 24, 2017 I tried this out with MAME and it works absolutely perfectly. Thank you so much. I also tried with Supermodel, which works to a degree, but loses accuracy towards the edges of the screen as there is no true widescreen. I couldn't get it to work on M2 emulator as I think that only supports mouse input for lightguns, but I hope I'm mistaken. Overall it's absolutely fantastic, thanks! Quote Link to comment Share on other sites More sharing options...
Thatman84 Posted May 24, 2017 Share Posted May 24, 2017 Anyone got a view on if this would work with retroarch mame and shield tv? Or is the touchmote app the linch pin here. I wanna test but dont wanna invest in stufff that wont work. Quote Link to comment Share on other sites More sharing options...
tsoukkis Posted May 24, 2017 Share Posted May 24, 2017 To my understanding, Touchmote is converting the IR sensor readings of the Wiimote, to either DirectInput (Mouse) or XInput (Right or Left Stick). Based on that, it depends on each emulator how it can handle XInput or DirectInput, Theoretically, every emulator that can handle these, should work (theoretically :)) 1 Quote Link to comment Share on other sites More sharing options...
Thatman84 Posted May 24, 2017 Share Posted May 24, 2017 20 minutes ago, tsoukkis said: To my understanding, Touchmote is converting the IR sensor readings of the Wiimote, to either DirectInput (Mouse) or XInput (Right or Left Stick). Based on that, it depends on each emulator how it can handle XInput or DirectInput, Theoretically, every emulator that can handle these, should work (theoretically :)) Sorry just for clarity the Shield TV is my emulation box and that is Android OS... still thinking that will be a big problem Quote Link to comment Share on other sites More sharing options...
tsoukkis Posted May 25, 2017 Share Posted May 25, 2017 22 hours ago, Thatman84 said: Sorry just for clarity the Shield TV is my emulation box and that is Android OS... still thinking that will be a big problem Yep, I think this is not possible. Touchmote is a Windows app and of course it is needed because it is the app where it connects the move of the Wiimote with the move of the mouse/stick. 1 Quote Link to comment Share on other sites More sharing options...
Thatman84 Posted May 25, 2017 Share Posted May 25, 2017 (edited) Yep as i thought. I just have to live in hope with android stuff. I never thought LB would be on Android but now it sort of is with a plugin. Just got to test it. Thanks for the reply to my stupid question lol Edited May 25, 2017 by Thatman84 Spelling Quote Link to comment Share on other sites More sharing options...
ThePolish Posted May 25, 2017 Author Share Posted May 25, 2017 (edited) I personally wish touchmote would be picked up and expanded on since I believe it is opensourced so the backend could be integrated into other projects, and used cross platform but for right now it's windows only =( Edited May 25, 2017 by ThePolish forgot half my thought 1 Quote Link to comment Share on other sites More sharing options...
Tomkun Posted May 26, 2017 Share Posted May 26, 2017 It is open source, isn't it? It's all there on Github. Quote Link to comment Share on other sites More sharing options...
teeedubb Posted May 26, 2017 Share Posted May 26, 2017 Anyone know how the accuracy of this method compares to using a wiimote in Wii mode with a dolphin bar in dolphin? I've been using it as a light gun cause I already had wiimote and a dolphin bar and other options are expensive and not that great, but the accuracy leaves alot to be desired. Quote Link to comment Share on other sites More sharing options...
Tomkun Posted May 26, 2017 Share Posted May 26, 2017 This is by far the most accurate of all the methods I've tried so far. Vanilla Touchmote was worst, then Dolphinbar and with tsoukkis's modifications I have near line-of-sight accuracy in MAME. The only *slight* issues are that there is a slight input lag - I guess this is due to Touchmote smoothing out the input. Also, if you play a 4:3 shooting game on a 16:9 screen you'll lose accuracy towards the edges of the x-axis. Quote Link to comment Share on other sites More sharing options...
Thatman84 Posted May 26, 2017 Share Posted May 26, 2017 (edited) @Tomkun do i recognise that name from RL module notes? Just checking. Man i need a PC for lightgun games. Droid just dont cut it. Next year roll on Edited May 26, 2017 by Thatman84 Spelling Quote Link to comment Share on other sites More sharing options...
tsoukkis Posted May 26, 2017 Share Posted May 26, 2017 3 hours ago, Tomkun said: Also, if you play a 4:3 shooting game on a 16:9 screen you'll lose accuracy towards the edges of the x-axis. I can quickly think two solutions for the 4:3 lost accuracy in the x-axis. I believe you have two black columns on either side of the 4:3 screen. 1. Either force the 4:3 to go full screen - it will lose the aspect ratio but the aim will be good. 2. Narrow the values of the X axis in the settings.json file, to pretend that your monitor is not that wide. Lower the value for right limit, increase the value for left limit. Do some trial and error. I am using the 1st option - I have not tested the 2nd one but I believe it can work fine! Another drawback with Touchmote, is that there is no calibration wizard. The wizard will be simple and it is there in some Wii games (hit on top left, hit on top right). But it needs some time and effort to develop that - for now I stick with editing the values in settings.json. Quote Link to comment Share on other sites More sharing options...
Tomkun Posted May 26, 2017 Share Posted May 26, 2017 1 hour ago, Thatman84 said: @Tomkun do i recognise that name from RL module notes? Just checking. Yes, that's me. 27 minutes ago, tsoukkis said: I can quickly think two solutions for the 4:3 lost accuracy in the x-axis. I believe you have two black columns on either side of the 4:3 screen. 1. Either force the 4:3 to go full screen - it will lose the aspect ratio but the aim will be good. 2. Narrow the values of the X axis in the settings.json file, to pretend that your monitor is not that wide. Lower the value for right limit, increase the value for left limit. Do some trial and error. I am using the 1st option - I have not tested the 2nd one but I believe it can work fine! Another drawback with Touchmote, is that there is no calibration wizard. The wizard will be simple and it is there in some Wii games (hit on top left, hit on top right). But it needs some time and effort to develop that - for now I stick with editing the values in settings.json. Apologies, I didn't mean that to come across so critically. I think you are correct that the best option is option 1. The second option would require changing the config file when playing games at different aspect ratios, which while doable would be a headache. Now if only Demulshooter would accept joystick inputs, we could use wiimotes for virtually any gun game in 2 player. The only other option would be to get Touchmote's mouse mode to use raw output, which I saw a request for on the github tracker, but I haven't seen any progress on. Quote Link to comment Share on other sites More sharing options...
tsoukkis Posted May 26, 2017 Share Posted May 26, 2017 1 hour ago, Tomkun said: Apologies, I didn't mean that to come across so critically. ???!!! I never thought you came across critically! I am more emphasising that there is not so much time to put on this now (age, job, family, household, games!) Quote Link to comment Share on other sites More sharing options...
teeedubb Posted May 28, 2017 Share Posted May 28, 2017 Thanks for the info guys, ill try this out whem i have some free time. Its a shame that 'modern' light guns dont compare to the ones from yesteryear. Ive been playing around with the psmove in a attempt to use it as a mouse/light gun (due to it being more accurate than a Wiimote), and while it works, it has some calibration and movement issues which I haven't been able to work out as of yet. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.