Of Gamepads and Joysticks

Blitz3D Forums/Blitz3D Programming/Of Gamepads and Joysticks

Adam Novagen(Posted 2009) [#1]
Hey all,

So, I'm doing a little 3D spare-time side-project, and I'd like to have more control options available than the keyboard. (The mouse is immaterial here.) SO, I can figure out Joystick control from the B3D HelpDocs, but how can I translate that stuff into working gamepad control?

I don't actually have a gamepad, so here's another question: do they have one or two analog thumbsticks?


Ginger Tea(Posted 2009) [#2]
thats the bugger
too many pads too many options
some have none but the norm is two or none with buttons under em

pongos lib does wonders from what ive been told

i found out trying my 360 wired pad and a ps3 type that the first 4 buttons were the same but the others were mapped differently
eg the triggers are an axis on 360 and buttons on ps3, i did post a comparison on the hoverthingie thread if that survived the thread bork

edit: here it is
http://www.blitzbasic.com/Community/posts.php?topic=77308


Pongo(Posted 2009) [#3]
You will find that every joypad has it's own numbering system for the buttons, and there are not any standards. The only thing that is reliable is the first analogue stick uses joyX() and JoyY(). The second analogue stick is inconsistent, even within the same manufacturer.

So, with that being said,... you need to remap the controls and let the user specify what is used for what.

The basic idea is that you need to convert each motion into a -1 to 1 range. Read the posts that I have in this thread http://www.blitzbasic.com/Community/posts.php?topic=82705#936156 for some good info.


Adam Novagen(Posted 2009) [#4]
Thanks guys! I'll look into this & see what I can come up with... I'll probably just leave off the gamepad though, or maybe have a "use-at-your-own-risk" calibrator.


Ginger Tea(Posted 2009) [#5]
i wouldnt leave off game pad support, well not without knowing the game type, as i said in another controller thread you could play match 3 on a well coded grid method instead of mouse and my sig says it all really when it comes to my stance

and as people like to customise game controlls if a game pad is universally 1 2 3 4 for the diamond allignment, but different for others then a user defined would just catch the right button pressed for any extras that may come its way (but you might want a 'default' games for windows config as that, being the same as a 360 might have more users in the whole pie chart of things, not that ive checked up on this mind)

http://www.blitzbasic.com/Community/posts.php?topic=77225#868743
Rob Farley (Posted 10 months ago) #71

Can people with controllers have a go with this and just see if it calibrates ok for your controller.

http://homepage.ntlworld.com/rob.farley/download/Misc/AutoSetup.zip

Cheers Rob