getPlayerNumByDeviceId() can return -1 after controllers disconnect and reconnect

Once a game is running, if a controller (Xbox 360 or Ouya) is connected it gets a new device Id assigned. This new device Id gets mapped to the next available player number. The problem is that when a controller is disconnected, it's mapped player number is never released. When it gets reconnected it always gives a new player number and when this goes over 3, it returns -1.

The ODK needs to detect disconnected controllers and allow the player numbers to be reused. Ideally it would map the same player number to the same reconnected controller.

Comments

  • nimble_gorillanimble_gorilla Posts: 19Member
    A related issue is that if player #1's controller gets disconnected then player #2's controller will switch to the ID of player #1 in the middle of a game. You can easily test this out by removing a battery from a controller.
  • BuddyBuddy Posts: 183Member
    We just reworked the controller/player mapping code, so it'll work as you expect after the next release!
  • GnomicStudiosGnomicStudios Posts: 13Member
    Thanks @Buddy. Any rough idea on the ETA for the next ODK release?
  • GnomicStudiosGnomicStudios Posts: 13Member
    By the way @Buddy, are you aware of the issue I raised here?: http://forums.ouya.tv/discussion/808/controller-directional-accuracy-problems

    The Ouya controller seems to have an internal dead zone (not sure if it's hardware or software though). This causes decreased accuracy around the axes. It would be far better to let developers handle the dead zone themselves as they may prefer to handle it with a circular rather than square cutoff.
Sign In or Register to comment.