Android Gamepad Support

I could change it back to the old default location.  I did not think this would be a big deal as the engine gives the correct device specific location where paks should be saved.

The biggest issue with the new location would be if you uninstall openbor it would also remove the data folder with any pak files, save games and settings.

I thought gamepads were fixed.  I tested it myself.  What pad are you using ?
 
1. Android Accelerometer - 3 axes, 0 buttons, 0 hat(s)
                                2. Microntek              USB Joystick          - 4 axes, 36 buttons, 1 hat(s)
25hnvd3.jpg
 
I've got a probem with this version, i'm trying this on a gpd q9 psv gamming tablet.

When i go to the options menu and activate the gamepad it works as expected, i don't need even need to configure anythig, everything works (directional pad, buttons, etc).

The problem is that this version recognizes 4 gamepads by default no matter what. And when i press start game, when i'm taken to the character select screen is like i have 4 players. In-game i control only my character, with the same gamepad, whereas the other 3 remains iddle. I tried to setup the keys start and attack 1 for every other gamepad aside the number 1, so no button press would trigger the start game for those pads, but i had no success.

Also the pak folder changed and when i uninstalled openbor, it wiped all my paks.

I attach my log.

Code:
Total Ram: 2111418368 Bytes
 Free Ram: 1196310528 Bytes
 Used Ram: 115760640 Bytes

SDL video Renderer: opengles2 

2 joystick(s) found!
SDL video Renderer: opengles2 

2 joystick(s) found!
OpenBoR v3.0 Build , Compile Date: May  1 2018

Game Selected: /mnt/sdcard/Android/data/org.openbor.engine/files/Paks/FFGoldPLUSREV3.pak

FileCaching System Init......	Enabled
Initializing video............
Reading video settings from 'data/video.txt'.

Colordepth is depreciated. All modules are displayed with a 32bit color screen.

Initialized video.............	480x272 (Mode: 1)

SDL video Renderer: opengles2 
Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 Done!
Timer init...................	Done!
Initialize Sound..............	Done!
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	Done!
Loading models...............

<--A lot of caching occurs here-->
<--A lot of loading occurs here-->

Loading models...............	Done!
Object engine init...........	Done!
Input init...................	
2 joystick(s) found!
1. PLAYSTATION(R)3 - 8 axes, 17 buttons, 0 hat(s)
                                2. Android Accelerometer - 3 axes, 0 buttons, 0 hat(s)
Done!
Create blending tables.......	Done!
Save settings so far........	Done!

Loading control settings.......	Done!
Loading control settings.......	Done!
Loading control settings.......	Done!
Level Loading:   'data/levels/ST01_1.txt'
Total Ram: 2111418368 Bytes
 Free Ram: 1047887872 Bytes
 Used Ram: 127363072 Bytes
 
Sorry I will change the pak location back to normal on my next update and it will not wipe the paks folder on uninstall.

I have a idea how to fix the dpad support but i need time to test it. Really busy with real life this weekend.
 
Diego Arturo said:
I've got a probem with this version, i'm trying this on a gpd q9 psv gamming tablet.

When i go to the options menu and activate the gamepad it works as expected, i don't need even need to configure anythig, everything works (directional pad, buttons, etc).

The problem is that this version recognizes 4 gamepads by default no matter what. And when i press start game, when i'm taken to the character select screen is like i have 4 players. In-game i control only my character, with the same gamepad, whereas the other 3 remains iddle. I tried to setup the keys start and attack 1 for every other gamepad aside the number 1, so no button press would trigger the start game for those pads, but i had no success.

Also the pak folder changed and when i uninstalled openbor, it wiped all my paks.

I attach my log.

Code:
Total Ram: 2111418368 Bytes
 Free Ram: 1196310528 Bytes
 Used Ram: 115760640 Bytes

SDL video Renderer: opengles2 

2 joystick(s) found!
SDL video Renderer: opengles2 

2 joystick(s) found!
OpenBoR v3.0 Build , Compile Date: May  1 2018

Game Selected: /mnt/sdcard/Android/data/org.openbor.engine/files/Paks/FFGoldPLUSREV3.pak

FileCaching System Init......	Enabled
Initializing video............
Reading video settings from 'data/video.txt'.

Colordepth is depreciated. All modules are displayed with a 32bit color screen.

Initialized video.............	480x272 (Mode: 1)

SDL video Renderer: opengles2 
Loading menu.txt.............	Done!
Loading fonts................	1 2 3 4 Done!
Timer init...................	Done!
Initialize Sound..............	Done!
Loading sprites..............	Done!
Loading level order..........	Done!
Loading model constants......	Done!
Loading script settings......	Done!
Loading scripts..............	Done!
Loading models...............

<--A lot of caching occurs here-->
<--A lot of loading occurs here-->

Loading models...............	Done!
Object engine init...........	Done!
Input init...................	
2 joystick(s) found!
1. PLAYSTATION(R)3 - 8 axes, 17 buttons, 0 hat(s)
                                2. Android Accelerometer - 3 axes, 0 buttons, 0 hat(s)
Done!
Create blending tables.......	Done!
Save settings so far........	Done!

Loading control settings.......	Done!
Loading control settings.......	Done!
Loading control settings.......	Done!
Level Loading:   'data/levels/ST01_1.txt'
Total Ram: 2111418368 Bytes
 Free Ram: 1047887872 Bytes
 Used Ram: 127363072 Bytes

the 4 players is fixed yet...
sorry not ready for  a stable release actually...

ps. msmalik please test before commit (thanks for your work)
 
msmalik681 said:
Sorry I will change the pak location back to normal on my next update and it will not wipe the paks folder on uninstall.

I have a idea how to fix the dpad support but i need time to test it. Really busy with real life this weekend.

When you restore original openbor path for Android we can draft a release!  ;)
 
Can you guys use the same one thats used by emulators i linked previously? my gamepad works in them without any problems.
 
https://github.com/huzongyao/AndroidNesoid/tree/master/Nesoid
https://github.com/Pretz/SNesoid/tree/master/SNesoid
 
@bWWd
Thanks I am looking over the source for that emulator !  Just to confirm you are saying you can map your d-pad and analogues but they don't work in game or they don't work at all ?

@White Dragon
The default folders have been restored for the android version but I am guessing we should hold off a release until gamepads are fully working.
 
Thanks!! Fow now can draft a release with all bug solved.
For gamepad Compatibility we have to wait sdl upgrade.
Tested ps4 gamepad and it seems work well
 
my gamepad in openbor can detect DPAD (axis) but when i configure and press ok then it does not work anyway ingame.All other buttons work fine, so i cant press left/right/up/down at all with my gamepad even if in config menu they are mapped properly.
 
ok,
for msmalik:
We need to investigate in control.c for: joysticks[ i ].Hats that store prev hats pression...

Then I have a doubt...
Can you edit the defined const JOY_MAX_INPUTS 32 to 36?

New joysticks have more then 32 buttons...

bwwd (and who want), please test this private build:
https://www29.zippyshare.com/v/oBjtRwi2/file.html

I expect that hold hats buttons don't work, but the single pression works...
 
bWWd said:
Still the same, dpad can be setup but doesnt work anywhere else

OK thanks.. So maybe the issue can be the touch max input. If I remember your joystick has more then 32 buttons right?
In openbor engine the limit is 32 that is related to the buttons checking. So we can test with increased limit.
How many buttons your joy has?
I remember 36...
 
It has 36 buttons, i do have other gamepad without analogs and left/right works but up/down doesnt work in this version , its 30 button gamepad so it might really be issue with current 32 button detection, it has to be more than that, i have 2 analog sticks on some gamepads.
This is from log with dual analogs gamepad : 2. Microntek              USB Joystick          - 4 axes, 36 buttons, 1 hat(s)
Log with 30 buttons gamepad with no analogs, on this one up/down doesnt work :
1. GreenAsia Inc.      USB  Joystick  - 2 axes, 30 buttons, 0 hat(s)
I have also 3rd gamepad with 32 buttons and up/down/left/right doesnt work as well but can be detected during setup.
Can you guys give it 40 to be safe ?

 
To be safe I can give 64!
Mmm...
Other infos:
- In old sdl version does bor engine work?
- up/down don't work but are detected?

I really think that this limit is the issue..

I have not an explanation about some dpad work and other not..
 
yes all buttons are detected but some directions dont work if theres more than 32 buttons or analogs from what i see.
Im 99% sure  "const JOY_MAX_INPUTS 32 " is the problem.
Even 64 would be safer for the future.
 
Back
Top Bottom