[PLUGIN] Joystick / Game controller support! v1.2.0

Started by Wyz, Fri 20/08/2010 19:43:43

Previous topic - Next topic

Vincent

Ciao Wyz. :)
I am gladly happy to say that the function doesn't crash anymore and the axes have their own reaction now. :)
I much appreciate the fantastic work that you have done. Thank you very much. :)

I hope you don't mind if I ask you another question. :-[

I think that there's a underlying issue that I hope is fixable.
When the axis is pressed there's no waiting actually. :(
Instead, when a button is pressed it works fantastically as it should be.

There is a way to wait for the axis to be pressed again to return with the script ?
(eg: as it happens with the buttons ?)

Dualnames

#81
Quote from: Grim on Thu 07/04/2016 11:46:31
Sorry for the bump.

I'm using xbox 360 wireless controller and in the tutorial demo it doesn't seem to do anything. It says in the beginning the controller has been detected and it has 10 buttons. I skip those messages (with keyboard) and change rooms with keys 1-9 but in none of them my controller is able to work. It works normally, when I play games with it, so I'm guessing there's some kind of problem with it being compatible with AGS and the Joystick plugin... Any ideas? ( I assume it is possible normally to use it in the tutorial?).

EDIT: Tried different controller. It works. It seems only wired controllers are compatible for this.

Is there a reason why this is happening i just had the issue reported on my side. Also can anyone/Grim run a figurative test to see what values the axis and the buttons get? Any ideas?

Actually nevermind, they do work, the problem lies with the Steam Controller, which cannot be detected through XInput, any ideas on that, does anyone actually own one?
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

Hey, is the source of this plugin available somewhere? Is it still working as of 2017, with PS4 gamepads and such?

Wyz

I noticed that the links in the first post were broken so I have re-uploaded both the plugin and the tutorial. Feel free to check them out! :) Oh, and if you do, please let me know as well; I'm curiousness myself whether they still work.

As for the source code: that is currently a complete mess so I can't really release that. I will probably revisit that someday in the future, there is also half an Linux port in there, but still a lot of work to get it up and running unfortunately. :(
Life is like an adventure without the pixel hunts.

eri0o

I use Linux too, half a Linux port that already builds a .so ?

Vincent

Hello to all AGSer and Wyz, I have found this kind of error recently. There is a way to fix it?
http://www.adventuregamestudio.co.uk/forums/index.php?topic=55164.0

eri0o



Hey, I have this error trying to run the tutorial project in the AGS Editor... Is it built with an ancient AGS version? :O

Crimson Wizard

Quote from: eri0o on Tue 12/09/2017 23:43:10
Hey, I have this error trying to run the tutorial project in the AGS Editor... Is it built with an ancient AGS version? :O

This looks like a bug in AGS Editor.

eri0o

I opened each room .asc files, looked the source on notepad (ok, gedit) and built a game from scratch and it worked. It also worked on Windows. Yey. The error above is only for the provided tutorial game so I wouldn't worry about.

Crimson Wizard

#89
It appears that the old editor version string in this project has "SP1" added to the version digits, which cause exception at parsing. This will be fixed in 3.4.1 then.


BTW, Wyz, there is a crush dump file in the tutorial archive.

Wyz

Yes the plug-in is 7 years old, so is the tutorial. Thanks for fixing the backwards compatibility CW!
I need to update and re-upload it someday (without crash dumps :-[) but still my time is fairly limited. I rather first make a complete port, which is a little more involved. For now you'll have to do with the files as is, sorry. :(
Life is like an adventure without the pixel hunts.

eri0o

Hey Wyz, I updated your tutorial code to load and run on AGS 3.4.1-7. I also switched the .dll for the one you shared with Vincent, from here. Maybe this is useful for someone else diving into your plugin.

Download AGSJoy Tutorial Game - AGS 3.4.1-Beta7

Also Wyz, if you ever find time to script, if you could add some code on what you would recommend to run before saving a game and after restore, that would be awesome.

Warning: To anyone wanting to load this tutorial, remember to copy the agsjoy.dll from the root project directory and place on your AGS Editor root folder (Ex: c:/Program Files/Adventure Game Studio 3.4.1).

Wyz

Thanks for the updated version! I'll add the link to the first post if you don't mind.

Yes, after the last update the problems with storing and restoring games should be fixed. Additional code before saving and after loading games should technically not be required.
But indeed I do recommend a bit of code when games are restored. I find it hard to provide a general solution as it really depends on how you design your game. But let me give two examples; maybe this helps someone.

Game A
Game A is a single play game which can be played either by keyboard or optional a game controller. When the game starts it scans for available game controllers, and opens every one it finds. The keyboard inputs and the inputs from all controllers are mapped to the same outputs; for instance ASWD, the arrow keys, the d-pad of whichever joypad is connected, or the stick of some joystick connected: they all control the character's movement. In short, no configuration, the kind of setup I would describe as "just works". ;)
Now imagine the player restores a saved game; at this point game controllers may have been connected or unplugged. If you don't do anything "just works" becomes "doesn't work" :-D because Joystick objects from unavailable game controllers stop firing events, and newly connected ones are not being considered.
In that case I recommend you'd close all open Joystick objects, and run the same scan as at the beginning of the game again.

Game B
Game B is a multi-play single screen game which can be played by mouse, keyboard, or game controllers. At the beginning of the game each player selects an input device from a list of available ones (mouse, keyboard, optional game controllers). During the game players can open a menu which allows them to reconfigure (change the meaning of buttons of) their selected input device, or pick another one.
Now imagine the players load a stored game; at this point game controllers may have been connected or unplugged. It could be the case that one of the players uses a device no longer available.
In that case I recommend showing a warning when one of the Joystick objects has become invalid (scan through them at game restore), or perhaps open the configuration screen automatically.

Other options are possible of course; these are just examples. :)
Life is like an adventure without the pixel hunts.

eri0o

Wyz! The d-pad (POV) in my wired Xbox360 joystick doesn't work. Do you have any idea why?

Is there any possibility of releasing the joystick plugin source? I would like to play with maybe porting it to Linux.

Radiant

Quote from: Wyz on Mon 18/09/2017 01:16:15
Thanks for the updated version! I'll add the link to the first post if you don't mind.

"Premium Access Only
The free hosting period for this file has now expired, only premium users can download it.

Subscribe to a plan to download ($5/month)"

....maaaaybe you should find a different host for that :)

The one in the top post is still the 2010 version.

Aviva

Quote from: eri0o on Wed 18/10/2017 01:12:33
Wyz! The d-pad (POV) in my wired Xbox360 joystick doesn't work. Do you have any idea why?

Is there any possibility of releasing the joystick plugin source? I would like to play with maybe porting it to Linux.

The tutorial doesn't even recognize my Xbox 360 controller at all. So I can't test it at all as of now.
Working on "Drained", a distopian RPG

Wyz

Yes, I've heard about problems with Xbox 360 controllers left and right, and it is really puzzling because: one day it's all working fine, and then suddenly it is not. I even had people with multiple Xbox controllers where one never worked, and then suddenly it started working but the other one stopped. I'm not really doing anything special, and I'm simply using what Windows provides. There is something weird going on with the combination of AGS and the Windows drivers, but it is extremely difficult to pin down. Even more so since I don't own a Xbox controller, so I can not test it myself.

Quote from: eri0o on Wed 18/10/2017 01:12:33
Wyz! The d-pad (POV) in my wired Xbox360 joystick doesn't work. Do you have any idea why?

Is there any possibility of releasing the joystick plugin source? I would like to play with maybe porting it to Linux.

The POV value does not respond to the D-pad at all? Hmmm, sometimes the D-pad is implemented as an analogue stick, so be sure to check all the axes. In rare cases the D-pad is implemented using buttons; be sure to check those as well. If none of the above respond to the D-pad something is amiss. Could be more Xbox controller shenanigans. :P

Quote from: Radiant on Thu 19/10/2017 17:31:56
....maaaaybe you should find a different host for that :)

Sure; do you have suggestions?
Life is like an adventure without the pixel hunts.

Radiant

Quote from: Wyz on Sat 21/10/2017 20:58:30
Quote from: Radiant on Thu 19/10/2017 17:31:56
....maaaaybe you should find a different host for that :)

Sure; do you have suggestions?

Github? Same as the Steam plugin, seems to work fine for them.

Wyz

Unfortunately, GitHub is only free to use for open source projects, which this is as yet not, for reasons mentioned before.
Any other suggestions perhaps?
Life is like an adventure without the pixel hunts.

Crimson Wizard

#99
Quote from: Wyz on Sun 22/10/2017 11:05:40
Unfortunately, GitHub is only free to use for open source projects, which this is as yet not, for reasons mentioned before.
Any other suggestions perhaps?

https://bitbucket.org/ allows private repositories with the limit of contributors access (up to 5 people, including you, I think).
It has a page for distributive uploads, but I do not remember if download links will work without private access, this is something to test out first.

SMF spam blocked by CleanTalk