[EXPERIMENTAL] Joystick in AGS - AGS-3.99.106.0-Alpha3-JoystickPR

Started by eri0o, Fri 29/04/2022 23:57:47

Previous topic - Next topic

AndreasBlack

#20
I did, the problem seems to still be there unfortunately. I can do a game capture and post. Edit: Easiest way to "semi understand" what's going on is. Keep tapping your button where the mouseclick is assigned too. It's a millisecond of "that" move that is happening. It does not happen when using the mouse.

Dualnames

eri0o, first off, I think this is great!

Secondly, the plugin I made uses all SDL thingies, including battery and rumble, they should also be implemented!
Once this is succesfully done, I'll make the plugin essentially deprecated!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

eri0o

So what I am looking into now is the GameController part of the API, this is just to go fast, later I will look into what you mentioned which is in the joystick part of the API.

But keep in mind I am looking at the intersection of this and the engine, this means I am modifying the engine, like, if a cutscene can be skipped by the controller, or a wait, or dialogues and so on, these are the things I am trying to figure out here.

Once that is taken care, then things like button configuration, what a joystick 1 or 2 have different, when this matters, and then we can go to the joystick implementation.

Dualnames

All good, I understand that, I think and again, this is great, this is the right way. MAKE ME OBSOLETE, ERIOO!
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

eri0o

I updated the Editor, it now instead it has a Joystick struct, and the opened Joystick can be a valid Gamepad or not, I haven't yet figure the interface to say which button can skip dialog/speech, but if it's recognized as Xbox360 compatible gamepad, whatever gets the A button is the button that advances dialog. You can also get button, axis or hat by index if you want to do your own non-xbox360 mapping.

Crimson Wizard

This thread should be updated, there's a slightly different API prepared for merging to AGS 4:
https://github.com/adventuregamestudio/ags/pull/1759

eri0o

I updated the API in the first post and added links to example project file, downloadeable test game, online test game...

There is a chance some really newer controller doesn't work in some way, but once the SDL2 version is upgraded these will probably be fixed (some joy-con stuff, and some steam deck stuff)

eri0o

Hey, it would be nice if someone could test this and report their findings.  :P

abstauber

I just gave this a go. After updating the gamepadv4 demo with the new api changes (line 70 and 72), it worked fine. I tested it with an 8bitdo Zero 2 Controller and a PS2 Gamepad+USB adapter. Both were detected instantly and every button worked fine.
One thing I recognized was: on the 8Bitdo pad, the dpad was exclusivly detected as analog left or L3.

On the PS2 pad it was the same until I activated the analog sticks. After that the dpad was mapped to the dpad and the analog sticks were correctly recognized as L3 and R4.

So all in all for a first test I'd say, it works very well. Next I'll upgrade my agsjoy game to this new version and have a look at that.

abstauber

Two observations so far:

GetAxis should return bool according to the first post, but returns a float.

GetAxis detects the Y-Axis of my gamepad's right analog stick two times. The testgame shows the y-values at a2 and a3, and the x-values in a4.


SMF spam blocked by CleanTalk