Jump to content



Photo
- - - - -

WIP - VP Mouse and Joystick Input Plugin


  • Please log in to reply
70 replies to this topic

#61 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 02 July 2011 - 10:47 PM

I've checked your code rascal.

For start it would be really good to just remove if device name = pinabll wizard from the code

and use any gamepad device like it is pinball wizard.

It will be hardcoded and x and y will be nudge and Z plunger, and buttons will also be hardcoded so anyone could use any gamepad that windows can see.

Button asigment will have to be by the book, or joy2key can jump in for buttons.

Next step would be to have dialog box for configuration of analog devices.

Problem that i see with any of mouse implementations is that there is no code in vp for mouse handling, and Z axis handling for plunger is already there and works great, just like x and y axis analog nudge IN ALL DIRECTIONS AND FORCES.

Edited by blur, 02 July 2011 - 10:50 PM.


#62 Noah Fentz

Noah Fentz

    'Rasslin' Fan

  • VPF Administrator
  • 12,282 posts
  • Location:South Lyon, MI

  • Flag: United States of America

  • Favorite Pinball: Whitewater

  • PS3 Gamer Tag: noahfentz


Contributor

Posted 02 July 2011 - 10:52 PM

Since it's easy for the devs to add other controller options, I ask that you do not remove the PBW device distinction, since it's been used in various tables.

Also, as we've discussed previously, any changes that break the current function of the PBW or Mot-Ion board are unacceptable. The reason we even have a VP9 to play with is in HUGE part that those products exist, and it would be horribly disrespectful to make them obsolete.

Thank you.

IdleReel.gif RumbleDMD.jpg HS2-DMD.jpg SBM.jpg ww_logo.jpg EK.jpg

 
T2.jpg Sorcerer.jpg Breakshot.jpg Firepower.jpg GorGar.jpg StarTrek.jpg


My Photobucket Resources
Whether You Believe You Can, Or You Can't, You Are Right." - Henry Ford
The future of pinball lives, it just needs to be nurtured!
If you're here to stab me in the back, you're going to have to get in line.


#63 ynneBBenny

ynneBBenny

    Benny

  • Charter Member
  • 419 posts
  • Location:Melbourne Australia

  • Flag: Australia

  • Favorite Pinball: Fire Power

Posted 03 July 2011 - 01:07 AM


QUOTE
Problem with that, is you may pull the plunger say all the way back and then slowly move it forward before releasing, so capturing the highest value would make it 100% in this case.

How about this then.....
The plunger rests on the micro switch. Telling VP it is at Zero.The second the plunger is pulled, the switch is closed, telling VP to now start counting mouse pluses (not reporting position, but pulses only) Lets assume the plungers total movement is 1000 pulses. Now lets assume we pull the plunger to 900, but then decide to put it to 800 before we release it. You are saying that it will activate acording to the 900 the minute it hits the micro switch. Youd be right.
Part of the programming would be memory timers. Every 1 second VP would refresh the plungers highest count to where it currently is. Maybe one second is too long (requires experimantation.)

Option 2, and probably more accurate. The speed of the mouse pulses determine the speed of the ball launch. A longer pull gives a higher speed than a shorter pull. Dunno what frequency the USB can handle though?
Anyway can you see the concept i'm suggesting?


Slight subject change.....
Maybe a variation not just for pincabs, but all users. Instead of using enter to launch the ball a mouse is used. The user holds the scroll wheel button down and pulls the mouse towards themself. As they are doing this the plunger moves according to thier movement. The ball is launched the second the scroll wheel button is released. Again the concept uses mouse pulse counting instead of position reporting. This hack would mean ANYONE could use it for thier setups.

#64 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 03 July 2011 - 01:31 AM

QUOTE (Noah Fentz @ Jul 3 2011, 12:52 AM) <{POST_SNAPBACK}>
Since it's easy for the devs to add other controller options, I ask that you do not remove the PBW device distinction, since it's been used in various tables.

Also, as we've discussed previously, any changes that break the current function of the PBW or Mot-Ion board are unacceptable. The reason we even have a VP9 to play with is in HUGE part that those products exist, and it would be horribly disrespectful to make them obsolete.

Thank you.



yeah, it's very easy to add thousands of possible gamepad devices in the code.

it's so easy that numbers of them are already added, namely one - utracade, and in unoficial code from rascal - another one ms side winder.


by the way if you remove if device name = PBW and always use settings as if it is PBW, it is not PBW that would be affected, it is the other one - ultracade.

but you can write the code like this:

if name = PBW -> flag = 1
if name = ultracade -> flag = 2
else flag = 1

and all gamepads will work like PBW

Edited by blur, 03 July 2011 - 01:32 AM.


#65 Noah Fentz

Noah Fentz

    'Rasslin' Fan

  • VPF Administrator
  • 12,282 posts
  • Location:South Lyon, MI

  • Flag: United States of America

  • Favorite Pinball: Whitewater

  • PS3 Gamer Tag: noahfentz


Contributor

Posted 03 July 2011 - 01:33 AM

The flags are already in place, and I have a few tables that use them. Most of them, in fact.

We want backwards compatibility whenever possible, no?

IdleReel.gif RumbleDMD.jpg HS2-DMD.jpg SBM.jpg ww_logo.jpg EK.jpg

 
T2.jpg Sorcerer.jpg Breakshot.jpg Firepower.jpg GorGar.jpg StarTrek.jpg


My Photobucket Resources
Whether You Believe You Can, Or You Can't, You Are Right." - Henry Ford
The future of pinball lives, it just needs to be nurtured!
If you're here to stab me in the back, you're going to have to get in line.


#66 blur

blur

    Pinball Fan

  • VIP
  • 1,500 posts

  • Flag: Croatia

  • Favorite Pinball: Amazing Spiderman, Black Hole, Totem



Posted 03 July 2011 - 01:43 AM

this is backward compatible

any PBW will work the same



#67 ynneBBenny

ynneBBenny

    Benny

  • Charter Member
  • 419 posts
  • Location:Melbourne Australia

  • Flag: Australia

  • Favorite Pinball: Fire Power

Posted 03 July 2011 - 02:20 AM

I dont want this lost in the abyss, as it should be a benifit for all users, not just pincab users...

QUOTE
Maybe a variation not just for pincabs, but all users. Instead of using enter to launch the ball, a mouse is used. The user holds the scroll wheel button down and pulls the mouse towards themself. As they are doing this the plunger moves according to thier movement. The ball is launched the second the scroll wheel button is released. Again the concept uses mouse pulse counting instead of position reporting. This hack would mean ANYONE could use it for thier setups.


#68 rascal

rascal

    two-faced as they come

  • VIP
  • 1,378 posts
  • Location:Indiana USA

  • Flag: United States of America

  • Favorite Pinball: Bally Eight Ball



Posted 03 July 2011 - 11:21 AM

QUOTE (WWW @ Jul 2 2011, 09:20 PM) <{POST_SNAPBACK}>
I dont want this lost in the abyss, as it should be a benifit for all users, not just pincab users...

QUOTE
Maybe a variation not just for pincabs, but all users. Instead of using enter to launch the ball, a mouse is used. The user holds the scroll wheel button down and pulls the mouse towards themself. As they are doing this the plunger moves according to thier movement. The ball is launched the second the scroll wheel button is released. Again the concept uses mouse pulse counting instead of position reporting. This hack would mean ANYONE could use it for thier setups.


This would benefit PC users too. Any joystick could be used with VP, not just hacked joysticks for cabs.

As blur mentioned, right now it's easy to add joystick/controller support to VP, as the code already supports them. Adding mouse support would take some doing. More doing then I've got the time or knowledge to help. Maybe cupid or blur would want to dev that deep.

I've thought about the mouse pull back plunger launch, and I think that is a great idea (however, I would use the left button instead of the scrollwheel button, just easer). Again it would take someone with more time to commit to the project then I have. If you could wait until I retire (lets see, maybe when I'm 80 with urine stains in my pants), I'd be happy to spend the rest of my time in between watching the grass grow, to further develop VP. This damn thing called life just keeps getting in the way of my good times. So I must stick with the simple tinkering for now and make big dream suggestions, and maybe, just maybe, someone else will like the idea and implement it.

The Z axis works real good, and is already in place. Rigging a JS/Controller to use this method can be easy for the cab user, and the PC user would just pick up a Joystick. So I'm still leaning in that direction (mainly because my spine is crocked from a blown out disk, but...), because it's there, it works, it's easy, and I'm lazy (ask anybody). smile.gif

Some bright mind should be able to use laser and optic sensors to bounce light off the plunger tip and return a Z axis value... oh wait, Nanotech already did that. We could just buy the Nanotech kit and be done, Noah will soon stock them. Truthfully, I think Noah should learn to speak chinese and find himself a little electronic sweatshop there in china to build his own USB pinball controller package. wink.gif

Posted Image


#69 Noah Fentz

Noah Fentz

    'Rasslin' Fan

  • VPF Administrator
  • 12,282 posts
  • Location:South Lyon, MI

  • Flag: United States of America

  • Favorite Pinball: Whitewater

  • PS3 Gamer Tag: noahfentz


Contributor

Posted 03 July 2011 - 01:13 PM

QUOTE (rascal @ Jul 3 2011, 07:21 AM) <{POST_SNAPBACK}>
Some bright mind should be able to use laser and optic sensors to bounce light off the plunger tip and return a Z axis value... oh wait, Nanotech already did that. We could just buy the Nanotech kit and be done, Noah will soon stock them. Truthfully, I think Noah should learn to speak chinese and find himself a little electronic sweatshop there in china to build his own USB pinball controller package. wink.gif


Already stocked.

http://virtuapin.net...;products_id=39

As long as the Nanotech device is available, I probably won't be looking into my own plunger solution. This thing works awesome. No need to fix what's not broken.

wink.gif

IdleReel.gif RumbleDMD.jpg HS2-DMD.jpg SBM.jpg ww_logo.jpg EK.jpg

 
T2.jpg Sorcerer.jpg Breakshot.jpg Firepower.jpg GorGar.jpg StarTrek.jpg


My Photobucket Resources
Whether You Believe You Can, Or You Can't, You Are Right." - Henry Ford
The future of pinball lives, it just needs to be nurtured!
If you're here to stab me in the back, you're going to have to get in line.


#70 dokworm

dokworm

    Enthusiast

  • Members
  • PipPipPip
  • 67 posts

  • Flag: Australia

  • Favorite Pinball: Star Wars

Posted 05 July 2011 - 01:29 AM

QUOTE (rascal @ Jul 2 2011, 10:00 PM) <{POST_SNAPBACK}>
QUOTE (WWW @ Jul 2 2011, 04:51 AM) <{POST_SNAPBACK}>
Infinately Variable Plunger Laser Mouse Hack

The answer is infront of us all. I have been trying for years to get someone to notice. All it will take is a small bit of coding in VP to implement it.
I still say this is the cheapest and easiest option that is "off the shelf" achievable for anyone.
It is also infinately variable, and solid state (other than the plunger itself) .

If this option was programmed into VP, then anyone could make one from their home.

Does the picture make sense?


I tried using a optical mouse. The problem is the spring on the plunger. Even though the plunger rod moves almost 3" when pulling back, the spring surrounding the rod throws off the optics, as it is just compressing and not really moving with the rod. I even mounted a small plate to the plunger that would ride on the mouse optics with little success. Here is a couple of pictures of the rough rig I had.




The best results so far have been with a joystick axis. It works really well as you can see in Rawd's videos. The Nanotech plunger uses an optic eye, but translates to a Z axis value. So the coding is already implemented in VP for that method, it just a mater of adding more controllers to the list of controllers that VP recognizes.

Cupid mentioned to me that he was going to work on the input section of the VP code to allow Windows detected joysticks/controllers and mouse input. To be able to configure these devices to VP settings. I've been holding off on any further experiments in hope that he will add this feature to VP. To be able to plug-n-play any joystick/controller/mouse that Windows detects would be the way to go. Then we can continue to get creative with our plunger rigs.

Haven't seen Cupid lately. Where ya at buddy? What are you up to?


I think the idea is sound, just backwards smile.gif

Put the LED on the side of the TIP of the plunger, have a long strip inside the machine that is parallel to the direction of travel of the plunger. The strip will have black-and-white stripes on it.

As the plunger is withdrawn, the tip will travel along, and count the stripes as it passes them, so we know how far back the plunger is pulled. As the plunger is let go, you could either count the stripes on the way back to calculate velocity, or just have a microswitch that detects the plunger has been 'fired' and use the initial 'pullback' count to set the velocity.
That way the springs are not in the way, no extra space is taken up (the striped piece of card is under or above the plunger inside the cabinet) and it is robust as there are no moving parts to break. It is also insanely cheap to make, less than $5, and requires no real skills.
You can print the striped piece out on a laser printer to whatever resolution you required, if you did count the stripes (pulses) on the way back and way forward then if you slowly moved the plunger back and forth the on-screen plunger would do the same.



#71 Spektre

Spektre

    Enthusiast

  • Members
  • PipPipPip
  • 92 posts

  • Flag: ---------

  • Favorite Pinball: South Park

Posted 09 July 2011 - 07:58 PM

[quote name='dokworm' post='127036' date='Jul 4 2011, 09:29 PM'I think the idea is sound, just backwards smile.gif

Put the LED on the side of the TIP of the plunger, have a long strip inside the machine that is parallel to the direction of travel of the plunger. The strip will have black-and-white stripes on it.

As the plunger is withdrawn, the tip will travel along, and count the stripes as it passes them, so we know how far back the plunger is pulled. As the plunger is let go, you could either count the stripes on the way back to calculate velocity, or just have a microswitch that detects the plunger has been 'fired' and use the initial 'pullback' count to set the velocity.
That way the springs are not in the way, no extra space is taken up (the striped piece of card is under or above the plunger inside the cabinet) and it is robust as there are no moving parts to break. It is also insanely cheap to make, less than $5, and requires no real skills.
You can print the striped piece out on a laser printer to whatever resolution you required, if you did count the stripes (pulses) on the way back and way forward then if you slowly moved the plunger back and forth the on-screen plunger would do the same.
[/quote]

Exactly, that should work great!


Although one issue is probably getting the mouse to zero. It's inevitable that the mouse is going to miss marks. Then the physical device and the graphic representation will be out of sync.

Edited by Spektre, 09 July 2011 - 08:43 PM.