aliens

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

Offline starwindz

  • Sergeant
  • **
  • Posts: 14
    • View Profile
Re: Android Port
« Reply #15 on: November 25, 2013, 10:21:25 am »
Quote
Then you put all the SDL libs in openxcom/android/jni (you need a special patch for SDL_gfx, which its author just added to the lib)

@page
Thank you very much for your kindness. As you have mentioned, I should google to find out all information to be needed to compile the android OpenXcom.

However I have some difficulty to obtain some compile dependencies for android just like 'openxcom-deps-win-vc.zip7' for VCExpress. So could you please upload or share compile dependency files(a zip file) only that you are currently using? Dependency files would include 'SDL', 'SDL2', 'SDL2_image', 'SDL2_mixer', 'SDL_gfx', 'YAML' and 'BOOST'.

Thank you again.

Offline HappyCat

  • Sergeant
  • **
  • Posts: 24
    • View Profile
Re: Android Port
« Reply #16 on: November 26, 2013, 02:59:07 pm »
Trying the same thing. Too bad I never could make Eclipse do what I want it to do)

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #17 on: November 27, 2013, 07:19:40 pm »
I've been thinking a while about how Xcom could be modded a bit to work well for fingers on a 4-inch screen

Here's a battlescape mockup I drew up, and I don't think it would be too hard to modify the code to have it like this (is the UI externalized at all anyways?)



I was thinking, to make the buttons even wider, End Turn and Minimap buttons can go up next to the Retreat/Options buttons. Even further, the 'Done With Unit' button can be removed and added as a long-press for Next Unit instead to make them even wider. What do you think? Is it fine the way it is or would that be better?

Also, for the TU reservations, I was thinking tapping any of those buttons would just bring up a big list to pick from instead, kinda like the firemode list.


As for geoscape/basescape, I think using icon grid menus instead of lists would also be hugely beneficial. I'll make mockups of those later.
« Last Edit: November 28, 2013, 03:13:28 am by Tarvis »

Offline redrat9595

  • Sergeant
  • **
  • Posts: 26
  • Good Times
    • View Profile
Re: Android Port
« Reply #18 on: November 28, 2013, 01:41:04 am »
...What do you think? Is it fine the way it is or would that be better...
...Also, for the TU reservations, I was thinking tapping any of those buttons would just bring up a big list to pick from instead, kinda like the firemode list...

This looks really nice. I think the next unit buttons are fine how they are, but maybe switching the abort and end turn buttons would be better because there's no confirmation for ending a turn and fat fingering the end turn button when you meant to fire could be disastrous.

Also, instead of a list, making the reserve cluster a single button that cycles through the options could be better, as well as easier to implement. It would start on green by default, and you would have to touch it three times to get it to autoshot.

Thanks,
Red
« Last Edit: November 28, 2013, 01:44:09 am by redrat9595 »

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #19 on: November 28, 2013, 03:09:52 am »
This looks really nice. I think the next unit buttons are fine how they are, but maybe switching the abort and end turn buttons would be better because there's no confirmation for ending a turn and fat fingering the end turn button when you meant to fire could be disastrous.

Also, instead of a list, making the reserve cluster a single button that cycles through the options could be better, as well as easier to implement. It would start on green by default, and you would have to touch it three times to get it to autoshot.

Thanks,
Red
Yeah, I thought of this too, but with the Reserve for Crouching/Dump TUs buttons from TFTD being regular in OpenXcom (something I forgot to include in the mockup) that might be tricky to hit since they're so thin. I'll think of something.

EDIT: Okay I've got it. I'll have the 4 reserve buttons act as one big button that cycles through them like you said, and then next to it will be the Reserve for Crouching button. To set TUs to 0 that can be assigned to long-pressing the "Don't Reselect Unit" button or something. Not super intuitive, but then again neither was right-clicking it.

Revised version. I think another thing that could be done (since buttons have a lot more room now) is little text labels! I don't know if it's better off being done through the text engine or by adding it to the graphics themselves, so I'll just leave it alone for now.


I also got rid of the black outline sorta for the regular reserve buttons to give the impression that they're actually 1 button.


And here's a WIP of the Basescape changes I had in mind. The missing button is Base Information which I figure could be made to come up by tapping the base name/location/funds bit
« Last Edit: November 28, 2013, 07:32:51 am by Tarvis »

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: Android Port
« Reply #20 on: November 28, 2013, 08:28:03 pm »
You seem like a talented chap, but the battlescape icons order seems a bit disruptive, and the basescape buttons a little cryptic without proper subtitles.

I recommend you take a look a PocketUFO since it was the first version of X-COM for portable devices. They made a pretty cool adaptation of the UI for vertical PDA screens:



You can get the windows version somewhere around the web.

Offline redrat9595

  • Sergeant
  • **
  • Posts: 26
  • Good Times
    • View Profile
Re: Android Port
« Reply #21 on: November 28, 2013, 08:50:04 pm »
Beat me to it. Here's a link I know works.
https://www.xcomufo.com/x1dl.html

Any ideas for more precise movement? The magnifying glass wasn't a bad idea IMO, but some people didn't like it. Also, how does turning/strafing work?

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #22 on: November 28, 2013, 08:52:43 pm »
I'm not sure if that's a very good base. PocketUFO was made for use with a stylus, and the point of all this is for the game to work well with a finger. Furthermore getting OpenXcom to work in a portrait orientation sounds like more hell than it's worth. (It would be cool though! I just think it would have to be an either/or type of deal, because getting the game to adapt either way would be rough)

I'll think of other layouts that would restore the older button order. It might cut down on viewing area, though.


As for the basescape, yeah I see what you mean. A simpler solution I guess would just be 4 taller menu buttons (with text) that open up new menus for the rest of the options.
"Manage Bases" -Contains Base Information, Build New Base, Build Facilities
"Manage XCom Forces" -Soldiers, Equip Craft
"Manage R&D" -Research, Manufacturing
"Manage Inventory and Hires" -Buy/Hire, Sell/Sack, Transfer
And a smaller one to go back to Geoscape.

I just thought the icons would have been a good idea since that would require the least amount of coding effort (simply reorganizing the button zones) without having to code new menus.

EDIT: I've thought about how movement/looking can work too without magnification. Obviously all these are a lot more than simple changes, but seems like the most intuitive way to do it on a touchscreen.

Tap on a unit to select it (Automatically center camera, too? Might be too much)

To move the unit, tap the unit again to enter 'Move Mode' where the red 3D cursor appears. Then you can tap on the map AND/OR drag the box to the destination. Dragging the box would allow for much finer movement. Then tap the box again to confirm the destination.

For looking, just dragging from the soldier to where to look should work, especially if tiles get shaded to show the FOV before the finger lets go. This would work best if it was outside of Move Mode, but would be a bit more cumbersome.


Other ideas would be adding buttons for entering moving/looking mode, but those might take up valuable space.

Shooting would work like the move mode, where you can tap the target and/or drag the target cursor around, then tap it again to confirm the shot.

The idea is that the shooting/moving targets are separate from the actual 'cursor' and instead are objects that you can drag around.
EDIT: After trying out PocketUFO, this is actually exactly how it's done there. Good idea then?


As for camera movement, drag scrolling should be fine, across all modes.

Do we have any control over the magnifying glass, or is that just given by SDL? For example, could it be made so that doing the pinch zoom gesture in the view area makes it zoom in the entire mapview (but not the UI)?
« Last Edit: November 28, 2013, 09:20:24 pm by Tarvis »

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: Android Port
« Reply #23 on: November 28, 2013, 09:57:29 pm »
Soldier movement could be handled smoothly just by having path preview cursors on by default, which makes movement based on double click actions: one should the preview, the other confirms the action, so it's pretty much flawless even if you have chubby fingers.

Also I merely suggested PocketUFO as inspiration. I like your idea of simplifying the basescape with subsections though, that might work fine.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: Android Port
« Reply #24 on: November 29, 2013, 03:04:30 am »
Yeah I think a double-click aim mode like the double-click move mode (path preview) would be sufficient, with drag scroll for the camera.

You can also look at Aliens vs Humans for another touch UI example:


Offline alienfood

  • Captain
  • ***
  • Posts: 79
  • It's people!
    • View Profile
Re: Android Port
« Reply #25 on: November 29, 2013, 08:32:39 pm »
There really seems to be some legs to this, very good work. I can see how a turn-based game would be ideal for something on a tablet that you can peck at over several weeks or months of casual play. One suggestion: have a setting to drop straight into your latest saved game at startup.

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #26 on: December 01, 2013, 10:36:53 pm »
Worked up a different layout. The idea was to make it more comprehensive (camera actions tend towards left, while unit actions tend towards the right) and also to reduce the cluttered button hell a bit.

Other changes between the are: switched Reserve Crouch/rest of reserve buttons to avoid fat-fingering the real crouch button, making you lose TUs. Since the other Reserve options are to be made into one big toggle button it'll be a lot easier to hit (and harder to hit the actual crouch button by accident)
« Last Edit: December 02, 2013, 01:07:53 am by Tarvis »

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: Android Port
« Reply #27 on: December 01, 2013, 11:37:31 pm »
It's a little too confusing. I'd recommend doing some merging to save some space, for instance:

* The "show all levels" button is considered obsolete my many. I'd do away with it.
* Don't use a prev unit button. Next unit is enough.
* See level above/below and level up/down buttons take too much space for the sake of aesthetics
* Gun windows have some needless border space which was actually cut in TFTD. Here's how to cut it:



* More radically, you could completely do away with the inventory button, and have the player access the inventory by clicking on the name or rank icon.  Stats could only be accessed inside the inventory screen.

Offline Mr. Quiet

  • Commander
  • *****
  • Posts: 523
  • Likes: Quiet things. Dislikes: Loud things.
    • View Profile
    • =Open_X_Com= Mods
Re: Android Port
« Reply #28 on: December 01, 2013, 11:41:41 pm »
Great job. You can also make the buttons on the screen transparent, or even remove the side buttons for "layers" and "next operative" so we can memorize which side we need to slide our pinky.

If this becomes very playable and everything, I'll buy me an android tablet.

Keep us up to date, and Sup post that video on the front page, because that's awesome news ;)

Offline Tarvis

  • Colonel
  • ****
  • Posts: 111
    • View Profile
Re: Android Port
« Reply #29 on: December 01, 2013, 11:50:32 pm »
I was thinking Move Unit Up/Down could be made obsolete too, by simply giving a move command to the level directly above/below the unit. Would that work?
EDIT: Turns out OpenXcom already does this! So I guess they could be gone. It makes it hard to move directly up/down when you can't see the level below you, but oh well.

And I'm not sure about removing "Show All Levels." I'd rather not remove functionality, and it is handy for quickly seeing if enemies are on the roof.

I do agree that the level up/down looks a bit jarring, but I really don't know a better way to have it. I don't think there's enough room on the bottom bar to put them.


As for the inventory button, I guess that works. If not, Minimap could be pushed into the pause menu as well, I suppose. With that and Prev Unit gone I guess there's room for Level Up/Down on the bottom after all.


While we're at it, can the menu/options button be removed too? I figure since Android phones usually have a dedicated Menu button it can just be called up by that instead.


Quote from: WeOwnTheNight
You can also make the buttons on the screen transparent
That'd be great for the level up/down buttons to make them not get in the way, but I have no idea if OpenXcom is set up to handle transparent buttons and such, especially considering it runs off of 256 total colors. They could be overlaid externally with SDL, but then they'd show up all over the entire game, not just Battlescape.
« Last Edit: December 01, 2013, 11:56:22 pm by Tarvis »