12 – Controller support

Using Keymaps in GameSalad Creator

This feature, gamepad controller support for Android, Kindle, FireTV, and Mac desktop games, is currently available in the 0.13.6 release for the Mac version of Creator and will not be available for Windows users until release 0.14.0.

If you open up a scene and look under attributes you’ll see that some new attributes have been added: “Player Type” and eight “Player {x} Keymap” attributes.

“Player Type” has two choices available for you to choose from: Single Player and Multiplayer. If Single Player is chosen, every controller input will be funneled through Player 1.

If Multiplayer is chosen, each controller that you connect will be assigned to the first available Player that doesn’t yet have a controller.

In each of the Keymaps you will see text attributes for each button that is on the controllers. You can edit these keymaps (they don’t have default values) to assign different keys on your keyboard to perform the actions that the controller would do.

(double click in the red area to edit the attributes)

NOTE: If you connect 4 controllers and then let’s say you disconnect controller 3. This will cause Player 3 to become empty and the next controller that is connected will fill Player 3’s slot instead of becoming player 5.

The strings for the keys are the same strings that are used in the keyboard event.

Looking under the “Devices” tab you will now see that a “Players” dropdown has been added.

This holds information on the controllers that are connected for each player as well as booleans for all of the buttons that controller has.

Notes: The left and right triggers are set to -1 by default (not being pressed). They change to “0” when pressed down halfway and change to “1” when pressed all the way down.

Left and right stick X change to “-1” when pushed to the left and change to “1” when pushed to the right. Left and right stick y change to “-1” when pushed up and change to “1” when pushed down.

NOTE: the “name” value of the device may not always match the controller name exactly.

Currently Supported Devices

Mac Desktop/Creator Preview

  1. XBOX 360 Wireless and Wired gamepads
  2. XBOX One gamepad (USB only)
  3. PS2 Dualshock 2 (with the HVG@ USB adapter only)
  4. PS3 Dualshock 3
  5. PS4 Dualshock 4
  6. Steelseries Free
  7. Steelseries 3GC (Red Mode recommended)
  8. Logitech F310 (Both Modes)
  9. Logitech Dual Action
  10. Game Elements Recoil
  11. Gtron Retro USB Super Classic Controller
  12. Steam Controller (GamePad Configuration)

Fire TV / Kindle / Android:

  1. Fire TV Remote,
  2. Fire TV Gamepad,
  3. XBOX 360 Wireless and Wired gamepads
  4. PS4 Dualshock 4
  5. Steelseries Free
  6. OUYA Gamepad
  7. Logitech F310 (X Mode)
  8. Game Elements Recoil
  9. NYKO Playpad Pro
  10. Any gamepad made for Android (Android version 4.1 or higher!)

Additional useful notes

When submitting a game to Amazon the app can be for all devices (when publishing use the Kindle target), not just Fire TV, so make sure the splash screen is in the right orientation and that it works for both the Fire TV and smaller devices.

When using the Multiplayer player type, the Fire TV remote will be pushed down the player list as gamepads are connected. If you do not want to support the Fire TV remote, uncheck the Fire TV remote support option in publishing and the Fire TV remote will never be assigned to a player.

Player type can be set at runtime. Setting it to “1” will make it single player and setting it to “0” will make it multiplayer.

If you’re not using a Fire TV remote or gamepad, make sure the gamepad you’re using actually works in the Fire TV UI. Because if it doesn’t work there, it’s probably not going to work in a GameSalad app either.

NOTE: We do not currently support force feedback.

Use the command “adb kill-server” to stop the adb server from listening over USB and use the command “adb connect IP address of the Fire TV box” to have adb start listening over tcp/ip. (More information on Android Debug Bridge here: http://developer.android.com/tools/help/adb.html)

Useful links

Tips for publishing to Fire TV from Amazon