Controllers 3 and 4 assigned to players 1 and 2 in local multiplayer (Xbox)

m5m_
Tue, 24 Sep 2024 16:02:05 +0000
Multiplayer & Networking

Note: Although this issue seems to be exclusive of Xbox, my organization has yet to be granted access to the Xbox section of the forums, hence why I’m posting the question here. Once we gain access to the subforum, I will request the topic to be moved.

Hi all,

We are in the process of porting our local multiplayer (1-4) game to Xbox consoles and have run into an issue with the controllers that only happens on this console: gamepads 3 and 4 are not recognized as additional gamepads and the game processes their inputs as if they were gamepads 1 and 2.

There is a character selection screen where players press A once to join the game, and then press A again to confirm their character (and become “Ready”). Once everyone is ready, the gameplay begins.

When playing on an Xbox One and Series, after players 1 and 2 join, if players 3 and 4 press A in their respective controllers, they do not join the game with another character but confirm the character selection for 1 and 2.

The same setup / code works fine on PC and other consoles. We are not doing anything special to handle Xbox controllers, other than pausing the game when they get disconnected. It is also weird that only happens with 3+ controllers/players, while 2 work alright.

We are working on UE 5.3.2 and our GDK version is October 2022 GDKX Update 1 (10.0.22621.1877).

This is how the input is set up:

On Begin Play, three local players are created in addition to the first player that is created automatically. Their Controller Ids are -1 because according to the docs “a value of -1 specifies to use the next available ID”. So these players should be automatically assigned to controllers/gamepads 1 to 3 (0 being already assigned to the first player automatically).

In the character selection menu, we check on Tick if each player controller (from 0 to 3) has pressed the gamepad button to join the game. If a controller has pressed it for the first time, their corresponding character is spawned. If a controller has pressed the button and their character already exists, their character selection is confirmed. This check happens inside a Macro that receives the player controller.

(we know there are far better approaches for this, but it was done a long time ago and it’s worked so far, so please bear with us)

This is where the bug seems to be happening. When controller/gamepad 2 presses the button, the macro receives the player controller from Player Index 0 instead? So it acts as if the input was coming from controller 0?

If i’m not mistaken, calls to macros are independent of each other, so a call being made with controller 2 passed as an argument shouldn’t be overriden by another subsequent call with controller 0 as an argument, right?

So… Any ideas? Has anyone run into a similar problem before? Are we misinterpreting anything about how controllers and ids should be assigned? Thanks!

7 posts - 2 participants