Jump to content
• Advertisement

# Mapping unit circle to rectangle (gamepad stick input)

This topic is 3052 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

When mapping a gamepad stick to XY controls, such a for a vehicle (steering/throttle) you lose a bit of control in the corners. You can't have full steer and full throttle. I'm curious what people do to fix this problem. I was thinking of taking the X value raw, and the computing the Y value in terms of the maximum possible Y value for the given X. This sounds kind of unstable though, at full X stick the maximum Y value is zero, or very close to it. This will make any slight Y movement twitch from 0 to full + or - Y.

#### Share this post

##### Share on other sites
Advertisement
Most racing games use a different button for "accelerate" and "brake". The left analog stick is just for steering. On the Xbox controller, you can use the trigger buttons for accelerate if you want to provide an "analog" acceleration button (otherwise, most of them use "X").

#### Share this post

##### Share on other sites
I agree, usually i'd use separate controls, probably the triggers. But this is for basic movement. Not realistic racing movement. So like say it where controlling a character. How would one remove the dead spots in the corners?

#### Share this post

##### Share on other sites
I imagine then it's based on angle/distance, where the angle is which direction to move in and the distance (amount of tilt in the analog stick) is the speed. That's how it feels with most 3rd person games which use such a control scheme.

#### Share this post

##### Share on other sites
Quote:
 Original post by bzroomI agree, usually i'd use separate controls, probably the triggers. But this is for basic movement. Not realistic racing movement. So like say it where controlling a character. How would one remove the dead spots in the corners?
What dead spots in the corners? For that matter, what corners?

The character moves with the same top speed no matter the direction, so rather than thinking about the stick as representing two independent axis, treat it as representing a direction and a magnitude.

#### Share this post

##### Share on other sites
Had this one in my delicious bookmarks:

http://theinstructionlimit.com/?p=531

Regards,

Alex

#### Share this post

##### Share on other sites
Thanks everyone, especially aleks_1661.

Bad analogy on my part with the character. It's not for a character.

This blog seems to have plenty of information to hold me over. Thank you.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
Rutin
19
2. 2
3. 3
4. 4
5. 5
frob
12
• Advertisement

• 15
• 13
• 9
• 12
• 10
• ### Forum Statistics

• Total Topics
631442
• Total Posts
3000102
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!