Re: [w3c/gamepad] extensions: Add vibrationActuator and dual-rumble effect (PR #163)

@nondebug commented on this pull request.



> +            </li>
+          </ol>
+        </dd>
+        <dt>
+          Construction
+        </dt>
+        <dd>
+          <p>
+            Add new steps to [=a new `Gamepad`=]:
+          </p>
+          <ol>
+            <li>If |gamepad:Gamepad| has a vibration actuator that can [=play
+            effects with type=] {{GamepadHapticEffectType/"dual-rumble"}},
+            initialize |gamepad:Gamepad|'s {{Gamepad/vibrationActuator}}
+            attribute to [=a new `GamepadHapticActuator`=] with
+            {{GamepadHapticActuatorType/"dual-rumble"}}.

I think we (Chromium) should deprecate and remove the actuator's `type` attribute since it's not useful for capability detection. Going forward, all vibration actuators that support "dual-rumble" effects should use type "dual-rumble" even if they support other effects. Once we've provided an alternate means of capability detection (either `canPlay` or `actuator.effects.includes`) then we can remove the `type` attribute.

In general, I don't want compatibility to be limited by the actuator type. It should be possible for user agents to emulate effects even when the actuator doesn't natively support that type of effect. For instance, a Switch Pro controller with an LRA in each handle might be able to play a "dual-rumble" effect meant for ERM actuators if the user agent knows how to simulate a dual-rumble effect with LRAs.

I agree `GamepadHapticActuator` is confusing. In my view it doesn't represent a specific physical actuator on the gamepad, it represents a system of actuators that can work together to create vibration effects. If a `GamepadHapticActuator` supports an effect type, that means its set of actuators includes the appropriate actuators to simulate the effect.

I originally thought that the `type` would help applications understand which effect type is preferred by the actuator. For example, a user agent might allow a "vibration" actuator to play "dual-rumble" effects as a fallback, with some loss in fidelity. The `type` attribute would let applications know to prefer "vibration" effects over "dual-rumble". I've changed my mind and I don't think this is useful anymore.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/gamepad/pull/163#discussion_r967555498
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/gamepad/pull/163/review/1103017347@github.com>

Received on Saturday, 10 September 2022 00:45:45 UTC