VCMI for Android

True, but if they are just replaced with some other characters instead of cutting the rest of the text at this point, it’s still better than “HD” Edition (screenshot added in the attachment by the rule pics or it didn’t happen or whatever).
I DO admit that I have played Heroes of Might and Magic 3 long enough to read those cut messages from memory by first words and know what’s gonna happen next - most of them at least - but it’s still ugly to see that kind of bug which is probably still not fixed.

Take your time then~ I will prepare the Inferno army in the meantime~ :sunglasses:

Wow I bet an Asuran Golem with that kind of Android installed could prepare tea in the meantime :stuck_out_tongue:

EDIT #1
For some reason preview of the file is kinda fuzzy but if clicked it will show the image properly.


Sooo… first of all, disclaimer – I have no clue if this works for anyone. :stuck_out_tongue: I tried to make building process straightforward, but it’s still a horrible mess.

Compiled apks are here:
github.com/Fayth/vcmi-android/r … 3-debug.7z (for android 4.1+, only armeabi)
github.com/Fayth/vcmi-android/r … 3-debug.7z (for android 5.0+, all abis (arm, arm v7a, arm64, x86, x86_64))
Project code: github.com/Fayth/vcmi-android
Modified vcmi: github.com/Fayth/vcmi/tree/android-support

The app should tell you how to setup the data, but roughly it goes like this: start app -> app detects this is a first run and creates /vcmi-data folder -> you’re supposed to put h3 data there (+optionally mods as well) -> restart the app -> app unpacks internal configs (including extra resolutions submod) to internal location -> start game (it’ll probably hang for few seconds before getting to main menu, because data-loading thread in CMT is joined to the ui thread – this should be changed at some point to load data without blocking main thread).

If you want to try to build it yourself, the rough outline is here: github.com/Fayth/vcmi-android/b … ilding.txt (I’m on win10, it probably should kind of work on linux (except maybe some permission magic in the scripts?), probably won’t work on older windows (needs win10 bash for ffmpeg build) and I have no clue abous macs)

I’ll try to answer tomorrow if you have any questions etc…

Some thoughts/details about the current state of the project in totally random order:

  • currently special characters seem to work correctly for me no matter if I choose CP1250 or CP1252; I’m not sure if this setting is correctly applied…
  • building ffmpeg is hell; fortunately someone did it before and I mostly reused his confs ( github.com/yesimroy/build-scrip … ndroid-ndk ),
  • I managed to run the game on my android 7.1, an 4.4.2 and a very old 4.1 (needed some extra hacks to get it running and the game is very slow :wink: )
  • I’ll probably take a break from coding this for a few days,
  • vcmi’s repository.json is broken and can’t be parsed without some non-strict mode (missing commas),
  • I tried adding WoG and I think it worked correctly (didn’t try to play a lot, but generated the map and didn’t crash),
  • RMG takes a very long time,
  • Higher resolutions should work, but the game is noticeably slower,
  • Few times I encountered the problem where the game wouldn’t start (both client and server were ready, last thing in the logs are successful autosave, then the game just idled on the loading screen and didn’t move to the game),
  • I’m probably not the best guy to handle contributions/requests etc and don’t really plan to make extensive use of github, so if you want I can add you as owners of the repo or whatever (not sure how, but I assume it’s possible).
  • I tried to gather are configurable paths into one place (vcmiconf.in), but of course there’s a possibility that I forgot about some of them… so if you find some hardcoded absolute paths then let me know :wink:
  • I think that vcmi like to randomly (?) remove my settings from settings.json reverting selected screen res/codepage (possible during a crash?)
  • this is the first time I’ve ever used python, so not sure about scripts quality :wink:

One thing we must decide on is where to store build scripts and configuration.

From one point it’s would be handy to have it in main repository too since then we can at least cover develop itself with Travis builds for Android (no reason to check it for pull requests since they took long enough already).

In same time I not sure how to make it all clean. :wink:

BTW any chance you have any device with Cyanogenmod?

I tried to install it, but looks like even with permissions given it’s can’t access or create directory. It’s says data must be put into “/storage/emulated/0/vcmi-data/Data”, but I suppose for whatever reason user under which application running don’t have the access there.

Though I’m pretty lame on how Android work so testing all of this over SSH as root. :mrgreen:

UPD: Find out that vcmi-data directory in root of internal memory wasn’t visible for file management over MTP for some reason. It’s works via with SSH though.

Now stuck at “Error: Heroes III data was not found!” :frowning:

I dooon’t think so. Personally I’ve never used any custom ROMs. I can ask around but I don’t think I can find something.

This is normal. It’ll usually be storage/emulated for devices without sdcard and something like /mnt/sdcard for the rest. This should be a root folder that is accessible though mtp. As far as I remember, Android does have some problem with syncing the data automatically, maybe that’s why it wasn’t visible… I can try to check later if there’s something to force syncing.

Hm, that’s a message from the actual game, right? So launcher detected that the files were added correctly. Are you able to access logs from logcat (through something like “adb logcat -f output.txt”)? There should be a line “Accessing data root: /storage/emulated/0/vcmi-data” – that’s the path that gets passed to VCMIDirs. Is it correct?

Yeah obviously VCMI was able to write cache. Ok it’s working now. Looks like I just mess and put my “Data” inside “Data” somehow.

It’s working now except screen is all red. E.g in taskbar (running app list) it’s looks fine and it’s also show proper colors for a second when I’m lock screen, but when it’s open in full screen colors are broken.

This is CyanogenMod 13 on Xiaomi Redmi Note 3.

PS: So it’s looks pretty much like this bug.

So far so good~
The game loads, starts, all is fine. The game goes in english language but I’m not mad, I believe I can understand english enough to play fluently :stuck_out_tongue:
For now I had only RoE + AB + SoD files nearby so I tested that a bit.
I will try to test WoG soon because why not, the intro in WoG is worth of trying :3
I have launched it on Huawei P9 with Android 6.0 onboard, I will try with Samsung S2+ with Android 5.5 (Resurrection Remix) soon, I have to clean some space first.
In theory I can try with Samsung Galaxy S1 with uh… There is CyanogenMod installed but I forgot exact numbers, I’m pretty sure it has Android from 4 branch but I’m yet to check, I simply forgot, forgive me :stuck_out_tongue:

To set up the name one has to do it the classic way (unless I don’t know about something):

  1. Multiplayer mode
  2. Backspace a lot, enter the name (it may be in blind mode because keyboard will slide in just like that)
  3. After typing the name, press “back” whatever your phone has either <- or <| or whatnot, ONCE
  4. Press Host button, the game will probably crash but fear not, the name will be memorised for next time you launch the game.
  5. Enjoy your player name replaced with proper name :slight_smile:

Back to the game! (This time Tower castle because golems~!)

More devices testing soon/later.

Black screen on my SGS4, Android v5 stock.
Any other selection differ than “Start VCMI” in launcher lead to crash of vcmi (Unfortunately VCMI, has stopped).
HMMIII data taken from my PC, where VCMI works with it.

Hello. First time tried install vcmi for android. My shitty china device show me black screen. I waiting few minutes but nothing not happing. Some tech info about pixs.ru/showimage/Screenshot_725 … 181784.png

  1. May be fault what i have russian version heroes?
  2. Or may be need install apk for android4?
    Idk.

Get and upload the logs from “cache” directory on your SD card next to where you put “Data” folder.
They’ll tell why it’s crashing in case VCMI itself managed to start.

Sounds like SDL incorrectly chooses pixel format. I didn’t see any calls to methods described in that bug report in vcmi. Possibly sdl receives some unhandled pixel format from the system here github.com/Fayth/vcmi-android/b … java#L1426 (and then it defaults to rgb565). There should be an entry in logcat logs with “pixel format xxx” if you want to check it.
(edit ~ actually, there’s one direct pixelformat manipulation in video handler, but I think if that was a problem, it would affect only the videos, not the whole game)

Yay, so it’s not only working for me. :wink:

Hm, the language should be based on your data files… It’s not in english for me (unless I add WoG).

I probably should have added saving launcher logs to a file, because currently launcher logs can only be retrieved through adb (or shell).

Black screen issue sounds more like some vcmi/SDL initialization problem, but it’s hard to say anything without any details. There might be some useful info in client log (in vcmi-data/cache, as SXX noted).

I might try to setup some emulators tomorrow to try to reproduce some problems (I wonder if there’s a way to use cyanogen emulator :wink: ).

If I understand correctly - in android version there’s possibility to enable/disable mods in launcher?

log client empty. 0 byte.
launcher: pixs.ru/showimage/Screenshot_880 … 185150.png
and if I click on “mod”, “codepage”, “change game resolution” - I see “В приложении VCMI произошла ошибка” It’s mean “In VCMI application error occurred” and launcher close.

OK I guess I hurried a bit too much with all that data.
Unfortunatelly the game crashes in two moments:

  1. Loading saved game.
  2. After battle results.
    These two things makes it unfinishable at this point (unless we pray that allied CPU kills enemy CPU and we will in the meantime drink tea on the grass).
    That’s for Huawei P9. It creates two vcmi log files so I can clean them, try to load game - which will crash it - and then upload the log if that helps in anything.

On Samsung Galaxy S2+ it reaches the launcher screen but trying to launch the game itself goes something like uh “Unfortunatelly, application VCMI was halted.”(?) It creates one log file which I can upload as well if that helps anything.
Well not sure if I can apply here version for 5.0+, I will try the 4.4+ as well and see if that changes anything before more BBQ.

On Samsung Galasy S1 not yet tested, I’m copying files as we speak.

I will check that but still I’m not mad it’s in english, I won’t be making war about it :stuck_out_tongue: (maybe even better, because we don’t risk that polish-exclusive-letters will do some OMGWTFBBQ situation :D)

BTW is it somehow possible to force VCMI to read from External microSD card instead of Internal Memory? Just asking~ :3

EDIT #1
Samsung Galaxy S1 with VCMI for 4.4+ doesn’t go but I think I know why. Cyanogenmod version is 10.2 which equals for 4.3.x so unless I can somehow put 4.4.x version here, this phone is out of question at the moment.

Samsung Galaxy S2+ with VCMI for 4.4+ gives the same result, launcher goes fine, launching VCMI itself, nope.

EDIT #2
Hmm~ I guess I will check the data files as well just in case that maybe I did some mistake in one way or another.

Both of these work correctly for me, so it may help if you can get the logs.

Special characters should work correctly in the current version. :wink:

I don’t hardcode the path to anything, but ask system to give me an “external storage directory”. I think I could force it to use a secondary external storage, but this would probably complicate things… honestly, if I was about to do something more complicated, I would just allow user choose the folder that he wants to use… but that might be something for later.

I managed to reproduce the problem with black screen on game start (on 5.0 emulator). There was a deadlock in CLogger and the game basically froze on the second log line.
I’ll try to build and upload updated packages… possibly later today. With fixed blackscreen, possible launcher crash and saving logs to file in the launcher (so I can actually know what goes wrong in the launcher ;)).

Edit~

Not yet (you can see the detected mods, but this doesn’t really work anyway, because currently it only shows mods from config/settings.json, so it’s displayed correctly only after you already run the game).

At your service :3
Added it in the attachment log files from the Huawei P9 and Samsung Galaxy S2+.

VCMI nailed Heroes 3 “HD” edition, concluded :3
Victory for VCMI!

There is no rush, I was just wondering, for now it’s possible for me to reserve enough space on any of those phones without problems.

Yay~! \o/
Oh yeah, I have asked friend to test it as well on Sony Xperia T3 and the result was crash on launcher aka didn’t see launcher, just crash.

Also I have checked the data and it’s “too big”, turns out I have accidentally copied some HotA data files, so maybe they made some crash?
I will re-copy files from clean installation, this time probably polish edition~

Kiiro over and out

VCMI_Client_log.txt (10.6 KB)
vcmi_logs.tar (214 KB)

Log in cache is empty
Here logcats for resolution selection crash and black screen

http://rgho.st/6gTFbFjnF

OKAY~!
With the change of data files properly from clean install it goes polish language with special characters being displayed properly so far, which is all good :slight_smile:

I’m yet to check save/load and battles so I will change the post in approaching few minutes~

The screenshot may be a bit blurry because of 800x600 or something…I guess?

EDIT #1
Interesting…
The loading game still fails…but not exactly…
When I a bit quickly tapped the “middle” button which returns to menu (but doesn’t close the application) I thinked “wait, maybe I gave him not enough time”. So I press the right button that shows the applications list and resumed the VCMI. That’s where surprise comes in. The game loaded, I just can’t do a thing…but not exactly. If I press on the map blindly and do whole minimize-maximize again, the game will update that info, even tough I still can’t do anything in real-time.
All of this was tested on Huawei P9 since the other phones are out of question at the moment.


Added updated version.
github.com/Fayth/vcmi-android/r … -debug.apk
github.com/Fayth/vcmi-android/r … -debug.apk

  • black screen on game start should be fixed,
  • slightly better error handling in launcher (saving launcher logs + crashes in /cache/VCMI_launcher.log; also hopefully less crashes),
  • added ability to enable/disable the mods and submods

I’m not entirely sure why this crash happened (looks like a problem in android support libs), but I think I might’ve fixed it in today’s version.

@Kiiro
S2 log – I’m not sure how exactly resource loading works in vcmi, but it looks like it couldn’t find some files during init (multiple entries with “File is not a valid JSON file! At line 1, position 0 error: File is empty”).
P9 log – hard to say what happens, because there are no errors in the logs… the last line in the client log is “Entering virtual void VCAI::loadGame” so I suspect there was some deserialization crash in AI. Was this save created in android version or copied from pc?

Probably. If you have full hd phone then everything is upscaled almost 2x.

Actually, I managed to do this few times (during normal game start, not loading). I have no idea why this happens, but I’d say this is SDL problem. The game gets “stuck” on loading screen – it looks like the whole game initialization succeeded, but the screen doesn’t refresh anymore (nothing in logs). Minimizing the game “helps”, because it forces SDL to recreate the screen, but it still doesn’t refresh.

Could this happen due to fullscreen enable / disable code being super hacky?
Other than that I don’t know much of our SDL code.