OpenDiablo2 icon indicating copy to clipboard operation
OpenDiablo2 copied to clipboard

Joystick Input

Open sstallion opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. One of the best features introduced in Diablo III (and beyond) was support for joystick controllers. I was curious if OpenDiablo would be open to such a feature?

Describe the solution you'd like A couple years ago, I developed a cross-platform HIDAPI support package for Go to tackle a private project, but I've been wondering if it could be suitable for adding joystick support to OpenDiablo2: https://github.com/sstallion/go-hid

Describe alternatives you've considered I suppose I could stock up on PS2 IntelliMouse's and relive 2000 again :-)

Additional context I've been looking for an excuse to dip my toe in OpenDiablo2 development, I thought this might be a good task to get started.

sstallion avatar Feb 16 '21 20:02 sstallion

it's definitely possible, and we've made it flexible enough that even MIDI can be used as an input backend.

Here's an example of using midi (via puredata) for controlling the mouse. https://user-images.githubusercontent.com/936440/108117887-663f8480-7052-11eb-8421-de3c5a88e147.mp4

EDIT: iirc, this midi stuff was never merged because it added a c library dependency for libportmidi. But i think you get my point: adding joystick support is very much a possibility.

Also, we're currently using ebiten, and will likely start using SDL2 shortly, so I believe we already have the ability to read joysticks and gamepads, we just haven't written the code for handling it. :)

gravestench avatar Feb 16 '21 20:02 gravestench

That's HORRIFYING (I love it!)

sstallion avatar Feb 16 '21 20:02 sstallion

Also, we're currently using ebiten, and will likely start using SDL2 shortly, so I believe we already have the ability to read joysticks and gamepads, we just haven't written the code for handling it. :)

Makes sense - at the very least that should reduce the amount of work by quite a bit. I'll check back once SDL is integrated. Thanks!

sstallion avatar Feb 16 '21 20:02 sstallion

As a long time controller/joystick user with the original D2 (with the right mods), I just want to add that the limiting factor is with quality of life (QoL):

  • (shift) clicking potions to your belt is too difficult with a controller (thumb stick), especially when taking heavy damage when you need split-second reaction time. Instead, there needs to be a shortcut for drinking potions direct from the inventory (even with it closed) like was made possible by SlashDiablo's "BH" hack for the original D2.
  • loot filters and auto gold pickup are necessary with a controller to keep gameplay fast paced.

Without the above, playing with a controller is akin to tying your shoes with chopsticks. But with those enhancements, so long as you use area of effect (or splash) attacks, the game is actually quite playable! And hey, you can even play it on a treadmill!

@sstallion I use this currently for D2 (here's the linux version): https://github.com/AntiMicroX/antimicrox

evbo avatar Mar 14 '21 20:03 evbo