Are emulated inputs the answer for parity with controller users?

Well, is it a good idea?

  • Brilliant!

    Votes: 3 37.5%
  • Blasphemy!

    Votes: 1 12.5%
  • Indifferent

    Votes: 4 50.0%

  • Total voters
    8

relaxation

New member
Oct 8, 2015
561
0
With the current state of the game, analog nudging enables a lot of things that aren’t possible to keyboard-only users and I’d like to mend the disparity. Telling players to purchase and use a controller over what their accustomed to isn’t a solution so I found an alternative since one hasn’t been provided.

And I didn’t invent it! The racing, flying & farming simulator communities also found ways to translate input into their respective games of choice instead of purchasing [expensive] peripherals.

So.. what is it?
Mapping a movement on a virtual controller that’s available via keystroke.

Hey! Isn’t this cheating since there is a lack of nuance?
The tilt-bob is there to detect if you were, as for nuance the technical aspect is there isn’t much room for it in a 0.0333 [2 frame] window when dealing with keypresses in TPA, it is however possible for mouse and trackball to act as your nuanced input, however keyboard users wouldn’t be inclinded to take their hands off the keyboard.

I don’t like easy special moves!
Continue as you were, but if you happen to like arbitrary self-imposed rules you could replace keyboard nudging with softer emulated nudges, limit the number of times they’re used resulting in a ‘more reaslistic’ experience.

So before I layout the details what are your thoughts? Does this bring keyboard up to par with the controller, close to it atleast? As a keyboard player would you want to Head2Head a controller user?

-A controller user trying to help out the keyboard players
 

invitro

New member
May 4, 2012
2,337
0
I'd like to be able to perform a "soft" nudge with keyboard, sure. I'd like to be able to play anybody head 2 head, controller or not, except maybe on Big Shot or El Dorado.

No vote yet because I don't know what your idea is...
 

Metalzoic

New member
Jun 8, 2012
907
0
I'm interested I suppose although I don't think the nudging is a big deal.
I'm curious what you're thinking. Autohotkey scripting? If it is super simple to implement and doesn't interfere with my cab I might do it.
 

relaxation

New member
Oct 8, 2015
561
0
So far what I have is a script thats run by a program that interprets keyboard inputs that outputs a DirectInput value, then that DirectInput value is converted into an XInput value which the game recognises. It isn't run or written for AHK but likely could easily be ported to it.

At the moment WASD would be your nudging directions and if you held space while pressing WASD then a modifier changes the value sent, currently you can set it below 100% then modify it further or the reverse, always soft unless you hold the spacebar.
 

Metalzoic

New member
Jun 8, 2012
907
0
So far what I have is a script thats run by a program that interprets keyboard inputs that outputs a DirectInput value, then that DirectInput value is converted into an XInput value which the game recognises. It isn't run or written for AHK but likely could easily be ported to it.

At the moment WASD would be your nudging directions and if you held space while pressing WASD then a modifier changes the value sent, currently you can set it below 100% then modify it further or the reverse, always soft unless you hold the spacebar.

Sounds cool, not sure how well it would translate to the cabinet though.
 

relaxation

New member
Oct 8, 2015
561
0
Sounds cool, not sure how well it would translate to the cabinet though.

Does your cab already have nudging support for other games, like an accelerometer? a trackball? Perhaps a suspended mouse?

maybe a pedal, dance, balance board peripheral.., some players look like they already dance at the machines
oh maybe a trackpad mounted on the side, nudge via swipe of a finger

I believe wiimotes and other IR tracking stuff might work so suspend those in the cab?
 
Last edited:

relaxation

New member
Oct 8, 2015
561
0
Here's a visual sample (had two modifier keys), not sure on the status of if KB users could diagonal nudge but you could configure it that way if you don't want straight left/right or use a modifer key to make them diagonal.

I played Xenon earlier on keyboard, wasn't too bad. Little confusing at first having to flip and nudge with the left hand (compared to an analog stick). the third and pinky finger on LeftShift, WASD with the middle and pointer & modify with a thumb on Space or LeftAlt

I'll look into cab stuff soon, do not have a bluetooth reciever to test the Wiimotes(22USD used at gamestop) accelerometer.

gameplay here time of this posting it's still processing, shouldn't take too long
 
Last edited:

relaxation

New member
Oct 8, 2015
561
0
Here's the instructions:


Anyone is welcome to port it to AHK and post it here, the program I'm using has a DIY vr/headtracking crowd behind it so Wii/Android/iStuff have plugins that may allow me to access&interpret their accelerometers, IR tracking may have too much latency for this application but I could be wrong. vpforums may help you cab people out, they've been doing this for at least 6 years before me with other tools but I've shown you.. I hope.. how to take their solutions and wrap it up in a way TPA would accept it.

In other terms to explain the tools and their use: vJoy is the vessel, FreePIE is the engine and x360ce is the cloaking device
 
Last edited:

Metalzoic

New member
Jun 8, 2012
907
0
You might want to add a warning to your instructions about VJoy. It is a useful program, however many programs can conflict with it.

For example AAE emulation and other emulators will crash if you have the VJoy drivers enabled. Many games will not work right (or work at all) with VJoy enabled such as Broforce, Street Fighter IV, Shank, Expendabros and a bunch of others that I've run across myself. On the flip side some games need VJoy to work with a keyboard, or in an arcade cabinet, like Mortal Kombat X and Injustice.

It doesn't need to be unintstalled, you just disable it from Device Manager under Human Interface Devices when not using it to avoid conflicts.
 

relaxation

New member
Oct 8, 2015
561
0
To be clear there are two virtual controller solutions that use the letters "vjoy", one is vJoy(sourceforge) the other is VJoy(headsoft).

After you mentioned it I just checked Broforce and there was a pulling to the left problem on the world campaign map, until I went into gamepad options and cleared it. later on I remapped Broforce and it moved on the map fine but not the characters, then checked Ultra Street Fighter IV and it didn't have an option to clear mappings but from what I could test it didn't interfere

Do those other games have an option to clear gamepad bindings? if you had a gamepad.. you wouldn't need this setup I would image.

thanks for the possible heads-up for those who play other games in the post below, I haven't really played anything else outside of pinball in some time.
 
Last edited:

Metalzoic

New member
Jun 8, 2012
907
0
I forgot their were two different programs with the same name. I can't remember which is the problem one. I believe it uses a green icon though.
I just mentioned it just in case someone downloads it and has issues because they could lose hours upon hours trying to troubleshoot what's wrong. This way they already know what to do if they have a problem.
 

relaxation

New member
Oct 8, 2015
561
0
Hi, i tried this, works great! but the nudge is a bit to weak.
So i messed arround with the script, what value is 100% or 75% etc?
Can this auto start with windows?
Thanx :D

Thanks for trying it out! I'll look into autostarting it* or just porting to AHK since a lot of people use that (I did too at one point).

Code:
#soft logic
if not keyboard.getKeyDown(N2_key):
pressed = .6
if keyboard.getKeyDown(N2_key) and pressed > 0:
pressed = 1
if keyboard.getKeyDown(N3_key) and pressed > 0:
pressed = .8

In english:
If you aren't pressing the [N2_key] space bar it's only doing 60% (max value * .6).
If you're pressing the space bar its 100% (max value * 1)
If you're pressing the [N3_key] left alt key it's 80% (max value * .8).

So you could change these values to anything, like .55, .946 or .64334 to essentially get any xx.x% strength nudge you desire.

*Copy your script to the same folder as FreePIE or use its full location when making a shortcut to FreePIE like so...
WwgcBmi.png

Use this shortcut manually, task scheduler or whatever and it'll launch the quoted script and /r starts it.
 
Last edited:

Pantah010

New member
Jan 31, 2013
113
0
Thanx, really happy with this! ;)
Now to revisit all tables with this softer nudge (got it at .75) :p
I recommend this for cabs with digital nudge!

Cheers :cool:
 

relaxation

New member
Oct 8, 2015
561
0
I came across an oversight on my part, there's an important subject regarding the Invert Nudge option inside the game and I made the FreePIE script with that turned on but I believe my controller had up&down inverted in x360ce so I never noticed up and down got inverted as well until I was trying to get AHK stuff going.

If you're not getting the intended behavoir... Keep Invert Nudge in mind if you're setting this up, you can turn it off and swap the axises math stuff yourself in the script or mess about in x360ce for the same purpose when selecting inverted axis <number>.
 
Last edited:

relaxation

New member
Oct 8, 2015
561
0
If you really need AHK support, which I'd advise against, this is what I could come up with so far for keyboard-only players.
You'll need to create a \Lib folder in ...\Program Files\AutoHotkey and put the CvJoyInterface.ahk file there in order for below to work.
Code:
;Emulated controller input for keyboard-only players of Pinball Sims
#SingleInstance, force
#include <CvJoyInterface>
; shortening terms
vJ := new CvJoyInterface()
mS := vJ.Devices[1]
pos := vJ.PercentTovJoy(100)
rest := vJ.PercentTovJoy(50)
neg := vJ.PercentTovJoy(0)
posmod := vJ.PercentTovJoy(80)
negmod := vJ.PercentTovJoy(20)

; starting neutral state
mS.SetAxisByName(rest,"x")
mS.SetAxisByName(rest,"y")
mS.SetAxisByName(rest,"z")
mS.SetAxisByName(rest,"rx")
mS.SetAxisByName(rest,"ry")
mS.SetAxisByName(rest,"rz")

; modified power hotkeys via WASD
~*w::
KeyWait, w, D
	mS.SetAxisByName(rest,"x")
	mS.SetAxisByName(posmod,"y")
KeyWait, w
	mS.SetAxisByName(rest,"y")
	return
~*a::
KeyWait, a, D
	mS.SetAxisByName(rest,"y")
	mS.SetAxisByName(negmod,"x")
KeyWait, a
	mS.SetAxisByName(rest,"x")
	return
~*s::
KeyWait, s, D
	mS.SetAxisByName(rest,"x")
	mS.SetAxisByName(negmod,"y")
KeyWait, s
	mS.SetAxisByName(rest,"y")
	return
~*d::
KeyWait, d, D
	mS.SetAxisByName(rest,"y")
	mS.SetAxisByName(posmod,"x")
KeyWait, d
	mS.SetAxisByName(rest,"x")
	return
	
; full power hotkeys via WASD with Alt held down
~*!w::
KeyWait, w, D
	mS.SetAxisByName(rest,"x")
	mS.SetAxisByName(pos,"y")
KeyWait, w
	mS.SetAxisByName(rest,"y")
	return
~*!a::
KeyWait, a, D
	mS.SetAxisByName(rest,"y")
	mS.SetAxisByName(neg,"x")
KeyWait, a
	mS.SetAxisByName(rest,"x")
	return
~*!s::
KeyWait, s, D
	mS.SetAxisByName(rest,"x")
	mS.SetAxisByName(neg,"y")
KeyWait, s
	mS.SetAxisByName(rest,"y")
	return
~*!d::
KeyWait, d, D
	mS.SetAxisByName(rest,"y")
	mS.SetAxisByName(pos,"x")
KeyWait, d
	mS.SetAxisByName(rest,"x")
	return
I tried loops, while getkeystates etc to get the line count down but those didn't work as reliably when striking the hotkey repeatedly at a quick pace. Couldn't bind the spacebar either when an astrisk is in use which is required because you may have a flipper engaged.

Currently I do not see AHK providing emulated nudge capabilities to cabs via accelerometer with this CvJoyInterface.. at least not in a way I understand from their SDK
 

relaxation

New member
Oct 8, 2015
561
0
Looks like a new avenue has opened today for FreePIE without the vJoy or x360ce requirements but requires the 360 driver and ScpDriver instead.
the vJoy dev was looking at emulating xinput stuff on the driver level too, but I think some kind of driver install, vJoy or ScpDriver, will always be a requirement
Does anyone have prior experience they'd like to share with the ScpDriver being used as an xinput wrapper? I don't have PS3&4 controllers.

Confirming that it works: proof
requiring me to build the dll myself was a pita, here just go download VS2015, which is 5GB, to build this 21KB dll file.
Checked TPA, FX2 and Broforce(reset your gamepad binds) and it works.. after I removed the x360ce files from their directories
 
Last edited:

relaxation

New member
Oct 8, 2015
561
0
While in the shower I was going over various ways people have done their nudge input since I think the accelerometer method is prohibitive in cost or complexity.

I didn't like the IR-wiimote method because it would wobble, I was just thinking the wiimote-accelerometer too would wobble and trying to think of a way to implement a digital deadzone, then I thought how would I deaden the wobble physically.. and it came to me: the hanging-dimes-off-a-mounted-controllers-analog-stick weren't there to push the stick from a nudge.. they were there to hold the analog stick in place while the table moved. I may play with this idea HOWEVER..

Later tonight I found out people disassembled FreestylePro controllers, mounted them, and used it as an analog input device.. now recently in that thread this project was linked to and basically it's a program to run on this [15USD] accelerometer which then can be seen as a USB gamepad and it looks like someone has already used x360ce to wrap it and have it work for TPA/FX2.. so Cab players seem covered with an inexpensive product that doesn't come with problems like a wiimote(batteries/wake issues).


Different topic, Custom tilt-bob
I thought I wanted to mimic the in-game meter but I looked at how VP/FP had their nudge systems in place and they're all just you can only do z-value or y-value over x-time. Then I wanted to mimic the behavior of a 2D pendulum, complete with input methods adding/subtracting to its motion based on the x-axis.. with a copy of that also working for the y-axis for a 3D space representation of a tilt-bob. Turns out the idea is easier than knowing how to implement it.

The idea was it read your inputs, applied it to the v. pendulum and then do input denial when you go above your virtual space allowance.
Virtual space allowance is a fancy way of saying one of the parameters is a virtual ring, the ring being the tilt sensor, .. on a physical machine think of the bob as a tear, as a tear the shape gets bigger further down right? so the difficulty of a machine is decided where the tear is placed inside the ring (higher or lower).. instead of this setup we would determine the ring size instead of the physical parameters of the tear since it's software.

This is basically a 3rd-party difficulty setting you could use for possibly all your pinball games.

Would there be any interest in funding this idea since I'm not qualified?
I'd perfer this to run in FreePIE, making the source free to the public to edit

A future problem, if it came to be, would be how to scale the ring to match real machines and then scaling real force to virtual space.. and of course knowing which table we're playing
 
Last edited:

Members online

No members online now.

Members online

No members online now.
Top