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: Analog guns with U-HID ---- configuration options?  (Read 2101 times)

0 Members and 1 Guest are viewing this topic.

jhuie

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:April 10, 2013, 12:12:12 am
  • I want to build my own arcade controls!
Analog guns with U-HID ---- configuration options?
« on: April 20, 2009, 02:09:18 am »
I am in the process of converting a Lucky & Wild game to Mame.  It has analog (potentiometer) guns which I have mapped to a U-HID device so they appear to be analog joysticks on a game controller.  I downloaded the latest version of Mame and they seem to work ok except two things:

1) When you move them near the center of the screen, the cursors will jump or snap to the center and stick there until you move quite away from the center again.  So the center of the screen is basically "sticky".  I'd like the movement to be smooth from one side to the other without jumping to the center each time.

2) The guns aren't quite pointing exactly at the cursor.  They are off by maybe an inch.

Has anyone out there done this who can explain how to calibrate these and fix these issues?  I've looked around quite a bit but haven't found much on the subject.  At least nothing recent that is using a current Mame version.

Thank you!

John

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Analog guns with U-HID ---- configuration options?
« Reply #1 on: April 20, 2009, 12:28:09 pm »
What you're running into sounds like a joystick's dead zone. I don't recall off hand, but you might check the windows joystick configuration to see if there's a setting there. I know there's a setting in MAME, but I don't know what the ini setting is off-hand. Someone may chime in with that, or you can always run MameUI and set it in the options dialog there, and then see what it corresponds to in the ini file.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

Neverending Project

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 851
  • Last login:April 06, 2015, 10:07:43 pm
    • Arcade Fixer
Re: Analog guns with U-HID ---- configuration options?
« Reply #2 on: April 20, 2009, 12:48:52 pm »
I haven't used the U-HID before, but I did come across the following page on it's website:
http://www.u-hid.com/index.php?option=com_content&view=article&id=4&Itemid=9

Basically, it says there is an Offset setting in the second page of the GUI of the U-Config program. This may help with your offset of an inch that you are seeing.

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: Analog guns with U-HID ---- configuration options?
« Reply #3 on: April 21, 2009, 05:41:44 pm »
1.  Set mame's deadzone to a lower number.  Mame's default is 0.3 (aka 30%), which is fine for gamepad thumbsticks, but too big for a high quality analog joystick.  Depending on the game and how "clean" your pots are, I suggest between 0% and 5% (0.0 - 0.05 in mame.ini).
Robin
Knowledge is Power

jhuie

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:April 10, 2013, 12:12:12 am
  • I want to build my own arcade controls!
Re: Analog guns with U-HID ---- configuration options?
« Reply #4 on: April 22, 2009, 12:54:20 am »
Oooooh, I get it now.   The dead zone is intended to make an analog joystick work like a 4-way or 8-way stick by having a region in the middle that's blanked out.  That makes sense.  But since I'm using it for guns I don't need (or want) it to work that way so I should set it to zero.  I'll try it.  Thanks guys!

Now to figure out how to better align the guns with the screen.....

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: Analog guns with U-HID ---- configuration options?
« Reply #5 on: April 22, 2009, 01:17:47 am »
No, it's not really to make it work like a 4 way or 8 way joystick. Take the game Spy Hunter for example. If you let go of the steering wheel, you should go perfectly straight. How about if you're holding it and therefore it's not exactly centered. It might just be a hair away from being centered. It would not play that well if that meant the car started turning left or right, and it isn't how the original game was designed to work. So a dead zone means even if it moves a hair left or right, the game will still see it as centered. But once you go out of the dead zone, normal analog action takes place.

As for alignment, I would think that could be accomplished via the windows joystick calibration app (or if the u-hid handles it's own calibration, through its app) by carefully tracing around the edges of the screen.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

jhuie

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:April 10, 2013, 12:12:12 am
  • I want to build my own arcade controls!
Re: Analog guns with U-HID ---- configuration options?
« Reply #6 on: April 22, 2009, 02:01:59 pm »
I see what you are saying.  Since Lucky & Wild is both a driver and a shooter I'll need to set up a dead zone on the steering wheel.  But there's no reason to have one on the guns, gas pedal or brakes.  I'll tinker more with the gun calebration and report back!

Thank you again.

John

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: Analog guns with U-HID ---- configuration options?
« Reply #7 on: April 22, 2009, 05:28:55 pm »
To tell the truth, the current use of mame's deadzone isn't the same as it was earlier.  It used to be designed to do both the analog-2-digital 4/8 way conversion point, and to stop accidental just off center drift.  Currently -joystick_map has mostly taken over the analog-2-digital conversion, with more flexiblity; however deadzone still has effect (if the deadzone is bigger than the joystick_map's center.

Still, mame's default value is the same as it was, and IMO 30% is much higher than needed to just cover wandering or off centers, even for the worst cases.  Something all people using analog joysticks 270 steering wheels, and joystick (positional) guns should decrease. 

I usually recommend setting the deadzone between 0.0 to 0.05 because I don't know how off center the user's hardware is that the deadzone has to cover.  If the hardware is perfect, zero is fine, but even the best devices sometimes need a little deadzone.  (A setting of 0.05 will get a 12x12 square deadzone around the center in positional gun games.  edit: 12 out of 256 input values per axis that is; it has nothing to do with the resolution.)
« Last Edit: April 22, 2009, 05:30:58 pm by u_rebelscum »
Robin
Knowledge is Power

jhuie

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 33
  • Last login:April 10, 2013, 12:12:12 am
  • I want to build my own arcade controls!
Re: Analog guns with U-HID ---- configuration options?
« Reply #8 on: April 23, 2009, 03:16:21 pm »
Thanks guys...this has been great info.  Changing the deadzone fixed the one problem.  However, I've still got tracking issues. 

Gun #2 tracks really well, but gun #1 doesn't.  If I point it at the extreme left then the cursor will be at the correct position horizontally.  But as I move across the screen to the right, the cursor moves faster than the gun and gets way ahead of it.  The further I move to the right the worse it gets until I get to about the middle and then it starts closing the gap again until I get to the extreme right when it's right on target.  And the same thing is happening vertically with that gun.

I've tried recalibrating through windows several times with the same results.  Anyone else have any ideas?

KissMyWookie

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 94
  • Last login:September 18, 2014, 04:57:34 pm
Re: Analog guns with U-HID ---- configuration options?
« Reply #9 on: June 27, 2009, 04:55:43 am »
Check that the pots are the same in the left gun as in the right gun.

It's possible that it was repaired some time in the past and an incorrect pot was used (either in resistance value or log/linear types).

Steve

Edit: Also, it could be that the pot is worn out and giving a higher resistance as the wiper sweeps across.
« Last Edit: June 27, 2009, 05:01:14 am by KissMyWookie »