Game Development Community

Commercial Steering or Racing Wheel Support??

by Brian Colin · in Torque Game Engine · 12/17/2004 (6:55 am) · 7 replies

We've developed a specialty Racing game for a client that currently utilizes
The Logitech MOMO Steering wheel and pedals....

The thing is, they work just fine; but ONLY IF the Logitech Drivers are NOT installed...
(...And WindowsXP being what it is, you can never really uninstall drivers from a machine....)

So it would be nice if we could find a way to...

(a) Get Torque to work with a wheel after the drivers have been installed, or
(b) Find a Racing Wheel set that works well with Torque

Can anyone recommend any commercial Wheels/Pedals that they are using successfully (reliably) with the Torque engine...?

Thanks

#1
12/20/2004 (1:31 pm)
As far as I know, Torque will work happily with any steering wheel/pedal combo that acts like a joystick, which is most (if not all) of them.
#2
12/22/2004 (10:38 am)
True enough, Ben...

IF the wheel/pedal is simply reconized by Windows XP, it treats it like a Joystick and all is well...

The trouble is, when the actual mfg's (In this case, Logitech's MOMO or WingMan)drivers are used, Torque no longer "sees" it like a joystick and the wheel/pedal no longer works as designed.

However, we were able to add a check for these types of drivers and our games can now use the full functionality of the wheels/pedals. (Pretty EZ to do, Kinda difficult to explain)

If ayone is interested in the details, drop me a line and I'l fill you in...
#3
12/22/2004 (3:05 pm)
Very cool... I would be interested in knowing how you got around this ?
#4
12/23/2004 (7:23 pm)
Sure, I'd love to see the source changes or what have you... drop me an e-mail at beng@garagegames.com ! :)
#5
12/28/2004 (7:36 am)
I've been asked by Brian to explain exactly how we got the steering wheel to work with Torque, so here goes:

Like mentioned before, we were only able to get our wheels to work (the Logitech MOMO and Wingman wheels) when the drivers were not installed. The reason this worked was because *sometimes* a wheel without a driver looks like a joystick to DirectInput. Once the drivers were installed and DirectInput was seeing them as wheels, Torque would stop seeing them as joysticks.

Our "fix" to this problem was forcing Torque to recognize a driving wheel as a joystick. The first step was to go into engine/platformWin32/winDirectInput.cc and modify the enumerateDevices() function to count DI8DEVTYPE_DRIVING objects. This was the line we added:

mDInputInterface->EnumDevices( DI8DEVTYPE_DRIVING, EnumDevicesProc, this, DIEDFL_ATTACHEDONLY );

And in winDInputDevice.cc, in the DInputDevice constructor, we added "case DI8DEVTYPE_DRIVING:" right above the joystick case, so the driving wheel device type would be set to JoystickDeviceType, and... viola! driving wheels become joysticks.

After we did this, we really didn't have any idea of what kind of data the wheels were spitting out, so we quickly added some printf statements to the enumerateObjects() function to find out that our joystick-wheels were using sliders.

Anyways, in the end we found that steering is controlled with the x axis, and the pedals are read with the slider. This is what we use in our client/config.cs:

moveMap.bind(joystick0, "xaxis", joySteering);
moveMap.bind(joystick0, "slider", joyThrottle);

The game now works with regular joysticks as well as wheels with the drivers installed. Torque thinks that they are both just plain old joysticks.
#6
12/28/2004 (7:55 am)
Thank you, Manuel!
#7
09/11/2006 (1:08 pm)
Many thanks for your solution Manuel. I have a Logitech Wingman Formula Gp, and I've been beating my head on the desk for days trying to figure out why moveMap.bind(joystick0, "yaxis", pedals) wasn't working. Using your method and "slider" gave me the results I needed. Thanks again.