Gamepad vs Arrows vs Point and Click vs Touch

So I want to discuss the basic input and control methods for unity. How hard they are to code, what users want and expect. Which ones translate to each other well.

Go.

Its easy for all of them!

It depends on the game for what will be a good control scheme…

Depends insanely on the type of game you are making, and the platform. You don’t want to make a fighting game using the point and click, nor do you want to make an RTS that forces a gamepad on the user.

As for how hard… not hard at all.

To get GamePad or keyboard input you just call the Input class and pick what you want to check for.

Example:

Input.GetAxis(“Horizontal”) that returns a float value indicating how far the axis is tilted on the joystic (or keyboard if it’s mapped to this)

or

Input.GetKeyDown (KeyCode.Space) that returns true the frame that the space key is pressed down.

There is also a config screen you can name actions like Shoot or Horizontal, using it allows you to not pay attention to the specific key and just check by name, like I did on the first example. This also allows the user to set his own keymapping when the game boots up, should you let him see the default startup lauch screen.

For mouse, you just use Input.mousePosition and check the left, or right click with the same method I pointed above.

Touch joysticks can get a bit more complex, since you have to coordinate things a bit more manually (unless you use some helper gui plugin) but there are samples projects around that help with that.

What about utilizing the gyroscopes in a phone/tablet (for tilt-based controls)? Is that hard/possible?

It’s pretty easy to access the gyro, where available, or the accelerometer which also gives you an idea of the device’s orientation.

Accessing it is easy, properly using it is a different matter. Most games are better off just using accelerometer, though (not the same as the gyroscope)

The accelerometer simply reports the rotation of the device while the Gyroscope may report a lot more data like movement speed. Y

Despite accelerometer being a bit more simple (and also more likely to exist in more Android devices) it is also hard to balance in a way that is… well fun.

Kind of - but your second paragraph is backwards. The accelerometer doesn’t report the rotation of the device, it reports the acceleration of the device. Usually that’s just a vector straight down, which you can use to determine some aspects of orientation, but if you shake the device from side to side it will report that too, which is undesirable if you are doing something like Real Racing’s steering system.

The gyro doesn’t have that problem, so if the device has one then you should definitely use it. The trouble is, Unity’s gyro “orientation” field is heavily smoothed and leads to a lot of lag, and IIRC it’s also in an arbitrary frame of reference, which drifts over time, so you need to calibrate it against the accelerometer. Or, better, derive your own, based on the lower level gyro data which is also provided.

AFAIK the only iOS devices with a gyro are iPad2, “new” iPad, and iPhone 4S.

well what do players expect?
On a PC I think mouse and keyboard, on a console I think a gamepad and obviously touch devices are touch and motion.
Is there much room outside of this? Im big on gamepad, but do web browser games support this?

how well does one type translate to the other?
I would think keyboard and gamepads translate while touch and mouse movement translate well.

Except for glitches with certain gamepads on OSX, yes.

Honestly people expect what’s put in front of them. If they see a touchscreen, they’ll expect touch controls. If they see psudo control stick on a mobile app, they’ll expect to use those, and not touch native controls. If you stick a giant picture of a gamepad in the splashscreen of your game, people will expect to use a gamepad, even in a web player.
PC may possibly be the only notable exception as an increasing amount of players realise they can stick a gamepad in a PC, but even then you can influence what people expect.

Yea that, sorry my terminology is not very clear on those. I wrote Tilt instead of rotation first and then replaced it all over… think neither is right but I guess the change was for the worse :stuck_out_tongue:

It depends heavily on the title and genre, and users themselves.

In a console you have no option, it’s just the gamepad that comes with the device (unless you working with one of the new motion things like Kinect.)

For PC, an RTS is surely going to demand a mix of mouse and keyboard.

FPS players on PC are almost surely going to want a mouse and WASD setup.

Some one playing a plat former game may demand support for gamepads, no PC user will ever accept forced use of gamepads btw, even if they demand the option be there.

Fighting games on PC are extremely rare because they demand joysticks (the big ones with 6 buttons) or at least conform for gamepads. They are nearly unplayable with keyboards. Does not mean PC users don’t want fighting games, just that they won’t accept the requirement for gamepads.

On mobile devices, well… touch is the only built in option, but just saying touch is not enough. You have to clarify how that touch is used. Swipe gestures? Virtual Gamepad? Dpad? Twin Sticks? It’s an entire universe of input devices form factors all under the “touch umbrella”.

BTW, a lot of iPad users also love their games to support the iCade controller.

The question is, really, impossible to answer without knowing the type of game you are making, and who you targeting it for.

Unity already provides a nice abstraction layer for input, at least for PC Mac where you can allow the user to configure his control option. I would say thats definitively in your best interest to support. In theory you can write a wrapper that handles touch versions of the controllers so you can have one single project that easily builds for all platforms.

I am a big fan of ‘choice’. I use an XBox 360 controller on my PC, but I sometimes misplace the blasted thing and can’t always be bothered to hunt for it. I play Dungeon Defenders with friends and I can either play mouse keyboard or via controller. Not every PC user like to use a controller, especially for an FPS (though I am one of the rare fools who actually prefers to aim with an analogue stick instead of a mouse) so I think it’s definitely a good idea to have a choice. In this respect the options Unity offers has a lot going for it, I only have to use: if (Input,GetButtonDown(“Action”)) and the user can then define what ‘Action’ is.

As for mobile systems like iOS I find some of the controls to be a bit awkward. What normally bothers me is that the left thumb (used to control the player’s movement) is normally fixed. I prefer it when the control matches where I place my thumb and use that as a point of reference, for example Square Enix’s Chaos Rings - to me that’s a more sensible control system because I am not worried about the accuracy of thumb used for control (as unlike a controller I don’t have the liberty of relying on the sense of touch). This means less looking at my thumb, more focusing on the game - at least it feels a lot more intuitive - maybe if I started playing these games more heavily I’ll get used to it. But I found playing Sonic 4 I just failed terribly because I didn’t get along with the touch controls (which were fixed) or the motion controls for that matter (which didn’t really work for me with that kind of game).

Interesting - is it easily accessible with Unity?

I’m a big believer in designing the game around the interface method of the target platform. I find it a shame that a lot of popular iOS games have on-screen controls. It feels like the designer was lazy and didn’t bother to consider the target platform. Placing virtual buttons on-screen also brings it’s own limitations and design issues that developers and consumers mostly seem to ignore/accept. Choice is very important though and if people prefer a certain style of input, and it doesn’t introduce any game breaking issues including it, then you should always try to add it in as an option.

I personally feel if you avoid the path of designing a controller-based game for a touch-screen platform, you end up creating a more unique and deserving game for that platform.

Someone mentioned Dungeon Defenders which for me is one of the worst iPhone games I’ve purchased. The interface takes up way too much screen real-estate and is far too confusing and chaotic. I knew it was the interface holding me back and after buying the PC version I had a far better play experience.

Not sure, but Prime31 sells a plugin for it.

BTW, when I say " a lot" i mean a significant number of people, not a huge percentage of iPad owners.

TouchArcade tends to love when a game supports the iCade, and the users there have a forum section for it. Additionally: there are more devices coming soon from the makers of the iCade to support the iPhone/iPod, plus many other controllers made by third parties that are using iCade compatibility modes. It’s becoming a standard, sort off.