mogzol / ScpDriverInterface

Emulate XBox 360 Controllers on Windows using Scarlet.Crush's SCP Virtual Bus Driver
MIT License
55 stars 8 forks source link

Embedded resources for reduced dependency management #4

Closed DavidRieman closed 3 years ago

DavidRieman commented 6 years ago

Best to view in github with ?w=1 since I let VS fix our mixed tabs/spaces. (I had been avoiding letting commits include the VS C# standard of spaces since the code was tabs-only prior, but I see you've used spaces now.)

DavidRieman commented 6 years ago

I've achieved a 100% stand-alone ScpDriverInstaller.exe now -- one could distribute just that file and it will install/uninstall the driver correctly.

DavidRieman commented 6 years ago

Bump?

CircuitLord commented 5 years ago

I've achieved a 100% stand-alone ScpDriverInstaller.exe now -- one could distribute just that file and it will install/uninstall the driver correctly.

This will work great for the program I developed/am developing. Creator's Camera.

In short it allows you to make cinematics in any game, by "scripting" camera paths, or flying around in-game to define camera paths for the program to playback smoothly.

And now a question:

Unfortunately this project seems to have been abandoned by the original developer, and I'm having a issue with the project, having to do with setting virtual controller values quickly and then waiting for x ms and setting them back to 0 (kind of hard to explain why). It gets pretty inaccurate as it does this. I've noticed from my testing that it seems to set one axis on a controller, then there's quite a bit of delay before the next axis that is included in the controller report is updated as well.

This might also just be a limitation with C# in general, but it would be awesome if this could be fixed.

I have no idea if you know anything about how this might be fixed, but I've been trying to find a solution for weeks now. I wasn't really sure what the best way to contact you was, so I figured I'd ask here. :)

DavidRieman commented 5 years ago

It sounds to me like you're issuing Report after each value rather than updating multiple values and then issuing Report? For example, if you want to set multiple states at the same time with no lag between them, based on this project's readme, I think that would look like:

controller.LeftTrigger = 255;
controller.RightTrigger = 128;
controller.RightStickX = 32767;
controller.RightStickY = 32767;
scpBus.Report(2, controller.GetReport());

That said, I made a wrapper that I think is even easier to use than ScpBus directly, called SimWinGamepad: https://github.com/DavidRieman/SimWinInput#simulate-gamepad - that project builds on ScpDriverInterface by embedding the installer in the DLL, automatically extracting and running it when the running system doesn't have the ScpBus driver installed yet. So it is super user-friendly.

Also, for a real-time input translation example using that: https://github.com/fqlx/XboxKeyboardMouse

CircuitLord commented 5 years ago

Yeah, I've been doing it like that, I set all of them then call a function that does the scpBus.Report(). I'll give that SimWinInput project a go though, it looks pretty nice :)

CircuitLord commented 5 years ago

So, I've fixed that problem I was having a few weeks ago.

I randomly started running into many issues with the driver itself, with both your all-in-one installer and the original found here. The all-in-one works great btw :)

Occasionally people, myself included, will get this or a similar error while trying to install it. annotation 2018-11-21 141030

The temporary fix I've found seems to be to put windows into Test mode to install it. (which obviously isn't a great fix for the average consumer).

I've seen another person with a similar error here (one I've also gotten before): https://github.com/fqlx/XboxKeyboardMouse/issues/130

Any idea what might be causing the error? I've researched it myself a bit but there doesn't seem to be too much info on it from what I could tell.