Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
802 stars 62 forks source link

[REQUEST] Gamepad Controller compatibility #324

Open John-Enigma opened 4 years ago

John-Enigma commented 4 years ago

Is it possible to add Xbox 360/Xbox One/Dualshock 4 (PS4)/Steam Link gamepad controller compatibility to the source port?

Interrupt commented 4 years ago

Figuring out how the controls would work seem like the biggest issue in getting gamepad support going. Basic movement seems easy enough, but the UI / MFD system is all designed around a mouse.

NeonLightning commented 3 years ago

might wanna look at openmw for some inspiration?

bangstk commented 3 years ago

I've played around with making Steam controller configs to make a pretty playable layout on gamepad. I did a whole playthrough of the game with the following on System Shock EE, so nothing in the UI would need fundamental altering.

Right Trigger - left click Left Trigger - right click

Left/Right Bumper - toggle left/right leaning

Left Stick - movement Left Stick Click - sprint Right Stick - move mouse (look around) Right Stick Click - quick pickup (this alone cuts down the frustration of a thumbstick cursor almost entirely)

Back Button - toggle mouselook* Start Button - ESC menu

Y - next weapon X - prev weapon

B (single press) - crouch B (hold for .5 sec) - prone A - jump (also automatically stands you up from crouch/prone so a Stand Up bind would be redundant)

DPad left - cycle left MFD (done by cycling from pressing F1, to F2, F3, F4, F5 next time button is pressed) DPad right - cycle right MFD (F6-F10) Dpad Down - select grenade Dpad Up - arm grenade (then right trigger to throw)

Using patches, reloading, and listening to logs are done by pressing Back button to enter cursor mode, and moving the cursor with the thumbstick. Not ideal, but still playable and keeps some of the mouse-driven tension going. Ideally you'd want to do all of those when you've moved out of immediate danger anyway. If reloading with the thumbstick cursor is too bullshit you can probably give up X for it (maybe long press for switching ammo type) but in my experience it wasn't too bad, since the cursor always starts from the center of the screen so it's at least a consistent action.

*Note: I also personally bind HUD Fullscreen Toggle (2) to the same button as Mouselook Toggle. This makes it more apparent that you have shifted from a 'game' paradigm to a 'UI' paradigm by having the cramped HUD background automatically appear when you change to Cursor Mode. This alone makes it behave very similarly to System Shock 2. I think this would be a good way to get new players more acclimated to the UI by making the game appear as if they had opened an inventory screen. For best effect, the bottom inventory section would stay hidden in Fullscreen HUD, and the MFDs would automatically switch to the Weapon and Automap modes.

If you want to try it out (with System Shock EE's default Modern controls) it's in the community configs as System Box for an Xbox One pad (or System Dualshock for ps4 controllers)