itch.io is community of indie game creators and players

Devlogs

Build 250621 (DirectInput support)

Project "Constraint"
A downloadable game for Windows

As it said: made some DirectInput support. So far:

  • Additive, non-multiplexed DI support (XInput here is muxed, as it mostly expects some gamepad you hold with both hands - DI allows for keyboard-n-flightstick should you prefer, however);
  • Type "help di" to see the list (fyi: "help abc" shows the help screen for everything starting with "abc", same for "cmdlist");
  • In-game enumerator, binder, device profile management;
  • "conf.store" affects your DI device selection as well;
  • Programmable transfer curves and deadzones;
  • Support for toggle buttons;
  • Single device selection at the moment, guess I'd better implement a control stack instead before moving on to adding new maps (that is, say, the top-most device #3 controls are set first, what it lacked will be taken from #2, then #1, #0, and then skipped).

On the values. Deadzone is set in the range scale (1.0 is the full range, so 0.1 means a 10% deadzone). Exponents are set as K in Out = exp(K * In) * n, where n is calculated internally so that Out(1.0)=1.0. The K can range from 0.1 to 50, where 0.1 makes a virtually linear output, while 50 is just an overkill top value. I feel comfortable with 2.5 but you be you, I'd say look somewhere between 2 and 4 or something.

The axis group. For being the aiming controls, yaw and pitch are applied as an axis pair. If it is incomplete (at least one axis is missing), it will fall back to the mouse. This is done this way because both the deadzone and the exponent are applied to the displacement vector, not each axis individually. For this we get a round deadzone, not a square one, and the handle direction is preserved. The method only applies to the aiming input while the movement controls and the roll axis are applied individually.

Files

  • ProjectConstraintBuild250621_directinput.zip 111 MB
    Jun 25, 2021
Download Project "Constraint"
Read comments (4)