Virtual-gamepad

Rating: 
0
No votes yet

This is my first RPM built for sailfish OS. The app should run a touch input demo I created to port some LÖVE games to mobiles.

This app depends on LÖVE runtime, make sure you install it first: https://openrepos.net/content/sashikknox/love-2d-runtime

The demo is a showcase of the library which can be easily implemented in any LÖVE games to make the games playable on mobile devices.

It features 3 different layouts and a landscape mode (just for the keyboard) which is intented for LÖVE builds without orientation (such as the one for sailfish):

  • Gamepad: Renders two thumbsticks and 8 buttons (4 around each thumbstick)
  • Arcade: Renders one thumbstick on the left and 4 buttons on the right
  • Keyboard: 1 virtual keyboard

 

from version 0.1.2-1, this demo requires internet permissions because it introduces remote network control functionality.

Version 0.1-.3-1 introduces the following features:

- Network setup menu (to enter the parameters for remote control)

- Auto binding functionality (work in progress)

Version 0.1-.4-1 adds voice promts(triggered when instances are connected, when starting searching for instances with autobind or when failing to find valid instances)

Version 0.1.5-1 add skins: Skins can be toggled on and off and allows for fully personalization of the gamepad by replacing the primitives used for the controls with assets.

It is known that the network menu crashes when running from a .love file (zipped), if you are a developer feel free to help solve the issue here:https://codeberg.org/glitchapp/virtual-gamepad/issues/1, otherwise please wait till the problem is solved.

Network functionality can only be tested for now on another instance of the virtual gamepad and on boxclip and starphase, more info here: https://codeberg.org/glitchapp/virtual-gamepad/wiki/Games-supporting-net...

 

If you have issues with the app not starting I suggest doing the following steps:

Download & install modplug from the link below and the correspondent love build for your system:

Install löve for 64bits: https://build.sailfishos.org/project/show/home:nephros:devel:games:love

or 32bits : https://build.sailfishos.org/package/binaries/home:nephros:devel:games:l...

If is still does not work please report the error and your love version.

 

Screenshots: 

Category:

Keywords:

Application versions: 
AttachmentSizeDate
File virtualinputs-0.1-1.noarch.rpm1.08 MB09/03/2024 - 10:06
File virtualinputs-0.1.2-1.noarch.rpm1.23 MB13/03/2024 - 16:49
File virtualinputs-0.1.3-1.noarch.rpm4.05 MB18/03/2024 - 13:22
File virtualinputs-0.1.4-1.noarch.rpm4.17 MB19/03/2024 - 10:51
File virtualinputs-0.1.5-1.noarch.rpm4.54 MB21/03/2024 - 13:31
Changelog: 

Changed default port numbers to: 1025 for listening, 1024 for sending and instance number to 2. This will make the remote controls work instantly without configuration when connecting to supported games (provided that the ip is correct)

Comments

darbess's picture

Unfortunately I have almost zero time, but I'll try to find some to experiment myself

glitchapp's picture

thanks, take it easy, I tried to also move the .desktop file to the new "games/love/" folder where I moved the rest of the files but it did not work on my phone, feel free to send me an example of .spec file to build the rpm that works and I will apply it to build the next updates on all apps.

darbess's picture

The app which can't access /usr/share/TouchControls is love, not yours. I think that /usr/share/applications/love.desktop has to be modified in order to free the runtime from sailjail limitations. I have no idea of your phone's setup, but obviously your love installation has access to places that ours can't reach

darbess's picture

I have an Xperia 10Plus, SFOS 4.5.0.25 (32 bit) and I used Storeman to install the LÖVE runtime and libmodplug from sashikknox's Openrepos repository. Modplug is available from another repository as well, but I chose to stay with the one the LÖVE runtime is from. Storeman found VirtualInputs as a dependency and installed that as well. When I try to start Virtual-gamepad, the runtime complains that it can't find /usr/share/TouchControls/TouchControls-0.1-6.love and stops, but this is expected, because the Sailjail mechanism prevents apps to access directories outside the permitted ones. You should either opt out of Sailjail (adding a section in the .desktop file) or, better, place the .love file in /usr/share/<AppName> . Currently, TouchControls is not the appname...
More info at https://github.com/sailfishos/sailjail

glitchapp's picture

I've just uploaded a new build setting the folder's name to match the app's name, let me know if it works.

glitchapp's picture

I could not reproduce that problem in my phone, does that means my phone has sailjail disabled? The spec file already put the game on /usr/share/<AppName>, this is the relevant part on the spec file:

%prep

%build

%install

mkdir -p %{buildroot}/usr/share/applications

mkdir -p %{buildroot}/usr/share/TouchControls

install -m 0755 %{_sourcedir}/Spiele/Sailfish/desktopFiles/VirtualGamePad/VirtualGamepad.desktop %{buildroot}/usr/share/applications/VirtualGamepad.desktop

install -m 0644 %{_sourcedir}/Spiele/Sailfish/desktopFiles/VirtualGamePad/TouchControls-0.1-6.love %{buildroot}/usr/share/TouchControls/TouchControls-0.1-6.love

install -m 0644 %{_sourcedir}/Spiele/Sailfish/desktopFiles/VirtualGamePad/TouchControls.png %{buildroot}/usr/share/TouchControls/TouchControls.png

%files

/usr/share/applications/VirtualGamepad.desktop

/usr/share/TouchControls/TouchControls-0.1-6.love

/usr/share/TouchControls/TouchControls.png

%changelog

I don't know what else should I do and since I can not reproduce the problem it is hard for me to know if a solution works, any hint is welcome. I can send you the spec file if you want to try to build it yourself.

baboo's picture

[defaultuser@XperiaXA2-DualSIM ~]$ love /usr/share/Touch
Controls/TouchControls-0.1-6.love
[ALSOFT] (WW) pthread_setschedparam failed: Operation no
t permitted (1)
[ALSOFT] (WW) D-Bus not supported
[ALSOFT] (WW) pthread_setschedparam failed: Operation no
t permitted (1)
[ALSOFT] (WW) D-Bus not supported
xkbcommon: ERROR: couldn't find a Compose file for local
e "en_US.utf8" (mapped to "en_US.utf8")
INFO: [LOVE] Touch pressed at coordinates: nilnil
INFO: [LOVE] Error: src/touchKeyboard.lua:58: attempt to
perform arithmetic on local 'x' (a nil value)
stack traceback:
[string "boot.lua"]:777: in function '__sub'
src/touchKeyboard.lua:58: in function 'touchpres
sed'
src/Gamepad/touchEvents.lua:18: in function
[string "boot.lua"]:604: in function <[string "b
oot.lua"]:594>
[C]: in function 'xpcall'

glitchapp's picture

Hi, thanks for the feedback, althoug the screenshots uploaded are taken from a desktop, I can assure that it works on my mobile. We need to find out if the reason for the games not working on your mobile is the love build you installed. Make sure it works by typing love on your terminal. If the problem persist you may need to install a different love build...

I can not reproduce your problem and therefore I don't know any other solution...

rob_k's picture

Hello, the app doesn't start (crashes perhaps, maybe I miss a lib). Pictures look interesting!

glitchapp's picture

Hello, I think I forgot to say it requires love2d runtime, make sure you installed it and let me know if it works: https://openrepos.net/content/sashikknox/love-2d-runtime

In my phone the app runs as expected.