Android port

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

[I've published an update.

- Bumped version number to 1.4.2
- Put all game data inside the .apk file, thanks to new superior .xz compression. Now .apk file size is 47 Mb, which will disappoint some folks, without any doubt.
- Removed antique armeabi architecture, to hit Google Play .apk size limit of 50 Mb, that shaved off approximately 3 megabytes. Maybe I will also remove MIPS arch in the future - I've never seen any device with MIPS architecture. That will disappoint even more folks. x86 tablets are quite common now though.

Next version will have a reworked map window, I promise :)

I have a question to the actual OpenTTD devs - is 1.4.2 a final version of 1.4 branch, or will there be another one? I would like to switch to master branch for my future development.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Android port

Post by Rubidium »

pelya wrote:is 1.4.2 a final version of 1.4 branch
Doubtful. At least until 1.5.0 is released there is a chance of yet another 1.4 based release happening. For example, 1.1.5 was released between 1.2.0-beta2 and 1.2.0-beta3, and there is nothing preventing us from making another 1.4 release even when the 1.5 branch has already been made (but no 1.5.0 has been released yet). Though... most of the time such releases during the betas and RCs of the next release are due to fixes for security vulnerabilities.

Even then, we normally try to make a release every two months until the next beta cycle starts (lately just before Christmas). dec-aug => 4 months, so... there is likely to be a 1.4.3 in the future and maybe even a 1.4.4.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Rubidium wrote:there is likely to be a 1.4.3 in the future and maybe even a 1.4.4.
Mmm. I have only three changes scheduled for Android version, I can backport them between branches just okay. Maybe four changes, if I'll get really really bored, and decide to fix the scenario editor UI.
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Android port

Post by oberhümer »

There's a game-breaking bug in the current port version (1.4.2), at least for me: It's impossible to open dialogs by tapping objects on the map, which makes it impossible to buy vehicles in a depot. I tried single, double, and two-finger, as well as a resetting in-game and app settings.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
fizze
Engineer
Engineer
Posts: 22
Joined: 08 Feb 2005 07:35
Contact:

Re: Android port

Post by fizze »

I just updated and it works just fine for me.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Uninstall and reinstall, that should fix all problems.
Don't forget to back.up your save games.
User avatar
Zhall
Tycoon
Tycoon
Posts: 1237
Joined: 17 Jul 2007 01:36
Skype: moonray_zdo
Location: Teh matrix, duh.
Contact:

Re: Android port

Post by Zhall »

Good job fixing support for touch screen only, I'm finally able to play this again.

I'm going to develop a 1,024x1024 map while I jog for a few months and post the save around here somewhere.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Version 1.4.2.34 is published
  • Cloud save support. It asks for crap-ton of permissions, blame Google Play Game services for that - OpenTTD will definitely not manage your Google+ activity, and don't expect any leaderboards or achievements.
  • Fixed minimap window, now legend can be hidden or shown with a button.
  • Fixed town authority window.
  • I've learned how to create lists in my posts
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Android port

Post by oberhümer »

One more thing: There used to be a way to scroll and continue scrolling without lifting your fingers (two-finger scrolling, I believe). It would be very useful to have that again - something like a virtual D-pad might work. As is, you either need to open and close the minimap all the time or lift and re-place your fingers all the time.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Yup, in the initial release a two-finger touch scrolled the map continuously, the problem was that it scrolled through half of a map with the slightest touch, and also in the opposite direction of what you have used to on touchscreen. I think I'll bring it back, with more sane scrolling speed.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Android port

Post by planetmaker »

Right, so I gave the 1.4.4 version I found today on GooglePlay store a shot, kinda as one of the first things I tried with that phone. Just let me use this as place to note down the first impressions so that they don't get lost and forgotten from when I tried this first time on an android phone:

The impressions are mixed, but you definitely did some steps in the right directions from the UI and input handling.

* The toolbars on the left and right side is a good choice for the extremely wide phone screens
* The font could be slightly bigger, given the button sizes (though it's ok, it's readable, just looks funny)
* The toolbar sprites seem too small for the buttons. Twice their size would work well. Probably can profit from trunk's GUI scale feature
* The click+hold for many of OpenTTD's menus does feel extremely bad for me when using a touch device. Click should open, another click select sub-function. Or did I miss something how to do that?
* I didn't exactly enjoy placing stations or tracks either... it ended up for me rather as random placement of random track tiles :D I've no real good alternative suggestion here though. And I didn't try to place with much patience every single tile. Probably we need something like adf88's polyline track building tool with a preview function before it's actually built. Or maybe generally also here a double confirmation for placing stuff....

Things might look different again, had I tried on 10" screen instead of 5".
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Android port

Post by kamnet »

I did recently try it (1.4.2, I think?) on a Samsung Galaxy Tab 10.1, it's better, but Planetmaker's fairly spot on. Placing stations and tracks felt a little easier.

As an aside, it would be great if the polyline tool were to make it into trunk. That would really boost track building ability on mobile devices.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

I'm being quite lazy lately, and also busy with my job, but I've got some free time this week for OpenTTD.
Currently the biggest issue with Android port is the lack of tutorial - mobile users are impatient and don't want to read the wiki.
I've tried the tutorial scenario, and it's too wordy and limited to my taste, and also offers only two translations, so I think it's better to put several short videos to Youtube, and open them from the main screen. Like, show how to build rails/roads, how to cancel your action with two-finger tap, how to build bus/train stations, how to connect them, how to buy buses/trains, how to give orders, and how to add AI to the game (because I've had to dig through wiki to find out that AI is activated only on 3-rd year into the game).
So, what do you think?

In case anyone wants to help me with videos, here's a tutorial - you don't need root for that, but you will need to enable "Show touches" in Android developer options, to show where you are touching the screen. I recommend using higher bit rate, because otherwise video might end buggy:

Code: Select all

adb shell screenrecord --bit-rate 10000000 --verbose /sdcard/video.mp4
And, please, no extra mods or GRFs, fresh new OpenTTD installation is preferred.

Now, on planetmaker's comments.
The toolbars on the left and right side is a good choice for the extremely wide phone screens
This feature broke the tutorial scenario, I hope no one will notice :roll: but yeah, it's mandatory for mobile UI.
The font could be slightly bigger, given the button sizes (though it's ok, it's readable, just looks funny)
Current font sizes are:

Code: Select all

small_size = 10
medium_size = 12
large_size = 16
mono_size = 12
I think increasing font size will make some dialogs too big to fit the screen, easiest way is to release new version and wait for user complaints ;) you may also increase font size through game options, and see which dialogs stop working.

Current default button size is 40 pixels, the maximum. I don't want to shrink it, because it makes OpenTTD borderline playable on 5" screen with just a finger, opinions and fingers may vary though. Also, the default 854x480 resolution fits 12 vertical buttons exactly, and with 36-pixel buttons it will be 13 buttons + 12 pixels of ugly red border.
The toolbar sprites seem too small for the buttons. Twice their size would work well. Probably can profit from trunk's GUI scale feature
I'll just wait for OpenTTD 1.5 then, because I'm lazy.
The click+hold for many of OpenTTD's menus does feel extremely bad for me when using a touch device. Click should open, another click select sub-function. Or did I miss something how to do that?
It's bad indeed, but don't worry, you'll get used to it after 4 hours of playing. I wanted to fix that long time ago, but got stuck in the unfamiliar code, and then opened a bug, which didn't work out so well, because it would break quick access feature. It would be nice to have though.
I didn't exactly enjoy placing stations or tracks either... it ended up for me rather as random placement of random track tiles :D I've no real good alternative suggestion here though. And I didn't try to place with much patience every single tile. Probably we need something like adf88's polyline track building tool with a preview function before it's actually built. Or maybe generally also here a double confirmation for placing stuff....
Touching the screen with another finger will cancel current action, like putting misplaced tracks. It works rather well after you do it a few times, but I don't know how to describe that to users in a convenient way, currently it's only in the description on Play Store. I don't like to implement a confirmation dialog, it's awkward and adds a lot of ugliness to the code, although if we really have to, we can reuse some of Juanjo's patches. Polyline would be nice too, but I'll be waiting until it get merged to trunk, and released in 1.5.

I also want to hide all windows when performing an action on the map, like laying tracks or creating station or selecting destination, which is especially painful with vehicle orders window covering half of the screen.

By the way, why station_show_coverage is set to false by default? I would rather have it always enabled.
Eddi
Tycoon
Tycoon
Posts: 8258
Joined: 17 Jan 2007 00:14

Re: Android port

Post by Eddi »

pelya wrote:
The toolbars on the left and right side is a good choice for the extremely wide phone screens
This feature broke the tutorial scenario, I hope no one will notice :roll:
it might be unbroken by adapting the script api.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

I've published an update: Google Play, direct download, touchscreen GUI is now better than ever.
  • position all 'build station' windows in the top-right corner.
  • hide all windows when selecting a vehicle destination station or building an airport.
  • fixed too big railroad semaphore dialog buttons.
  • two-finger tap no longer de-selects current tool and closes build station window.
  • main toolbar menus do not auto-close anymore.
  • two-finger scrolling is now continuous, it's not very quick to stay manageable.
I can also hide all windows when building road or rail stations, not just airports, but their windows seem small enough for me, what do you think?
Next big change is the tutorial sigh. I'll record the video, could someone please do a voice-over narration, in multiple languages preferably? Youtube has a nice video editor for these kinds of things.
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Android port

Post by oberhümer »

Nice update overall. One comment though:
  • main toolbar menus do not auto-close anymore
This is a step in the right direction, but they're not quite there yet. I found I was trying to use them like the standard Android overflow menu button, i.e.:
  • A tap on the button opens the menu
  • A tap on a menu item or anywhere outside the menu area closes the menu
  • Tapping the button and dragging allows selecting a menu item without lifting your finger
It seems like the most intuitive solution, not sure about the implementation. Would be nice to have in regular OpenTTD too, with "tap" replaced by "click".
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Android port

Post by Alberth »

A click currently selects the first item iirc, which is also the most used function.
Changing it would mean you almost double the number of clicks at the toolbar.

On the other hand, new users are often confused about the menus, they don't expect them in the toolbar, your way would expose them more often.
Being a retired OpenTTD developer does not mean I know what I am doing.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Alberth wrote:A click currently selects the first item iirc, which is also the most used function.
Ye,s it was confusing to me at the beginning, and Plametmaker likes it more with two taps.
Menus with just one item will still auto-select it.
Tapping the button and dragging allows selecting a menu item without lifting your finger
I didn't know standard Abdroid menus work this way. It works in Google+ app, but does not work in GMail.
Anyway, clicking outside menu should close it, I agree.
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: Android port

Post by oberhümer »

I didn't know standard Abdroid menus work this way. It works in Google+ app, but does not work in GMail.
I didn't either until a short time ago. In fact, I only discovered it accidentally. It seems to be a quite recent addition.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

My first Android tutorial is ready. It covers touchscreen basics and creating a bus service.

Youtube link, video file for download, video editor project file, subtitles file.

It does not have an audio track, so I would like to ask you to narrate it in your favorite language, and upload to Youtube. I will then put all Youtube links into the next Android OpenTTD release, in two-three weeks.
You don't need to strictly follow my subtitles, they are just a suggestion.
Youtube has a video editor that can do that, however it re-compresses the video, so the resulting video loses a bit of quality.

Feel free to post feedback and suggestions. Some details in video can be re-done, like scenes duration or effects.

Next video will probably be railroad building, but don't expect it until next month.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 12 guests