Black Mesa

Black Mesa

Not enough ratings
Playstation DS4 / DualSense / Nintendo Switch Pro Gyro Setup
By DaMu
This guide will go over the advanced configuration file needed to be modified to enable and optimize controller support in Black Mesa, and potentially other Source engine games.

This guide may be outdated because Black Mesa now finally supports Steam Input API.
   
Award
Favorite
Favorited
Unfavorite
Controller.cfg & References
Look for the configuration file in the Black Mesa folder.

"[steam_directory]\steamapps\common\Black Mesa\bms\cfg\360controller.cfg"
https://steamuserimages-a.akamaihd.net/ugc/1849300637083855187/7C8B385EDA699BCD892AD8C58F4FF1D55ED4C01C/?imw=256&&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=falseThis file is a structured reference for what the game, or any Source game, expects, but it's not recommended to modify because the game cannot verify all its files properly.

In this guide, we're going to create a similar config file for other controller types such as Playstation and Nintendo controllers with built-in gyroscope capability. This config file can then be executed in the developer console accessible in-game.

The config file follows a structure of sections for managing the controller:
  • Joystick Properties
    Includes things like Joystick Name
    joy_name "Gyro Controller"
  • Advanced Joystick Enable
    This command is required to allow all features of the standard Xbox joystick to function, including sticks and triggers.
    joy_advanced "1" joyadvancedupdate +jlook
  • Axis Assignment
    Each axis needs to be assigned to a function.
    joy_advaxisy "1" //GAME AXIS FORWARD
  • Stick Settings
    All the properties and modes applied to stick responsiveness.
    joy_pitchsensitivity "+1.0" //why so SMALL
  • Buttons
    Probably the easiest and most inconsequential section to understand.
    bind "A_BUTTON" "+jump" //or Say Apple in Portal 2

Use this website as a guide for what parameters do, their expected values and defaults. Note that it's incomplete and based off of CS:GO, but should still work with games in this engine.

Total CSGO Commands[totalcsgo.com]
Requirements for Gyro
According to JibbSmart, the absolute basics of good gyro look controls revolve around one principle:

The Gyro is a Mouse.[www.gamedeveloper.com]

Black Mesa, using keyboard and mouse configs by default, makes gyro translation easy by simply using it to take over the mouse input. But in the event that games lock out and prevent mouse movement simultaneously when a controller is active, the fallback is Steam Input's Mouse-Like Joystick (MLJ).

MLJ attempts to map the gyro movements to the right stick of a controller, because that stick is the primary input method for looking around. Analog sticks are flawed at aiming in a 3D space, and so many settings and restrictions are placed to attempt to help it. What is possible is to remove all the limitations put in place for Xbox controllers. Specifically:

  • Sensitivity
  • Acceleration
  • Deadzone

Xbox = SAD.

Sensitivity
The default stick sensitivity is too slow for reliable movement, especially compared to the mouse's potential. In the game's current settings menu (as of April 2022), the slider at its highest setting does not allow much faster movement. Fortunately, it can be altered beyond the slider.

Adjust sensitivity to the highest value possible to allow quick sudden turns, and tune mapping values to keep all analog stick values obtainable at any time to prevent jittery movement when trying to fine aim.

Acceleration
By default, acceleration is applied when the stick is pegged to one side, causing the speed of the stick to grow exponentially after some time has passed. This helps Xbox sticks use more of the stick to fine aim and then switch it to a broader movement when applied all the way to the edge. Gyro doesn't need the stick's default acceleration because it already has the range to move slowly and precisely or quickly and broadly when requested.

Some acceleration may be necessary for specific circumstances, but other input remappers can apply this directly to the gyro. Remove stick acceleration completely from the game's settings, and consult either Steam Input or the remapper for better acceleration tweaks.

Deadzone
Gyroscopes and mice do not need deadzones, but sticks do, especially as they fail over time. Both of the former devices allow very small precise movements without compromises, but as sticks drift, they cannot do the same. The cheaty solution for controllers is aim-assist, something that is planned to be turned off completely later, but any deadzone or minimal movement threshold hurts the gyro more than necessary.

If you absolutely need a deadzone, consider applying one in your Big Picture Mode config, or using remapping software like DS4Windows or JoyShockMapper. Steam can also configure controller sticks without requiring a config. Don't bother letting the game provide a deadzone by default.
Enable Advanced Joystick Settings
Here, I'll go over each line that needs to be changed from the default.

But REMEMBER: it's better to have a separate config file in the same directory as "360controller.cfg" instead of modifying. You can call this second file anything you want, as long as you call it by its name when executing in the developer console.

Let's start with the easiest:
joy_name "Gyro controller"
Can be "Playstation controller", "DS4 controller", "Playstation 5 controller", doesn't matter. Just be consisent.

Next, enable the advanced axes and assign them.
joy_advanced "1" //allow for multiple axes joy_advaxisx "3" //GAME AXIS SIDE joy_advaxisy "1" //GAME AXIS FORWARD joy_advaxisz "0" //Trigger? joy_advaxisr "2" //GAME AXIS PITCH joy_advaxisu "4" //GAME AXIS YAW joy_advaxisv "0" //Leaning, maybe
IF YOU ARE USING BIG PICTURE MODE CONFIG OR REMAPPING TO XBOX CONTROLLER The game looks for these axes values on an Xbox controller, so as long as the connected controller behaves like that, these values should work. If you have Steam Input disabled, the numbered value may need to be changed. Alter them after testing in game.

Now from this point, we remove the default controller settings that make us SAD.

Sensitivity
Sensitivity is too low. Crank it up. No, 25 is not too much.
joy_pitchsensitivity "+25.0" //Up and Down Look Sensitivity joy_yawsensitivity "-25.0" //Left and Right Look Sensitivity

Acceleration
There are acceleration modes, scales and thresholds. Remove all of them, make input as linear as possible.
joy_response_look "0" //Default "1" enables acceleration joy_accelscale "0.000" //Default "1.125", removed

Deadzone
Remove the deadzone, and reenable diagonal movement.
joy_axis_deadzone "0.000" //Where are deadzones? joy_diagonalpov "1" //POV manipulator
Big Picture Mode Configuration
Activate in Developer Console