Happy (and surprised) to see that PS4 controllers are fully supported in OSX I tried plugging it into Defold to control my gamecharacter.
Seems like there are no built-in support for that controller ( but after a few tweaks I managed to get at least the analogue stick and the right side buttons to work).
So my questions are actually 2:
Can you please update the default.gamepads in builtins to include the wireless controller?
How do you connect several controllers of the same type and get input individually?? (creating this small one screen/4p multiplayer game).
I will add these to the backlogg. The first part is not complicated, but your second question will need design and take some time. Both need to be prioritised
Support for multiple gamepads is something that I’ve been waiting for a long time now
Maybe a simple solution could be to send the controller index with the input data in the on_input function. That way you could deal with splitting the input in any way you want.
Most of my games are local co-op or local competitive, and without multiple gamepad support, I simply can’t continue working on those games. I’m starting to lose hope here. Is there any chance that we will see this feature any time soon?
I think the question around multiple controllers comes down to how we deal with the index/id of each. From the top of my head, I could see something like this.
There are a number of controller slots (4?)
A controller plugged in is assigned the first available slot
The controller keeps its slot until it is removed by the user, which makes its slot available again
The slot is communicated in the input action, e.g. action = {…, controller_id = 1}
Does this cover your use-cases? If not, what’s missing? Is there a need for added/removed controllers being reported somehow?
This sounds perfectly fine for my current use cases. I think 4 is the standard number of slots for microsoft controllers. I would assume that the keyboard input would be passed with controller_id = 0 or similar?
Any more functionality, like supporting added/removed gamepads, I would consider luxury-features and would be necessary only in the final game, and that’s quite some time away
I don’t know if controller_id would be needed for anything else but gamepads but I guess either have it in mouse/keyboard etc or not doesnt matter.
You will probably always store away the id as soon as it is retrieved for the first time.
Maybe need some kind of solution for “knowing” what Gamepad is connected.
I mean say you have 2 connected gamepads.
First time that player2 moves right with it’s gamepad, how do we know it’s the 2’nd player that will move on screen? Unless yes it is like Ragnar says that we can always tie up id:2 to the second gamepad.
To answer my own question. Many games have some kind of “starting point” (before or in the game) where you click X button to enter the game and then it will be assigned to a certain player.
Yeah, that’s a good point. Wouldn’t that be possible with the id-system though? Say that controller with id 2 is the one who presses “start game”, you assign id 2 to Player 1.
As things look right now the plans are to have updated the default.gamepads to include the PS4 controller this month and support for multiple gamepads in April. We will keep you posted.
I checked the Jira ticket and it’s been postponed due to more pressing issues. There’s a new tentative release date set, but I’ll let @Ingela_Garneij confirm it since she’s got a better overview of the coming releases.
Yes, we have postponed this to after summer (release date preliminary to september), since we need to improve our canvas and spine functionality. I will try to push the prio up some, but I can’t promise anything