finalburnneo / FBNeo

FinalBurn Neo - We are Team FBNeo.
http://neo-source.com
Other
881 stars 355 forks source link

Gun games with analog control weren't right #1758

Open JPman1aco opened 2 months ago

JPman1aco commented 2 months ago

When trying to use an analogue arcade gun that I converted to a PC controller with an Arduino.

I noticed that on the FBneo the aiming reticle doesn't follow the position of the gun, it just goes in the direction I turn the gun but doesn't return with the gun to the center.

Other analog games like After Burner II worked as expected with my gun and I was able to use it like an airplane control stick.

The FBneo improvement that made gun games more playable with mouse and d-pad broke support for the analog gun controller.

gun

barbudreadmon commented 2 months ago

Basically the problem is that we don't use axis returned values "directly" for gun games, so when a stick is held right/left/up/down, the cursor keeps moving in that direction instead of staying at the position the stick is being held. @dinkc64 I don't know if there is a setting in win32 builds to handle this. FWIW, using BurnGunSetCoords to inject axis values as coordinates seems to work in the libretro port.

dinkc64 commented 2 months ago

@JPman1aco Hi, neat project! Are you using the Windows version of FBNeo?

@barbudreadmon, so basically: lightgun games on the lr port can be configured to use direct axis or go through burn_gun for gamepad/mouse use? Is that what we need to do on the windows ui side?

barbudreadmon commented 2 months ago

Yes he is using the win32 builds (i talked with him on discord before he posted this issue, took me a while to understand his problem).

FWIW, i pushed this change yesterday to the lr port : https://github.com/libretro/FBNeo/commit/c821b1008e31d40b6d0464f67a3bc0b1a3da4cce So basically, if arcade gun is selected as an input device, i poll the stick, convert it into a width/height position, and send it to the game through BurnGunSetCoords, this is also what i do for lightgun devices (sinden, ...) except the polled "libretro input device" is different. This is what suited best the lr port since it was already using this function for lightguns hence required very few changes/additions, not entirely sure what would be the best for the win32 builds.

dinkc64 commented 2 months ago

So basically for positional mode, we scale the input (0 (left/up) - 0x80 (center) - 0xff (right/down)) to the game's window size and feed that into BurnGunSetCoords()? or we just send 0 - ff to BurnGunSetCoords()?

dinkc64 commented 2 months ago

@JPman1aco Hi, Experimental Positional Mode has been added: edit your config/fbneo.ini file and find this: bBurnGunPositionalMode, and set it to 1 load fbneo and try a lightgun game, I tested with Lethal Enforcers and it appeared to work fine.

Please let me know how it goes!

@barbudreadmon, maybe you can use this to simplify things on your end?

best regards,

barbudreadmon commented 2 months ago

I'll give it a try :)

dinkc64 commented 2 months ago

barbudreadmon, I realized this might not be good for your use, we'd have to expand it to a per-device thing, which is no problem :)

dinkc64 commented 2 months ago

...you know, for example, if player 1 has a sinden or what OP has, and player 2 has a mouse or joy?

barbudreadmon commented 2 months ago

Oh, you are right, it'd be a problem if players can't use different kinds of controller. I might as well stay with my current implementation then, "don't fix what is not broken" as they say.

dinkc64 commented 2 months ago

Well, I think your impl. is kinda hacky, which is why I even mentioned it in the first place. (I'm responsible for a greater number of hacky shit, so, not trying to be an asshole or anything like that) ..plus I would like to expand on fbneo ui's impl. to do similar

JPman1aco commented 2 months ago

@JPman1aco Hi, Experimental Positional Mode has been added: edit your config/fbneo.ini file and find this: bBurnGunPositionalMode, and set it to 1 load fbneo and try a lightgun game, I tested with Lethal Enforcers and it appeared to work fine.

Please let me know how it goes!

@barbudreadmon, maybe you can use this to simplify things on your end?

best regards,

  • dink

Worked perfectly.

Playing with a gun controller is an experience that we no longer find on the streets.