Page 2 of 2

Re: What's up with gamepad axes?

Posted: Fri Apr 28, 2023 4:05 pm
by BrotSagtMist
Ohwell while adding transparency i kinda deleted all the lines. So much cpu wasting lines...

Code: Select all

love.window.setMode(0,0)  
joystick = love.joystick.getJoysticks()[1]
drawCanvas = love.graphics.newCanvas()
distance = 500
bla=    function()      love.graphics.circle("fill", joystick:getGamepadAxis("leftx")*distance+love.graphics.getWidth()/2, joystick:getGamepadAxis("lefty")*distance+love.graphics.getHeight()/2,20)    end
function love.draw() 
 love.graphics.setColor(1,1,1,.1)
  drawCanvas:renderTo(bla) 
 love.graphics.setColor(1,1,1,1)
  love.graphics.circle("line", joystick:getGamepadAxis("leftx")*distance+love.graphics.getWidth()/2, joystick:getGamepadAxis("lefty")*distance+love.graphics.getHeight()/2, 55)
  love.graphics.draw(drawCanvas)
end
But anyway point is, this is what two of my pads return on doing a slow circle and pushing diagonal:
shot-2023-04-28_17-51-22.png
shot-2023-04-28_17-51-22.png (57.64 KiB) Viewed 962 times
shot-2023-04-28_17-56-50.png
shot-2023-04-28_17-56-50.png (106.07 KiB) Viewed 962 times
Can you guess which is the cheaper pad?
Note how the upper is obvously broken sensoric wise but the other doesnt center, so yes they kinda suck booth. Kinda genuine xbox360 btw.
My third pad doesnt even work with this kind of code.

Re: What's up with gamepad axes?

Posted: Sat Apr 29, 2023 5:55 am
by zorg
In most games (and whatever calibration utility steam has), circles are just guidelines for you to orient yourself by; deadzones and scaling makes your controller input behave calibrated in the sense that two things happen:
- no movement in resting position,
- 100% input in all directions if you push the joystick to the furthest extent; it might not be a circle in terms of the raw input, but that's why you constrain the input to a smaller actual circle shape.

Re: What's up with gamepad axes?

Posted: Sat Apr 29, 2023 10:16 am
by MrFariator
Games sometimes also tailormake their deadzones, so to perhaps suit the specific game's needs. Admittedly this won't always work, but for games that target specific controllers (eq. console exclusives), they have a pretty good idea of what the ranges they're working with.

Re: What's up with gamepad axes?

Posted: Sat Apr 29, 2023 10:05 pm
by Bobble68
MrFariator wrote: Sat Apr 29, 2023 10:16 am Games sometimes also tailormake their deadzones, so to perhaps suit the specific game's needs. Admittedly this won't always work, but for games that target specific controllers (eq. console exclusives), they have a pretty good idea of what the ranges they're working with.
That's interesting, probably a good idea to bare this in mind for my game. I think in my case its best to have mostly registered diagonals given the nature of my game.