argonlefou / DemulShooter

Enable dual lightgun play in arcade games and emulator
114 stars 15 forks source link

Point Blank X Plugin input broken when using `-noinput` #224

Closed SeongGino closed 1 month ago

SeongGino commented 1 month ago

When running PBX with the Unity patches provided by DemulShooter, if DemulShooter is run with -noinput, inputs are not received and the crosshair stays perpetually in the bottom-lefthand corner (even with -nocrosshair).

Why is this important (to me)?

Because I use Linux, and have used DS through Wine for a while, I'm well familiar with its incompatibility with multi mice at the moment, and thus input is usually broken to varying degrees on the platform. The current workaround I rely on is to use -useSingleMouse, which I assume(?) is using the system cursor for input rather than mice coords directly, which is fine--but there are some games, PBX included, where some shots incorrectly register as being off-screen.

In this case, I'd rather use -noinput and simply fallback to the native game's internal emulated gun mechanisms; yes, this won't have multiplayer compatibility, but until Wine bug 55547 gets addressed or even acknowledged, it's not like I would even be able to access it currently anyways.

argonlefou commented 1 month ago

Tricky one but nice catch !

When running PBX with the Unity patches provided by DemulShooter, if DemulShooter is run with -noinput, inputs are not received and the crosshair stays perpetually in the bottom-lefthand corner (even with -nocrosshair).

Yes, -noinput disable the input system in DemulShooter. Butterfly effect is, for Unity games, that data are passed from/to the added plugin (either by mapped memory in older plugins, or local TCP socket in newer ones - including Point Blank) and disabling inputs just sends nothing to the plugin....including the -nocrosshair flag which is part of the message. That's why the crosshair stays on with the -noinput flag

To clarify, inputs are technically being received somewhat in the frontend (i.e. games selection menus), but with no gun feedback (sound & shot graphic); all mouse input is completely ignored in actual microgames.

Yes the game has some mouse inputs implemented here and there, on top of the one I blocked with the pugin (used in mini games) I did notice that in the menus.

Why is this important (to me)?

Because I use Linux, and have used DS through Wine for a while, I'm well familiar with its incompatibility with multi mice at the moment, and thus input is usually broken to varying degrees on the platform. The current workaround I rely on is to use -useSingleMouse, which I assume(?) is using the system cursor for input rather than mice coords directly

Correct ! Precious thing do develop and test with a mouse rather than a lightgun attached on a laptop ;)

In this case, I'd rather use -noinput and simply fallback to the native game's internal emulated gun mechanisms; yes, this won't have multiplayer compatibility, but _until Wine bug 55547 gets addressed or even acknowledged, it's not like I would even be able to access it currently anyways._

I do understand perfectly. This should also affect every other Unity-based demulshooter games, as the mechanic is the same.

I did not notice that side effect with the -noinput because all other had no native controls so no one may have tested it back then.

I'll need to tweak the plugin AND demulshooter a little bit to make sure that problem is fixed. As of today, just adding the plugin to the game will block inputs, I'll add the -noinput flag to the message between DS and the plugin

SeongGino commented 1 month ago

Thank you so much for going through the whole reply like that! Can't really say I expected the thoroughness.

Not really much else to say, other than looking forward to seeing the fix. Though really, I would just like if Wine's rawinput implem was better. Guess it's one of those things that doesn't get noticed until someone has just the right combination of particular circumstances - which seems to be the position I've constantly found myself in for the past nine months, aha.

On a tangent FWIW, it seems to be hit or miss whether Wine handles a game's DS provided input better or not. Gundam: Spirits of Zeon for example is borderline unplayable with -useSingleMouse because of the cursor jumping to the bottom-leftmost corner so often, so that I use -noinput; but most Model 2 games, Friction, VCop 3 thru CXBX, Operation Ghost and other Ring system titles, and etc. are just fine. But again, I don't pin that on DS so much as it's a Wine issue.

argonlefou commented 1 month ago

Should be fixed in v12.8 update

Do not forget to also replace the plugin files

SeongGino commented 1 month ago

Works great now, big thanks :tada: