Cendric2 icon indicating copy to clipboard operation
Cendric2 copied to clipboard

Linux Controller Linux update

Open chui2ch opened this issue 6 years ago • 30 comments

I just tested the game with the update, and now all the buttons are labeled as B1, B2, B3, B4 etc. It no longer shows the play station buttons, or the Xbox A,B,X,Y buttons. image

chui2ch avatar Jun 21 '18 00:06 chui2ch

Awesome, that's how it should be if it doesn't know the mappings for your controller. In the terminal, it should show the product id for your controller. If you want, you can give me that number together with the mappings for your controller. Just click a button on this screen and then press a gamepad button on your gamepad to see which is which. Would be great if you could send me the mappings for your controller, then I'll add them to the game :)

Ironbell avatar Jun 21 '18 07:06 Ironbell

DS4 Controller Controller ID: 2508 B3=Square B2=Triangle B1=Circle B0=X B8=Share B9=Options B4=Left Bunmper B5=Right Bumper B10=PS button B6=Left Trigger B7=Right Trigger B11=L3 B12=R3

chui2ch avatar Jun 21 '18 10:06 chui2ch

Logitech F310 Controller ID: 49693 B2=X B3=Y B1=B B0=A B4=Left Bumper B5=Right Bumper Z-=Left Trigger R-=Right Trigger B6=Back B7=Start B8=Logitech button B9=L3 B10=R3

chui2ch avatar Jun 21 '18 10:06 chui2ch

When I went to do this with a DS3 it shows the number as just 1. Does that seem correct?

chui2ch avatar Jun 21 '18 10:06 chui2ch

Wow thank you, that's seriously awesome. DS3 with productId 1 is weird though, because it says "1" is 0001 Fry's Electronics 7778 Counterfeit flash drive [Kingston]. DS3 is also not on this list here: http://www.linux-usb.org/usb.ids which explains it. Linux does not recognize the id, so it's just a "flash drive" I guess.

your DS4 controller seems to be correct (09cc is the hex value and it's therefore a DualShock 4 [CUH-ZCT2x])

Logitech is hex c21d F310 Gamepad [XInput Mode], seems to be correct too. I'll add those mappings for sure into the game. Thank you so much!

Ironbell avatar Jun 21 '18 16:06 Ironbell

Oh, and by any chance, would you have the mappings for right stick / left stick / dpad too? You just have to check the 4 directions for each. Only if you got the time though :)

Ironbell avatar Jun 21 '18 16:06 Ironbell

F310 LS left=X- LS Up=Y- LS Down=Y+ LS Right=X+ RS Left=U- RS Up=v- RS Down=v+ RS Right=U+ DPL=PX- (up and left on the dpad are registering as the same thing) DPU=PX- DLD=PY+ DLP=PX+

chui2ch avatar Jun 21 '18 23:06 chui2ch

DS4 LSL=X- LSR=X+ LSU=Y- LSD=Y+ RSL=U- RSR=U+ RSU=V- RSD=V+ DPL=PX-(dpad left and up are detected as the same) DPR=PX+ DPU=PX- DPD=PY+

chui2ch avatar Jun 21 '18 23:06 chui2ch

The DS3 is connected through bluetooth. It may need to detect the id in a different way. Also do you want Xbox one bindings?

chui2ch avatar Jun 21 '18 23:06 chui2ch

Hm, if SFML (the multimedia library Cendric is based on) can't get it from the wireless controller over xInput or whatever it uses, it would get difficult. For the XboxOne bindings: Yeah, would be cool, I got them already in the game but it would be good to see whether they're different for linux. I heard some axis is inverted somewhere. does the game recognize your XboxOne and already apply the mappings?

Ironbell avatar Jun 22 '18 11:06 Ironbell

Sorry I have not had a chance to sit down and map out the xbox controller yet. It does not detect the correct buttons. I did test the game with the DS4 after the patch, and the key bindings all see right in the menu and for the most part the are correct in game, however it still says to click O to pickup/interact. But I have X set to interact. image

chui2ch avatar Jun 23 '18 19:06 chui2ch

Thanks for the catch, I fixed it right now and will upload it to Steam soon. What do you mean with the XboxController does not detect the correct buttons?

Ironbell avatar Jun 24 '18 08:06 Ironbell

When I say say they are not correct I mean that you said you had the bindings in for the xbox controllers, but it appears that the configuration did not carry over to Linux. xbox one elite controller Gamepad ID=739 B3=Y B2=X B1=B B0=A B6=Back B7=Menu/Start B9=L3 B10=R3 B4=Left Bumper B5=Right Bumper B8=Xbox Button Left Trigger=Z- Right Trigger=R-

Left Stick L=X- R=X+ U=Y- D=Y+

Right Stick L=U- R=U+ U=V- D=V+

Dpad L=PX-(up and left show the same access.) R=PX+ U=PX- D=PY+

chui2ch avatar Jun 24 '18 12:06 chui2ch

Xbox One Controller Gamepad ID=733 B3=Y B2=X B1=B B0=A B6=Back B7=Menu/Start B9=L3 B10=R3 B4=Left Bumper B5=Right Bumper B8=Xbox Button Left Trigger=Z- Right Trigger=R-

Left Stick L=X- R=X+ U=Y- D=Y+

Right Stick L=U- R=U+ U=V- D=V+

Dpad L=PX-(up and left show the same access.) R=PX+ U=PX- D=PY+

chui2ch avatar Jun 24 '18 12:06 chui2ch

Awesome! Yeah I do have several mappings defined for Xbox controllers, but there are a lot of controllers out there which I did not include yet. Product Id 733 (Xbox One Controller (Firmware 2015)) and 739 ( Xbox One Elite Controller) were not mapped yet, but according to the linux list, they are indeed xbox one controllers. These are the ones defined for now, including other Xbox One controllers:

https://github.com/tizian/Cendric2/blob/master/include/Enums/GamepadProductID.h

I'll add yours as soon as possible. The DPad issue seems to be a bug on SFML with Linux, I'm going to ask in their Forums. It is not critical for cendric though, as the DPad does not have to be used to play the game.

Thank you again for your help!

Ironbell avatar Jun 24 '18 12:06 Ironbell

Build is live on Steam. Does it work for you?

Ironbell avatar Jun 24 '18 13:06 Ironbell

So for the most part the xbox bindings are correct. The Dpad up and Dpad down are flipped. I changed the configuration for dpap up to be down and dpad down to be up for movement 2 options and it worked like a charm.

chui2ch avatar Jun 24 '18 13:06 chui2ch

Flipped them for Linux, which means that you will probably have to reset them again or configure them as they were. But thanks again and I hope you can now finally enjoy the game ;)

Ironbell avatar Jun 24 '18 14:06 Ironbell

Do you already have xbox 360 game pads configured for linux? I have yet to start the game on my home theater pc, but I am using 360 pads on it. I will work on testing it on there next.

chui2ch avatar Jun 24 '18 15:06 chui2ch

I do have some configured, but I'm not sure whether the mappings are the same on linux. will gladly add them if you try them out and they're different or even new. :)

Ironbell avatar Jun 24 '18 15:06 Ironbell

on linux the DS4 buttons are displayed wrong triangle is displayed as square square is displayed as cross cross is displayed as circle and circle is displayed as triangle

also when i use multiple controllers i dont have the ability to switch without unplugging a controller

eiiiiix avatar Oct 28 '18 00:10 eiiiiix

I wonder whether that's a different DS4 controller model, as I used chui2ch's mapping for Linux & DS4. Do you know the exact model you're using? Also, yes, only one controller is supported, the first connected one. I don't intend to change it, because it would mean looking for input on all possible slots - and who would use more than one controller for a singleplayer game? ;)

Ironbell avatar Oct 28 '18 08:10 Ironbell

Sony changed the ds4 at some point and the new ones have a different ID. As far as I know I have one of the older controllers.

chui2ch avatar Oct 28 '18 13:10 chui2ch

i must have a newer model then i bought this one recently and had no idea there were other models and as for 2 controllers in a single player game, idk i just like being able to switch controllers sometimes

eiiiiix avatar Oct 31 '18 17:10 eiiiiix

@eiiiiix To include your mappings, I would need to know the product id of your gamepad. You find example values here for gamepads that are already mapped: https://github.com/tizian/Cendric2/blob/master/include/Enums/GamepadProductID.h

Ironbell avatar Oct 31 '18 18:10 Ironbell

@Ironbell sorry my laptops cooling fan kinda exploded and wrecked the inside but my ds4 is on the list (https://github.com/tizian/Cendric2/blob/master/include/Enums/GamepadProductID.h#L12)

eiiiiix avatar Nov 07 '18 17:11 eiiiiix

@eiiiiix That's weird, because @chui2ch also gave me mappings for Linux and that specific controller, https://github.com/tizian/Cendric2/blob/master/src/Controller/GamepadMappings/DualShock42Mapping.cpp#L51

would that mean the mappings are different on different linux systems but with the exact same controller? holy^^'

Ironbell avatar Nov 07 '18 18:11 Ironbell

It should not be, but it would be best if you could use sdl input instead of mapping individual controllers. You could contact @icculus about the issue. He may be able to help. Also @eiiiiix what distro are you using? I am on Ubuntu 18.04.

chui2ch avatar Nov 08 '18 03:11 chui2ch

im using Solus 4.9 i would like to use Ubuntu more but i usually have overheats when i use it

eiiiiix avatar Nov 09 '18 02:11 eiiiiix

I wonder if the LSI that solus uses could be causing an issue. Have you tried turning ot off and using the steam run time?

chui2ch avatar Nov 09 '18 12:11 chui2ch