Transcript
Using Joysticks in GameSalad by Alan Uthoff
What is a gamepad or joystick?
Modern Joysticks •
Follow the HID (Human Interface Device) standard
•
Connect over USB or Bluetooth
•
Have a unique VenderID and Product ID
•
Are made up of analog elements that have a usage page and usage and min, max values
Modern Joysticks APIs •
Allows the developer to think in joysticks instead of devices
•
Abstract away the HID
•
Have concepts of analogs sticks and buttons
•
Map hid device elements to buttons and analog sticks for you
Problems •
Usage table are a suggestion not a rule
•
API are platform dependent
•
Dead zones are not always built in to the device
•
Not all gamepad have all of the same buttons
•
Gamepad can pretend to be other gamepads
•
Some elements pretend to be other types of elements
Joysticks in GameSalad Makes using joysticks and gamepads a dream
New Device Attributes •
Player attributes
•
8 players max
•
Vender id and product id only work on mac
Player Attribute •
Joystick attribute give information about the connected joystick
•
Joysticks can have the following elements •
Dpad (up, down, left, right)
•
X, Y, A, B, Start, Select, L3, R3, L1, R2, L2 and R2
•
Right Stick, Left Stick, Left Trigger and Right Trigger
Joystick Attributes •
Connected: whether a the player’s joystick is connected (true is connected)
•
Name: the name of the joystick may not be the same on all platforms
•
Vender ID: the HID vender id for the joystick
•
Product ID: the HID product id for the joystick
Buttons •
Dpad is always four way
•
Down is true and release is false
•
Not all joysticks have a select, L2/R2 or triggers
Analog Elements •
Have built in dead zone so they always center at Zero
•
Go from -1 to 1 •
Analog sticks -1 is up and left, 1 down and right
•
Triggers 1 is pressed -1 is released
New Game Attributes •
2 new game attributes
•
Key mapping
•
Player Types •
Single Player
•
Multiplayer
FireTv •
Support Remote and GamePad
•
There are two new options in publishing •
Support FireTV Remote
•
Back button Quits app
•
If you game supports both we demote the remote gamepads are connected
•
Menu button is start and the
•
Center button on the remote is A
Supported Controllers •
Mac •
XBOX 360 Wireless and Wired gamepads
•
XBOX One gamepad (USB only)
• •
PS3 Dualshock 3
•
PS4 Dualshock 4
•
Steelseries Free
•
Steelseries 3GC (Red Mode recommended)
•
Logitech F310
•
Logitech Dual Action
• •
PS2 Dualshock 2 (with the HVG@ USB adapter only)
Game Elements Recoil
Android •
Any controller made for Android
Things to watch out for •
•
Do not use button presses to change scenes directly
Requires Android 4.1 or higher
•
Keymapping are not automatic
•
When submitting to Fire TV, here are a few things to look for: •
Do not have UI buttons on screen if they can not be highlighted and selected. e.g. Pause and mute buttons in mid game.
•
Have some kind of highlight for your buttons to put them in focus.
•
for more info on amazon submission rules: https://developer.amazon.com/ public/solutions/devices/fire-tv/docs/controller-behavior-guidelines