Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Analog Controllers

Author
Message
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 10th Sep 2011 09:16
I am programming a shooting game (mostly for my own amusement) that involves using the left and right analog controllers of a game pad to aim the shot. The programming is coming along very well, but the problem I'm having is with the input coming from the controller itself.

The minimum and maximum values of the JOYSTICK X() and JOYSTICK Y() commands are -1000 and +1000, but I've found that the input, instead of being smooth, comes in increments of about 8 or so. Since this is a very precise target shooting game, I was wondering if there are any controllers out there that send the values of the analog stick's location in increments of 1.
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 10th Sep 2011 11:32
Divide the value by 8 then...

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 10th Sep 2011 23:26
Oh, I already divide by about ten thousand, so that's not the issue. I'm just trying to find a controller that has the most sensitivity so it will work best in my game.
Qqite
16
Years of Service
User Offline
Joined: 28th Feb 2010
Location: Florida, U.S.
Posted: 10th Sep 2011 23:39
(1000+1000)/8 = 250

So you're saying that 1/250 accuracy on EACH coord isn't precise enough for you?

Ventures of the worlds around us are limited only by our imagination.
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 11th Sep 2011 06:23
Pretty much... I mean, it's definitely playable, but the mechanics of the game are such that the more precision, the better, so if I could get that 1/2000 accuracy, it would make the game much, much better.

Basically, it's a stationary target shooting game, and you line up the sights using both controllers. The left controller moves the rear sight and the right controller rotates the gun. With the precision that I have now, the sights are quite a bit jumpy. If I were to try and smooth them out by dividing by more than I do, then the game would be pointlessly easy.
PirateJohn
14
Years of Service
User Offline
Joined: 4th Aug 2011
Location: California
Posted: 11th Sep 2011 06:25
FYI, here's the code for the subroutine in which the shooter aims and fires:

Login to post a reply

Server time is: 2026-07-11 14:37:09
Your offset time is: 2026-07-11 14:37:09