The Magician wrote on Dec 16, 2012, 12:57:
I would contend that a better way to do it would be to actually design and build the game around a control scheme that is completely customizable, and includes support for keyboard/mouse and Xbox 360 controllers. Devise a control scheme that can do everything you want to do sensibly on a Xbox controller (none of this "hold A and pull right trigger, then tap left shoulder button" crap I found in one game recently), map the controls on PC to standard, let the player remap them all, and make sure that everything in the game that may involve controls is designed so that it understands that there may be a different device running as the controller.
This is exactly how things are done nowadays. The concept you're describing is called "virtual controller". There is one tricky part to it and one shortcoming.
The tricky part is that there is no such thing as standard gamepad or standard keyboard in the PC world. There are dozens of keyboard layouts and dozens of generic controllers that tend to differ in very confusing and obscure ways. There's also the challenge of handling keyboard exceptions such as what if someone binds one action to Alt and another to Tab, and then tries to use both at the same time. It's all manageable, but costly.
The shortcoming is that the
real challenge with porting the controls from gamepad to mouse/keyboard is all about user convenience. Conventions differ wildly. For the sake of brevity, let's just consider a single example. Controller has four "modifier buttons" - LB, RB, LT and RT - all of them conveniently available. But the regular keyboard/mouse setup has only two - left Ctrl and left Shift. Both are reachable using the weakest of your fingers, which basically means relatively long reaction times (and no button mashing). Note that you can't use other keys as modifiers, because the player's fingers are busy handling WASD and Space, i.e. the movement buttons. In some cases you can use RMB as modifier, but LMB is almost always reserved for player's primary action (shooting, using, talking, etc.).
So what if a game has three of more modifiers and two or more core actions, in addition to movement that involves both walking and jumping? Remapping won't suffice. You need to invent a new control scheme.