VCMI for Android

Just installed this, seems to work very nicely. Big thanks for this!!

Ivan, right, this makes sense. I think I’ll follow this and after 0.95 release switch this package to stable version and create a new one (“VCMI for Android Beta”) which will follow your dev versions releases.

edit: just tried 0.94 stable and it seems AI works a lot faster there, is that expected behavior?

From what I know there was a major progress in AI since 0.94

I really appreciate what you’re doing ,thanks veryyyyyyyy much

two questions

  1. can you post the whole code on git?
    i konw that your achievement.and i’m not a progranmoer.only wish more people to join the program,make it more palyable.
    2.can you post a single apk file for android?
    thanks.

FYI:sorry for my english,i’m not good at that

Looked through your patch, some notes:

  • disabled shared memory: that’s quite direct way to fix problems with missing shared memory. But won’t it cause some problems on startup if client will try to connect to not-yet-present server?
  • disabled unicode conversion: should be fixed. Because that code is needed for support of localized versions of H3 (like Russian version).

BTW - any chance to make vcmilauncher work on Android? This is Qt5 application used as mod manager and settings editor (for options that can’t be changed from in-game UI)

Something like “VCMI daily/weekly/monthly build” would make more sense - our dev builds are more like preparation work before release and Win-only. Archlinux user-provided repo (aur) has vcmi-svn package, Ubuntu has daily builds from svn on launchpad.

Likely yes. I can’t say much about AI but it definitely got some improvements since 0.95. So less speed actually means better AI

This shouldn’t cause issues because client tries to reconnect to server every 2 seconds.

This is true, I’ll try to fix it in the next update (got too lazy for that :frowning: )

Not sure, maybe I’ll look into it.

On some devices there’s a very weird issue with shared libraries and unaligned access (which is strange since unaligned access should kill all ARM devices, shouldn’t it?)

Using shared libraries (libvcmi.so, various AIs) makes it segfault at random places (in calls between them I guess?), this is not too hard to solve and just statically linking everything and hacking CGameInterface.cpp’s to not use dlopen/dlsym seems to solve this one.

And then there’s unaligned access, i.e. at CDefHandler::getSprite,

	SSpriteDef sd = * reinterpret_cast<const SSpriteDef *>(FDef + BaseOffset);

BaseOffset % 4 != 0
and maybe in some other places?
Doing

echo 2 > /proc/cpu/alignment

makes it run but that’s a really bad solution to this problem.

VCMI should work with unaligned access. AFAIK vcmi runs without issues on Android devices inside Linux chroot.

There is define that enables code for unaligned access:
github.com/vcmi/vcmi/blob/maste … dian.h#L22
This should results in:

  1. packed attribute set for structures that may not be aligned
  2. enabling of set of unaligned read methods. Which are used in defhandler.
    Maybe that check is not triggered on Android?

Yes, you’re right, it seems it’s not triggered because #if defined(linux) is false (wtf)

Wow, the android finally got some love.
But I don’t have anything with that system. :stuck_out_tongue:
Still, your nick should be written in some sort of hall of fame. Is there anything like that on this forum?

Hello,
I was so happy to hear the news about VCMI for Android and I installed it following those directives, vcmi.xyz.is/installation.html, but when I launch it I only get black screen after some config menu and then back to phone desktop… =(((
(Samsung Galaxy SIII Gt-i9300 on 4.1.2)

i have same problem until switch on wi-fi. If i understodd correctly, SDL need to download something from internet.

Great work!

I am very happy particularly to see that the actual patch is quite small.

So it is.

Reportedly Qt 5 does support Android so it should be possible.

Not quite… Perhaps I could create a group for accomplished contributors and then add some visual sign of membership. But… I’m too lazy. :stuck_out_tongue:
I made the thread sticky and I’ll mention it in the next release announcement.

Update, 0.94f.

Download: either from google play or direct link vcmi.xyz.is/vcmi-0.94f.apk

thanks again.

After i click end turn it waits forever…other than that i am pretty amazed

I’m not sure if that’s because of the port, you should try copying the save you’re getting this problem with to PC and testing with newest desktop build: [forum.vcmi.eu/t/vcmi-0-94f-development-version-r3771/786/1)

I use gog edition on android.This might be the problem?btw thanks for your effort.I really apreciate it.

No, it should work fine.