Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Force Feedback Support...  (Read 6570 times)

0 Members and 1 Guest are viewing this topic.

datahead8888

  • Newbie
  • *
  • Posts: 5
    • View Profile
Force Feedback Support...
« on: January 16, 2016, 03:01:32 pm »
This is a feature request to add support for force feedback on game controllers.  A good example of this is the rumble pack on the old Nintendo 64 -- you can make the controller vibrate in response to game actions such as hitting an enemy, firing a gun, landing on the ground, or when nearby objects fall or explode.

Currently if someone is using SFML to handle game pad input and wants force feedback support, they suddenly must add an additional library.  For large open source games, the difficulty in making builds tends to be proportional to the number of dependencies.  This can lead an open source project to question whether force feedback support is worth it.

I realize that there are many combinations of game controllers and operating systems.  Perhaps a config or plugin setup could be used to handle this.  It would of course ultimately  have to address most major controllers and operating systems through this in order for cross platform projects to be able to use this in SFML.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Force Feedback Support...
« Reply #1 on: January 16, 2016, 06:09:48 pm »
There have been a few short discussions about this feature, but so far no serious attempt to approach it.

The first step to realize force feedback in SFML would be to do some research on the requirements (how can it be implemented on every platform, what libraries are needed, etc.) and discuss ways in which it could be provided. If you're interested, your help would be appreciated -- some higher priority tasks have been pending for a long time, so it's unlikely that the team would incidentally implement this ;)
« Last Edit: January 16, 2016, 06:11:52 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
Re: Force Feedback Support...
« Reply #2 on: January 23, 2016, 06:34:24 pm »
I remember researching this a while back, because I was also interested in this feature.

On Linux is seems fairly straight forward. There are some ioclt and file wiriting calls and thats pretty much it. There is some information in the kernel doc.

On windows the whole thing is a little more complicated in our case. If I recall correctly SFML is using the windows 2000 (by now deprecated) multimedia joystick API. Force feedback is not supported there. For that you have to use the DirectX DirectInput system. This means we would have to rewrite the sf::Joystick windows implementation to use DirectX. But maybe that has to be done at some point anyway.  My research kinda stopped there, because I don't have much knowledge of DirectX. Also I don't know if using DirectInput means that you have to provide DirectX Redistributables with every SFML application (with would suck) or if windows already provides it automatically.

I have no idea about MacOS, but I guess it may be them same as on Linux.

Maybe this information is usefull for somebody. For the interested this is how SDL does it.

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Force Feedback Support...
« Reply #3 on: January 24, 2016, 07:06:44 pm »
All supported versions of Windows have DirectX built in up to a specific level, however the SDK is (or at least used to be) a bit tricky in combination with compilers/linkers other than Visual C++. Also switching to Xinput (DirectInput is not enough IIRC), we'd get DirectX as a dependency for SFML as well (the SDK is not redistributable).

mequint

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Force Feedback Support...
« Reply #4 on: October 15, 2018, 06:04:29 pm »
I am interested in this feature as well...looking into it further, it looks like SDL has been able to implement force feedback so looking into that library might be able to give some clues into how it can be done without having to implement Xinput.

 

anything