Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (9 posts)

Gamepad thumbstick dead zone

Last post 10/8/2008 12:11 AM by JasonD. 8 replies.
  • 9/1/2008 9:38 PM

    Gamepad thumbstick dead zone

    I sometimes get raw gamepad thumbstick values (from an official wireless XBox 360 controller) as high as 0.246 when the stick is not being used!  The controller is old, but still, it happens, so it could happen "in the field".

    This is high enough that GamePadDeadZone.Circular will produce non-zero values.  (GamePadDeadZone.IndependentAxes will still produce zero values for both axes, though, which is unexpected.  It's tolerance must be higher than GamePadDeadZone.Circular)

    The only fix I can see is to process the dead zones myself, and assume anything beneath 0.250 is dead.  Or, perhaps I can change the tolerance level for the XNA Framework?

    Any ideas?

  • 9/1/2008 10:15 PM In reply to

    Re: Gamepad thumbstick dead zone

    Assuming anything under 0.250 is dead is incorrect.  Since both axes could be 0.246 simultaneously, then the total magnitude of the vector (when trying to replicateGamePadDeadZone.Circular) could be as high as 0.348!

    (However, for this particular controller, only the X gets this out of whack.  The Y is usually within 0.187.  This still means the total magnitude is 0.309.  But, again, perhaps there are controllers "in the field" that have both X and Y as bad as 0.246 when not being used.)

    So, I should assume a total magnitude of anything of <= 0.350 to be zero, to deal with this controller's dead zone properly.  This appears to work fine for my game.

  • 9/2/2008 5:58 PM In reply to

    Re: Gamepad thumbstick dead zone

    I think you have a faulty controller.

    If you really want a larger deadzone than the one implemented for you by the XNA Framework, you can read the gamepad specifying the no deadzone option, then apply some other deadzone computation of your own. I wouldn't recommend doing this, though. The officially recommended deadzone amount was chosen to give the best compromise between robustness while stlil being as responsive as possible, and this value is what most commercial games will be using.

    If your controller does not return to rest within that limit, it is likely to have problems with many different games. btw. you might be able to get it to calibrate more accurately by spinning the stick in a circle around its perimeter a couple of times.

  • 9/2/2008 7:16 PM In reply to

    Re: Gamepad thumbstick dead zone

    It seems I have a slightly faulty controller.  The controller does work... I haven't noticed any issues with it for any game other than my own XNA game, using the Framework's deadzone handler.

    I have coded my own deadzone handler, accepting raw input, and it seems to work well.  It appears to be only slightly larger than the Framework's, so it's close to being the same thing.  So, I'll stick with it.

    I wonder how many commercial games use something like XNA's method?  Has XNA's method been extensively tested in the field, where there exists controllers like mine?  I doubt it, since how many XNA games are actually out there?  Just one, right?  The commercial products have probably been using their own computations on the raw input.  I guess we'll see.  I just thought everyone here should know that not all controllers behave so well.

  • 9/2/2008 7:38 PM In reply to

    Re: Gamepad thumbstick dead zone

    While I can't say for sure, I would guess the default deadzone settings were tested pretty well. You could argue it might have been worth it to have some sort of configuration value that could be set via code controlling the deadzones, but that is a different complaint than claiming no testing was done. I currently test with a beat up controller that my dog half ate. It's right trigger squeaks like hell and the left thumbstick is mostly still there, but the default deadzone still serves my purposes.
  • 9/2/2008 8:40 PM In reply to

    Re: Gamepad thumbstick dead zone

    The XNA Framework uses the same size deadzone as the vast majority of commercial games. This has been widely tested by the team that makes peripherals such as the Xbox controller.
  • 9/2/2008 9:01 PM In reply to

    Re: Gamepad thumbstick dead zone

    I didn't say it wasn't tested.  Of course it was.

    I am wondering if it was tested significantly with older controllers.  I will test my controller with commerical games, and see if they also mess up, as the XNA deadzone does, and then we'll know if the commercial games are, indeed, identical to the XNA Framework.  I'll report my findings.
  • 9/3/2008 5:52 PM In reply to

    Re: Gamepad thumbstick dead zone

    OK, I tested my old controller on my XBox 360 with multiple games: Geometry Wars 1 and 2, Aegis Wing, Marble Blast Ultra, and they all handle the dead zone properly.  None of them show motion when the controller isn't being used.  I tapped the controller to attempt to force this to happen at least 100 times per game.

    The same controller on my PC (I assume this doesn't matter, since the raw hardware values are computed inside the controller, but perhaps the fact that I'm using a  PC does make a difference?), with the XNA Framework, will report, on occasion, after 40 or 50 flicks of the controller, values near 0.250 when there's no motion.  Such values break the XNA dead zone handler (i.e. it reports as motion) when using GamePadDeadZone.Circular.

    Please note that this occurs with GamePadDeadZone.Circular only, not with GamePadDeadZone.IndependentAxes.  If these XBox 360 games use something like GamePadDeadZone.IndependentAxes code (they shouldn't, but perhaps they are), then their code could be using identical to the XNA Framework.  However, if they are using GamePadDeadZone.Circular style code, then they handle the dead zone for my older controller better than the XNA Framework.

    In any case, programming your own dead zone handling is easy as pie, and I need only loosing the tolerance slightly to make it work for my controller, as well.

  • 10/8/2008 12:11 AM In reply to

    Re: Gamepad thumbstick dead zone

Page 1 of 1 (9 posts) Previous Discussion Next Discussion