Search Unity

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

Discussion in 'Game Design' started by Raidenwins, May 8, 2017.

  1. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    132
    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?
     
    DavidSJones likes this.
  2. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    You should design you game with both keyboard/mouse and controllers in mind. You should give your players the maximum choice when it comes to input devices that can used with your game.

    If you are not against using a third party library for handling input I would recommend using Rewired for input handling.

    If you are not familiar with Rewired here is a simple example that shows using a variety of controller types and keyboard. So you get a general idea of workflow.

    https://forum.unity3d.com/threads/c...ship-or-aircraft-cockpit.455223/#post-2957041
     
  3. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I think you will get a large number of complaints for not supporting keyboard/mouse and only supporting controllers.. Some people may not want to purchase a controller just to play a game and just expect keyboard and mouse as a minimum standard for any game of third person action/adventure game..

    I like the freedom to pick my input choices and Realistic FPS is probably closer to the style of game you will be making. I did not want to be restricted to just gamepads and keyboards. I wanted to use flight controllers and then later I did some experiments with a racing wheel and mouse.

    I created a Rewired integration for Realstic FPS so I could do just that. So now I can alternate whatever input devices I like. Keyboard/mouse one day, gamepad on another day, flight controllers on another day and if like some real excitement a racing wheel and mouse.

    It was a pretty straight forward integration and did not have to change much of the Realistic source code to handle all of those cases. Just change Unity Input.Getbutton() to RewiredPlayer.Getbutton(). More details can be found here.

    https://forum.unity3d.com/threads/realistic-fps-prefab-released.176985/page-69#post-2921727
     
    Raidenwins and Ryiah like this.
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    This. I remember a thread a while back where @ShilohGames mentioned putting a game on Steam Greenlight that only supported a game controller and said "some PC users were absolutely furious".

    https://forum.unity3d.com/threads/analytics-for-pc-gamers-that-use-controller.365117/#post-2363202

    Just support them both. Some people will tell you that a game can only be played ideally with one or the other but at the end of the day there will always be someone who can do it.
     
  5. cichys_

    cichys_

    Joined:
    Nov 7, 2016
    Posts:
    8
    Best thing is to support both. Many Steam/PC users are also console gamer and they prefer to use a gamepad.
    You will lose many potential players if you don't.
    I would never play an action game with a keyboard.
     
    Raidenwins and theANMATOR2b like this.
  6. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Thanks for that thread link. I know I had seen this discussion before.
     
    Raidenwins likes this.
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Whatever you support, do it properly. Better to not support an input method then to support one poorly.
     
    BrandyStarbrite and Raidenwins like this.
  8. Socrates

    Socrates

    Joined:
    Mar 29, 2011
    Posts:
    787
    Allow people to remap their keys/inputs as well. Default key layouts just don't work for some of us. Being able to change inputs can also help people who don't have full mobility still play the game.

    Edit: Extra Credits recently did an episode that included some interesting information on ways people may end up playing games with controller and keyboard. It's worth a watch.
     
    Raidenwins and Ryiah like this.
  9. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    The is very important requirement to allow remapping for accessibility. In addition most of the time a customer will probably have hardware (e.g. controllers) that you do not access to for testing purposes.
     
    Raidenwins likes this.
  10. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Another aspect to consider is a player may want to use multiple usb devices concurrently. Mixing and matching various controllers (and keyboard/mouse) is fun. For example in my previously mentioned Realistic FPS example I used the following combinations for playing but not exclusively.

    Flight Controllers (3 usb devices): [ flight controller joystick, flight controller throttle and rudder pedals ]

    Racing Wheel (2 usb devices plus usb mouse) [ racing wheel, racing wheel pedals and a mouse ]

    X-plane 10 flight simulation software also allows keyboard/mouse and controllers also. You can mix and match almost an endless combination of keyboard/mouse and controllers.

    Another reason to keep keyboard and mouse is some people might want to use a controller which actually emulates a keyboard so it works everywhere. A classic example of that is X-Arcade TankStick (see Exhibit A). It has all the buttons like a normal controller but it is just sending out keyboard commands.


    Exhibit A:
    tankstick_joystick.jpg
     
    Raidenwins and Socrates like this.
  11. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    132
    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?
     
  12. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Use what works now, over what might work at some future date.

    We know Rewired works. We hope that UInput will be released (let alone work).
     
    Raidenwins and Socrates like this.
  13. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Rewired of course! Speaking as fan and happy customer since the Rewired beta release.

    There is a free trial version of Rewired so you can do a proper evaluation today.
    http://guavaman.com/projects/rewired/trial.html

    After you purchase a product the main issue I care about is what type of support will I get. Rewired support is just fantastic. Having a developer who has physically worked with 99% of the controllers on the Rewired supported controller list is critical for me. Deep controller knowledge and understanding of USB issues is extremely important for me.

    When Unity's input system has a problem how long will I have to wait to get a fix? To me that is the question that really matters.
     
    Raidenwins likes this.
  14. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Even when Unity releases their improved input system, I suspect it's going to be a long time (if ever) before it's as complete a solution as Rewired. I'm a huge fan. It's one of the best supported and solid assets I've run into.
     
    Raidenwins likes this.
  15. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    132
    Thank you. That's very helpful. I am still doing research, but I am leaning towards using a third-party API and Rewired is definitely a leading contender for me.
     
  16. DavidSJones

    DavidSJones

    Joined:
    Jul 31, 2017
    Posts:
    2
    I work in unity for my indie games as well. While I love the controllers, any pc game should definitely support keyboards and probably use the mouse as well. These should be seen as kind of the default controls due to there being so many different "joysticks" (as unity calls them) and each one has the potential to have a completely different mapping configuration. I found this article while searching for the most popular controllers in PC gaming so I could include them. In short make sure the keyboard and mouse are supported first, then add controller support. I am unfamiliar with the Rewired option, so just from what unity gives you, you will need to map each controller you want to support. Make sure to list them in the description or info screen has being the only ones you know it will work with. Good luck.
     
    Raidenwins likes this.
  17. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Support for both keyboard and controller, is definitely the best option here.
    Not all pc gamers, like playing games, with a keyboard. And alot of games
    nowadays, support options for both types, and a few other peripherals as well.
     
    Raidenwins likes this.
  18. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    132
    Yes, that's what I've decided to do, i.e. provide support for both game pads and a keyboard. I am using a library called Rewired that makes this straightforward.
     
    BrandyStarbrite and guavaman like this.
  19. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Cool!:)