Suggestions for Joypad and Android

Got a cool idea that should be in R'n'D? Let's hear it!

Moderators: Zomis, Flumminator

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Fri Jul 14, 2017 10:12 am

Nice! :)

I did a first quick test on the FireTV and found immediately a problem. If you try to change the player name, the virt. keyboard pops up but you cant change the name. You didn´t see the actual name and any changes. If I leave the virt. keyboard all controller settings are lost. Only the d-pad is working. I have to restart RnD.
15/7/2017 19:48: My connected keyboard has no function.
I have changed the personal data directory on the Android version from "internal storage" to "external storage" ...
... as a small solution I´ve changed the playername in setup.conf :wink:

If I dont try to change the player name all other functions are working as described. :D
I will test more later.
If you also want a Windows (?) binary with the latest game controller code for testing, let me know!
Ja, sehr gerne :)
Last edited by ango on Sat Jul 15, 2017 5:50 pm, edited 1 time in total.

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 15, 2017 12:44 pm

I did more testing today and found another problem.
- menu button: acts as right joystick button ("drop" in the game, "yes" in request dialogs)
If you want exit the game and you use the HOME button, but then decide against it and use the BACK button, the controller is going crazy :)
The steering is very fast and the controller mapping is gone. You have to restart the game. The problem occurs only if you use the button combination HOME and BACK.

Nevertheless, it is a lot of fun to play RnD on the amazon fire tv/stick with a game controller. :D

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 15, 2017 3:24 pm

... RdN version in game is 4.0.0.2, app information shows 4.0.0.1 :wink:

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 15, 2017 4:05 pm

As you were able to run the current release R'n'D APK on your Fire TV, you might also have some knowledge (or might even just try) how to add a level set like "BD2K3" to the Android version on the Fire TV. The data folder should be something like "/.../Android/data/org.artsoft.rocksndiamonds/files/levels" or something like this,
Did also a quick test on level import on the android fire tv/stick version.
Level import is fine. Only "Zelda 2" isn´t working, because it has a different menu. You do not know where you are in the game menu.

Tested the following imports:
Bd2k3.zip
Boulder_Dash_Dream.zip
Contributions.zip
DX_Boulderdash.zip
Earth Shaker Explosions.zip
Earth Shaker Old Set B.zip
Emerald_Mine_Club.zip
Snake_Bite.zip
Sokoban.zip
Supaplex.zip
Walpurgis Flashbacks.zip
Walpurgis Gardens.zip
Walpurgis World.zip
Zeld.zip

I´ve extracted all to the internal storage: /Android/data/org.artsoft.rocksndiamonds/files/levels. You don´t need root. :)
Last edited by ango on Sat Jul 15, 2017 5:29 pm, edited 2 times in total.

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 15, 2017 4:13 pm

Can you please put the direction control also on the d-pad?
In my opinion you can react faster in game with the d-pad as with the left-stick.

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 15, 2017 5:18 pm

I had to adjust the game controller calibration program for the Fire TV, to be able to skip unused game controller buttons in the calibration process (as the Fire TV's remote control obviously does not have all those axes and buttons that is available on a standard Xbox style game controller). (Skipping unused axes and buttons is done via keyboard keys or touch screen input, which are both not available on the Fire TV remote, so I had to add the Android "menu" key/button for this purpose, which is also available on the Fire TV remote control.)
If you use the calibration you are stuck on the screen. You have to restart RnD.

... btw, I have a keyboard and mouse on my fire tv stick. I´m using an usb otg adapter with 3 usb ports on my fire tv stick.
At one port I´ve added a 64 GB USB stick to have more storage (for all my emulator roms, Amiga, PSX, SNES, Dreamcast, Megadrive ...).
My fire tv stick is a nice little emulator station ... I was surprised how well all emulators run. :D
On another port I´ve added a keyboard and mouse combi adapter. All is working fine. Keyboard and mouse are running out of the box.
Unfortunately RnD does not recognize the direction keys (up,down,left,right). I have to customize it to other keys like wasd.

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Suggestions for Joypad and Android

Post by Holger » Wed Jul 26, 2017 9:50 am

I think it's time for an update on this topic! :-)
I did a first quick test on the FireTV and found immediately a problem. If you try to change the player name, the virt. keyboard pops up but you cant change the name. You didn´t see the actual name and any changes. If I leave the virt. keyboard all controller settings are lost. Only the d-pad is working. I have to restart RnD.
I was able to fully reproduce this problem -- very strange indeed! Especially as using the virtual keyboard with the Android R'n'D port works just fine with my Android phone and tablet. So something must be severely going wrong here: No working screen keyboard, and messed up game controller settings after leaving the screen keyboard. Especially the last one is strange: After leaving the screen keyboard, the Fire TV remote control does not produce joystick and game controller events anymore, but sends keyboard events!

Even though I do not have a solution for these problems for now (I have the suspicion that there might be some problems buried in the SDL2 library, as I have no idea what I might do wrong in R'n'D to cause game controller events to be turned to keyboard events), I have at least improved support for these keyboard events from the remote control, especially for the "select key" event that is produced by the button in the middle of the "navigation ring" on the remote control. So it is at least possible to leave and restart R'n'D (or even play games using those key events).

I will try to find out what happens here, or ask in the SDL forums...
My connected keyboard has no function.
It's a Bluetooth keyboard, right? Does it also refuses to work immediately after (re)starting R'n'D? Or only after the screen keyboard mixed up the controller settings?
... as a small solution I´ve changed the playername in setup.conf
That is possible, yes, but not very end-user friendly, of course! :-D

But there's another (clumsy, but easier) way to change the player name: Use the screen keyboard, then blindly erase the existing name using the backspace ("<=") key, then blindly type the new name and leave the screen keyboard. (You might want to restart R'n'D afterwards due to the mixed up game controller settings.)
If I dont try to change the player name all other functions are working as described.
That's at least good to know! :-)
If you also want a Windows (?) binary with the latest game controller code for testing, let me know!
Ja, sehr gerne
You can find the latest development version here:

http://www.artsoft.org/RELEASES/rocksnd ... 0726-1.exe

For the new game controller stuff to be working, you will most probably need a more recent version of the SDL2 library, as I don't know exactly at the moment which SDL version the last R'n'D release version is shipped with (but I think it's too old for the new game controller support to be working). (However, you don't need updates for SDL_mixer.dll etc.) It should be possible to download the following zip file and just replace the file "SDL2.dll" in the R'n'D main directory with the new one from the zip file:

http://libsdl.org/release/SDL2-2.0.5.zip

So, I would especially be interested if all the game controller stuff is working fine on Windows, as I haven't tested it at all so far.
If you want exit the game and you use the HOME button, but then decide against it and use the BACK button, the controller is going crazy :)
The steering is very fast and the controller mapping is gone. You have to restart the game. The problem occurs only if you use the button combination HOME and BACK.
Strange -- I wasn't able to reproduce this behaviour. When leaving the game via the "home" button, I will be thrown back to the Fire TV main menu. When I select the R'n'D icon again, I'm back in R'n'D where I left it, and everything is up to normal, including controllers (like the remote control).

How to you return from the Fire TV main menu to R'n'D using the "back" button? Maybe I just did or understood something wrong... :-o
... RdN version in game is 4.0.0.2, app information shows 4.0.0.1
Manually fixed for now. But I still have to update the build process accordingly, or 4.0.0.3 will be shipped with "4.0.0.2" again... ;-)

Thanks for noting this!
Did also a quick test on level import on the android fire tv/stick version.
Level import is fine.
How did you import the custom R'n'D levels? I would like to add a description to the "Levels" page that is as user-friendly as possible. Did you use some download/unzip tool/app directly on the Fire TV? Or some third-party Windows tool to copy files to the Fire TV file system?

I was able to add "BD2K3" to R'n'D on the Fire TV using the "adb push" command line tool after I connected it to the Fire TV via WiFi, but the ordinary end user would not be happy with this procedure... ;-)
Only "Zelda 2" isn´t working, because it has a different menu. You do not know where you are in the game menu.
Good point. Levels like this (and also the upcoming new "R'n'D jue" level set from Juergen Bonhagen) will only be usable with a pointing device (mouse, finger), but not with a keyboard or game controller.

It would be possible to create a slightly modified version of "Zelda 2" though, which contains some graphical highlighting of the currently selected menu entry. This would require a minor change to the game's "graphicsinfo.conf"...
Can you please put the direction control also on the d-pad?
In my opinion you can react faster in game with the d-pad as with the left-stick.
You're definitely right -- R'n'D needs a digital joystick or game pad, not an analog one, which is usually not precise enough for these kind of games.

Please try the new joystick configuration of the latest Android version (see link below) to configure your game controller accordingly -- it will then support all analog sticks and the d-pad simultaneously, just as it should, and saves it as a new personal game controller mapping, which will then be loaded at each start of R'n'D.

The next version of R'n'D will also ship with a database of already supported/known game controllers, so the joystick configuration is then only needed for new/unknown devices.
If you use the calibration you are stuck on the screen. You have to restart RnD.
Yes, because there's no "escape" key on the Fire TV remote. :-/

The old joystick calibration screen is gone now (as it is not needed anyway for modern joysticks and game controllers), and is replaced with a new configuration screen that is used to map all supported game controllers to an Xbox style controller. Check it out! :-)

(To leave the joystick configuration screen without changes, just press the "back" button.)
My fire tv stick is a nice little emulator station ... I was surprised how well all emulators run.
Sounds great! I'm also surprised how "open" the Fire TV is! That's really a great (and not-so-usual) thing...
On another port I´ve added a keyboard and mouse combi adapter. All is working fine. Keyboard and mouse are running out of the box.
Unfortunately RnD does not recognize the direction keys (up,down,left,right). I have to customize it to other keys like wasd.
That's really strange! So in general, the keyboard works with R'n'D, but you have to configure it to use keys different than the cursor keys to move the cursor? I really wonder which keyboard events are produced by the cursor keys then?

Do you know how to connect to an Android device using "adb", the "Android Debug Bridge" command line tool? If so, you could watch/monitor the keyboard events using "adb logcat", and see which events are send when pressing the cursor keys.

Does the mouse work in R'n'D then? (Not sure if "running out of the box" also was true for R'n'D, or only for other apps...)

And finally, here's the link to the new Android development version:

http://www.artsoft.org/RELEASES/rocksnd ... 0726-1.apk

For me, it now works fine with Bluetooth game controllers now, including d-pad support after using the new joystick configuration screen in the input setup.

Have fun with it! :-)

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Fri Jul 28, 2017 3:20 pm

It's a Bluetooth keyboard, right? Does it also refuses to work immediately after (re)starting R'n'D? Or only after the screen keyboard mixed up the controller settings?
No, it´s a normal wireless (2.4 G) keyboard/mouse combination.
You can find the latest development version here:
Thank you. I´ll try this Windows version later today.
Strange -- I wasn't able to reproduce this behaviour. When leaving the game via the "home" button, I will be thrown back to the Fire TV main menu. When I select the R'n'D icon again, I'm back in R'n'D where I left it, and everything is up to normal, including controllers (like the remote control).
- menu button: acts as right joystick button ("drop" in the game, "yes" in request dialogs)
How to you return from the Fire TV main menu to R'n'D using the "back" button? Maybe I just did or understood something wrong... :-o
... sorry my fault. I mean the MENU button not the HOME button.
If you start the game, scroll down on EXIT and confirm with the MENU Button, then go back with the BACK button ... now move the direction keys and you see what I mean.
How did you import the custom R'n'D levels? I would like to add a description to the "Levels" page that is as user-friendly as possible. Did you use some download/unzip tool/app directly on the Fire TV? Or some third-party Windows tool to copy files to the Fire TV file system?
Yes, I was using Total Commander for Android on my fire Tv Stick in conjunction with adblink (http://jocala.com/). With adblink you can copy files from your pc direct to your fire tv stick. Thats the way I´ve copied RnD, Total Commander etc. from my pc to the fire tv stick.
I also copied RnD Levles with adblink to the fire tv stick download folder. With Total Commander I`ve unpacked the levels into the RnD folder.
It would be possible to create a slightly modified version of "Zelda 2" though, which contains some graphical highlighting of the currently selected menu entry. This would require a minor change to the game's "graphicsinfo.conf"...
Nice. :wink:
Do you know how to connect to an Android device using "adb", the "Android Debug Bridge" command line tool? If so, you could watch/monitor the keyboard events using "adb logcat", and see which events are send when pressing the cursor keys.
No, sorry. I only use adblink as described above. It has a user friendly interface.
Does the mouse work in R'n'D then? (Not sure if "running out of the box" also was true for R'n'D, or only for other apps...)
Yes its working, like using the touch screen on your handy. Of course more accurate and useful for the level editor :wink:

Now I test the new android and pc version. Thanks for the update :D

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Fri Jul 28, 2017 3:55 pm

For the new game controller stuff to be working, you will most probably need a more recent version of the SDL2 library, as I don't know exactly at the moment which SDL version the last R'n'D release version is shipped with (but I think it's too old for the new game controller support to be working). (However, you don't need updates for SDL_mixer.dll etc.) It should be possible to download the following zip file and just replace the file "SDL2.dll" in the R'n'D main directory with the new one from the zip file:

http://libsdl.org/release/SDL2-2.0.5.zip
I think you mean: http://libsdl.org/release/SDL2-devel-2.0.5-VC.zip (SDL2-2.0.5/lib/x86/sdl2.dll) because the other link/zip doesn´t contain "SDL2.dll" :wink:

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Fri Jul 28, 2017 4:42 pm

Must give a quick feedback for the new pc version. Just copied the new .exe and the new sdl2.dll into the RnD directory.
All is working fine. The xbox controller is working fanstatic. I feel retreated into the good old amiga days. :mrgreen:

... I love it!

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Suggestions for Joypad and Android

Post by Holger » Fri Jul 28, 2017 7:08 pm

I think you mean: http://libsdl.org/release/SDL2-devel-2.0.5-VC.zip (SDL2-2.0.5/lib/x86/sdl2.dll) because the other link/zip doesn´t contain "SDL2.dll" :wink:
Oops, sorry, that was the link to the source code zip archive -- in fact, I meant this one:

https://libsdl.org/release/SDL2-2.0.5-win32-x86.zip

It only contains that single file "SDL2.dll" (plus a file "README-SDL.txt" which can be ignored here).

But I'm happy that you were able to help yourself successfully! :-)

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Suggestions for Joypad and Android

Post by Holger » Fri Jul 28, 2017 7:15 pm

The xbox controller is working fanstatic.
Great to hear that! :-D

But: Another thing I forgot to add for the latest development version, which is required to use the new game controller configuration stuff (else the game will exit with an error message): You need some new graphics to be placed in the main "graphics/gfx_classic". I've added it as an attachment.

The original Xbox controller should indeed work "out of the box" with SDL based programs, but you might need the new joystick / game controller configuration for other joysticks and game controllers for which there is no immediate support available yet.
I feel retreated into the good old amiga days.
Again, great to hear that! That's the whole purpose of R'n'D! :-D
Attachments
joystick.zip
(62.25 KiB) Downloaded 76 times

User avatar
Holger
Site Admin
Posts: 2981
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Re: Suggestions for Joypad and Android

Post by Holger » Fri Jul 28, 2017 11:47 pm

No, it´s a normal wireless (2.4 G) keyboard/mouse combination.
But the keyboard somehow refuses to work with R'n'D, while it works fine with other apps?

Or do these problems only occur after invoking the "type player name" menu entry?
... sorry my fault. I mean the MENU button not the HOME button.
If you start the game, scroll down on EXIT and confirm with the MENU Button, then go back with the BACK button ... now move the direction keys and you see what I mean.
Ah, now I understand -- this problem should be fixed with the latest version! Please try if it works for you...
Yes, I was using Total Commander for Android [...]
Ah, sounds cool -- I'll try that! :-)

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 29, 2017 10:35 am

But: Another thing I forgot to add for the latest development version, which is required to use the new game controller configuration stuff (else the game will exit with an error message): You need some new graphics to be placed in the main "graphics/gfx_classic". I've added it as an attachment.
Thank you. Have not configured my gamepad, so I didn´t noticed the error.

User avatar
ango
Posts: 20
Joined: Sat Jun 10, 2017 9:38 am
Location: Germany

Re: Suggestions for Joypad and Android

Post by ango » Sat Jul 29, 2017 10:38 am

But the keyboard somehow refuses to work with R'n'D, while it works fine with other apps?
Yes, the keyboard is working fine. Only the arrow keys where not working in the last RnD android version.

I´ll test the new version later today.

Post Reply