OoliteProject / oolite

The main Oolite repository.
https://www.oolite.space
557 stars 72 forks source link

Feature request: haptic (force feedback) #265

Open gilbertohasnofb opened 6 years ago

gilbertohasnofb commented 6 years ago

It would be very nice to have haptic (force feedback) implemented in game so that joystick users could experience vibrations. As an example, here is a list of events that could trigger vibrations:

Would something like this be feasible in Oolite?

AnotherCommander commented 6 years ago

It could be, but it is not a small task. SDL 1.2 does not support haptic devices out of the box. In order to support this technology we will require one of the below methods:

So, whichever way we try this is not something that can happen soon. But it probably is not impossible either.

KonstantinosSykas commented 6 years ago

Despite the itch I have to put my hands on this, I wonder what will happen with the installations coming from Linux repositories. These installations will not have the patched SDL library, delivered with oolite.org installations, thus, breaking execution or just not supporting haptic, right? :worried:

gilbertohasnofb commented 6 years ago

Thank you two for the input, I imagined this would not be something trivial (else it would probably already be implemented). Would it be all right to leave this issue opened then in case someone wants to take a look at it in the future?

KonstantinosSykas commented 6 years ago

@AnotherCommander Let's leave it open for a couple of weeks. I need to have a look at it, because we have the same library issue with SpiderMonkey JS and this dualism has started getting on my nerves.

KonstantinosSykas commented 6 years ago

OK. Let's forget the "dualism" problem and focus on what features can be delivered in Oolite from oolite.org. We will leave the player decide whether to install from oolite.org or not.

Having this set, I have checked the Oolite for Linux SDL version and luckily it is 1.2.14; the exact same version the patch needs. So I paused on that front and turned my attention to Windows.

On Windows, things become more interesting. The SDL version used here is 1.2.13; one step behind the version needed by the patch. Upgrading to 1.2.14 is a very tedious task, and unless there is another volunteer, it is not an option. The first skim through the patch contents, was very promising, so I decided the manual patching approach.

Stay tuned for updates.

gilbertohasnofb commented 6 years ago

Stay tuned for updates.

Sounding really promising, thanks for taking a look at this!

KonstantinosSykas commented 6 years ago

Still busy on trying to backport force feedback support on SDL 1.2.13 for Windows. What we have seen so far code-wise, is that we are in a pitch black room trying to find a light switch, without knowing if actually there is a light a switch. Frankly speaking, this has lessen our hopes. However, we continue the effort and have managed to have a first build of the library. To see if it's worth it, we are looking to get our hands on a force feedback device to start a library stand-alone testing cycle. This cycle will show us if we will "turn on the light" to proceed with Oolite force feedback support.

KonstantinosSykas commented 6 years ago

We haven't found the light switch, yet, however, we now have a flashlight. 🙈 🔦

An experimental SDL1.2 with haptic support is ready for Windows 64bit. A couple of vibration effects have been successfully tested (using a testhaptic utility delivered by libsdl.org) on a BlackWidow XE (aka SL-6640-BK) stick.

SDL1.2 with haptic support is also built for Linux. I can't find a way to make Linux recognize the stick's vibration capabilities, though. I will be calling out for testing help in the Bulletin Board.

In the meantime a new branch (named "haptic") is opened to receive the results of this effort.