Kodi Community Forum

Full Version: Input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Well, call me a retro-nerd, but I do like the idea that I can use the original controllers for their matching emulators. Ever tried playing Street Fighter 2 Turbo with an X360 controller? Tongue

That being said, a zero-config solution should be default. The lineart grumpygamer is making can serve as a check for X360/dualshock users to make out what a certain button or trigger is mapped to, For us retro-nerds the lineart allows us to map our controllers specifically for the game we want to play. I see only winners here Smile
Ok, let's talk a bit about the console specific controllers. If one has a NES controller I ofc can understand that he wants to play his NES games with it. However, nothing prevents us from assigning multiple controllers to one player. So if you have two 360 controllers and tow NES controllers, bind one of each to player 1 and player 2 and just grab the one you want to use atm. Won't this work just fine?
The only situation where you would have to switch a controller between player profiles is when you only have one of each and a friend comes by.
(2016-02-09, 13:04)da-anda Wrote: [ -> ]Ok, let's talk a bit about the console specific controllers. If one has a NES controller I ofc can understand that he wants to play his NES games with it. However, nothing prevents us from assigning multiple controllers to one player. So if you have two 360 controllers and tow NES controllers, bind one of each to player 1 and player 2 and just grab the one you want to use atm. Won't this work just fine?
The only situation where you would have to switch a controller between player profiles is when you only have one of each and a friend comes by.

There are several assumptions hidden in your approach that are not given. For a lot of controllers we don't know that it's a NES/PS/Xbox/... controller. On win32 we don't even know that it's an Xbox 360 controller because you can use the exact same API with a DualShock 3/4 and there's no way in the API to differentiate them. On win32 a lot of controllers are generic bluetooth controllers so we have no idea if they will be used together or separately. We also can't know which controller a user wants to use with which platform so having multiple global player 1 controllers would be a nightmare. What happens if you have two player 1 controllers and they are used at the same time. You have to know that controller X is used as player 1 on the current platform and that controller Y is used as player 2. The obvious choice is to just assign them to the available ports one by one but if a user wants to use different controllers he has to be able to do that mapping specifically because there's no bullet proof way to do it automatically. Either way even in your example there would have to be a way to specify for each controller that it's player 1 or player 2 so you need some kind of configuration tool.

Personally I have a few Xbox 360 controllers, a few controllers from Google for Android TV, the Shield TV controller and a bluetooth NES controller. I've tried playing NES games with the Xbox 360 controller and it's ok-ish but the controller just isn't meant to be used with the D-PAD all the time and it feels odd. So I use the NES controller to play NES games but it's impossible to SNES games with the NES controller because it misses some buttons.

As already mentioned a few times the goal has to be that for a normal user with one or two controllers everything works out of the box. But for users with a lot of different controllers who want to use them explicitly on specific platforms there also needs to be a comfortable way to be able to specify how they want to use their controllers.
I don't see where my concept has an issue. If you have 2 XBOX controllers and 2 NES controllers, then you can by default bind XBOX-A and NES-A to Player1 and XBOX-B and NES-B to Player2. There is no need for Kodi to know of what type the controller is. It's up to the user to grab the controller he wants to use as both are always active (as long as plugged ofc). Both input devices A will control player1 - regardless which core and you should actually also be able to use them simultaniously (at least technically), so you can start playing a game with the XBOX controller, grab the NES controller mid game and continue without any break.

If you ofc grab XBOX-B by mistake, then you're by default Player2 and you either switch to the other controller (same as if they would be plugged physically in the wrong console port) or also bind it to Player1 from now on and rebind once you need two players again. There is no special magic or logic behind. It's IMO the most simple solution.

If you only have a limited set of controllers and want to assign one for player2, then it's as easy as described here http://forum.kodi.tv/showthread.php?tid=...pid2237137 (open the OSD, choose "manage players" button, click on "assign input device" on player2 and press any button on the input device).


edit: the only assumption I have is that controllers will always have the same ID and that we can tell which button is from which controller ID - but that should be the case, right?
You can also have a window "Player 1 please press a button on your controller ..." before a emulator starts.

Maybe a menu-entry "Test Controllers" in the context/fullscreen menu of the emulator, where players can test their controller and/or config and switch it if needed.
(2016-02-09, 17:35)da-anda Wrote: [ -> ]I don't see where my concept has an issue. If you have 2 XBOX controllers and 2 NES controllers, then you can by default bind XBOX-A and NES-A to Player1 and XBOX-B and NES-B to Player2. There is no need for Kodi to know of what type the controller is. It's up to the user to grab the controller he wants to use as both are always active (as long as plugged ofc).
Are you assuming that all controllers are permanently attached to the device? I believe that will mostly not be the case. For desktop systems, maybe, but Kodi is a living room platform after all. Most htpc's will either not have a sufficient amount of USB ports to keep more than 2 controllers attached or (as in my case) this setup will fail the WAF-test Tongue I would think it would be more likely to see controllers being detached and attached on the fly.
(2016-02-09, 17:35)da-anda Wrote: [ -> ]edit: the only assumption I have is that controllers will always have the same ID and that we can tell which button is from which controller ID - but that should be the case, right?

You assume too much again Smile We don't have a global ID. We sometimes have a USB ID, but this only differentiates between controllers of different models. I've noticed that about half of my controller hoard are pairs, so that's even less valuable.

If the user has two controllers, I think the way they choose a controller is whichever they plug in. If we can exploit this hardware action to make a slightly simpler GUI, I'm all for it. If they want to use a different controller, unplug/replug.

(2016-02-09, 18:14)Solo0815 Wrote: [ -> ]You can also have a window "Player 1 please press a button on your controller ..." before a emulator starts.

Maybe a menu-entry "Test Controllers" in the context/fullscreen menu of the emulator, where players can test their controller and/or config and switch it if needed.

Another hardware solution for this GUI problem would be to simply assign controllers in the order they're plugged in. If the user wants to change players, just unplug both controllers, and reconnect in the opposite order. What about this strategy until we make some GUI progress?
What about something like the old ea sports games, show a list of all attached controllers in an unassigned position and have controller input move the respective entry to a player assignment. You could also allow more than one to the same player input for a local "twitch plays" kind of experience. Input added while a core is running could either get assigned to the next free player slot or pause the emulator to bring up the assignment menu again with either behavior being a selectable option.
I think input added in-game should get the next free player spot, no need to interrupt the game. I like your idea of "moving the controller", that's simple and intuitive and doesn't require much text. BTW, the controller input system can handle multiple controllers on the same port, so the only limitation is the GUI.
(2016-02-09, 19:40)garbear Wrote: [ -> ]
(2016-02-09, 17:35)da-anda Wrote: [ -> ]edit: the only assumption I have is that controllers will always have the same ID and that we can tell which button is from which controller ID - but that should be the case, right?

You assume too much again Smile We don't have a global ID. We sometimes have a USB ID, but this only differentiates between controllers of different models. I've noticed that about half of my controller hoard are pairs, so that's even less valuable
Meeeeh. So how to differentiate between controllers of the same model? Like two XBOX 360 (wireless via same receiver and/or wired) and two NES ones? There needs to be something ™ that tells the input is from a specific device.
(2016-02-10, 13:13)da-anda Wrote: [ -> ]
(2016-02-09, 19:40)garbear Wrote: [ -> ]
(2016-02-09, 17:35)da-anda Wrote: [ -> ]edit: the only assumption I have is that controllers will always have the same ID and that we can tell which button is from which controller ID - but that should be the case, right?

You assume too much again Smile We don't have a global ID. We sometimes have a USB ID, but this only differentiates between controllers of different models. I've noticed that about half of my controller hoard are pairs, so that's even less valuable
Meeeeh. So how to differentiate between controllers of the same model? Like two XBOX 360 (wireless via same receiver and/or wired) and two NES ones? There needs to be something ™ that tells the input is from a specific device.

I agree with this.
Obviously we can tell from which device an input event is coming but we can't uniquely identify controllers across multiple runs of Kodi so you can't permanently assign a specific Xbox 360 controller to be player 1.
(2016-02-09, 19:27)Scourge Wrote: [ -> ]
(2016-02-09, 17:35)da-anda Wrote: [ -> ]I don't see where my concept has an issue. If you have 2 XBOX controllers and 2 NES controllers, then you can by default bind XBOX-A and NES-A to Player1 and XBOX-B and NES-B to Player2. There is no need for Kodi to know of what type the controller is. It's up to the user to grab the controller he wants to use as both are always active (as long as plugged ofc).
Are you assuming that all controllers are permanently attached to the device? I believe that will mostly not be the case. For desktop systems, maybe, but Kodi is a living room platform after all. Most htpc's will either not have a sufficient amount of USB ports to keep more than 2 controllers attached or (as in my case) this setup will fail the WAF-test Tongue I would think it would be more likely to see controllers being detached and attached on the fly.

Well I have 5 port USB hub +1 USB cable just for gaming and 6 controllers, 4 XBOX and 2 cheap noname soooo Smile
I liek the idea press any key on your controler for player 1, then player 2, etc etc


...
Quote: show a list of all attached controllers in an unassigned position and have controller input move the respective entry to a player assignment.

Yes, this would do it! For example:
joy1 -> pl1
joy2 -> pl3
joy3 -> pl4
joy4 -> pl2

With light indicator for every controller when any key is pressed so we can easily identify them.
@Montellese / @garbear
what about the XBOX360 wireless adapter. This likely will be plugged all the time and connected controllers indicate if they are player1 or player2. Can we in this special case also get that info? We ofc still need a way to deal with other controllers - I just wanted to know if we could cover this case.
(2016-02-12, 12:23)da-anda Wrote: [ -> ]@Montellese / @garbear
what about the XBOX360 wireless adapter. This likely will be plugged all the time and connected controllers indicate if they are player1 or player2. Can we in this special case also get that info? We ofc still need a way to deal with other controllers - I just wanted to know if we could cover this case.

At least on win32 when using the XInput API the controller which is indicated as player 1 will always get the port number 1 and so on. AFAIK the same holds true for the Nexus Player controllers which also have an indicator for player 1 to 4.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26