Game Development Community

JoyStick???

by iGamer · in Hardware Issues · 07/01/2003 (2:32 pm) · 16 replies

Hi guys

i want to incorporate JOTSTICK into TORQUE. So, im just curious if there is any Compatible joystick out there or any joystick goes with TGE.

How about "Microsoft Sidewinder Force Feedback 2 Joystick (USB)"?


thanks much guys

--Ram

#1
07/01/2003 (2:37 pm)
Hello, See www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4324

It covers it. Force feedback may require some coding, I havent played with it. But the best way to learn is doing it yourself. That code will however allow you to use a joystick in a regular mode.


Thanks,
Gavin Miller
#2
07/25/2003 (7:41 am)
Thanks miller
but the player is not responding to the joystick movements. I want the player/vehicle to move left or right when i move the joystick left or right, but it isnt happening


any help would be great

thanks in advance

---
iGamer
#3
07/25/2003 (9:36 am)
You need to add key bindings to use the joystick. Check out the keymapping scripts.
#4
07/30/2003 (8:06 am)
Thanks pat
i just mage the below changes in config.cs

moveMap.bind(joystick0, "xaxis", yaw);
moveMap.bind(joystick0, "yaxis", pitch);

thats it .... my game "rocks" now
#5
07/30/2003 (9:29 am)
Did you get Force Feedback to work?
#6
07/30/2003 (10:56 am)
Im working on it, i think within a week ill have something to show u guyz
#7
08/20/2003 (5:02 pm)
Excuse me but wouldn't the forcefeedback code be there in Direct X8 SDK anyway? just need to find the code? also as this engine is a decendant of Starsiege isn't the joystick code there? the reason I ask is because I wish to do a Battlezone R.T.S style game with hover tanks, Walkers e.t.cand I am looking for an engine that can do it.

I tried 3d rad but that engine is a joke although I like the concept of individual brains that it has, I am especially interested in the Joystick code so I can use my Thrustmaster Afterburner , Saitek X35F/X36T and my Quickshot Sky Commander H.O.T.A.S joysticks and I hope to be getting a Saitek X45 and a Quickshot Gen X 700 H.O.T.A.S joystick as well as a Quickshot Prowheel flight yoke /car controller I have recently bought to go along with my Genius Speedwheel Formula wheel which I have . I wish for my game to be played from people just using keyboard and mouse to 10 button 6 axis joysticks with throttles and rudders so does the joystick code have all this?
#8
08/20/2003 (5:51 pm)
Because if I can get to do my game with spawning and can input whole cyberplanets to use as terrain using Mojoworld Editor, go to www.pandromeda.com to see thisamazing softwareto se what I am talking about I shall definately buy this engine and one of the issues is joystick support so if this engine can do it then I will definately buy it as I have Real-Time Strategy Game Programming in Direct X 6.

Also I was wondering if when a vehicle is destroyed if the unmount command could be used to make the player or A.I NPC eject from the vehicle?
#9
03/25/2004 (2:11 pm)
I was looking for information about joysticks and found this thread...

I did the mapping thing, but it doesn't work properly. Well, the 'pitch' movement is inverted, but the movement is smooth. However, if I pull the joystick to the left or right, the player turns just a little, and no more. There are certain positions where the 'yaw' movement works, but not properly. I have tested two different joysticks and I had the same result... any clue?
#10
03/27/2004 (5:13 pm)
Luis - are you binding the axis to the move keys or to the move axis the mouse uses?
#11
03/28/2004 (11:25 am)
Well, I'm using exactly these two lines:

moveMap.bind(joystick0, "xaxis", yaw);
moveMap.bind(joystick0, "yaxis", moveForward);

I tried binding the xaxis to turnLeft, but it just turns and turns...
#12
03/28/2004 (11:46 am)
Right.

moveForward is for binding buttons to. So it won't work. You'll need to find something else to bind to. (Don't know what it's called off hand.)
#13
03/28/2004 (12:29 pm)
:m But moveForward is the one that works! The one which is not working properly is the turning thing. I tried 'yaw' and 'turnLeft', but it doesn't work.

Well, with this:
moveMap.bind(joystick0, "xaxis", yaw);
moveMap.bind(joystick0, "yaxis", pitch);

the player stands still, of course, but is able to look around. However, the xaxis movement isn't smooth. It's not that it doesn't work at all. It's just that if I pull the joystick just a little bit to the left (or right), you get the turning. But if I pull it fully to the left (or right), the turning stops! No idea why :(
#14
06/10/2004 (11:08 am)
What do I have to do to get my joystick working under Linux? I've noticed there is code that utilizes the SDL to access the joystick, but following the above examples didn't change anything for me.
#15
09/28/2004 (5:06 am)
@Luis

If you push the joystick a little to the left and hold it in exactly the same position, you would probably stop turning as well. (provided you have a steady enough hand)

The actionmap only triggers off your event handlers when the position of the joystick changes. Put an echo() in there, pop the console and you can see for yourself. It's the mouse code that is killing you there (no movement when the mouse is still). The solution would probably be to bind it to turnright. (works the same way as moveforward)

Binding moveforward to the yaxis is correct (and is even analog!), but certain other "button commands" are not as friendly. (e.g. handbrake in the racing demo) Probably more correct to bind to movebackward, as y-ordinates are negative in the "up" position and positive in the "down" position, but that is all preference and device.

@iGamer

Very interested to see the force-feedback in action, preferably before I have to figure it out myself! ;-) (Your week is up!!!)
#16
10/24/2004 (10:50 pm)
I just tried binding the slider and rzaxis(yes, not ZAXIS but RZAXIS) to panUp and turnRight and as soon as I touch the right analog stick my view starts spinning to the right and looks straight up in to the sky.

I take it those calls need to be rewrote to take in to account deadZones. It's too late to try it now. I will experiment tomorrow and write what I find unless someone else has an answer already...