VCMI for Android

Ok I setup uploaded build processing for Android:
builds.vcmi.download/branch/develop/Android/

Yay. :slight_smile:
(actually, this might need some confirmation if it doesn’t break anything: the fix changes pixel mode chosen by gl to hardcoded RGB565 with 0 depth buffer)

You can add a call to “python3.5 ./update_internal_assets.py” on travis and assets will be recreated. Basically internalData is zipped content of Mods and config on repo. (the update_internal_assets script also tries to pack ./…/data/vcmi_submods folder, where I have templates + extra resolutions – recreating assets on travis won’t include them).
Edit ~ actually, some more explanations about overriding: I tried to organize the files like in the desktop version:

  • “internal” data that normally is in executable folder is placed in private, application-scoped folder (unpacked from internalData when starting the application for the first time)
  • “public” user data that normally is in “$appdata-like” location (config/settings.json, saves, maps etc) are in public folder that user can modify/delete

Downloading these submods on startup shouldn’t be a problem (but we probably should ask the user if he wants to; I’m not sure how common users without data plans are :wink: ).

@Intro: Do you mean that there’s some unused space on the top/left? It looks the same for me AND these black margins are also present in the desktop version as well.
@bottom line: this will be much harder to debug. Honestly, this looks like some problem in SDL. Might also be connected to this post [forum.vcmi.eu/t/vcmi-for-android/784/199) where sdl displays random junk in the letterboxed space on the sides.

Problem is that we absolutely shouldn’t include mods with unclear licensing to our Google Play packages. After all it’s should be doable to rework them with free assets instead (extraResolutions at least).

Yeah, I meant we can solve it like this:

  • place these submods somewhere online,
  • build android package without them (rebuilding internalData without submods),
  • after starting the app for the first time (or basically any time when submods are not detected) ask user if he wants to download them -> download&unpack them to internal data folder.

Well, assuming that this method would be legally possible.

Hello Fay,

Issues:
Doesn’t load next scenario of campaign after showing introduction video of it. Hang on main picture - in my case third from [forum.vcmi.eu/t/vcmi-for-android/784/199).
Auto fight crashes VCMI right before showing results (creatures lost by attacker & defeater, …). Does in release version, doesn’t in latest develop.
Fight is something like “tap-action-tap-action-tap-…” or LONG wait for actions with pointer mode set to “Native with map swipe”. In dev.

Android keyboard could be made more usefull (hide,show,arrows…) when saving scenarios? something like in JuiceSSH during session.
I could upload saves. HMM III Complete, Android 7.0 & Android 6.0

Related to:
VCMI-1.4-api21-20170515-release.apk
VCMI-branch-develop-01e5f99-fb57108.apk

Do you mean “next scenario” as in moving to the next mission after winning the previous one? I guess I can check that, but it doesn’t look like android-specific problem.

Yeah, this was the vcmi problem at the time I built the app last time. Use automatic builds if possible, they’re the most up-to-date.

I’m not sure what you mean… pointer modes shouldn’t affect the performance (and even if they did, it’s relative mode that would be slower, as it needs some extra calculations). And if you mean the performance in general, then there isn’t much that I can do from android side.

Currently keyboard handling uses default SDL android implementation and I never really analyzed the logic. But honestly I’m not sure what to do there. Waiting for ideas. :wink:
One thing I can think of (not strictly about the keyboard) is to add the button to open the chat/console, because I don’t think there is a way to do it in the gui.

@SXX
I found out that the fix for the “red background” won’t behave correctly on all devices and will crash the app if that device doesn’t support the surface type that I forced. In this case I’ll probably need to add some better egl capabilities detection (a simple solution would be to check if RGB565/Depth0 is supported, otherwise fall-back to the gl-chosen default values – not sure if it’s possible to implement without messing up SDL config).

BTW today I played short game on Android and so far only problems I seen is battle machines tend to appear in army (though I guess this could be problem with outdated bundled config files) and also battle end tend to crash game for some reason.

Small note. I dropped VCMILIB_ADDITIONAL_SOURCES from CMakeList and instead added “ifdef” for Android-specific code. I hope this won’t break something since I really hope to at least share CMake configs.

Hello, Fay.
I’ve findout that issue not in “next scenarion” but even on second loading after one game was already loaded without complete exiting (to “desktop”) from game.
I’ve recorded videos with issues.
Next scenario hang - youtu.be/6Ev4pwCwzBE
Second load hang - youtu.be/qrPXmB2SEZ0
Slow fight - youtu.be/O867LD377Qs
Large keyboard vs keyboard use in JuiceSSH - youtu.be/Tc0ET_YVZMk

Hello SXX,
Where I should report not android related issues?
Because i’ve tried to switch to “next scenario” on PC (Linux) and one campaign scenario (Clearing the Border) loaded “next scenario” (After the Amulet) and i saved it to continue on android, but other campaign scenario (Graduation Exercise) crashed vcmi on PC on loading next scenario of campaign.

Our bug tracker is here:
bugs.vcmi.eu

But use search first because most likely this is already reported.
There are issues with campaigns for quite some time.

Sorry, I tried to merge some of the CMake projects locally, but failed. Still unsure why it’s fail to build now because I added CAndroidVMHelper into the main CMakeLists.txt of our lib. :frowning: .

I don’t really understand git and Travis but to me it seems unnecessary to use submodules as a way to update VCMI for daily builds. Wouldn’t it be better to update the repository itself?? And shouldn’t be the submodule present in the vcmi-android first so that Travis can update it?? Just a rough guess.

Edit: Nah, I’m blind. The submodule is present. No idea why it gives error.

It’s gives error simply because I broke it. I tried to actually merge some of Android build configuration into our main CMake files, but failed.

Once I find time to install everything needed for Android build to my own machine I’ll fix it one way or another.

Hi there ! How can i play expansion WOG on VCMI for android ? I can’t find WOG mod folder anywhere to put it on android.

I think you have to install it first on your PC and then copy the data into vcmi-data folder in android.

Sorry, I don’t really have time for development recently. I try to read this topic periodically though.

Wow, that really looks strange. That definitely didn’t happen for me. At the moment I’m not sure how it’s possible, but I’ll check when I’m able to.

Hmm, okay. I might need to check what I can actually do with SDLs keyboard handling.
I think that the ability to show/hide keyboard is a feature of your keyboard app (that shows up when suggestions are displayed(?)). I don’t have anything like this in the default google keyboard.

After a quick check – I don’t get why it has problems during linking, but after adding VCMI_ANDROID define in both lib.cmake and SDL_android_main.cpp, the project complied on my side. (probably some problems with the order of file including?)

Yeah, vcmi on android generally tries to follow the same folder structure as the desktop one – mods can be copied from desktop version to /vcmi-data/Mods/ and then enabled via mods menu in launcher.

Nope. Not possible to enable mods via the launcher. I have like 5-6 mods in it. Doesn’t show up in the launcher at all

Well, in that case I need more info, because it definitely should work. Launcher checks for /vcmi-data/Mods//mod.json existence to determine if that’s a valid mod. If you confirm that mods are placed correctly on your device, then I’d love to see the launcher logs (/vcmi-data/cache/VCMI_launcher.log) after opening mods screen.