Author Topic: [PLUGIN] Joystick / Game controller support! v1.2.0  (Read 23511 times)

Snarky

  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    •  
    • I can help with translating
    •  
Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #100 on: 22 Oct 2017, 18:20 »
Just put it on Dropbox?

Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #101 on: 23 Oct 2017, 12:55 »
Hey Wyz, found a repo in github that may contain interesting code github.com/ThemsAllTook/libstem_gamepad

my storage suggestion is Google Drive if you already have gmail.

Wyz

  • AGS Project Tracker Admins
  • anno 1986
    • I can help with making music
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #102 on: 24 Oct 2017, 11:06 »
All of my Dropbox accounts are filled to past the brim unfortunately. Hmmm,... Google Drive might be an option; I can make a new gmail account for that I guess. I'll look into that! Thanks all for the suggestions. :)

edit:
All updated! I've counted: this is the fifth time I had to swap over files to another host; pretty please Google, don't fail me. I can't stand doing it once more. (roll)
« Last Edit: 27 Oct 2017, 13:44 by Wyz »
Life is like an adventure without the pixel hunts.

Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #103 on: 08 Apr 2018, 22:34 »
Dear Wyz,

if you ever have time, please share the code for the joystick plugin . :] I really would like to take a stab at making a Linux .so version . (roll)

Edit: Recently I discovered that launching a game from steam (you can add non-steam games to steam) makes steam filter the joystick first, like, a PS4 joystick for instance, is converted in a joystick that feels like Xbox360 when looking from the Joystick plugin!
« Last Edit: 28 Apr 2018, 18:22 by eri0o »

Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #104 on: 30 Apr 2018, 00:50 »
I recently wanted to add joystick support in the Linux version of my game. I saw Until I Have You in my Steam library had it. Dualnames pointed me to qcaptain Nemo, and qcaptain Nemo was kind enough to provide me the source he wrote. He told me I could do what I want, and if I shared, I should stick a MIT license in it... So, here it is.

Github Repo | Release

When launching your game from command line, it will happily state Plugin 'agsjoy' loading succeeded, resolving imports... !

Just place the libagsjoy.so in your <Game Name>/Compiled/Linux/data/lib64 folder - I haven't yet built for 32-bits. :/

libagsjoy.so (64 bit)

Bear in mind this code uses SDL2, so your game will be dependant on SDL2 .

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #105 on: 30 Apr 2018, 01:33 »
Finally, good to know someone did this, I was about to suggest you writing your own using SDL, but looks like this is no longer needed :).

BTW, is it really Linux-only code? If that's SDL it could work on Windows too... probably.
« Last Edit: 30 Apr 2018, 01:35 by Crimson Wizard »

Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #106 on: 30 Apr 2018, 04:29 »
Hey! You were right CW.  Now I just need someone to help me figure out how to fuse both Windows and Linux version in the same code and which ifdef can save me.

agsjoy.dll (SDL2 edition) | SDL2.dll (you need to download this one too!)

libagsjoy.so

I created a folder called WindowsVersion in my repo. Source available on Github (requires VS 2017 )

Note that feature parity with Wyz plugin hasn`t been reached yet.

Note: Build your game using Wyz's .dll and then switch in the game folder for this fall and SDL2.dll if you want to test it.

Edit:
I think to add each ePOV enumerator to the editor, to be compatible with Wyz's agsjoy, I would need to use something like editor->RegisterScriptHeader . The values I got from experiementing, but I don't know if I should get them from somewhere...

Edit2: has someone ever written a plugin for OSX? How does one build for it?
« Last Edit: 30 Apr 2018, 17:07 by eri0o »

Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #107 on: 19 May 2018, 23:59 »
New 0.2.1 release | github repository

Windows build: agsjoy.dll (SDL2 edition) | SDL2.dll (you need to download this one too!)

Linux build: libagsjoy.so

MAC OSX build: libagsjoy.dylib

feature parity with Wyz plugin hasn't been reached yet.

Note:
  • For Windows Build your game using Wyz's .dll and then switch in the compiled game folder for this agsjoy.dll and SDL2.dll if you want to test it.
  • For Linux, just place libagsjoy.so in the same folder as the binary ags (if you are building the Engine yourself) or in Compiled/Linux/data/lib64 if you are using prebuilt Linux right from the Editor. SDL2 must either be installed through your package manager or the game should be loaded through Steam.
  • For MAC OSX I don't know yet, but it should be working. Requires SDL2 too.

Wyz

  • AGS Project Tracker Admins
  • anno 1986
    • I can help with making music
    •  
    • I can help with story design
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
    • I can help with web design
    •  
Re: [PLUGIN] Joystick / Game controller support! v1.2.0
« Reply #108 on: 21 May 2018, 16:43 »
Ok, I've just read the developments here. I have been disconnected from the world for a while, my apologies. I saw your PM earlier eri0o; I have responded to it.
Let me state a couple of things I wrote him.

I have just released my incomplete refactor of the Joystick plugin what was going to be version 1.3.0. As the name suggests it is in an unfinished state; life happened unexpectedly, and I had to stop working on it.
This version has a nice build system and supports building multi-platform. That also allows adding SDL as a platform bypassing any unfinished code. So I've prepped for this and put it up on GitHub.

However, this version does not help reverse engineering the plugin I guess; so if you want sources for 1.2.x, please PM me. I don't want to release them though.

I do want to finish it in the future, but it seems unfair to let you all wait. I hope this helps at least.

And the repo: https://github.com/FTPlus/agsjoy
Life is like an adventure without the pixel hunts.