Home | Games | Awards | About | Blog | Media | Contact | Other
Multidirectional XNA Games Control Tip
Monday, May 03, 2010
By: Matthew Doucette
(printer friendly version)

If you are making a multidirectional moving or shooting XNA game, your controls may be broken. This mistake is so common I decided to write an article on it. Read a slightly edited blurb I wrote on the XNA forums:

Slowly rotate your fire or move your character around in a circle and it should not lock to the direct up, down, left, right directions (12, 3, 6, 9 on the clock). Most XNA dual-stick shooters make this mistake. I'm surprised developers miss this control issue in arcade games. Anyone who is a fan of Geometry Wars will feel your controls are bad, perhaps without knowing why. You are stealing away their skill. They'll aim precisely and your game will ignore it. The dead zone, when the game locks the axis to zero, should activate when you are not shooting or not moving, but never lock left and right when you are moving up and down, and vice-versa. The worst thing is, the better the gamer, the more they'll be frustrated by this.

HOPE THIS HELPS!!!

That's the problem, here's the fix (quoted from Jason, our lead programmer):

http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.input.gamepaddeadzone.aspx

He's using the default:

"IndependentAxes The X and Y positions of each stick are compared against the dead zone independently. This setting is the default when calling GetState."

He should use:

"Circular The combined X and Y position of each stick is compared against the dead zone. This provides better control than IndependentAxes when the stick is used as a two-dimensional control surface, such as when controlling a character's view in a first-person game."

The default means if X is near 0, it becomes 0, regardless of Y. So anything near up or down becomes up or down. This is good for 4-way motion.

As you can see, XNA defaults to using independent Axes, and most newcomer developers simply don't know enough about XNA and sometimes about gaming to know differently.

Please share!

 

More Xona.com Links:

 

External Links:

*Xbox LIVE Indie Games formerly known as Xbox LIVE Community Games.

 

 

 

About the Author:  I am Matthew Doucette of Xona Games, an award-winningindie game studio I run with my twin brother. We concentrate on nostalgic game concepts with modern-day gameplay and intensity. Our company, our games, and our technology have all won prestigious awards and received worldwide press. Our games have ranked from #1 in Canada to #1 in Japan, as well as become #1 best sellers in multiple countries. Read about our story and our blog.


Email:
Xona Games, Xona.com, Xonatech, Saw Tooth Distortion, Duality ZF, Decimation X, Decimation X2, Decimation X3, and Score Rush
trademarked and copyrighted by Xona Games, Inc., Jason Doucette, and Matthew Doucette.
© Xona Games, Inc.