Configure Controls

From RocketLauncher Wiki
Jump to: navigation, search

Introduction

To begin, let's clear that there is no ideal way to control all games and emulators that can be executed through HyperLaunch. Each application allows certain modes of control and does not support certain others. Lest's make a list of the different controllers systems that can be used and how to integrate them with HyperLaunch, Emulators and Games.

Joystick Input

If you are using USB Controllers to play your games, the best option is to map every Game and Emulator directly with the Joysticks input, This is easier said than done.

It is good to remember that there are two types of values ​​transmitted by our controllers to our PC:

Digital values​​: They can have a value of On or Off. This is the case of a normal button on your controller, or even the keys on a conventional keyboard. Many old games use only this type of input, but not all of them do.

Analog values​​: They can have a variable value (from -128 to 128, for example). This is the case of the analog sticks in PC Controllers or Joysticks, paddles, pedals, etc. on Arcade machines. As you can imagine, the transmitted value depends on how hard or how far this control is pressed, and the game or application reacts accordingly, so these controls can be difficult to replace by digital controls. Each individual value (X or Y Values of an Analog Stick) are called Axis.

As you can see, to correctly emulate systems that where build to use analog controls, you should use Joysticks input.

In Windows there is two main Input Methods for Joysticks: Direct Input and XInput.

Direct Input

In simple words DirectInput is the normal way you use your Joysticks and GamePads in Windows. When you open "Game Devices" in the Control Panel, you are seeing DInput devices. Also HyperLaunch and HyperLaunchHQ uses DirectInput to change the order of the controller to the preferred ones, and to capture the input of such controllers.

DirectInput is part of DirectX since version 1.0. While Microsoft initially intended that DirectInput would handle all inputs, it hasn't turned out this way. As of 2011 Microsoft doesn't recommend using DirectInput for keyboards or mice, and has started pushing the newer XInput for Xbox 360 controllers. In Windows Vista, Windows 7 and later Windows versions, the in-built action mapping UI has been removed.

XInput

XInput, an API for "next generation" controllers, was introduced in December 2005 alongside the launch of the Xbox 360. This instruction set provided full support for Xbox 360 controllers in Windows XP SP1 and subsequent operating systems, and is described by Microsoft as being easier to program for and requiring less setup than DirectInput. XInput is compatible with DirectX version 9 and later.

The order of XInput controllers is determined by the XInput system and can't be changed, the order the controllers are conected generally determine the number that is represented in the controller with the guide button lights. HyperLaunch and HyperLaunchHQ can't change the order of an XInput device. But you should also note that every XInput device with Microsoft Drivers is also a DInput device, even if you can see it as two controllers, both can be accessed by different applications with the two different libraries.

DirectInput vs XInput

An Xbox 360 Controller with the default Microsoft driver with DirectInput has the following limitations compared to with XInput:

  • The left and right triggers will act as a single axis representing the signed difference between the triggers, not as independent analog axes
  • Vibration effects will not operate
  • Querying for headset devices will not operate
  • According to MSDN, "the combination of the left and right triggers in DirectInput is by design. Games have always assumed that DirectInput device axes are centered when there is no user interaction with the device. However, the Xbox 360 controller was designed to register minimum value, not center, when the triggers are not being held." MSDN proffered the "solution" of combining the triggers, setting one trigger to a positive direction and the other to a negative direction, so no user interaction is indicative to DirectInput of the "control" being at center.

The above, however, ignores the fact that many DirectInput controllers, such as gamepads with dual analog sticks and racing-wheel controller sets, already map triggers and pedals independently. In addition, many DirectInput devices also have vibration effects. At least one driver, XBCD, gives the Xbox 360 controllers the vibration support, dead zones and (optionally) independent triggers through DirectInput. This suggests that Microsoft's Xbox 360 controller driver intentionally has weaker DirectInput support, rather than due to any differences between DirectInput and XInput APIs. On the other hand, Xbox 360 controller and XInput support only very basic control of vibration motors in contrast with great palette of various effects supported by DirectInput.

The XInput API also as of 2010 has limits that DirectInput does not:

  • XInput supports only "next generation" controllers. This limits it basically to controllers for the Xbox 360 that also have Windows drivers. Legacy Windows controllers, joysticks and generalized force-feedback devices are not supported.
  • XInput supports a maximum of four controllers at a time. This is an Xbox limit, carried over to Windows. Although as of 2010 few PC games require more than four controllers at once, DirectInput itself has no such limitation.
  • XInput does not support keyboards, mice, or mouse-type devices. While this mirrors Microsoft's recommendation not to use DirectInput with these devices,[8] programmers can use DirectInput with these devices.
  • XInput supports maximum of 4 axes, 10 buttons, 2 triggers and 8-direction digital pad per controller, compared to DirectInput's support for 8 axes, 128 buttons, and full-range POV. (Incidentally, the number of axes, buttons and triggers XInput supports corresponds directly to the Xbox 360 controller.)
  • As of 2011 XInput is for Xbox 360 controllers, while DirectInput is for any controller. In XInput 1.4 introduced with Windows 8 support of querying for headset devices was reintroduced.

Alternative Drivers

XBCD

XBCD is a driver that allows owners of an Xbox controller to use it on a Windows computer. The controller itself is a USB device with an extra wire (V-sync, usually yellow). With an appropriate adaptor, users can use the controller with a PC.

XBCD also supports wired Xbox 360 Controllers, allowing them expanded support for DirectInput.

The actual software allows users to use the vibration functions of the Xbox controller, and remap the buttons and axes of the controller. As an example, pressing X on the controller could be mapped so that it increments the X-axis in whatever game you are playing.

XBCD uses DirectInput 8, and support for Xinput is provided via the bundled xinput wrapper that users must copy into their games directory.

Current development of XBCD aims to improve wired controller compatibility. Wireless controllers for the PC are known to have issues using XBCD as they require a driver for their individual receivers, and report different values than the wired controller.

A new version of the setup utility has been developed to support both Xbox 360 and Xbox controllers, as well as improving performance when running and adding various user interface enhancements.

There is also an alternative Driver for the Wireless Xbox 360 Controller called X360WC.

Currently the support and project maintenance has been moved to another of the current project maintainer sites at VBA-M forums.

Xbox 360 コントローラー用デバイス ドライバ

This is an alternative driver for Xbox 360 Controllers by a Japanese author. There are drivers for Wired and Wireless controllers and for Windows XP, Vista, 7 in 32 and 64 Bits Architecture. They convert the Xbox 360 controllers to DirectInput controllers, so you can't use the controllers with games that use exclusively XInput, at least not without x360ce, the Xbox 360 Controller Emulator.

x360ce

This is not exactly a driver but a emulator that transform your DInput controller into a XInput device. Many PC games and emulators support Xinput and normally the configuration is very simple or none.

Usage in HyperLaunch

HyperLaunch and HyperLaunchHQ can help you with the Joysticks configuration of your emulators.

In HyperLaunchHQ you can setup the prefered controllers order in a per-system basis, or you can change their order in the GLOBAL system. This way every time you launch a game through HyperLaunch, the usb controllers will be rearranged in the order you want, and the emulator or game will always get the controllers in the correct order.

HyperLaunch always work with the DInput controllers. This don't mean that Xbox 360 controllers won't be reorganized, but just the DInput part of the controller (Xbox 360 controllers are XInput and DInput devices at the same time) will take is position in the controllers list. So if the game or emulator use DInput, this won't be a problem, the controllers will be recognaiced in the order you want to.

But when you need to play a game that uses XInput as is input method, you can't be sure which controller will be number one or two until you actually connect the controller and see the lights in the controller that indicates the player number. Actually, it is currently imposible for any application in Windows to change the XInput devices order, they will always take the first free position (one to four) when they are connected.

It is worth remembering that many emulators can lose the settings of a controller, if it is not connected the time you run the application, and therefore the controller will not work the next time you run this emulator. This can only be solved by marking the emulator configuration file (if the application has one) as read-only, but this action can bring other problems such as the inability to change settings from the emulator or from HLHQ once you lock this file.

As we made clear before, it is always best to set the joysticks controls directly in the emulator, but due to several problems that can arise, it may be necessary to use a KeyMapper to transform Gamepad input to keyboard or mouse input.

More information about how to change this setting can be found in the HLHQ Settings page.

Keyboard and Mouse Input

All Windows Games and Emulators support keyboard input (and sometimes mouse input), so this should be the perfect method to interact with your front end and applications.

One problem with this input method is the lack of Analog Input, except for the mouse input, witch represents just two Axis and is not commonly configurable in the emulators. Also, mouses are limited in Windows to one device at time (Except when using Raw Input).

Other problem is comfort. It's very difficult to play a game with a keyboard when it as been designed to be played with a Game Controller or an Arcade control panel.

One solution to this problem is to build your own arcade machine, using devices like the I-PAC to map buttons to keyboard input.

You can also use applications like Xpadder or JoyToKey to map your PC Joysticks Buttons and Axis to Keyboard and Mouse input that can be used by the emulators and applications.

Usage in HyperLaunch

Keyboard input can be configured directly in emulators, and using Keymappers to convert Joystick Input to Keyboard and mouse input. Hyperlaunch can help you to create profiles for various Keymappers and asing this profiles globally, or to a system, emulator or game in particular.

Raw Input

Raw Input Refers to the Program (Game or Emulator) talking directly to the drivers of the hardware without any libraries interference. This make possible to read all kind of data for the controllers that is ignored by the libraries (like detect two mices at the same time). But this also make all keymapper, that works simulating input libraries, useless. The most common case is MAME, that by default is compiled for use Raw input (but it can be compilled to use Dinput on Windows).

In this case you must work directly with the app to configure your controls.

External Links

DirectInput in Wikipedia, The Free Encyclopedia.

XBCD in Wikipedia, The Free Encyclopedia.

Jonny's Place post about Xbox 360 コントローラー用デバイス ドライバ

Xbox 360 コントローラー用デバイス ドライバ

x360ce Google Code Page