Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Force Feedback Controller Toolkit

Discussion in 'Assets and Asset Store' started by Zaddo67, Nov 20, 2012.

  1. KuraLemot

    KuraLemot

    Joined:
    Aug 21, 2014
    Posts:
    5
    I now you are busy. I'm sory to disturb your time but thanks to reply my post

    I use windows 7 64 bit. I have tried in windows 8.1 too and get the same problem ......
     
  2. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    I have investigated you problem and I can't see any reason why you would be getting this error.

    I have uploaded a compiled version of my sample scene. here:
    https://dl.dropboxusercontent.com/u/87201649/ffbtest.zip

    Please try this and see if it works.

    Steps you can do to trouble shoot are;

    1. Do a developer build. There is a checkbox on the build form for this. Run the program and see if you get any error messages in the console.
    2. Check the output log for any erros. This is created in the subfolder .\xxxx_Data\output_log.txt where xxxx is the name of your game.
     
  3. KuraLemot

    KuraLemot

    Joined:
    Aug 21, 2014
    Posts:
    5
    your sample scene is working nicely. Now I am confusing about that....

    I've check the output log, my project have an error

    Fallback handler could not load library .../xxx_Data/Mono/FFWheelInput
    Fallback handler could not load library .../xxx_Data/Mono/.\FFWheelInput
    Fallback handler could not load library .../xxx_Data/Mono/FFWheelInput
    Fallback handler could not load library.../xxx_Data/Mono/libFFWheelInput
    Fallback handler could not load library .../xxx_Data/Mono/.\libFFWheelInput
     
  4. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    That is the error I would expect to see if the FFWheelInput.dll was not in the directory with the .exe. I deleted the dll and tried running my test application to see what errors I would get, and I got exactly the same as you, see below.

    I can's think of any reason, why it give you this error when you have the DLL in the folder with the .exe. The only thing I can think to try is create a shortcut and run your game with the shortcut. To do this:
    1. Right click on your exe, choose create shortcut
    2. Right click on the shortcut and choose properties
    3. Make sure "Start in" is the same as target directory
    4. click ok and then double click on the shortcut
    5. One last thing to try, replace the FFWheelInput.dll with the one from my test program you downloaded (Yours may have been corrupted)


    shortcut.png

    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/FFWheelInput
    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/.\FFWheelInput
    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/FFWheelInput
    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/libFFWheelInput
    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/.\libFFWheelInput
    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/libFFWheelInput
    Fallback handler could not load library K:/Temp/ffbtest/testffb_Data/Mono/FFWheelInput
     
  5. KuraLemot

    KuraLemot

    Joined:
    Aug 21, 2014
    Posts:
    5
    I don't why when I build my project with architecture x86 and use new FFWheel from you is working .....
    maybe you are right, my FFwheel is corrupt

    more importantly ..... my project is work

    Thanks Zaddo67, you are the best....:)
     
  6. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Thats great news KuraLemot!!!

    I am glad I could help.
     
  7. RitaMaia

    RitaMaia

    Joined:
    Sep 24, 2014
    Posts:
    2
    Hi Zaddo67!

    Im having the same problem as KuraLemot, but nothing happens even with your compiled example. I cant make your plugin to work.It always gives me:

    NullReferenceException: Object reference not set to an instance of an object
    FFBGame.Start () (at Assets/ForceFeedbackToolkit/ForceFeedbackToolkit Samples/MultipleControllers/FFBGame.cs:24)


    im on windows 8.1, directX 11

    Thanks!!!
     
  8. Tortyfoo

    Tortyfoo

    Joined:
    Mar 6, 2012
    Posts:
    132
    @RitaMaia Have you installed DirectX 9 using the link in the pdf file?
     
  9. RitaMaia

    RitaMaia

    Joined:
    Sep 24, 2014
    Posts:
    2
  10. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Hi RitaMaia.
    If you are running the compiled version, then FFWHEELINPUT.DLL, is in the same folder as the .exe. This is the most common mistake people make, having this in the wrong folder.

    Here are the dependency's for FFWHEELINPUT.DLL. Please check they are in your system. I think they should be in your C\Windows\System32 folder.

    ffdepends.png
     
    Last edited: Oct 2, 2014
  11. LarsRocks

    LarsRocks

    Joined:
    Oct 23, 2014
    Posts:
    10
    Works great, but only for 32-bit builds. Couldn't get to run it with x86_64 :( (Windows 7)

    @Zaddo67 Any chance you could compile a 64-bit Version?
     
  12. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    @LarsRocks. Unfortunately Not. I suggest you take a look at the Logitech kit on the Asset Store. This should do the trick for you.
     
  13. heavengate

    heavengate

    Joined:
    Jun 7, 2014
    Posts:
    2
    I can use joystick to control the car, but force feedback is not work, my enviroment is: windows7 64bit, untiy3d 4.5, directX11, joystick is rapoo v600
     
  14. heavengate

    heavengate

    Joined:
    Jun 7, 2014
    Posts:
    2
    enn.. which is the reason, 64bit? or directX11?
     
  15. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    The FFB toolkit only works for 32Bit builds and you need DirextX9 installed
     
    Last edited: Mar 17, 2015
  16. Diestr

    Diestr

    Joined:
    Jan 22, 2014
    Posts:
    17
    FFB only support 2 players at most. When I use 4 joystick, and it crashed.
     
  17. Diestr

    Diestr

    Joined:
    Jan 22, 2014
    Posts:
    17
    It's really a nice tookit, and I really hope the ffb works well on more than two players.
     
  18. Diestr

    Diestr

    Joined:
    Jan 22, 2014
    Posts:
    17
    Here is the report
     

    Attached Files:

  19. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Hi can you port the dll to 64bit please?

    Thx in advance!
     
    GaRzY likes this.
  20. GaRzY

    GaRzY

    Joined:
    Jan 13, 2013
    Posts:
    4
    #69 +1
     
  21. Dag-Tholander

    Dag-Tholander

    Joined:
    Jul 16, 2014
    Posts:
    90
    @Zaddo67 Hi! Can you please port the dll to 64bit, I'm getting this error :
    Failed to load 'Assets/FFWheelInput.dll', expected 64 bit architecture (IMAGE_FILE_MACHINE_AMD64), but was IMAGE_FILE_MACHINE_I386. You must recompile your plugin for 64 bit architecture.
    DInputProxy.DWheel:StopConstantForce(Int32) (at Assets/Standard Assets/ForceFeedbackToolkit/DInputProxy.cs:529)
    DInputProxy.DWheel:StopConstantForce(Int32) (at Assets/Standard Assets/ForceFeedbackToolkit/DInputProxy.cs:526)
    DInputProxy.DWheel:StopConstantForce() (at Assets/Standard Assets/ForceFeedbackToolkit/DInputProxy.cs:519)
    WheelInput:StopConstantForce(Int32) (at Assets/Standard Assets/ForceFeedbackToolkit/WheelInput.cs:1105)
    WheelInput:StopConstantForce() (at Assets/Standard Assets/ForceFeedbackToolkit/WheelInput.cs:1100)
    WheelMenu:OnApplicationFocus(Boolean) (at Assets/Standard Assets/ForceFeedbackToolkit/WheelMenu.cs:524)

    And the Logitech SDK is also 32bit only.
     
    Last edited: Dec 27, 2015
  22. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    I finaly wrote my own dinput wrapper dll for unity
     
    devotid likes this.
  23. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    Any chance you could share? I have just ported a two year old project and the 32 version is not working in Unity 5.1.2

    THanks in advance.

    Kevin
     
  24. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    It's not fully implemented... more an dirty hack

    Supported force feedback funktions:
    *SpringForce
    *Constant Force

    The RacingWheelSDK.rar is for Unity.
    Just extract it into unity...
     

    Attached Files:

  25. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Here are the first 5 rar for c++ source

    sry cant upload more than 1 MB and 5 files
     

    Attached Files:

  26. Spy-Shifty

    Spy-Shifty

    Joined:
    May 5, 2011
    Posts:
    546
    Ok thats all ...
    You have to install the dx SDK to compile and maybe to adjust some setting
    Most functions are defined and wrapped in c#
    You just have to fill them with Code :D
    It's easy if you know how to... Just look at Spring Force and Damper Force impl.

    But be aware, if you produce errors in the c++ dll
    Unity will crash instantly without error message!

    So no garanty for anything ;)

    Have fun
     

    Attached Files:

  27. GamesDeveloper12

    GamesDeveloper12

    Joined:
    Nov 7, 2013
    Posts:
    18
    Hi, i have imported the unity files into an empty project and it can detect that my saitek r440 and thrustmaster t500 rs are rotating but doesn't give them any force feedback when i call one of the two functions you have implemented.
     
  28. adamjimenez

    adamjimenez

    Joined:
    Jan 19, 2018
    Posts:
    2
    Sorry to resurrect an old thread! Is this package still available somewhere? And is it still the best bet for force feedback on sidewinder joystick?
     
  29. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    This is based on the sidewinder joystick being a gameport adapter ...

    Based on this project I think would this would work for SideWinder. But at least it can give you some good ideas.

    https://github.com/tloimu/adapt-ffb-joy

    The original project was based on the orginal google code website was mentioned in the rise of flight forum.

    https://code.google.com/archive/p/adapt-ffb-joy/


    Based on the results posted in this forum it sounds like people discuss how they got it to work.

    https://riseofflight.com/forum/topic/45292-ms-sidewinder-ffb-pro-working-usb-adapter/
     
  30. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    This uses DirectInput, it should work shouldn't it?
    https://na.suzohapp.com/products/driving_controls/50-0102-08
     
  31. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    The description in the link says the following that is not intended for PC (See Exhibit A). You need to use the control board (additional cost) and then do some additional work (probably both hardware and software) to get it to work with a PC.

    Exhibit A:
    • 270o wheel assembly fitted with a strong DC motor to provide realistic feel and feedback.
    • Requires signals from game board to operate.
    • Black Cap with checkered flag logo fitted as standard.
    • Not intended to connect to a PC.
    • Optional Control Board Available (50-2000-03)
     
  32. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    Thanks, I did some more research and realized that I believe it wouldn't be recognizable by DirectInput, all the software was custom built by the hardware manufacturers (SEGA) so I would have to have the original board. Also I the this plugin is only for 32 bit Windows and I have 64. I guess my only option is to write a 64 bit plugin.
     
  33. devotid

    devotid

    Joined:
    Nov 14, 2011
    Posts:
    445
    Is this for commercial use? Im curious as to why are you sourcing a 270 degree wheel with proprietary software requirements? I have built a few "heavy duty" welded sim racing rigs for customers from readily available Logitech/Fanatec wheels and was just wondering why this unit and not a current 1080 degree DOR?

    Is this for an arcade with general public? ie; needs to be bulletproof? lol.

    Kevin
     
  34. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    Yes it will be for an arcade game so needs to be bulletproof, 270 is fine for this game. I have been doing a lot of research on some of the consumer wheels and something like a Fanatec wheel might be ok, although there are a lot of exposed parts on their systems.
     
    devotid likes this.
  35. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    I was thinking about the issue of spare parts if something breaks. With consumer wheels I do not know how quickly you can get a repair done. I would expect 6 to 8 weeks to get something replaced when under warranty. How long is a warranty for a consumer wheel? That does make a custom solution seem like a better option if you get a good supply of parts.

    Of course I do not know how many arcade machine units you are planning to ship so that makes a difference too.

    Have you seen this thread on this topic? It sounds similar to what you want to do except in a mame context.

    https://www.reddit.com/r/cade/comments/8teogs/steering_wheelgas_pedalshifter_suggestions_for/

    Arcade Controls might be a better place for discussion since people interface to all sorts of various arcade controls. Have you been on those forums before?

    http://forum.arcadecontrols.com/index.php?topic=11688.0

    The driving and cabs section might be more of your interest ...

    http://forum.arcadecontrols.com/index.php/board,55.0.html
     
  36. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    I'll check those links out thanks. I'm still using the old Unity input system and haven't upgraded to the new one but it looks like it supports all HID devices which would include force feedback wheels which means there wouldn't be a need for a plugin. It still doesn't mention anything about FF in the manual though.
    https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/manual/HID.html

    Also I'm a long way from shipping anything. I just began development but want to start implementing FFB
     
    Last edited: May 5, 2020
  37. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    Unity technologies told me the new input system will not be supporting FFB
     
  38. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Not surprised.

    Have you started thinking about what your arcade cabinet will look like? Will you be able to swap in various wheels for testing and prototyping and production? You should also think about cooling issues too.

    Do you have consumer racing wheel with force feedback that you can use for testing your FFB solution? In addition to this plugin Logitech SDK in the asset store (which is their SDK for unity) is something to be aware of. They do have a their Windows SDK that you can get from Logitech website also. You should look at that also if you have not already.

    Certification:

    Since your product is going to be in a public environment have you looked if there are other regulatory issues/standards that you have to comply with? Local/State/Federal level is what I am thinking about. Do you have to be certified by any government agency before your product can be used? FCC certification? I not sure if you have to have your product run through for certification (e.g UL labs www.ul.com). All of these type of things should be included in your overall budget.

    Something like this should have useful resources ...

    AMERICAN AMUSEMENT MACHINE ASSOCIATION
    https://coin-op.org

    LEGAL issues:

    Not sure what legal issues you have to think about in your documentation since you are offering force feedback. You should probably look at consumer racing wheels user manuals for what type of legal warnings and disclaimers that are included. You should also look at age limits you should include in your documentation too. In just looking at Thurstmaster racing wheel (that has force feedback) documentation they have a minimum age requirement of 14.

    You should have a lawyer review everything before placing your product in a public venue.
     
    Last edited: May 7, 2020
    devotid and MathewHI like this.
  39. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Another Legal issue potentially.

    That is another issue you have to learn if you can even use a consumer grade racing wheel in your own commercial product. Yet another licensing thing to see what it says.

    = = =
    There is some more discussion on these forums too for DIY FFB steering wheels.

    https://www.xsimulator.net/community/threads/diy-ffb-steering-wheel-mmosffb-in-progress.7769/page-8

    = = =

    These videos (and they have links in the description with more details) might be something worth looking at if you wish to build your own custom solution.

    DIY Steering Wheel Pedals H-Shifter - Arduino | Part 1



    DIY Steering Wheel with Force Feedback - Arduino | Part 2



    DIY Steering Wheel Mechanical - Arduino | Part 3



    Custom force feedback interfaces with Open FFBoard (DIY direct drive wheel)

     
    Last edited: May 8, 2020
  40. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    Looks like I have my work cut out for me. Those sure look bulletproof to me.
     
  41. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Another thing to consider. Does your game really need force feedback to be viable? You should maybe try beta tests a wheel with and without force feedback.

    The last video "Custom force feedback interfaces with Open FFBoard (DIY direct drive wheel)" is open source to a degree and he has stuff posted on github. The nice thing about that particular video you get to see it used with a real PC car game. So you have better overview of how it works in a real situation.

    With regards to bullet proof it also depends on what type of environment your cabinet will be in. If you have it with adults only (18+ years of age) then you might have to worry about damage less. If you are placing your cabinet in a open to anyone in the public environment you should have more wear and tear on the equipment.

    You should consider that in your design on how easy it is to upgrade/repair the wheel mechanism if there is a problem. Also if you are going to have constant wear and tear and have to repair your wheel regularly you might consider using less expensive parts to make repairs less costly. Also I do not know who is responsible for repairs? Is that the operator or is that you as the manufacturer?

    That is where the issue of how much you have in spare parts available if something breaks down. I would also be concerned about vibration and cooling too. If your game is running continuously for 4 or 5 hours can your wheel mechanism handle the heat?

    If you are looking for bullet proof you can always spend more money. :) The Simpit youtube channel has lot of discussion on rigs, wheels and other bells and whistles. This is one of the very high end models but you get the idea. It is good to see how much vibration these wheels produce too. That also impacts wear and tear on your cabinet.

    Leo Bodnar Sim Steering 2 Force Feedback System Review

     
    MathewHI likes this.
  42. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    74
    I noticed that the docs say "HIDs can support output (for example, to toggle lights or force feedback motors on a gamepad)." Is it really not possible to use this for Force Feedback on a wheel?
     
  43. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    There’s a section they put up on the forums dedicated to answering questions about the new input system. I just asked a few days ago they told me no force feedback.
     
  44. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551
    Here is something else you can look at if you have not seen it already.

    This vehicle physics asset is including force feedback built around the Logitech SDK in a future release mentioned in this thread.

    https://forum.unity.com/threads/nwh-vehicle-physics-2.863188/page-2#post-5825311
     
  45. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    I'm using my own vehicle physics but I will be using the Logitech SDK for the PC version of the game to be used with consumer wheels.
     
  46. MathewHI

    MathewHI

    Joined:
    Mar 29, 2016
    Posts:
    501
    I thought it was weird too but I found out Force Feedback devices are PIDs "Physical Interface Device" which is an extension to HIDs so I guess Unity thought it wasn't worth the trouble implementing that into their massively used all purpose video gaming engine.
     
  47. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    74
    Lol, yeah that makes sense :rolleyes:. I guess I'll look into the Logitech SDK, hopefully it works with non-logitech wheels.
     
  48. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    74
  49. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,551

    What versions of Unity are supporting? What products are you testing against?
     
  50. skaughtx0r

    skaughtx0r

    Joined:
    Mar 9, 2014
    Posts:
    74
    I've tested with Fanatec Forza CSR, other users report it working with Fanatec CSL base. Some other users tested Logitech G29/920, though some have had issues.

    I've only tested against Unity 2018.4 right now, I assume it will work with newer versions, unless they changed how Native Plugins work.