Author Topic: Android Port (SDL2)  (Read 111550 times)

Offline page

  • Sergeant
  • **
  • Posts: 20
    • View Profile
Re: Android Port (SDL2)
« Reply #105 on: May 24, 2014, 12:20:09 am »
Not tested yet, but nice job! However, I checked your github repo (I guess you have the same nick there?) and couldn't find any changes. Could you at least push there so I can see/pull the changes? Thanks!

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #106 on: May 24, 2014, 06:31:51 am »
Yes, https://github.com/sfalexrog/OpenXcom is my repo, but I got stuck a bit trying to figure out how it worked. Tried pushing the changes, it's probably broken now but I think the relevant changes are here. Unfortunately, I've been dumb and made a commit that has fixes for resolution AND name changes. I'm not good with computers  :-[

Also, the bug with game crashing due to soldiers dying to reaction fire is still there. Will look into it later, I guess.

EDIT: Okay, I think I've figured out what caused the game crashing. The fix should be on github. New debug build is also up for everyone brave enough to test it.
MORE EDIT: Okay, looks like I've figured out how to git fetch upstream, git merge and git push. I think the current version is playable, didn't encounter anything game-breaking (then again, I messed with the code and git more than I've played, which is a good thing, I guess?)
« Last Edit: May 25, 2014, 07:39:32 pm by sfalexrog »

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #107 on: May 28, 2014, 02:09:14 pm »
I guess it won't hurt if I just post another version signed with a debug key:
https://dl.dropboxusercontent.com/u/732324/openxcom-1.0-debug.apk

This version should be up to date with today's (2014-05-27 23:05) nightly, and has some minor changes:
 - Drag scrolling uses left mouse button by default (so it's enabled for geoscape and battlescape)
 - page's drag scrolling code is disabled in favor of the common code (i.e. which is used in the desktop version). Swiping from soldier to turn still works, though.
 - Save/load screens should be somewhat easier to use (loading starts when you lift your finger up, not when you tap the screen)

Known bugs:
 - Sometimes the intro will play at a very high speed
 - Multitouch is broken
 - Quitting with the button apparently doesn't work exactly as intended, and some menu items (especially in Advanced options) might get duplicated. It's better to remove the game from the recents before starting it again.
 - Loading screen is shown in 320x200, so not everything fits in

Of course, you should update your data folder with the current nightly.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #108 on: June 01, 2014, 12:47:06 pm »
Ah, why the hell not.

I've heard about performance issues on some devices (high CPU and battery consumption), and while I'm no wizard and can't really do anything about most graphics stuff happening on the CPU, here's a version with some snake(men) oil sprinkled on it: https://dl.dropboxusercontent.com/u/732324/openxcom-1.0-debug-opt.apk

I've tried changing the compiler to clang-3.4 and messing with compiler flags, resulting in a somewhat larger binary that should have some more optimizations turned on. As for any real performance gains, I'm not sure they're there. Like I've said, snake(men) oil.

Still, it (mostly) corresponds to the current (2014-06-01 06:23) nightly, and has some added features:
 - Placing more than one finger on your touchscreen should no longer make the game freak out
 - There's a rudimentary support for multitouch gestures. So far it's only implemented for geoscape, and it's really basic, but it will zoom in/out if you pinch fast enough (for now it's tied to the pinch speed)
 - Not sure if I've posted about it, but hiding the keyboard no longer gets you stuck in text input: just tap on it again! To save the text you still need to hit enter, though.

So, yeah. Update data folder, load the game, see if there's anything broken.

Offline hawk66

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: Android Port (SDL2)
« Reply #109 on: June 05, 2014, 10:39:11 pm »
I've managed to install the app and copied the folders

to /storage/sdcard0/openxcom/data

so data is the root for the contents of the openxcom data files and the original files.

I get the error 'Failed to open direcotry : SoldierName/'

So, what I'am doing wrong here?

Thanks.

EDIT:
I messed up the folder structure and did not realize it...very nice port :), thanks a lot for doing this!!!
« Last Edit: June 06, 2014, 03:46:22 pm by hawk66 »

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #110 on: June 07, 2014, 12:11:11 am »
Thanks! Nice to know someone is actually using the android version  :)

Also, more updates!
This version:
 - Should have all changes from the upstream!
 - Has an option to change video scaler! (currently you can have either a "blurry" one or a "blocky" one - linear or disabled)
 - Has a better implementation of globe-pinching!
 - Lifts the base-naming window higher (so that the name won't be obscured by a keyboard)!
 - Adds a "cancel" button for the first base naming window! (It's buggy at the moment, and I don't know why one would want to use it, but here you have it)
 - Based on current (as in hg-current) SDL2, SDL2_image and SDL2_mixer, so expect some bugs to be fixed and other introduced!

Anyway, this update will probably break something really hard, so I'll be happy to have all your logcats from crashes.
New version:
https://dl.dropboxusercontent.com/u/732324/openxcom-1.0-fef3d48e-debug.apk

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #111 on: June 11, 2014, 01:00:49 am »
Updated the port a bit more.

In this version:
 - Game should no longer crash on globe pinch-zooming (credit goes to SupSuper for telling me what to fix);
 - Onscreen keyboard now hides if the associated TextEdit gets destroyed;
 - Not sure if that's a noticeable change, but SDL and yaml libraries are now statically linked.

New version: https://dl.dropboxusercontent.com/u/732324/openxcom-1.0-916d160c-debug.apk

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: Android Port (SDL2)
« Reply #112 on: June 14, 2014, 05:34:23 pm »
Now that 1.0 is released, will there be an Android build? Thanks!

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #113 on: June 14, 2014, 07:32:04 pm »
It's going to be up on the main site soon, but I guess it won't hurt to post the link here.
https://dl.dropboxusercontent.com/u/732324/OpenXcom-1.0.apk

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: Android Port (SDL2)
« Reply #114 on: June 14, 2014, 09:31:22 pm »
Is there an updated data archive for it too? I only found one posted by someone else in May a couple pages back.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Android Port (SDL2)
« Reply #115 on: June 14, 2014, 10:54:12 pm »
You can grab the OpenXcom data from any port (eg. the Windows ZIP on the Downloads page). The original game data is up to you to get. :P

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: Android Port (SDL2)
« Reply #116 on: June 14, 2014, 11:05:14 pm »
The original game data was easy because I was ironically playing it via DOSBox Turbo when I heard that OpenXcom had just been released.

The OpenXcom data was the part I was wondering about. I managed to get it from the 1.0 release tag on github, though, as that was as easy as any other method to accomplish on a tablet away from home.

Offline Xuio

  • Squaddie
  • *
  • Posts: 3
    • View Profile
Re: Android Port (SDL2)
« Reply #117 on: June 15, 2014, 08:49:31 pm »
I have little problem with version 1.0 and my Galaxy Note 3. Buttons in sell/purchase and skyranger equip screens are "stuck" when i press them with s-pen, so selecting small number of items is very inconvenient. The rest is great.

Offline HunterZ

  • Sergeant
  • **
  • Posts: 33
    • View Profile
Re: Android Port (SDL2)
« Reply #118 on: June 15, 2014, 09:08:35 pm »
The only real quirk I've noticed on my Nexus 7 is that when in shooting mode I have to click the gun icon to cancel shooting mode before I can click any other buttons. Oh, and for some reason I can't drag inventory items (but I can click to grab and click to place).

Compared to playing in DOSBox Turbo, it's great being able to drag scroll and to see radar ranges and vectors on the tactical display. On the other hand I miss the Roland music, and the drag-to-turn for soldiers is touchy.

Offline sfalexrog

  • Captain
  • ***
  • Posts: 56
    • View Profile
Re: Android Port (SDL2)
« Reply #119 on: June 16, 2014, 02:21:14 am »
Xuio, I've heard about buttons being stuck on some devices, but unfortunately couldn't reproduce it on my end. It probably has something to do with the way SDL2 handles touch devices, but since I don't have access to any device with an active stylus, I can't be sure on how to fix that. Still, I hope it'll be fixed eventually  :)

HunterZ, well, I hate to ruin the magic, but touchscreen support is somewhat barebones because it's mainly mouse emulation, and there's only so much you can do with it. I've noticed myself trying to drag-drop things on the inventory screen, so maybe I'll get down to implementing it some day :) Maybe I'll tune drag-turning a bit too, but that might start to interfere with map drag-scrolling. As for Roland music, well, you can actually make some .OGGs and use them!

Also, well, since android is experimental (hey, the front page says it!), I might as well try and do some experimenting:
 - Now the game actually tries to use your system locale. I'm not sure where it's used apart from setting the display language on the first launch, but Android should ignore locale with native code anyway, so I wouldn't expect things to break too much.
 - Also, OpenXcom's data, translations and data patch are now contained inside the package. You still need the original data, and you'll have to place it in /sdcard/OpenXcom/data as usual, but everything else will be installed automagically.

Since I have no experience with Java and its Android implementation in particular, expect things to break hard. Still, even if they do break for some reason, don't hesitate to tell me about it, maybe I'll fix it somehow!

The link is here:
https://dl.dropboxusercontent.com/u/732324/OpenXcom-1.0-bundle.apk