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: Wingun, lightgun, guncon 2 troubles aplenty  (Read 18003 times)

0 Members and 1 Guest are viewing this topic.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Wingun, lightgun, guncon 2 troubles aplenty
« on: August 03, 2012, 11:03:30 pm »
Hi, I have been trying to set up some light gun games to work with MAME, and the experience on the whole has been... exhausting to say the least. While I originally intended to get some light guns that were actually designed for the PC, all of the producers of such light guns have stopped production. Because of this I decided to turn to Guncons (specifically Guncon 2 and a Nyko Super Cobra [3rd party guncon 1]).  After searching for how to get a Guncon 2 to communicate with a PC, what I found was that WinGun was the program that worked for people, as Guncon2PC had a "rolling x issue". I could not find out about this myself, because every link to Sm0gdragon's work ended in a 404 page in Italian.

After installing WinGun, I found that my Guncon 2 is not being recognized (nor my super cobra, but that is to be expected because I am running it through an adapter). Unfortunately no one else has had this problem, because I could not find any links to the issue. Hence why I am here asking for help.

Is there something I am doing wrong that I am just too stupid to see myself?

Running around trying to find an answer has left me with a blood vessel in my brain that is just about ready to pop.

I am running Windows 7 64 bit, and I am connecting to a TV via a VGA to RCA converter box. I have tested the Guncon 2 and it works with my PS 2 just dandy. Let me know what else you need to know in order to answer my question.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #1 on: August 03, 2012, 11:41:07 pm »
Why are you using a vga 2 rca box?  I would suggest getting a dedicated video card with svid out if you are using that type of tv.  Converting the signal via an external device is going to cause timing issues (i think it would at least) and it'll reek havoc on any lightgun you plug in.   

If your tv has svid and you are willing to do that, I've got a old act-labs svid gun I'll sell ya cheap.... it's a little rough cosmetically (it's the ray gun kind) but it's still pixel perfect. I'm now using a lcd monitor in my cab and thus I don't have any use for it anymore.


Your other solution is ultimarcs "fake" lightgun system.  It works rather well from what I've been told, but it's more of a wiimote-like solution. 

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #2 on: August 04, 2012, 12:07:53 am »
My old graphics card used to have S-video, if I remember correctly, my current one only has HDMI. so the only way that act labs gun would work is if I had a means of converting the signal to it, considering my tv only has the screw in cable (coaxial? is that the right word?). Furthermore, the only Aimtracs I can find are all $95 a pop, and I would rather try and get this software working than try and drop $100 for another light gun. If you could tell me where I could find one for a more reasonable price I'd consider looking into it.

I dunno. If I really can't get them to work with my PC I'll consider buying that act labs gun off you. You will have to wait a bit until my paycheck comes in though, I'm pretty broke right now. PM me the price you are thinking of parting with it for.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #3 on: August 04, 2012, 12:45:58 am »
Ok I'm not telling you what to do at all, but before you worry about lightguns you might want to get a better monitor. 

A videocard with hdmi-out is of no use to a monitor that can only display 480i  I'm not saying get a lcd panel or anything that drastic (although they are quite cheap now), but you might want to look into a used arcade monitor or at the very least a better tv.  Coaxial isn't rca... it's actually one step down from rca as the audio and video are combined.  Any gun solution you use (save the aimtrack) is going to need a direct connection to the monitor to work properly.... you've got two good options in terms of video cards, but your tv just doesn't have the inputs needed for any solution on the market.

Once you get that sorted:

You can buy an aimtrack kit for only $44 and install it in one of your existing guns.

You could optionally use a wiimote, but a wiimote is around 60 bucks, plus another 10 or so for a gun housing, plus another 10 for a bluetooth adaptor... plus 15 for a sensor bar..... if you don't already have the equiptment it isn't really cost-effective.

Yeah I'll still sell you my gun if you want it.  I'm not particularly trying to make money or anything, I just don't need it and you do.  I'll take whatever I make and put that towards an aimtrack kit. 

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #4 on: August 04, 2012, 07:40:12 pm »
I actually have a better monitor (22" LCD, and I know someone with an LCD tv that is a bit bigger that they aren't using if I really wanted bigger), the reason why I got the converter box was to hook into my old CRT tv so that I could get the guncons to work with it.

Regarding the Aimtrak kit: will it actually fit inside my Guncon 2? Is it designed to do that? if so, $45 is more reasonable and is something to consider. (or does it fit inside guncon 1's only? I'd love to know more about how to use the kit.)

Regarding the wii remote: another idea I would like more information on. I own a wii and 2 remotes, both of which are pretty much just sitting gathering dust. (furthermore, wii remotes are less than $40 for the remote part now where I live, and finding some for very cheap would be no problem if I didn't want to mess with my own) If there is software out there that can make the wii remote behave like an aimtrak (where it calculates where you are pointing on the monitor as opposed to just the sensor bar) then I would definitely be interested in finding out more about gun housing and whatnot.

I'll go checking my other TV's to see if any of them have an S-Video after I determine more about the aimtrak and wii-mote options.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #5 on: August 05, 2012, 03:15:16 am »
The aimtrack originally was only sold as a kit.  I believe (don't quote me on this) the super high price on the full gun is due to the fact that andy buys up guncon parts and uses them to build the guns.  It isn't particularly designed to fit in either though, it just does.  You basically hot-glue it in place.... no big deal.

I hate to burst your bubble, but the wiimote and the aimtrack operate almost exactly the same.  Both the aimtrack and wiimote only see their sensor bars... they can't sense the monitor in any way.  Any differences are software ones, and via glovepie you can write your own software for the wiimote.... some of the examples out there are pretty good. 

The drawback with the wiimote is that it's a little akward to pair with your computer.  You basically have to sync it every time you want to use it.... which isn't a big deal, but it isn't automatic. (Press 1 + 2 at the appropriate time)


felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #6 on: August 05, 2012, 04:22:48 am »
When it comes to the aimtrak working like a Wii-remote, I already know they share the same principle with hardware. The noticeable difference though is that the software designed for the aimtrak allows for it to configure where you are aiming at the screen relative to the sensor bar. Aim at the middle of the screen >>> the gun sees it is aiming below the sensor bar, but translates that the reticle should technically aim at the middle of the screen. The only reason why I haven't sprung for the Wii solution already (especially because a new 3rd party wii-remote-gun that is basically a cheaper aimtrak) is because I don't know of any software written for the wii-remote+glovePIE that can behave like the aimtrak software. If you do, I would really appreciate it. I don't have any software or coding experience, nor education, so unless someone else has done it already the wii-remote solution is not viable... unless I take up a new hobby learning to speak computer.

syncing the wii remotes is no big deal. As long as there is a means to get it to (convincingly) pretend like it is a lightgun, such hoops are a small trifle in comparison to the ones I am having now. (although I just got my PS 2 out and can play some games on it for now, which is helping sate my need for arcade shooter action)

mike boss

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2645
  • Last login:October 22, 2021, 01:19:45 pm
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #7 on: August 06, 2012, 03:02:43 pm »
Somewhere on the BYOAC forum I recall a tutorial for installing Aim Traks into GunCons. Unsure if its GunCon 1 or 2.
None the less if you search I'm sure you will find it.
I myself had purchased two GunCon2 after reading about the GunCon2Mouse project, I know two different programs existed. Don't recall the names now, but I recall one not working for me and the other "sort of" did. It was supposed to recognize the guns when plugged into the PC, but didn't.
I had a PC configured with MaLa and MAME as well as various other consoles. I had wanted to do a all Gun Games project in a Virtua Cop cabinet. Using the GunCon to mouse program I found it was very off, and the calibration didn't work. Not sure if this was the driver or the GunCons themselves.
However what I do recall was my GunCon2 (and I'm not sure if this is all GunCon2) had your standard RCA video connection that would goto the TV.
So I had the GunGon2's plugged into the rear USB ports of my PC, they were connected together, then from the video out on the videocard the connection was sent to the TV. But as I said the response was off, I had a hard time finder older videocards that had your run of the mill RCA video out. In the end I purchased Aim Traks to install but never did.

All this ramble I guess what I am really saying is for all my homework the best solution (all be it, it will cost you) is go with Aim Traks and house them in your GunCon. You can even use them with an LCD, so that is a huge + .

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #8 on: August 06, 2012, 04:02:23 pm »
What he said. 

In regards to the wiimotes... all andy's software is doing is doing a little routine to move the cursor and saving 4 points to be used as the bounds of the screen.  Then those are applied to the gun's position to get a relative position on the monitor.... this number is then multiplied by the screen resolution to get an absolute pixel position on the screen.  Or at least if I programmed it, that's how I would do it. 

As for his roll compensation... that might be a bit tricker to re-create.  I'm sure somebody with some math skillz could do it, but that person isn't me.  ;)

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #9 on: August 07, 2012, 03:47:11 am »
all andy's software is doing is doing a little routine to move the cursor and saving 4 points to be used as the bounds of the screen. 

Who is Andy and what is this software you speak of? is this in regard to the aimtrak software or is this software to work with a Wii remote? if it is the latter give me a link.

Something else to think about...

http://www.buy.com/prod/wii-crossfire-remote-integrated-pistol-by-penguin-united/211957372.html

While I was looking for housing for a prospective wii light gun I saw that myself. Read it has good construction too. Now I just need to find the software to make it behave like an aimtrak and I will be good to go, provided I can confirm the hardware to work with bluetooth and all that fine stuff.

In the mean time I will try and track down that forum topic about which guncon type is used to install the kit.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #10 on: August 07, 2012, 03:57:46 am »
Andy Warren... he owns Ultimarc.... everybody knows that.  ;)

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #11 on: August 08, 2012, 02:44:49 am »
Well, I registered and posted on the GlovePIE forums, hopefully I can get the answers I am looking for from them when it comes to getting a Wii remote to pretend to be a light gun. I also think I found the thread on what guns can be used for the ultimarc kit. Guncons are part of it.

It's too bad I don't know Andy.
==========

*Runs back into the thread*

Hey, I'm back, and I have some potentially good news! I found a script for GlovePIE that allows for screen calibration to use a wii remote like a light gun!

Good Lord it was hard tracking it down though. After hours and hours of searching, sending emails to people who I had no idea whether they would ever respond, and crawling on my knees along the obscure strands on the corners of the web, I finally found the site I was looking for. it was called wiili.org. The only problem was, it had been shut down 3 years ago! Considering that the GlovePIE forums as well as the wiki lacked the information I needed, I knew that the only possible place to get my answer was to get to this site, considering it was a repository of many many scripts for the program, and much like the Library of Alexandria, it was a treasure that did not stand the test of time, and has left us a less enriched humanity on the whole. I was very dismayed at first, as there was no way, conventionally or with portals that I could get there. So, I gave up. I walked away from my computer, and spent a bit of time just enjoying the real world. Then, as I was hanging up a clock on the bathroom wall I fell and hit my head on the toilet seat, and when I came to, I had a revelation... If I hook up a Nintendo 64 while playing a gold cartridge version of Ocarina of Time in the Fire Temple, where the original music was different from later versions, to a full sized phone booth, and then pull part of the corner of the cartridge out, I could travel back in time! And I did! So I found the script I was looking for, now all I need to do is wait until my bluetooth USB dongle comes in the mail, then I can test the script out with my wii remote. If it works then I will try to see if the Penguin United Crossfire Pistol works with GlovePIE. If it doesn't, then screaming and hair-pulling will ensue, followed by reverse engineering and seeing if I can switch the guts or chips or something to make it work. In the mean time while we wait, I will leave the script with you.




/*Wii Light Gun
 Version 0.1
 Written April 27th, 2008

 Scripted by Tre Lantana
 AKA WearingTheHatofShame
 AKA Anonymous J
 AKA BisKit
 AKA Biz Kit

  ________________
 |                |
 |     NOTES:     |
 |________________|
 This script will only work on games and applications that
   do not require direct input to be used.
 For example, this can be used with:
   most emulators,
   House of the Dead 2
   House of the Dead 3
   Most PC Light gun games
   Etcetera

  ________________
 |                |
 |  Instructions  |
 |________________|

   Start the script
   Aim at the top edge of the screen and press B
   Aim at the bottom edge of the screen and press B
   Aim at the left edge of the screen and press B
   Aim at the right edge of the screen and press B
   Enjoy

  ________________
 |                |
 |   Controls:    |
 |________________|

   Point at the screen to move the mouse

   Wiimote Btn  - Keyboard/Mouse Button
   B Button     - Left Click (mouse)
   A Button     - Right Click (mouse)
   1 Button     - Middle Click (mouse)
   2 Button     - Enter (keyboard)
   Dpad Up      - W (keyboard)
   Dpad Left    - A (keyboard)
   Dpad Down    - S (keyboard)
   Dpad Right   - D (keyboard)
   Plus Button  - Numpad Plus (keyboard)
   Minus Button - Numpad Minus (keyboard)
   Home Button  - Home key (keyboard)
   Shake        - Right Click (mouse)
   Aim off screen to the right - Right Click (mouse)

 */




 if(!var.inited) {
   var.inited = 0;
   var.aim_right_click = false; //Sets whether the mouse's right button is set when you aim off screen to the right
   var.shake_right_click = false; //Sets whether the mouse's right button is set when you shake the wiimote.
 }
 if(var.inited == 0) {
   var.topofscreen = 0;
   debug = wiimote.pointery;
   debug = "Hold the wiimote level, aim at the top edge of the screen, and press B.  ("+wiimote.pointery+")";
   if(wiimote.B) {
     var.topofscreen = wiimote.pointery;
     var.inited = 1;
   }
 }
 if(var.inited == 1) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 2;
   }
 }
 if(var.inited == 2) {
   var.bottomofscreen = 0;
   debug = wiimote.pointery;
   debug = "Hold the wiimote level, aim at the bottom edge of the screen, and press B.  ("+wiimote.pointery+")";
   if(wiimote.B) {
     var.bottomofscreen = wiimote.pointery;
     var.inited = 3;
   }
 }
 if(var.inited == 3) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 4;
   }
 }
 if(var.inited == 4) {
   //var.leftofscreen = 0;
   debug = wiimote.pointerx;
   debug = "Hold the wiimote level, aim at the left edge of the screen, and press B.  ("+wiimote.pointerx+")";
   if(wiimote.B) {
     var.leftofscreen = wiimote.pointerx;
     var.inited = 5;
   }
 }
 if(var.inited == 5) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 6;
   }
 }
 if(var.inited == 6) {
   //var.rightofscreen = 0;
   debug = wiimote.pointerx;
   debug = "Hold the wiimote level, aim at the right edge of the screen, and press B.  ("+wiimote.pointerx+")";
   if(wiimote.B) {
     var.rightofscreen = wiimote.pointerx;
     var.inited = 7;
   }
 }
 if(var.inited == 7) {
   debug = "Release the B button";
   if(!wiimote.B) {
     var.inited = 8;
   }
 }

 if(var.inited == 8) {

   var.xamount = 1/(var.rightofscreen-var.leftofscreen);
   var.yamount = 1/(var.bottomofscreen-var.topofscreen);

   var.inited = 9;

 }

 if(var.inited == 9) {
   
   var.mx = wiimote.pointerx;
   if(var.mx >= var.leftofscreen and var.mx <= var.rightofscreen) {
     var.aimedx = (var.mx-var.leftofscreen)*var.xamount;
   }
   if(var.mx < var.leftofscreen) var.aimedx = 0;
   if(var.mx > var.rightofscreen) var.aimedx = 1;

   
   var.my = wiimote.pointery;
   if(var.my >= var.topofscreen and var.mx <= var.bottomofscreen) {
     var.aimedy = (var.my-var.topofscreen)*var.yamount;
   }
   if(var.my < var.topofscreen) var.aimedy = 0;
   if(var.my > var.bottomofscreen) var.aimedy = 1;

   mouse.x = var.aimedx;
   mouse.y = var.aimedy;
   debug = "1 / "+var.rightofscreen+"-"+var.leftofscreen+" = "+var.xamount;
   //debug = var.mx-var.leftofscreen + " " + (var.mx-var.leftofscreen)*var.xamount;

   mouse.leftbutton = wiimote.B;
   mouse.rightbutton = wiimote.A or (var.mx > var.rightofscreen and var.aim_right_click) or (wiimote.rawforce > 80 and var.shake_right_click);
   key.enter = wiimote.Two;
   key.w = wiimote.Up;
   key.s = wiimote.Down;
   key.a = wiimote.Left;
   key.d = wiimote.Right;
   key.numpadplus = wiimote.Plus;
   key.numpadminus = wiimote.Minus;
   key.home = wiimote.Home;
   mouse.middlebutton = wiimote.One;
 }
 if(var.inited != 9) {
   mouse.x = wiimote.pointerx;
   mouse.y = wiimote.pointery;
 }
« Last Edit: August 11, 2012, 02:08:32 am by felix pontifex »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #12 on: August 11, 2012, 07:21:39 am »
Quote
This script will only work on games and applications that
   do not require direct input to be used.
 For example, this can be used with:
   most emulators,
   House of the Dead 2
   House of the Dead 3
   Most PC Light gun games
   Etcetera

Sorry man, but that won't work with MAME.  For mame scripts, the wiimotes have to be setup as joysticks.  You also can't use multiple wiimotes.  Also I've used that script before, the calibration isn't what you think it is.



I can program in glovepie though, so I'll try to whip something up when I get the time.

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #13 on: August 11, 2012, 12:09:25 pm »
Are you having any difficulties getting the wiimote to pair consistently with your PC?

That was always my biggest issue with using Wiimotes.

I'd love to hear more about that if you've found a combination what works consistently.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #14 on: August 11, 2012, 02:17:27 pm »
Yeah it's still an issue....  I think this guy is jumping the gun a bit (no pun intended) but it doesn't hurt to buy a bluetooth adaptor and try it out.

Some of the bluetooth stacks allow you to create a shortcut to your device like you would an application..... that really helps.  Also the later versions of glovepie are pretty good about pairing up if you press 1+2.  I've yet to get it to sync 100% of the time correctly, but because glovepie supports disconnect upon pressing the power button and reconnect when pressing 1+2 it's easy enough to try again when things go wrong.


You can actually get them to pair the proper way, like they do on a wii (any button syncs) but very few bluetooth stacks support it.  A wiimote's pairing code is just it's bluetooth address backwards.  Send that and/or use that pairing code and the device now works like it would on the wii.  The catch?  This is traditionally done by sending a null-terminated string to the bluetooth stack.....and wiimotes addresses often have null characters in the middle of their address.  Toshiba stacks are known to accept addresses with nulls in them, but most aren't.  The author of glovepie discovered this and is going to add it to the next release of glovepie.... but he announced that in Janurary.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #15 on: August 12, 2012, 01:47:00 am »
Considering I haven't sunk money into the most expensive part of the setup (The Penguin United blah blah pistol) I haven't gotten -too- ambitious yet. I bought a blue tooth adapter that was said to be compatible according to the list (only cost $7), and I have the Toshiba stack. Just waiting for the adapter to come in the mail. Besides, I was planning to get the bluetooth anyway so I could play wii games on Dolphin.

I have to ask about the MAME non-compatibility thing, is that to do with later versions using raw inputs? would it work with an earlier version (or a MAME that has had the raw inputs thing modded out of it)?

Furthermore, this leaves me with more questions about the script itself... what does the author of the script mean by "most PC light gun games"? there are light gun games that were made for the PC? I thought it was all consoles and arcade.

Lastly, why didn't you mention you knew how to do stuff in GlovePIE? It would have saved me a lot of headaches if I could have just turned to you and asked the things I didn't get any useful advice about before. Like for example: Do you think the blah blah pistol will work with GlovePIE as is? if it doesn't would you be able to help me to get it to work, or is that a more complex coding issue?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #16 on: August 12, 2012, 02:06:57 am »
Heh..... I know you are new, but I didn't think you were THAT new.  I do a little bit of everything around here.  ;)

The glovepie problems with mame are a two-fold issue, I *think* most problems have been mostly resolved at this point, but you are going to have to use a REALLY new verison of mame where direct input is put in non-exclusive mode and that script isn't going to work because it uses high-level mouse manipulation instead of low-level (raw mouse). 

Thus why that script you found was so old. 

Glovepie now supports raw mouse input but I haven't tried it in mame.  I've got all the hardware, I just haven't had time to play with it recently.  Even if it doesn't work, glovepie allows you to map the wiimote to a virtual joystick and mame has no problems handling two joysticks at once.

As I said before, doing something similar to what andy does for the calibration of his guns is fairly easy to write... his roll compensation... that's a little beyond me.


Those guns are just oddly shaped wiimotes.  Afaik they should work as well as any wiimote, but I don't have one, so I can't tell you for certain.


Yeah there are a couple dozen or so pc lightgun games.... mostly ports of arcade titles. 

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #17 on: August 13, 2012, 01:48:26 am »
yes Mr. Castro, I am a most verdant member of this operation. I think I need to be clearer with how I ask my questions, because I still have more:

I plan to ask Penguin United about the software used in their peripheral, however, assuming that it is different from a first party wii...

1. Let us assume that the Penguin Pistol emits data that can be captured by the blue tooth device, but due to a difference in coding it is not recognizing GlovePIE. If I were to use a piece of software capable of gathering the data emitted from the device (such as wireshark or something) and gave you that information, would you be able to manipulate GlovePIE on either a script or coding level in order to make the device compatible?

2. If you cannot, do you know someone who could?

Furthermore, regarding a light gun script:

3. in the script I provided, is there roll compensation in there that you can use? (I assume "no", but I must ask)

4. What is roll compensation anyway?

5. What is the complexity of roll compensation such that it is difficult to write?

6. Would asking Andy about how to write roll compensation be of any help? (I can do the asking if you are too shy  ;) )
« Last Edit: August 13, 2012, 03:50:46 am by felix pontifex »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #18 on: August 13, 2012, 02:20:14 am »
No "r" in my name.... I'm not a Dictator of a small bananna republic.  ;)

1.  It most likely will.  Remember it has to work on the Wii, which means it has to show up as a supported device.  I wouldn't worry much about it.

2.  not personally no

3.  no.

4.  A wiimote uses a series of ir leds in a straight line to help determine position.  If you are holding the wiimote at an angle (gangsta style or ect) the dots are no longer in a straight line to the camera in the wiimote and thus without roll compensation, it gets confused.  Glovepie has some built in roll compensation, but as I haven't messed with it that much, I have no clue how good it is.   The last time I messed with Glovepie you had to do almost all wii functionality manually.  Now a lot of the stuff has automated functions, which is easier, but I don't know how good they are.

5.  It's not complex, it just requires math and geometry and ... ugh I do this for fun. 

6.  I don't know if he'd let out a trade secret.... if we get a good script working it could hurt his business afterall.  He's a nice guy though, you could always ask.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #19 on: August 14, 2012, 04:42:34 am »
Ok, I wanted to give an update to what is going on:

I got my bluetooth adapter today, and although it was difficult at first to get the windows bluetooth stack to recognize my wii remote before it shut off, I finally got it working. Funny enough, I think the reason why it got working was because I was trying to install the Toshiba bluetooth stack, and in order to do that you have to rename an .ini file to a bak file, and i am wondering if that is what did the trick for the windows stack.

I called Penguin United today to ask about the pistol, and I got the same response as from you (an assumption that it should work). So once you decide to make a light gun script I will buy the pistol. Funny enough, I asked how sales for it were coming along and he said that they were planning to discontinue it soon, so Andy doesn't have much competition to worry about. Maybe I can get in on a sweet clearance deal or something, they do have an open line to their sales department...

Speaking of the light gun script, I tried out the one I posted in here earlier and it works decently for a mouse. When you make yours, if possible please make it so that you calibrate by aiming at the corners as opposed to just regular top, bottom and sides. While it will be easier to figure out where to aim with an actual set of crosshairs, I can never be entirely sure if I am aiming directly center at the top/bottom/sides, and changing it to aim at the corners is easier, because I know where the corners are without making a custom desktop background. While the accuracy wasn't pixel perfect (then again this could be because I wasn't aiming perfectly) the pointer seemed to remain roughly where I aimed it (as I tried my best to act like the buttons on the remote were the bead on a shotgun). My biggest complaint is it seemed that the pointer was slightly delayed. I don't know if there is a way to fix that, whether it is an issue with the script, glovePIE or hardware.

I tried the controller at a jaunty angle and it did skip around a bit, but if you can make a script that lets me aim at corners to calibrate (and any other dead obvious improvements to the script that you can see) just release it to me without roll compensation added in, and just add it later if it doesn't require a full rewrite, because from what I can tell, I won't be holding the gun at enough of an angle to cause any real functionality issues.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #20 on: August 14, 2012, 04:04:57 pm »
wii mouse is another option:
http://home.exetel.com.au/amurgshere/wiimouse.phtml

I've only messed with it one evening, but couldn't get it working.
Hoping it was my ancient bluetooth adapter and not the 3rd party guns. (big ben interactive walther p99 replicas)
I got a new one, but haven't had time to mess with it.

If I can't get them to work well enough, they'll become expensive aim-trak shells.  :lol

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #21 on: August 14, 2012, 07:26:20 pm »
I tried that one and it actually pairs pretty well.  The problem is afaik there aren't any settings.... you can't calibrate, ect....

I woudl sure like to know how they got music to work in the speaker though.... I tried it ages ago for mamehooker and anything I sent sounded like crap.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #22 on: August 15, 2012, 03:11:36 am »
I will certainly check out what that program can/can't do tomorrow. It looks interesting, thank you for sharing it BadMouth.

@Howard_Castro: I know that this is a matter of you doing something for a complete stranger with no particular personal incentive aside from intrinsic satisfaction, but when do you think you will have the time to work on a light gun script?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #23 on: August 15, 2012, 05:15:39 am »
Still no "R" in my last name.  ;)

No I need to do it myself because I've recently upgraded my mame cab to a lcd monitor and my collection of lightguns is now useless. 

I had one of my famous bouts with insomnia tonight so I decided to have a look.  It IS possible to do wiimotes in mame, and dual wiimotes at that, but glovepie still suffers from a lot of the problems it did years ago.  So in order to get a wiimote working on Glovepie you must:

1.  Get a bluetooth stack that glovepie supports (fairly easy to do, but still... your dongle might not be compatable).
2.  Use wiimotes that are NOT paired to a Wii.  I found out the hard way that if you hit the power button on a wiimote while glovepie is running, it isn't connected and you are close enough to your wii it restarts your computer!
3.  Install PPJoy (not a big deal in xp, kind of akward in vista/7)
4.  Change the joystick settings in your mame.ini to a deadzone of 0 and a sensitivity of 1.  This is easy, but if you intend on running joysticks as well, you may need to  make   multiple inis or custom command line launching for gun games.
5.  (Optional) Have a mame ctrlr file/default.cfg that has all the main functions alternately remapped to josytick buttons.  This is because you can't send false keystrokes to MAME, so GlovePie and PPjoy can only send joystick buttons.  By default MAME does this for the player buttons, but not the start, coin and exit buttons, which you might want.

If you want to deal with all of that setup, it works pretty well.  Even without calibration it does a pretty accurate job of motion tracking.  Movement is slightly slow, but there isn't anything we can do about it... it's the nature of a ir camera. 

I made a little test script that basically makes the wiimote control both a virtual mouse (for windows and pc games) and the virtual joystick at the same time.  Once I ironed out all the issues above, it worked pretty reliably.  All that's left is a bit of polish and a way to turn off wiimotes and calibrate the guns.  I'm hoping I can just do what Nintendo did with skyward sword and just press the up button to center the pointer.  That would be a whole heck of a lot simpler than shooting the four corners every time the cursor gets out of whack. 



Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #24 on: August 15, 2012, 04:23:13 pm »
I did some more experimenting today.  I haven't worked on calibration yet (that'll be the last thing I do) but I wanted to get the cursor output as smooth and steady as I could.  I managed to get it stable enough to hit the little clay targets in duckhunt at their smallest point.  That's the smallest target you'll ever hit in a gun game, so I would say mission accomplished on that bit. 

Just a heads up to people having accuracy issues.  This should be obvious, but I forgot about it, so other people might be running into the same issue.  You can't run hlsl with gun games... period.  Mame is using the dimensions of the game window to locate cursor position, as it should.  Hlsl effects distort the image though (literally, that's hlsl's purpose) so while it looks like you are aiming in one location, if the effects were turned off and the screen was flattened back down, you are actually aiming in another. So hlsl... don't use it.  I could get in the ball park, but I couldn't accurately play duckhunt with them turned on, with them off I got nearly 100%.... so there you go.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #25 on: August 15, 2012, 04:52:40 pm »
I did some more experimenting today.  I haven't worked on calibration yet (that'll be the last thing I do) but I wanted to get the cursor output as smooth and steady as I could.  I managed to get it stable enough to hit the little clay targets in duckhunt at their smallest point.  That's the smallest target you'll ever hit in a gun game, so I would say mission accomplished on that bit.

Is this with a standard wii remote or wii motion plus?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #26 on: August 15, 2012, 08:40:57 pm »
Either.  I'm not using wiimotion plus stuff if at all possible because those nifty little guns linked earlier don't have it.

Did some more research.  You can turn off a wiimote from within glovepie (or out of glovepie for that matter) by holding the power button.  So turn them off is a synch.  The catch?  Turning them on.....  Glovepie only does auto-syncing for the first few seconds of the start of a script or if you click on the glovepie window.  That's going to be a bit of a hurdle because afaik you can't easily close glovepie from the command line. 

One workaround would be to write the script to exit whenever the Esc key is pressed (or whatever you have your exit key mapped to).  Of course then you have to reload the script each time to launch a game and re-sync the wiimotes, which can take a while. 

My script does perfectly fine running in the background... it could be running the whole time you have your cab up and not interfere with your system mouse or anything.  If you leave your wiimotes on all the time though, it's going to run the batteries down. 

I found tons of tools over at the dolphin forums.  There's one program that claims to permenantly sync your wiimotes to your pc, so like on the wii you can just press any button while the pc is on and it'll sync.  This would be ideal but I haven't tried it yet.  There's also a suite of command line tools for bluetooth, so you can connect and disconnect bluetooth devices via command line.  We shouldn't rely on these, but it would be good for when the wiimotes get locked up or ect.. (bind them to a hotkey or something). 

So we're getting there... it's just a matter of making things easy to do from within a cab.  Ideally you should be able to turn on your cab and not worry about anything.  If you want to play a gun game, you just press the button(s) to sync the remote and you are done.  When you are done playing, you should be able to just press the power button to turn the gun off. 

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #27 on: August 16, 2012, 03:11:23 am »
I am having some new issues with glovepie =/ . This stuff just does not want to work out for me...

I was having trouble connecting via the windows bluetooth stack so I decided to install the Toshiba one. The Toshiba one works, but now Glovepie will not work. When I use the old lightgun script the lights on the wii remote change like the script tells them to (first and fourth lights on solid, middle 2 off), but the mouse just sticks into the top left corner of my monitor, and none of the buttons work on the wii remote so I cannot calibrate. Some assistance would be nice, as this whole thing has just worn out my will to try and solve it right now...

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #28 on: August 16, 2012, 03:52:31 am »
It says right in the glovepie ver 45 docs that only the BlueSoli and Microsoft stacks are officially supported for auto-connect.  Even though he found that exploit for the toshiba stack it isn't implemented yet.  All those utilites I mentioned from the dolphin forums also work best with the microsoft or bluesoli stack.  Also keep in mind that Glovepie doesn't like it when you use other methods to connect/disconnect your wiimote...at least not while a script is running. 

If you have glovepie and your stack setup correctly when you are running a script, within the first few seconds you should be able to press 1+2 and the wiimote will auto-pair.  You'll hear the connection tone in windows.  Sometimes glovepie rejects it and upairs it... so you press 1+2 again and it'll work.  Sometimes it takes a long time to pair a wiimote, so you have to keep pressing 1+2 to keep the wiimote flashing.  This is the nature of the beast unfortunately. 

You've got to keep in mind that certain stacks don't play nice with certain bluetooth dongles.  For my own personal dongle and system, I've found that the default microsoft one is the most reliable.  Your mileage will vary though. 

Also don't use that script you linked to... with all due respect to the original author it's dated and coded in a bad way. (Probably due to it's age... gloepie wasn't exactly feature rich back then.) He is manipulating the real mouse... which means if your wiimote fouls up everything locks up.  My new script is using the virtual cursor, which is much better because the real mouse cursor is left unmolested and you are able to move it with your system mouse. 

It isn't ready for primetime yet, but if anyone wants to mess with it:

'-----------------------------
'Combined Wiimote Gun Script For Mame, PC Games and Other Emulators
'By HowardC
'--------------------------------------------------------------
'Note:  to Use this script, First Download and Install PPJOY
'from
'After Installation, Add two Virtual Joysticks with the default
'mappings.

'MAME WILL NOT SEE THE WIIMOTES WITHOUT PPJOY!!!!!!
'--------------------------------------------------------------

'Store Needed Data in Variables so they don't
'change as the script runs

'Wiimote1  Variables
var.cursorx=wiimote1.PointerX
var.cursory=wiimote1.pointerY
var.Abtn=wiimote1.a
var.Bbtn=wiimote1.b
var.One=wiimote1.One
var.Two=wiimote1.Two
var.Minus=wiimote1.Minus
var.Plus=wiimote1.Plus
Var.Home=Wiimote1.Home
var.up=wiimote1.Up
var.down=wiimote1.Down
var.left=wiimote1.Left
var.right=wiimote1.right
'Shake to Reload - Comment Out if it Bothers you
var.shake=wiimote1.SwingDown


'Wiimote2 Variables
var.cursorx2=wiimote2.PointerX
var.cursory2=wiimote2.pointerY
var.Abtn2=wiimote2.a
var.Bbtn2=wiimote2.b
var.One2=wiimote2.One
var.Two2=wiimote2.Two
var.Minus2=wiimote2.Minus
var.Plus2=wiimote2.Plus
Var.Home2=Wiimote2.Home
var.up2=wiimote2.Up
var.down2=wiimote2.Down
var.left2=wiimote2.Left
var.right2=wiimote2.right
'Shake to Reload - Comment Out if it Bothers you
var.shake2=wiimote2.swingdown





'Make our False Cursor Red For Player One
fakecursor1.caption =""
fakecursor1.colour=[1,0,0]

'Make our False Cursor Blue For Player Two
fakecursor2.caption =""
fakecursor2.colour=[0,0,1]


'Wiimote1 Keys Binded to Fake Mouse 1
fakecursor1.x =var.cursorx
fakecursor1.y =var.cursory
fakecursor1.LeftButton=var.bbtn
fakecursor1.rightbutton=var.abtn
fakecursor1.MiddleButton=var.home
fakecursor1.XButton1=var.One
fakecursor1.XButton2=Var.Two
Fakecursor1.Button6=Var.Minus
Fakecursor1.Button7=Var.Plus
FakeCursor1.rightbutton=var.shake

'Wiimote1 Keys Binded to Fake Joystick 1
ppjoy1.Analog0=ensuremaprange(var.cursorx,0,1,-1,1)
ppjoy1.analog1=ensuremaprange(var.cursory,0,1,-1,1)
ppjoy1.Digital0=var.bbtn
ppjoy1.digital1=var.abtn
ppjoy1.Digital2=var.One
ppjoy1.Digital3=var.Two
ppjoy1.Digital4=var.Home
ppjoy1.Digital5=Var.Minus
ppjoy1.Digital6=Var.Plus
'Note:  By default PPJOY maps the POV HAT to 16-19
ppjoy1.digital16=var.up
ppjoy1.digital17=var.down
ppjoy1.digital18=var.left
ppjoy1.digital19=var.right
ppjoy1.digital1=var.shake

'Wiimote1 Keys Binded to Fake Keyboard (Won't work for MAME!)
Up=var.up
Down=var.down
Left=var.left
Right=var.right




'Wiimote2 Keys Binded to Fake Mouse 2
fakecursor2.x =var.cursorx2
fakecursor2.y =var.cursory2
fakecursor2.LeftButton=var.bbtn2
fakecursor2.rightbutton=var.abtn2
fakecursor2.MiddleButton=var.home2
fakecursor2.XButton1=var.One2
fakecursor2.XButton2=Var.Two2
Fakecursor2.Button6=Var.Minus2
Fakecursor2.Button7=Var.Plus2
fakecursor2.rightbutton=var.shake2

'Wiimote1 Keys Binded to Fake Joystick 2
ppjoy2.Analog0=ensuremaprange(var.cursorx2,0,1,-1,1)
ppjoy2.analog1=ensuremaprange(var.cursory2,0,1,-1,1)
ppjoy2.Digital0=var.bbtn2
ppjoy2.digital1=var.abtn2
ppjoy2.Digital2=var.One2
ppjoy2.Digital3=var.Two2
ppjoy2.Digital4=var.Home2
ppjoy2.Digital5=Var.Minus2
ppjoy2.Digital6=Var.Plus2
'Note:  By default PPJOY maps the POV HAT to 16-19
ppjoy2.digital16=var.up2
ppjoy2.digital17=var.down2
ppjoy2.digital18=var.left2
ppjoy2.digital19=var.right2
ppjoy2.digital1=var.shake2

'Wiimote2 Keys Binded to Fake Keyboard (Won't work for MAME!)
R=var.up
F=var.down
D=var.left
G=var.right

'---------------------------------

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #29 on: August 17, 2012, 02:50:00 am »
My homemade sensor bar has finally bit the big one... only took it 5 years.... so development is halted for now.

I'll probably be going out on wednesday of next week and I'll pick up a wireless bar then.  I did create a little code to center the pointer when you press the down button on the d-pad, and it was working pretty well... until the sensor bar crapped out. 

The code still needs direct-x implementation for the pc games and other emulators.  It's gonna be a pain in the butt because dx is in mickeys (relative) and wiimote cursor position is a fraction of the screen (absolute). 

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #30 on: August 17, 2012, 05:21:09 am »
Thank you Mr. Casto for your hard work. Unfortunately for me the only way to get PPJoy to work is if I install windows XP somewhere and boot from it. Despite having Windows 7 professional I cannot get PPJoy to work, even with DSEOB.

I know there are ways to make MAME operate without using rawinputs, and I have to ask, is the PPJoy requirement specifically to resolve that problem?

I will make the required fixes to my bluetooth and attempt to try out your script tomorrow. I have already stayed up way too late trying to fit a square peg in a round hole.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #31 on: August 17, 2012, 06:08:36 am »
I didn't say ppjoy was required for my health.  ;)

The way mame reads mouse inputs is flat out impossible to emulate on a software level (or close to it), so ppjoy is a requirement so that we can use joystick inputs, which we are able to emulate. 

ppjoy is difficult to install on win 7, but not impossible.  I'm on win 7 and I've got it installed.  Of course I'm a developer, so my pc is permenantly in test mode. 

These links are very helpful as only certain versions of ppjoy can install in win 7 and you have to do special configurations.

http://wiki.mechlivinglegends.net/index.php?title=PPJoy_for_using_multiple_joysticks




It seems like this stuff is wearing you out.  Remember you can always go the aimtrack route.... it's more expensive, but you won't have to deal with all of this.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #32 on: August 17, 2012, 06:32:41 pm »
Ok, so I finally got GlovePIE working again. Apparently connecting via the windows device manager thingy is not what I am supposed to do. rather I am supposed to have the auto bluetooth connect on and just hit the buttons when a script is running. I did not know this, I thought I was supposed to connect via windows first. If I can have a separate account on this comp use test mode then I will install PPJoy there. I wanted to use Pinnacle Game Profiler but for some reason it just does not want to recognize my wii remote. Be back in a few minutes...

I guess I will just have to suck it up for now and keep my comp in test mode for now until I can get Pinnacle working or something. I really wish I could get JoytoKey to work with my wii remote, since PPJoy seems to do the same thing.

I got the script working. I will wait until you get a new sensor bar. in the mean time my Penguin United Pistol should be coming in the mail very soon...
« Last Edit: August 17, 2012, 07:48:16 pm by felix pontifex »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #33 on: August 17, 2012, 08:00:55 pm »
JoytoKey wouldn't help you in the least.

It takes joystick movement (analog) and converts it into keybooard presses (digital).  So unless you want herky-jerky movement that absolutely will not work in mame (again, you can't send mouse or keyboard data to mame easily) you are stuck with ppjoy. 


Just for the record, test mode isn't insecure in the least.  All it lets you do is run unsigned drivers for the most part.  So until they start putting viruses in drivers, I think you are good.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #34 on: August 18, 2012, 12:11:01 am »
I've been playing around with some non-mame games just to see what methods one would need to make a truely universal script (mine just works with mame atm). 

My findings:

House of the Dead III -   Faked Joystick Input doesn't work.  Fake mouse works just fine, but the game only supports mice for one player.  Similar issues with other pc lightgun games.  Perhaps someone could write an app like the one used for the old act-labs guns to inject values directly into the memory address?


SINGE -  Games are only one player, so that helps.  SINGE oddly enough has poor support for even andy's guns.  The only way to get any movement on the screen was to use the -fullscreen_windowed mode, which polls the system cursor.  This works ok, except for the fact that the cursor can move beyond the game screen if your monitor isn't 4:3 aspect ratio. 

Flash Games/Homebrew games - typically they are one player and typically they just use the system mouse, so they are easy to support. 

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #35 on: August 18, 2012, 04:40:08 am »
when this stuff finally gets done with I think I am going to learn enough Flash in order to make some simple light gun games. That is after I give myself a vacation from learning anything new and frustrating. As I keep learning more about light gun games I am finding that there are many more ports to consoles of arcade games than I initially assumed, which makes me feel better about my guncons.

When it comes to the IR camera delay, do you find that it hampers gameplay for those games? Do you know if aimtraks have the same delay? I'm curious mainly because I am having some wishful thinking about my penguin pistol. Maybe the camera they use will be higher quality and have less delay. I'm sure you will shoot me down with your advanced technical knowledge.

By the way, what company made SINGE and when?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #36 on: August 18, 2012, 12:53:20 pm »
I don't own an aimtrack so I can't really tell you if it's better or not, but all IR guns inheriantly have a delay.  A true lightgun literally uses the monitor's timing to determine position, so reaction is instant.  For an ir gun, position has to be calculated, either on a chip within the gun itself or via software.  Both wiimotes and the aimtrack do a little bit of both.  That's where your delay comes from. 

That being said, the delay isn't that big of a deal, and a lot of it is a visual delay.  Yeah the cursor has a time keeping up with your movements, but when you stop (which you will to shoot) it catches up. 


I seriously doubt that those wiimote guns will be more accurate.  The reason they came out is due to the wiimote's short throw on the B trigger, making gun shells feel mushy.  Don't get me wrong, that's what I would use on a cab as well for the wiimote route, but that's because of their form, not function.

IR guns biggest drawback is accuracy.  A good lightgun is accurate within one pixel, a level of accuracy you'll never get with an ir gun.  IR guns, even well calibrated ones, usually have about an half an inch of slop.  Luckily the targets on most gun games are fairly huge.  Try duck hunt if you have doubts.  Strangely enough that game has the smallest, most moving targets of any lightgun game, especially the skeet shoot levels.  Most people with IR guns tend to leave the cross hair on, to cope with inaccuracies.  So if you want to "shoot from the hip"  with the cursor turned off, it might not be the setup for you.

The IR guns biggest strength is their adaptability.  When you change your monitor setup they'll still work, ect....  Also one of the reasons they are so popular for mame is the positional gun games.  The majority of mame's gun games are actually positional gun games (giant joystick, and not a real gun).  You won't be playing games like terminator 2 or operation wolf on a real lightgun... they just aren't compatable.  IMHO these are the games that are the most fun, much more so than the traditional lightgun games.


SINGE isn't a single game, it's an Offshoot of the Daphne emulator.  It was originally intended as a means of making fan games, but it devolved into the "porting" of all the laserdisc games that daphne doesn't emulate.  This includes the American Laser Games, like maddog mcree and ect.  You buy the digital leisure copies of the games and SINGE rips them into more arcade accurate versions, playable through singe.    These games are slowly going out of print, so you can pick them up on ebay/amazon for a few bucks a piece.  If you don't like these games then don't waste your time, but if you DO I highly reccomend using singe, because the engine that the digital leisure ports run on is just awful.  Half of them won't even play on windows 7 they are so broken.  Btw... these are some of the few games you might have trouble with the ir guns.  The bulk of the stages are easy, even by lightgun stages, but for the bonus quick draw scenes, you pretty much have to have the crosshairs turned on.  They are still quite playable though.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #37 on: August 18, 2012, 11:26:51 pm »
I played around with house of the dead III a little more today.  I'm pretty sure that game is just broken now that I've tested a bit more.  I'm using a no-cd crack, because... well you don't want to have to put in a cd on a mame cab and I think it may have screwed up the configuration a little.

I tried a  few of my real joysticks and had mixed results.  My matcatz xbox 360 controllers worked just fine, which is odd considering they are xinput devices and the games were released in 2005.  As expected, the rumble feature doesn't work with the pad (xinput doesn't support true force-feedback).  So next I tried a xbox classic controller, expecting it to fully work as it's a true directX joystick.  The joystick wouldn't respond at all, even though in the game's cfg menu I could use it to remap buttons.  Oddly enough force feedback does work?

I thought of a different way to deal with the pc games.  I downloaded the now ancient troubleshooter app that used to fix pc lightgun games for the old act-labs guns.  I was hoping there was an ini file or something, and sure enough there was.  It has the memory addresses of all the cursor postions to those games. I'm not big on making memory hacking apps, but it might be that the troubleshooter could be modified to handle more than just the act-labs guns.


felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #38 on: August 19, 2012, 02:21:13 am »
I had another question about calibrating a wii remote through a script: If you were to make a script the asked not for just the calibration of the screen's corners, but of multiple places on the screen (such as corners, the center, and other points on the screen like the top, bottom, sides, and other spots in between the middle and the sides, making a grid if you were to connect the dots) would it possibly be able to tighten up the accuracy of the gun at all? I recognize that it would not make pixel perfect aiming per-se, but if the user (me) were willing to perform a longer more detailed calibration would that data be useful in minimizing the "slop" presented by the limits of the hardware? Or is good calibration simply a matter of programming?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #39 on: August 19, 2012, 04:26:49 am »
It's hard to say honestly.  If I were a bit better at math I could probably give you a better answer, but the truth is I really don't know. 

For the method I use you really only need two points for calibration, the upper-left corner and the lower-right one.  Those two points will give you the minimum and maximum values on the screen.  Most calibration routines go a bit further and ask you to shoot the center of the screen.  This is mostly to reduce human error.  You might be a bit off at hitting the corners, but it's pretty darn hard to screw up hitting the Center.  So you'll take your max values and divide them by two.... if they are greatly different from the center point, you can average out your min and max values with the center point to even things out a little more. 

I've also found in my tests that just finding the center point helps a lot.  I wrote a test script that allows you to press the down arrow and center the cursor.  The idea is you point the wiimote at the center of the screen and press down to zero it in.  It works amazingly well.  But inconsistencies in the wii cursor report keeps it from being perfect.  You see glovepie averages the cursor positions into the range of 0 to 1 so it can be multiplied by the screen resolution or what have you easily.  The only problem is a wiimotes REAL range can go below zero and above one.... in other words we don't know the exact range.  So a three point calibration system, like the one used in terminator 2 would give us the min and max values of your own personal monitor as well as one point of reference for averaging. 

My guess on your suggestion?  More averaging, in a perfect world, would improve accuracy, but in reality every time the user makes a bad shot, it would throw the whole table off, and if you give a whole grid of values it's going to be a huge pain in the butt to calibrate and people won't bother lining up the shot.  Also remember that glovepie can't save values, so you are going to have to calibrate every time the script is ran, unless you read the offset values while the script is running and hardcode them manually. 

I think three, carefully aimed shots, is the best solution.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #40 on: August 20, 2012, 02:00:40 am »
I wanted you to know that I am probably going to get my penguin pistol tomorrow, so we can find out if it works ok'n'stuff. When you get a calibration feature ready for the script, would it be much work to add a bit to it where instead of just shooting the corners/center once, you do so 3 times? (for averaging purposes) I ask because I would like to test and see if there is a difference myself. Most users (as you said) would mind the multiple shot calibrations, but I do not. For your script, is there any sort of visual confirmation of where the center is supposed to be? Like a dot or something?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #41 on: August 20, 2012, 04:00:10 am »
I was working on the calibration code tonight actually.  I still need a new sensor bar to properly test (the leds on this one are going in and out) but it works fairly well at first glance. 

It'll have multiple visual confirmations on the screen, because I very much intend for this to be a all-in one script.  At the desktop you'll be presented with flashing icons showing you where to shoot.  In mame you'll have the mame cursor "shimmer" in the position where you are supposed to shoot.  By shimmer I mean the cursor will bounce a pixel or two back and forth.  I had to do this because with mame's preferred "auto" crosshair display, the crosshairs disappear if there isn't any movement aftre a second or two.   This means you'll need to keep your crosshairs at least turned to auto, but trust me, for an ir gun that is almost a requirement.  You can turn them off for positional gun games like terminator 2, but you'll need to have the game in a spot where the game's cursor is moveable to calibrate, which means you are going to lose a game.  ;)

In either mode, if you have some form of text to speech installed, there will be a voice telling you what to do.  That could easily be replaced by wav files if a person preferred it instead of installing sapi.   

We'll see about the additional averaging.  To be honest, it would be a noticable amount of extra work.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #42 on: August 21, 2012, 07:47:05 am »
One of the more annoying aspects of glovepie's scripting language is the inability to save or retrieve settings.  It's looping nature also causes issues with constants, or lack there of. 

The constant issue is easily fixed.... you just put the variables in an if statement that can only be entered when the script starts... like so:

if var.init=0 then
     var.init=1
     var.const1=12
     var.const2=13
end if

The script starts up and of course init is 0 because it's never been defined.  Once in the loop we immediately set var.init to 1 ensuring that after these variables are set the first time, they are never set again evne though the script is constantly looping.

Saving variables is a little tricker as there isn't any easy way to do it.  Luckily glovepie supports the launching of programs in the script and the passing of variable values in the command line options.  So I wrote a little command line app that changes the variable values in a script and re-saves it. 


What does all this mean? 

Well normally any glovepie script that involves a calibration routine (like our wiimote gun script) MUST be recalibrated every time you run the script as there isn't any way to save the calibration values.  Now with my command line app, every time you calibrate your gun the values will be resaved in a "constant" section of the script, and thus the next time you open and run the script it will load your latest calibration values!   Now we are getting somewhere!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #43 on: August 22, 2012, 11:35:09 am »
Picked up a new sensor bar today.  Too bad I forgot the batteries.  (DOH!)  Anyway before the bats I did have went dead I tried it out and it works amazingly well.  Now the thing is gigantic, you could probably go into battle with it, but it has adjustable seperation distance between the leds and it works really well. 

It's called the "Wireless Ultra Sensor Bar" by Power A.  If you need one go pick it up!

Anyway, I'll see what I can do about releasing at least the basic script tonight.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #44 on: August 22, 2012, 03:26:19 pm »
That is some wonderful news! I wanted you to know that I lost the Internet connection at my house, and I do not know when I will be getting it back. I suspect someone forgot to pay the bill but I won't find that out until I actually get around to calling my ISP. Some good news of my own though (btw posting from a friend's house): I got the penguin remote pistol and it is connecting to my bluetooth and showing up as a wii remote. I haven't been able to properly test whether it works with glovepie because of some battery issues of my own. I brought 2 pairs with me here, one that is kind of low, and the other that I thought was charged to full. Little did I know the ones that were supposed to be fully charged were in fact, dead, so I won't be able to give a 100% functional confirmation on the pistol until then, but so far it seems to be working (unless my friend has some spare batteries I can borrow).

I plan to also test a rifle shell thing that I bought, it aims the wii remote at a 90 degree angle, so it may require a modified script with roll compensation or something to work (and I do not expect you to help with that, seeing that it is not part of your plans).

(some time later) well my friend has no spare AA's, so I will just have to test it at home.

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #45 on: August 23, 2012, 06:41:40 pm »
So, I got around to testing the penguin gun, and it works, with 1 caveat and 2 potential caveats. After getting the pistol to sync with windows and GlovePIE I was unable to get the wii remote back on (will talk about this later in the post) so I gave up on comparing the two under the exact same conditions before I got too frustrated. This being said, I cannot be certain that the second condition is exclusive to the pistol, or if it is for the wii remote as well.

First of all, I have confirmed the IR sensor in the pistol is more sensitive than the wii remote, considering I had to block out the windows behind my computer in order for the cursor to stop skipping around in confusion, either when using it on the wii or the pc. I suspect however that the PC is more receptive to the sensitivity, as the cursor skipped around more frequently and violently than on the wii. This means that I will have to switch the locations of my tv and pc. (which is not a big deal because I was planning to do that anyway in the future).

Secondly, and this is the one I am not sure whether it is the pistol or the script, but when I tested it on the first draft of the script you posted, I found that at the sides of the monitor the cursor begins to skip back closer to the center of the screen. To be more specific, the horizontal field limitation is such that I can drag the cursor across to the second monitor on the left, and get about 20% across it before experiencing this phenomenon, while if I try to drag it across to the right, as soon as I get to the right edge of the screen it does this. I do not know what causes this to happen this way, whether it is a matter of the script programming or something else. If the phenomenon cannot be programmed out completely in a later revision I hope you will help me figure out how to center it on my main monitor so that if I slightly overshoot the monitor to the left or right there won't be the skip.

Third, I own the version 1 pistol. This means that it is not compatible with the Wii Motion Plus attachment. I contacted customer service and they said that they had an adapter from their returns that they can send me if I send my order number and shipping address. I purchased directly from Penguin United, and they do not have the version 2 pistol anymore. I bring this up, because aside from version 1 lacking the motion plus adapter (which customer service claims is the only thing that differs between the two) if you read the reviews for the pistol on Amazon there are statements about the pistol disconnecting mid game, and being inaccurate. I cannot verify if any of this is true, because Howard has not released a more complete version of the script for me to test the two side by side. I will see about finding a version 2 pistol when I get around to buying it a few weeks from now.

Aside from those 3 possible caveats, the pistol works fine, connects to the PC as well as a wii remote, and connects to glovePIE as well (or in my case, as poorly) as a real wii remote. I will give a direct side by side review of the over all shape, design, and button layout to a guncon 2, a wii remote, and a wii zapper in a later post, to give my full impression on the feel of the device and its strengths and weaknesses.

However, I want to bring up a technical problem I have been constantly having. Even though I can sync my wii remote to windows with little difficulty, getting GlovePIE to recognize that it has been synced has been a constant problem that has dogged me all throughout the process. Is there anything I can do to get it to recognize any easier?

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #46 on: August 24, 2012, 04:00:39 am »
Ok, I just read "fun with glovePIE" so I will try the directions you put in there for syncing, hopefully I have just been really dumb about it all or something. Can you give me an update on how the script is coming along? or even better, an updated script?

Also I am thinking that when all of this is said and done I will make a tutorial on what does and does not work in regards to light guns, so no one in the future suffers the same frustrations.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #47 on: August 24, 2012, 04:56:58 am »
It's about done.  It's only a matter of cleanup and misc stuff that needs done to it.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:July 14, 2025, 01:30:54 pm
  • ...
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #48 on: August 24, 2012, 02:17:01 pm »
It's about done.  It's only a matter of cleanup and misc stuff that needs done to it.

So glad I've put off working on this until someone else worked out all the kinks.  :lol

felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #49 on: August 28, 2012, 03:13:58 pm »
I know that you are still finishing the script, but could you please post a beta of what you have completed so far? I'd like to try messing around with it.

Also, how is that wireless power bar holding up energy consumption wise? I am interested in possibly getting one, since the one I got from ebay was DOA, the only thing is, is that a lot of the ones on amazon have very mixed ratings.
« Last Edit: August 28, 2012, 03:25:03 pm by felix pontifex »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #50 on: August 29, 2012, 04:09:48 am »
It wouldn't do you any good atm. 

I've integrated it with my writetopie app as well as various othere utilites and ect floating around the net.  I'll have to release it as a whole package unfortunately and that just isn't ready yet. 


felix pontifex

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 24
  • Last login:December 31, 2013, 01:29:10 pm
  • I want to build my own arcade controls!
Re: Wingun, lightgun, guncon 2 troubles aplenty
« Reply #51 on: August 29, 2012, 05:16:20 pm »
Well ok, as long as you don't get Mad Scientist Syndrome and keep it to yourself trying to perfect it. Also wanted to say that I looked at the ratings for the Power A version of the light bar, and it didn't have great ratings, especially in regards to the battery life. So I decided to buy the Nyko one instead. It will be here in a few days and when all is said and done we can compare notes on battery life and whatnot.

In other news, I have been looking for a used kinect to play with in conjunction with glovepie, but despite there being over 20 for sale locally I have gotten no responses yet. Weird. I was thinking if I get one I could map a gesture to show reloading (maybe pressing a on the penguin pistol and putting my other hand on the bottom of the handle, to simulate dropping a clip and putting a new one in) and a crouch feature in case I play Time Crisis or any other game that uses the foot pedal for that.