Multiple Gamepads (DEF-1416) (SOLVED)

Cool, I was thinking the controller_id would be missing for devices where it makes no sense, like keyboard, mouse and touch screens.

2 Likes

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.

1 Like

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.

1 Like

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.

1 Like

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.

3 Likes

How’s progress going with the multiple gamepads feature?

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

1 Like

That is very disappointing since the game I’m working on is completely dependent on this feature and it is right now simply missing, with no way for me to work around it. My only options right now are to try to find another engine or stop working on my game for half a year (!).

1 Like

What kind of game is it? There may be other solutions possible that could be done in current Defold - such as using mobile devices as controllers and linking them up with the main game on a LAN.

1 Like

It’s actually three different ones - all fairly fast action games. I do a lot of project-hopping, but all my games depend on this feature, since I have no network coding skills and I’m really into same-screen coop/pvp :slight_smile:

I actually had no idea that you could use mobile devices as controllers, and I must admit I don’t quite understand how that would work with the current input-system. For me, it comes down to having responsive and tight action controls so touch controls won’t work.

2 Likes

I would say that you need to be alerted if the controller is disconnected.

Especially for fast pace games where you would need to pause the game if you loose a controller.

+1 for this feature.

3 Likes

Is there any news?

No, I’m afraid not. @Sara?

I think, it’s a good practice to set source of input.
Because, if game supports local multiplayer and several input devices (one player with keyboard+mouse and one with gamepad), developer have to know how separate same actions.
For example: I have one name for same actions (shoot, run_left, jump, pause) in Input Building. But if one of the players pressed ‘shoot’-button, I don’t know who did it. Player with mouse? Player with gamepad 1? Player with gamepad 2?
And it does not a pretty solution, when you have:

  • key_shoot,
  • mouse_shoot,
  • gamepad_shoot
    in Input Building.
1 Like

I would put a tiny Lua module in-between the on_input() function and the actual logic acting upon input. I would probably bind the actions as you suggest (key_shoot, mouse_shoot etc) an let some Lua code split the action into a source (key, mouse, gamepad) and action (shoot).

2 Likes

Yes, but if it will implement on the engine side, it will be a solution of the main problem of the thread.

1 Like

Multiple gamepad support (finally!) added in Defold 1.2.93: Defold 1.2.93 has been released

7 Likes

Wooh! Finally worth to start making games again!

5 Likes

:slight_smile: Looking forward to some lovely co-op games!

2 Likes