Gampads / Joysticks. Do you use them?

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Gampads / Joysticks. Do you use them?

Post by lonewolff »

Hi Guys,

I am in the process of wrting a 2D sidescroller. I have the fundamentals of the 'game' (if you can call it that yet) all working and am about to work on input.

Which brings me to the question. Do you personally use a gamepad or joystick when gaming (with the appropriate types of games of course)?

Just wondering if it is worth while writing this part of the code or not :)

Thanks for your input (LOL - Pun wasn't intended :lol: )
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

For simulators, I use a Saitek X52 HOTAS (separate joystick and throttle units), Saitek rudder pedals and TrackIR.
For many games I use a Logitech G13 game board (25 buttons, 1 analog thumbstick, macros and lcd screen).
For some games I use an xbox 360 controller (mainly only if they are designed for console use. I'd prefer good mouse and keyboard controls).
For serious use and playing Silent Storm I use a Space Pilot Pro.

For a side scroller, I'd probably use a 360 controller if the game supported analog movement. Otherwise I'd stick to keyboard.
bstone
OGRE Expert User
OGRE Expert User
Posts: 1920
Joined: Sun Feb 19, 2012 9:24 pm
Location: Russia
x 201

Re: Gampads / Joysticks. Do you use them?

Post by bstone »

Damn, and I was going to say that this is not the right forum to ask about that :lol:
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

bstone wrote:Damn, and I was going to say that this is not the right forum to ask about that :lol:
Sure it is :)

I have been on these forums for seven years now and know that there gamers are amongst us. :wink:

[Edit]

BTW, I only have a Microsoft Sidewinder game pad and a trusty old Starcursor (from the old C64 days, that I modified to work on the PC's 15 pin game port 8) ).

I must admit that these rarely get used though.
User avatar
Miscreant
Greenskin
Posts: 126
Joined: Mon Jun 14, 2010 2:12 am
Location: Brisbane, Australia
x 3

Re: Gampads / Joysticks. Do you use them?

Post by Miscreant »

I have a 360 controller that I like to use for games, although like Kojack it will depend on the game. Generally I prefer to use a controller if it's available since I tend to find it more comfortable than a mouse and keyboard, althoughy there are exceptions to this rule; for example even though Skyrim works quite well with a 360 controller I prefer to use mouse and keyboard for increased accuracy when aiming and the ability to hotkey items to the number keys. That said, being able to use a gamepad isn't that important to me and really I just like to be able to play the game without needing to think about the controls. Most PC gamers I know don't have gamepads so obviously having the game work well with keyboard and mouse should be a priority.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

Miscreant wrote:Most PC gamers I know don't have gamepads so obviously having the game work well with keyboard and mouse should be a priority.
Absolutely.

I was forward thinking a bit, so when my game makes me an 'instant millionaire' :lol: I'll be able to port over to XBOX and have the controls allready figured out.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Re: Gampads / Joysticks. Do you use them?

Post by betajaen »

I use a XBOX 360 controller too, pretty much for all games that don't strictly need the mouse.

One thing I have noticed with some games (Rockstar and Bethesda particularly), is that you don't have to switch between controllers and keyboard/mouse in the options, and can even plug in the Gamepad when the game is running. Even the UI change between Keyboard/Mouse graphics to Gamepad ones based on the last input device used. In some cases you can use both at the same time (Gamepad/mouse combo).

If your going to support gamepads, it makes sense to go the extra mile there.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

For sure! The code I have been testing can easily detect the presense or lack thereof at any time, which will make life very easy. 8)

I have always been of the belief of 'do it well'. If I personally find bugs of any kind in my apps, I constantly work to remove them.

If there is a bug, it bugs me :)

Users are quick to point out bugs and other bad things about an app. They are less likely to point out the good things (and in reality, are probably not aware of them).
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

(Rockstar and Bethesda particularly)
Not so much bethesda these days. I need to unplug my 360 controller to play Skyrim, otherwise it assumes that if it's plugged in then I must want to use it instead of mouse/keyboard.
I wanted to get the recent Rayman game that was on steam. But it's joystick code was crap. It grabs the first joystick device it sees and tries to use it as a 360 controller. It doesn't use the directx preferred device setting. It wanted to use my Space Pilot Pro as a gamepad. I unplugged it, so then the game wanted to use my G13's analog stick. I gave up and managed to get keyboard controls working, but I'm not going to buy a game that needs me to unplug a heap of usb devices because you can't tell it which to use.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Re: Gampads / Joysticks. Do you use them?

Post by betajaen »

Odd, I remember using Fallout New Vegas, quite seamlessly between the controller and keyboard/mouse. Perhaps it's a slightly different engine to Skyrim.

Another good game is Team Fortress 2, oddly enough. I some times use the joypad in my left hand for movement, and the mouse for aiming. It works quite well.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

I some times use the joypad in my left hand for movement, and the mouse for aiming. It works quite well.
You'd probably like the Logitech G13 then. Left thumb analog stick plus a heap of macro buttons for your fingers (plus Lua scripting).
There are similar controllers (Nostromo, etc) but they use a 4 or 8 way digital hat switch for the thumb instead of a real analog thumbstick.
It's great in games that support analog movement, like Splinter Cell Chaos Theory or Chronicles Of Riddick.
Odd, I remember using Fallout New Vegas, quite seamlessly between the controller and keyboard/mouse.
I had no trouble with New Vegas either. Skyrim is much more consolised and prefers controllers over mouse/keyboard.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

I am guessing you need to purchase a USB adapter to use XBOX controllers on the PC right?

[Edit]
I have since noticed that you can actually get an official Microsoft USB version of the controller. Cool! $35 I might have to get one. 8)
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

Yep, I have two of the pc edition 360 controllers.
One cool thing about them is that XInput (the MS library for 360 controllers) is incredibly easy to use. Only a few lines of code to access all of the controller's features (force feedback, etc), far easier than DirectInput.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

Really?

I was going down the DirectInput path, so I didn't have to stuff around with supplying DX redists and the likes. I might have to reconsider. :roll:

I notice if I go with DirectInput the following features will not work on the 360 controller.
MSDN wrote:The Xbox 360 Controller is properly enumerated on DirectInput, and can be used with the DirectInputAPIs. However, some functionality provided by XInput will be missing from the DirectInput implementation:
•The left and right trigger buttons will act as a single button, not independently
•The vibration effects will not be available
•Querying for headset devices will not be available
I cant see myself using the vibration effects (maybe I would), the trigger buttons would be nice to have independently, I wont ever use the headset function.

Hmmm, what do I do. :roll:

[edit]
Man, you have got me thinking.

I am currently working off the DirectX Summer 2004 SDK on Visual Studio.net 2003 (yes, I got Ogre running under that, after lots of fiddling 8) ).

So, do I continue with this SDK and be able to ship a single executable with no addtional dependencies, that will run on a clean install of XP and above (yep, I have tested this! No VC runtimes, no DX redists).

Or...

Do I embrace the times and ship a lean exe with a shitload of dll's, runtimes, etc?

[edit 2]
I also noticed this...
Wikipedia wrote:As of 2011 XInput is for Xbox 360 controllers, while DirectInput is for any controller.
So, does this mean if I go with the latest DX SDK, no controller will work unless it is an XBOX controller?
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56

Re: Gampads / Joysticks. Do you use them?

Post by Klaim »

I have a Saitek Cyborg, the one like the XBOX360 pad but not as confortable I must say...

Anyway, I use it with games that are platformers or 2D gameplay only. I don't use it in 3D movement games, even if the game was made for it.

Also, I have one game project that I think cannot be played confortably without a game pad. However, I still need to target the PC.
It's hard problem to solve, but I guess if I make the game "playable" and recommand a game pad (like they did in Super Meat Boy), it should be fine.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

So, does this mean if I go with the latest DX SDK, no controller will work unless it is an XBOX controller?
XInput and DirectInput both exist at once in the newer sdk. Both can use the 360 controller, but xinput supports it better (and can't support anything else). You can have both apis in the same program.

Here's an example of using xinput:

Code: Select all

XInputEnable(true);

XINPUT_STATE state;
XInputGetState(0,&state);
That's all you need to read the state of every control on a 360 controller (the state variable contains members for each thumbstick, buttons, etc). There's a set state to give it force feedback motor values.

Although you still need directinput for every other kind of controller.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58

Re: Gampads / Joysticks. Do you use them?

Post by betajaen »

I remember writing an NxOgre demo with the Character Controller and the Sinbad mesh, using a Xbox 360 PC controller using nothing more than OIS. There were some quirks (values being opposite than they should be) but all in all it was straightforward.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

Yeah, I steer clear of OIS. I found a few bugs in it while using it and I don't want to make a wrapper(my interpretation) of a wrapper(OIS) of a wrapper(directinput).

Plus, OIS keyboard input is based on Direct Input as well (from memory), which means that people using non US101 derived keyboards are screwed. So, I only really want Direct Input for joystick/gamepad input.

@Kojack - that initialisation code is awesome and very temping. I guess it would be pretty easy to cater for 360 controllers with that ease of use.

[edit]
Just finished writing my basic gamepad class. 8)

Wierdly enough I can unplug the controller and plug it back in after ten seconds and the class still then recieves joystick input, without doing anything. Is this a side effect of being awesome? LOL :lol:

The awsome-ness ends there though. It only continues to work if plugged into the same port. Changing USB ports halts the input. And plugging the gamepad in after program execution does nothing.

Not a bad start though :D
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

Does the same light on the controller light up? (The player 1 light)
Changing the usb port may make it think it's now controller 2 (or 3 or 4). Xinput supports 4 controllers at once.

I'm pretty sure OIS still uses directinput for the 360 controller, which means it's limited to merging the left and right triggers into one value, which makes them near useless.
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

Player 1 light? Is that an XBOX controller thing?

I only have a Sidewinder - it only has one light. 'On' means plugged in :D

[edit]
Oh and my above mentioned class is in Direct Input - Until I get my hands on a 360 controller (soon).
User avatar
duststorm
Minaton
Posts: 921
Joined: Sat Jul 31, 2010 6:29 pm
Location: Belgium
x 80

Re: Gampads / Joysticks. Do you use them?

Post by duststorm »

lonewolff wrote:Player 1 light? Is that an XBOX controller thing?
Yes, it's specific. Xbox controllers have 4 lights around the central round button to indicate to which player the controller is connected.
They have a lot of non-standard features, which is probably the main reason why there is a separate library for them.
Developer @ MakeHuman.org
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

Sorry, when you said the xinput code looked tempting, then edited the post to say you just finished writing a gamepad class, I thought you had gotten access to a 360 controller and tried it out. :)
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Gampads / Joysticks. Do you use them?

Post by lonewolff »

Kojack wrote:Sorry, when you said the xinput code looked tempting, then edited the post to say you just finished writing a gamepad class, I thought you had gotten access to a 360 controller and tried it out. :)
No all good :)

Re-reading my post does look that way though, doesn't it?

BTW, The class is working well now. It will now redetect lost devices (even unplugged) and the gamepad can even be connected after the program has started and control resumes as normal. 8)

Stil have to get a 360 controller though. :wink:

[edit]
A I even gave my avatar a refresh in the process :lol:
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: Gampads / Joysticks. Do you use them?

Post by Kojack »

I wanted to get the recent Rayman game that was on steam. But it's joystick code was crap.
Rayman Origins was on sale, so I grabbed it. Damn cool platformer, but the full game has the same crap input problems as the demo. I had to disable the drivers for my space pilot pro, g13, rudder pedals and hotas joystick before the 360 controller was visible to the game. That's really crap input programming.
The steam and ubisoft forums have a bunch of threads of people saying their 360 controller won't work, and a bunch of replies from people saying things like "make sure the controller is plugged in" and "it works for me, your hardware must be broken".
User avatar
Zonder
Ogre Magi
Posts: 1174
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: Gampads / Joysticks. Do you use them?

Post by Zonder »

I have used my PS3 controller in the past for some games. But generally I am keyboard and mouse.
There are 10 types of people in the world: Those who understand binary, and those who don't...