Sign in to follow this  

What inputs to support for PC game, keyboard, controller, or both

Recommended Posts

So I am an indie developer, working on a third person action adventure-like game in Unity. So far, while developing the game, I've only been playing and testing it with a keyboard. However, now I want to add support for a controller (Xbox One for example) as well. My question is, should I support inputs with a keyboard and a controller both? I personally am a console gamer and I only play games with a controller, so that is my preferred inputs scheme. In addition, supporting only one control scheme would reduce my development effort. I do realize though that, since the game in question is a PC game, I would think a lot of gamers would want to use a keyboard.

 

What is the prevailing design philosophy on this? Do most players on Steam, for example, prefer a keyboard? Would there be any harm in only supporting a controller?

Share this post


Link to post
Share on other sites

my opinion is keyboard/mouse.  there may be a case where a controller would be better but I cant think of one, at least not where I would prefer to use a controller.  I am partial towards strategy (RTS or TBS) games though.

Share this post


Link to post
Share on other sites
I would guess that most PC gamers would not have a gamepad, so you would be restricting your audience by requiring one. I have one plugged in but almost never use it :)

I've worked on games that require them before, and it causes endless complaints and hate mail...

Supporting both KB/Mouse and XInput will make most people happy. Having configuable controls will make 99% happy. Adding direct input support will get you that last 1% :lol:

Share this post


Link to post
Share on other sites

Keyboard/Mouse, but always make Gamepad an option.

 

Depending on the game, it may be significantly easier to play the game with a controller. So you'll eliminate some bitching and moaning in advance if this is the case.

Share this post


Link to post
Share on other sites

If your game can be played on a PC, you should really support keyboard/mouse.  If your game is the type that can be played with a gamepad(RTS is one that maybe shouldn't apply here), you should support XInput and DInput if possible.  I HIGHLY recommend doing customizable inputs, as that is the only way to make about everybody happy(you'll never make 100% happy of course).

 

Unity's current input system is pretty crappy though.  I recommend something like ReWired for input if you could.  It takes a small budget to do so, but it lets you pretty much support everything under the sun, far beyond what Unity alone can do.  And it comes with systems for customizing input so you save time on that as well.

 

I don't know about the rest of us, but unless my game is very specific, I don't think I would ever release something that you couldn't customize the controls in.  Even for an RTS, there would very likely be a few keyboard presses for things like grouping units, etc... and I personally would allow the player to customize the primary presses that are typically on the mouse, in case they want to reverse left/right, etc...  Of course, I would provide an easy way to save such options, as well as to return to defaults.

Share this post


Link to post
Share on other sites

IMO, unless you don't have time to put into doing input handling right (and then most probably you run into problems later anyway when people start complaining about not being able to re-assign the keyboard keys and mousebuttons), always cater to KB/M AND gamepads at least (driving wheels and joysticks make less sense for a 3D TP View game, but then again these are just other types of input devices).

 

Ideally your game is agnostic to WHAT people are using to input their commands with... it just recognizes the input devices, and gives players options to map actions to the buttons these devices support.

The only real complication comes with handling analog axes or the lack of these in certain input devices (like the Keyboard), so you might need to invest some thought into how to handle things that could be assigned to an analog axis on a gamepad (Which gives the player a range of analog states to control the axis) when the same axis is assigned to keyboard keys (which either means fixing the keys to always mean "max analog state", or work with different keys for different states, or multiclicks for moving between different discreete approximations (like what World of Warships has done with full speed, 3/4, 1/2 and 1/4 speed, W and S are used to switch between the states, going from 0 to full speed takes 4 taps on the W key for example).

 

Other than that, you need to think a little bit about the amount of actions that need to be mapped, but when leaving input devices like Joysticks and driving wheels out of the equation which sometimes still have not that many digital keys, modern gamepads have an overabundance of digital keys to use, so unless you want to give the player a quadrillion of abilities to map to different buttons, you can ignore that point.

If you do, you need to find ways to have that same set of actions work on a gamepad with "only" about 8-10 digital keys, plus 2 if you use the Trigger axis as 2 additional digital buttons, ignoring the analog aspect of it.

 

Generally, I would concentrate my efforts on a re-mappable Input schema. It will be of use to even hardcore M/KB fans, so everyone wins.

Then create default mappings for M/KB, and Gamepads, and see if your game works fine on both.

 

To all the guys saying "PCs don't need gamepads"... well, unless you are a weirdo like me that has a console-replacement PC hooked to the TV. Many games on Steam didn't get my business because I wanted to play them on the big TV, but the game does not support Gamepads, and I couldn't be arsed to use a keymapper to create a crappy version of a gamepad mapping for the game because the game doesn't support analog axes, at all... even though the console version does.

Going to buy a PS4 Pro soon, partially to play the games that just got shoddy PC ports without Gamepad support. Rather play the PS4 Pro version that forces devs to fully support gamepads natively.

So there is your reason why you should care about gamepad support, even when developing games for PC exclusively. And its not like its rocket sience as soon as you have remappable input mappings in your game.

Share this post


Link to post
Share on other sites

An interesting piece of data:

If you intend on selling through Steam, might as well know that games that support both get a significant amount of additional sales. I can't say whether that's because there's an install base, but the correlation is strong, and the comparison was made on a sample of games a few thousands strong, so it is more than representative of the whole.

There are a lot more gamepad avids on Steam than I thought it seems (much to my pleasure given I game with 3 different gamepads on this machine alone, which I cycle with my Retropie Raspberry pi based on need).

The PC 'is' the new console ;)

Share this post


Link to post
Share on other sites

To all the guys saying "PCs don't need gamepads"... well, unless you are a weirdo like me that has a console-replacement PC hooked to the TV. Many games on Steam didn't get my business because I wanted to play them on the big TV, but the game does not support Gamepads, and I couldn't be arsed to use a keymapper to create a crappy version of a gamepad mapping for the game because the game doesn't support analog axes, at all... even though the console version does.

 

^ This.  There are enough games out there to pick from that I'll skip stuff most stuff that can't be played comfortably from a couch with a 360 or Steam controller.  That includes anything where the UI is too small to read from a bit of a distance.

Share this post


Link to post
Share on other sites

Generally adding controller input isnt that hard as an additional option, I will agree that there are a lot of game types that I just wouldnt play with a controller, but then games like Fighting games, racing / driving games, just feel more natural with a controller. 
I have a friend who will only play FPS games with a controller (weirds me out), so realistically there are people that opt to play with controller even on PC games where most people think keyboard feels more natural.
So for the generally fairly little work it is to add controller support to a game, I tend to think its almost always worth adding, just to hit a wider range of players who have different control preferences.

Share this post


Link to post
Share on other sites

About differences with analog/axis versus button only inputs...one thing some input systems do for anything that works on an axis, such as movement, is to store the input as an analog value between -1 and 1(or if you prefer separate values 0 to 1 twice).  Then if the input assigned to that action is an analog input like an axis, you almost directly map it.  If the input is a button or 2(be it keyboard or gamepad button), you can do a "simulated" axis.  This is one thing even Unity's crappy input system actually does, as do some of the asset store packages that are really nice.

 

The other thing you can do is keep all inputs to either an on or off state.  Then, if an key/button is assigned, you directly map it.  And if an axis direction is assigned, you say on/off based on some percentage of tilt, maybe 20%, so if the X-Axis is tilted to a +0.2 or more, it counts as 'pressing the button.'

 

What kind of game you are making will determine which of these methods(or both in many cases) you need to use.

Share this post


Link to post
Share on other sites
Posted (edited)

Some of the responses missed the part that this is about Unity.

While it has some flaws, Unity's input mapping system is quite capable.  (Sometimes it is a bit tiresome, like mapping all XBox buttons for all controllers, but those are free to download).

With only a tiny bit of work you can configure the game to accept input from the keyboard, and from a controller, from a force feedback joystick, from a flight yoke, from alternative UI devices, whatever they want. If they want to remap arrow keys to WASD or IJKL or whatever they can do it. If they want to reverse up/down or left/right for their preferences they can do it. If they want some buttons one controller and alternate buttons for the commands on another controller, they can do it.

Set it up right and it doesn't matter what they use. All that matters to the game is that you have axis values and buttons for input.  

If you need keyboard input it is slightly more difficult for non-keyboard configurations, but those are also handled fairly easily. There are plenty of tutorials on making a UI for keyboards that generate key events the same as regular keyboard events and also reading actual keyboards, then you can process them the same way. It gives the user the option to stay with their gamepad to type with their thumbs, or to start typing on their keyboard, or both.

 

TL;DR:  It is Unity.  It's easy to support both.

Edited by frob

Share this post


Link to post
Share on other sites

I personally mentioned Unity, and the actual lacking of Unity's input system.  I highly recommend usage of a nice asset such as ReWired because of this.  Unity's system can handle things somewhat well, but has a couple of downfalls, one of which for me is a deal breaker.  You can't directly configure Unity's inputs at runtime, and that is really a big deal to me.  Sure, you can code stuff on top of that to deal with it, but that takes time of course.

Share this post


Link to post
Share on other sites

What is the prevailing design philosophy on this?
I've been playing PC games for like 14 years, and I have never touched a PC game that didn't support a keyboard. It'd be as asinine as releasing a console game that doesn't supports the platform's controller.

Shipping a PC game without mouse & keyboard support is opening yourself to ridicule,
Exactly. Talking about this, Bethesda released Skyrim without proper mouse support at first, half the time the UI simply didn't work with mouse input. People were very, very angry about it.

Share this post


Link to post
Share on other sites

Thank you for the detailed and informative responses, everyone. It's clear to me now that I have to support both Keyboard/Mouse and a game controller (s), at the very least. In addition, all types of input have to be configurable with ability to save input configurations, of course, and an option to reset to defaults.

The next question I have is whether to use a third party input system for Unity, such as ReWired, or Unity's new input system. I have done some research into ReWired and I agree that it is superior to what Unity offers out of the box today. However, there is a new input system in the works for Unity, which sounds promising, and they should be releasing an experimental version this summer. Here is a link to their blog: https://blogs.unity3d.com/2016/04/12/developing-the-new-input-system-together-with-you/. In general, if Unity offers a certain feature out of the box, I prefer to use it over any alternative third party solutions, provided their functionalities are fairly similar. Any opinions on ReWired vs. this new input system?

Share this post


Link to post
Share on other sites

Thank you for the detailed and informative responses, everyone. It's clear to me now that I have to support both Keyboard/Mouse and a game controller (s), at the very least. In addition, all types of input have to be configurable with ability to save input configurations, of course, and an option to reset to defaults.

The next question I have is whether to use a third party input system for Unity, such as ReWired, or Unity's new input system. I have done some research into ReWired and I agree that it is superior to what Unity offers out of the box today. However, there is a new input system in the works for Unity, which sounds promising, and they should be releasing an experimental version this summer. Here is a link to their blog: https://blogs.unity3d.com/2016/04/12/developing-the-new-input-system-together-with-you/. In general, if Unity offers a certain feature out of the box, I prefer to use it over any alternative third party solutions, provided their functionalities are fairly similar. Any opinions on ReWired vs. this new input system?

 

How long do you think it will take to make your project?  Are you expecting to finish soon and be waiting on Unity's new input system?  If you think you will take a while(learning Unity, long project, etc...) then by all means it may be worth trying to wait on Unity's new system.  The catch is that you don't want to be waiting forever, just to find out you can't continue your project without committing to a certain input method.

Share this post


Link to post
Share on other sites

Reminds me of my wait for the new UI system. It took several years longer than they promised and was in a shabby state out-of-the-box. 2 years on, it's pretty usable, but still with some unnecessary complexity and missing functionality. My advice is not to wait for official features. Use what is there now, migrate if new stuff appears and is better.

Share this post


Link to post
Share on other sites

Some of the responses missed the part that this is about Unity.

While it has some flaws, Unity's input mapping system is quite capable.  (Sometimes it is a bit tiresome, like mapping all XBox buttons for all controllers, but those are free to download).

With only a tiny bit of work you can configure the game to accept input from the keyboard, and from a controller, from a force feedback joystick, from a flight yoke, from alternative UI devices, whatever they want. If they want to remap arrow keys to WASD or IJKL or whatever they can do it. If they want to reverse up/down or left/right for their preferences they can do it. If they want some buttons one controller and alternate buttons for the commands on another controller, they can do it.

Set it up right and it doesn't matter what they use. All that matters to the game is that you have axis values and buttons for input.  

If you need keyboard input it is slightly more difficult for non-keyboard configurations, but those are also handled fairly easily. There are plenty of tutorials on making a UI for keyboards that generate key events the same as regular keyboard events and also reading actual keyboards, then you can process them the same way. It gives the user the option to stay with their gamepad to type with their thumbs, or to start typing on their keyboard, or both.

 

TL;DR:  It is Unity.  It's easy to support both.

Would suggest using an asset store extension such as incontrol though, as control mapping from controller to controller will vary significantly natively and can be a burden to work with (and though Unity is quite capable, the axis configuration is still a mess to work with tbh).

But the TL;DR is pretty much on point: Why not do both given it shouldn't take you more than half a day to a day depending on the project's scope.

Share this post


Link to post
Share on other sites
Posted (edited)

Reminds me of my wait for the new UI system. It took several years longer than they promised and was in a shabby state out-of-the-box. 2 years on, it's pretty usable, but still with some unnecessary complexity and missing functionality. My advice is not to wait for official features. Use what is there now, migrate if new stuff appears and is better.

 

That's great advice! Plus, if an input system is well designed, it shouldn't be too hard to switch from one system to another, if necessary. Good software design principles are universal, after all. Thanks for that.

 

@kburkhard84 It's unlikely it'd be finished soon, i.e. it'd probably take a while longer.

Edited by lougv22

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this