Author Topic: OpenXcom for Android - new official thread  (Read 346098 times)

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
OpenXcom for Android - new official thread
« on: June 25, 2014, 12:59:08 am »
(Because we totally don't have two threads already!)

Link to the latest version?
Here: https://openxcom.org/forum/index.php/topic,2428.msg50242.html#msg50242 (OMG TFTD)

Welcome!

Following in page's footsteps, I'm trying to bring OpenXcom to your Android devices. I'll be trying to catch up with the current git version of OpenXcom, with all new fixes and added features. Still, this port is not yet stable and crashes, glitches and generally weird behavior is to be expected.

Installation instructions

  • Grab your X-com/OpenXcom data files and copy them to /sdcard/OpenXcom/data folder. If done right, you should (at least) have folders GEODATA, GEOGRAPH, MAPS, MISSDAT, ROUTES, SOUND, TERRAIN, UFOGRAPH, UFOINTRO and UNITS in your /sdcard/OpenXcom/data folder. If you're copying data from your OpenXcom installation, don't worry about other folders being copied over.
    N.B.! Check where your /sdcard symlink points at with your favorite Android file manager! On some devices it might point to an actual SD card, on others it might be internal memory storage. Check twice where you're putting your data!
  • Install the .apk (it should only ask you for storage access permissions, don't trust it if it asks for anything apart from that!).
  • Run the .apk. On the first run you'll see a preloader screen. The preloader is non-interactive, all it does is checks if your files have the same version as the build, and if not, it overwrites them.
  • If the preloader screen doesn't appear and you have a black DOS-like screen that tells you you're missing something, you've probably copied the data files to a wrong location. Check and re-check your paths! Note that /sdcard should point to the contents of your "external storage" and not be a subfolder on your memory card!

Features
  • Pinch-to-zoom in geoscape mode
  • Weapons are highlighted when aiming in battlescape mode
  • ...probably something else that I'm forgetting about

Controls - MUST READ!
Since most Android devices are somewhat limited in terms of input, there are some differences in the main and Android versions.
  • Turning can be accomplished by either swiping from your soldier in the direction you want or long-pressing on a tile you want to turn to.
  • Currently there's no way to force-fire or use alternative movement modes.
  • Tap on the weapon frame to get out of aiming mode.

Known problems
  • On some devices (notably Samsungs) the screen will be tinted purpleish-red. The fix is to disable hardware overlay in the device's developer options (look up the instructions if you can't find the menu)
  • OpenGL screen filters don't work for now. Only SDL2's linear (blurry) filter is available.
  • Closing the game by hitting "Quit game" and then reopening it results in intro being played too fast and advanced options menu being overpopulated. You should completely unload OpenXcom from memory (Android 4.0+ users can swipe the app from the recents).
  • For now it appears that the app doesn't really "sleep" when the device's screen is locked/turned off. This will result in a higher battery consumption.

Downloads
The downloads will be available on the official mod portal: https://www.openxcom.com/mod/openxcom-android-nightly.
The source code is githubbed at https://github.com/sfalexrog/OpenXcom (branch "experimental"). You're advised to not look directly at the code  ;D
« Last Edit: August 21, 2015, 01:34:08 am by sfalexrog »

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #1 on: June 26, 2014, 02:08:26 pm »
New version! Still based on upstream 966b2f2003, but should provide some fixes.
Changeset:
  • Attempt to avoid sound-related wakelogs (as seen in https://bugzilla.libsdl.org/show_bug.cgi?id=2480); this may result in loss of sound in some circumstances, but seems to work for now.
  • Native code gets unloaded on quitting the game, so the bug with duplicate menu items in advanced options should be solved.
  • Date and time should be displayed properly (if they weren't before). Thanks android developers with your zero respect for wchar_t for making me rewrite these functions yet again!
  • Git revision now displayed on title screen (though in this build it is reported incorrectly as g25a5039)

Offline meltyman

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #2 on: June 26, 2014, 07:08:06 pm »
Can you upload new apk to Dropbox? I cannot download anything from mods page.

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #3 on: June 26, 2014, 07:16:17 pm »
I'm confused: I thought newer versions of the apk included the OpenXcom data files (not to be confused with X-Com data files), but the instructions in the first post in this new thread say to do that manually?

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #4 on: June 26, 2014, 07:47:19 pm »
Can you upload new apk to Dropbox? I cannot download anything from mods page.

Here you go: https://dl.dropboxusercontent.com/u/732324/OpenXcom-1.0-g6fbb074.apk. Although you should probably report your problems with the modsite to Jo5hua (https://openxcom.org/forum/index.php?action=profile;u=1376)

I'm confused: I thought newer versions of the apk included the OpenXcom data files (not to be confused with X-Com data files), but the instructions in the first post in this new thread say to do that manually?

I was referring to the original X-Com files, the OpenXcom files should be added automatically. (FWIW, you can just drop your OpenXcom files into the dir, they will simply be overwritten by the data in the .apk file)

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #5 on: June 27, 2014, 01:07:02 am »
I guess I was confused because the wording in the OP is "X-com/OpenXcom".

Offline kiksy

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #6 on: June 27, 2014, 06:15:22 pm »
Hi,

Installing OpenXcom-1.0-g6fbb074.apk just gives me a black screen as soon as it runs. Can't see any major issues in CatLog, just one reference to :

dalvikvm E >>>> org.libsdl.openxcom [ userid 0 ] [ appId 10264]

Rolling back to the apk : OpenXcom-1.0.apk

and it runs fine again.

Samsung Galaxy S5

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #7 on: June 27, 2014, 07:45:42 pm »
Hi,

Installing OpenXcom-1.0-g6fbb074.apk just gives me a black screen as soon as it runs. Can't see any major issues in CatLog, just one reference to :

dalvikvm E >>>> org.libsdl.openxcom [ userid 0 ] [ appId 10264]

Rolling back to the apk : OpenXcom-1.0.apk

and it runs fine again.

Samsung Galaxy S5

Sounds like there's something wrong with the auto-update module. Do you have files like "openxcom_data_marker", "openxcom_translation_marker" and "openxcom_patch_marker" in your /sdcard/OpenXcom/data folder? What are their contents? Also, could you please post the whole logcat (or the relevant part, when you start up the newer version)?

Offline judgeholden

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #8 on: June 28, 2014, 07:36:58 am »
I'm having trouble installing, too. Forgive me if my questions are very basic, by the way. I just installed Android on my Touchpad today. For this. So, I'm a major newb.
First, my Touchpad doesn't have an sdcard0, which may be the issue. It just has an sdcard1. Perhaps this doesn't matter, and it just points to sdcard.

Anyway, I'm getting the "Failed to open directory: SoldierName/" error.
I downloaded the apk and installed it.
Next, I created an sdcard1\OpenXcom\Data. In it I pasted GEODATA, GEOGRAPH, Language, MAPS, Resources, ROUTES, Ruleset, Shaders, SoldierName, SOUND, TERRAIN, UFOGRAPH, UFOINTRO, and UNITS.

I then ran the apk and got the DOS-like screen. Anyone have any ideas as to what I'm doing wrong and how I may correct it?
Many thanks!

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #9 on: June 28, 2014, 11:33:36 am »
First, my Touchpad doesn't have an sdcard0, which may be the issue. It just has an sdcard1. Perhaps this doesn't matter, and it just points to sdcard.

Unfortunately, that does seem to matter. For now the paths are hardcoded, and if there's no sdcard folder in the root of your device (see screenshot; there should also be "dev", "etc", "mnt", "proc" folders around), the game won't work properly. I'll see what I can do about it, though.

Offline kiksy

  • Squaddie
  • *
  • Posts: 6
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #10 on: June 28, 2014, 01:17:46 pm »
I'm having trouble installing, too. Forgive me if my questions are very basic, by the way. I just installed Android on my Touchpad today. For this. So, I'm a major newb.
First, my Touchpad doesn't have an sdcard0, which may be the issue. It just has an sdcard1. Perhaps this doesn't matter, and it just points to sdcard.

You might be able to symlink sdcard0 to sdcard1. I vaguely remember having to do this before for an app years ago.


Sounds like there's something wrong with the auto-update module. Do you have files like "openxcom_data_marker", "openxcom_translation_marker" and "openxcom_patch_marker" in your /sdcard/OpenXcom/data folder? What are their contents? Also, could you please post the whole logcat (or the relevant part, when you start up the newer version)?

I do not have "openxcom_data_marker", "openxcom_translation_marker" and "openxcom_patch_marker"  in sdcard/OpenXcom/data .

Attached is a logcat, this is just me opening the app, and straight away seeing the black screen, waiting a few seconds, then stopping logging.

https://dl.dropboxusercontent.com/u/175186/logcat_and_device_info.zip

Offline judgeholden

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #11 on: June 28, 2014, 09:02:24 pm »
Ok, I was about to table this and go to a Touchpad forum, since that seemed more specific to my issue, but I fixed it.
(turns out I didn't have root access and therefore wasn't seeing the right folder.)

As I mentioned, total newb without any prior Android experience so I'm bound to do many stupid things. But thank you, it was helpful to see the exact problem was, in fact, a directory one, and manage to troubleshoot from there. Took all of 30 seconds this morning to realize what I was doing wrong.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #12 on: June 28, 2014, 11:35:46 pm »
Well, just as I was fighting through some Android weirdness... (turns out android didn't have *official* SD card support before version 4.4, so good luck trying to figure out where your /sdcard symlink really points to)

New build! Based on upstream 18ebd7cc1c.

Changeset:
  • Some little internal changes and tweaks, including the return of old (read: the same as in the master version) mouse pointer scaling code. Nothing should be broken, but you'd better not turn off letterboxed mode unless you want your touches screwed up bad!
  • I've tried un-hardcoding references to /sdcard, using Environment.getExternalStorageDirectory() method. That might be more of a problem due to each vendor understanding the "external storage" differently, and it will probably point to your internal storage instead.
  • To make up for the previous bullet point the loading screen now will tell you where it expects the data to be. That's still not very user-friendly, but at least it should assist with troubleshooting.
  • Due to a really dumb oversight by me the game wouldn't start if it couldn't find the files in the hardcoded path. This should be fixed (the game will attempt to run no matter what, it will just update and patch your data if it manages to find it)

Just as usual, the updated version is on the mod page. My Dropbox mirror is https://dl.dropboxusercontent.com/u/732324/OpenXcom-1.0-ge1f416d-bundle.apk (for those having trouble downloading from the modsite).

Offline judgeholden

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #13 on: June 29, 2014, 04:11:00 am »
I really do appreciate you attempting to solve my issue for me. It's kind of incredible.

I do have another issue, uncertain if it's a known issue I'm not seeing mentioned. When I go to either buy or sell, the up and down arrows are staying selected somewhat. If I hit up arrow to buy more canon rounds, it will just shoot all the way up till it tells me my stores are full. If I hit down, it'll go to zero. If I hit both, it will just flip up and down one based on where I hit it.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: OpenXcom for Android - new official thread
« Reply #14 on: June 29, 2014, 04:01:51 pm »
I really do appreciate you attempting to solve my issue for me. It's kind of incredible.

I do have another issue, uncertain if it's a known issue I'm not seeing mentioned. When I go to either buy or sell, the up and down arrows are staying selected somewhat. If I hit up arrow to buy more canon rounds, it will just shoot all the way up till it tells me my stores are full. If I hit down, it'll go to zero. If I hit both, it will just flip up and down one based on where I hit it.

Well, OpenXcom should kick you in the balls during the game, not while you're trying to get it running  :)

Sticky keys is a weird issue that should have been fixed at least twice: by the SDL2 guys and by me. Looks like it depends on the device (I couldn't reproduce the issue neither on my Nexus 4 nor Nexus 7, but saw that kind of behavior on a Galaxy S3 that I don't really have access to). You might try pressing the stuck button again, it worked on the said S3 device, but your mileage may vary. Hope there'll be a proper fix eventually.