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

aka_zed
Engineer
Engineer
Posts: 3
Joined: 17 Jun 2005 14:46
Contact:

Re: Android port

Post by aka_zed »

lubomyr wrote:my attempt to create port to android
builded with crystaX ndk & pelya SDL-lib

http://anddev.at.ua/load/openttd_1_0_4/1-1-0-4
Good job!
Runs great on my orange Boston.
Really difficult to control because of very small buttons!
bokkie
Transport Coordinator
Transport Coordinator
Posts: 327
Joined: 19 Jan 2007 19:26

Re: Android port

Post by bokkie »

works for me as well on Motorola Milestone! Same problem here though, very hard to use the touchscreen to control the game. My screen has 854x400 something resolution so choosing 320x240 or something results in a skewed screen. Is it possible to add an (native screen resolution/2) option? Or maybe that should be something for trunk as well...
pelya
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Hey. I've fixed most of minor bugs in OpenTTD Android port and published it to Market. That should mean I'm an official OpenTTD Android maintainer now :mrgreen:
Sources
compiled .apk file
Download statistics and ratings
[url=market://search?q=pname:org.openttd.sdl]Market link[/url]
Last edited by pelya on 19 Nov 2010 09:11, edited 1 time in total.
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Android port

Post by Zephyris »

Where does it look for the data files? So I can save 20Mb of internet usage :)
pelya
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Zephyris wrote:Where does it look for the data files? So I can save 20Mb of internet usage :)
It downloads them from https://sourceforge.net/projects/libsdl ... a/OpenTTD/ - unzip it to /sdcard/app-data/org.openttd.sdl/ on your phone.
You'll also need this file - also put it to /sdcard/app-data/org.openttd.sdl/.
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Re: Android port

Post by SHADOW-XIII »

Awesome but there's a problem
Cannot install on my Nexus One (2.2.1) it says Installation unsuccessful.
When I look into the system logs I could spot "Package file was not signed correctly"

Edit: oh stupid me, had to uninstall non-market version obviously :)
what are you looking at? it's a signature!
User avatar
Pnaky
Transport Coordinator
Transport Coordinator
Posts: 260
Joined: 18 Nov 2004 21:31
Location: Czech Republic - Teplice - Jablonec n/N - Praha
Contact:

Re: Android port

Post by Pnaky »

I tried your port on my Desire with Froyo however it isnt playable now - resolution on screen isnt good for using touchscreen...
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Android port

Post by Zephyris »

Sad but true, this app is only suitable for any device with 640x480 or more screen resolution. You might also want to consider including my big GUI grf...
leexgx
Engineer
Engineer
Posts: 5
Joined: 06 Feb 2005 12:31

Re: Android port

Post by leexgx »

just tested this out on my HTC desire :) works well just not playable at all due to screen size

i am guessing this would would work well on an tablet android system as they have some screens that are big to fit OpenTTD, has any one tried or even own an android tablet system
pelya
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

Zephyris wrote:Sad but true, this app is only suitable for any device with 640x480 or more screen resolution. You might also want to consider including my big GUI grf...
That sounds like a solution, I'll try to make an optional download from it next week.

Edit:
I've also got one crashreport, I cannot tell for sure but it seems that OpenTTD closes because it's out of memory - it uses 200 Mb RAM on my phone, typically Android phones should have at least 400 Mb RAM but that may vary. So I want to create another package, openttd-lowmem or something like that, with music, sounds and TTF fonts disabled. Is there any way to reduce memory usage even more, disabling some caches, using unoptimized renderer etc?

Also I have a question - since 1.0.5 is out, should I silently move to 1.0.5 with the Market update, or release another package? There are 10 servers running 1.0.5 just a day after release, so I think most of servers will switch to 1.0.5 quickly.
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Re: Android port

Post by SHADOW-XIII »

OTTD needs some re-designs of the interface for small screens with big resolutions.
In my opinion it should be introduced internally in the core.
The good example is the on-screen keyboard, but it's pain because it's only usable on 320x240 and any higher resolution it become too small
The small text isn't as painful as all kind of small buttons, indeed BigGUI grf solves the problem but somehow workaround to what the problem is and another issue are windows showing out of the screen borders or the, being too big for screen and nowhere able to see the rest ... (like OTTD settings)
what are you looking at? it's a signature!
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Android port

Post by Zephyris »

There are a couple of simple fixes which would probably be trunk-worthy which could help solve these issues:

1. Automatic button/title-bar/etc. resizing according to font size. I have made some large font grfs but they are as-yet unsupported - OpenTTD does not try and detect bitmap font size. I would imagine it would be simple to scan throught the font sprites and take the mean or maximum sprite height as the font size for window layout. The variable font size code is already present in the form of TTF font support.

2. A switch which allows moving windows by a left click drag anywhere within them. While not a tidy fix this would allow use of large windows at low resolution because you can always reposition them even if the title bar is not visible on-screen. There are some windows this would not work well on (e.g. depot windows), maybe use a right click drag for moving the window?
pelya
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

I've made new release - updated OpenTTD version to 1.0.5, and added big GUI addon by Zephyris to optional downloads dialog.

Please tell me other bugs you'll find, and suggestions for more options.

I think the cursor keys/trackball should be used to move mouse cursor, not to slide terrain, what do you think?

Also you may think out some better mouse click emulation - now it's multitouch/pressure, multitouch is not present on devices with Android 1.6.

The mouse behaves wacky when I'm trying to select an item from the list - such as clicking floppy button which generates list for Save Game, Load Game and Quit. On PC you have to click and drag mouse without releasing the button to select an item, on Android this is rather cumbersome. So main devs, could you please make it into two clicks instead of one? :bow: or at least tell me which file to change. :roll:

Also I've released OpenTTD-lowmem app, with disabled sound, music and TTF fonts, it eats just 20 Mb less RAM then regular OpenTTD, however that might be enough for someone.
thror
Engineer
Engineer
Posts: 8
Joined: 16 Jul 2010 09:18
Location: Spain

Re: Android port

Post by thror »

Nice job!! I've just updated to the new version, it looks quite better with the big gui grf, I think it should be active by default, if possible.
pelya wrote:I think the cursor keys/trackball should be used to move mouse cursor, not to slide terrain, what do you think?
I think that move the cursor with keys/trackball will be more accurate than now with touchscreen.
pelya wrote:Also you may think out some better mouse click emulation - now it's multitouch/pressure, multitouch is not present on devices with Android 1.6.
My HTC Hero had Android 1.6 (now I updated to 2.1) and had multitouch functions, I think it depend on devices not Android version. Anyway, could you use the trackball pushbutton as click emulation?
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Re: Android port

Post by SHADOW-XIII »

Many thanks for the update!

BigGUI should be ON be default on resolutions 640x480+

Trackball, although usually slow in movement could be used as more precise mouse (but leaving able to use touchscreen as mouse as well) and should be clickable.

Other ideas:
- 2 fingers on screen = Right mouse button (press & hold to move screen), on 1.6 use MENU button?
- Back button works as Backspace (close a window)
- Search button as PAUSE ?
- pinch to zoom or zoom in/out using 2 fingers sliding together or away from each other?
- not following OTTD on this field but how much CTRL key is used in any combination? If there are some combinations without GUI for that so you need a CTRL key to access some things we could map it to SEARCH/MENU button)
what are you looking at? it's a signature!
pelya
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

SHADOW-XIII wrote:Many thanks for the update!
Trackball, although usually slow in movement could be used as more precise mouse (but leaving able to use touchscreen as mouse as well) and should be clickable.
I will add that.
SHADOW-XIII wrote: Other ideas:
- 2 fingers on screen = Right mouse button (press & hold to move screen), on 1.6 use MENU button?
You can already configure such behavior, through "Change device config" menu
SHADOW-XIII wrote: - Back button works as Backspace (close a window)
Currently it's Escape - it also closes some windows when pressed. Also Menu, when not used for mouse clicks, returns Delete - also closes some windows.
So, is the Backspace an ultimate hotkey for closing any window on screen? I haven't played OpenTTD other than to see if it really works, so I don't know such things.
SHADOW-XIII wrote: - Search button as PAUSE ?
Search/Call/Trackball center buttons are all mapped to Enter. Can the game work without Enter key? If so I'll remap them to Pause.
SHADOW-XIII wrote: - pinch to zoom or zoom in/out using 2 fingers sliding together or away from each other?
Another nice feature, I'll make such gesture to return KP_PLUS and KP_MINUS on SDL side.
SHADOW-XIII wrote: - not following OTTD on this field but how much CTRL key is used in any combination? If there are some combinations without GUI for that so you need a CTRL key to access some things we could map it to SEARCH/MENU button
Most modern touchscreen devices have only 4 usable hardware buttons - Menu, Back and Volume Up/Down. Many devices have Search button, but not all of them (Chinese Android touch tablets usually lack it). Also there are more limitations - you cannot hold Menu or Back or Search and touch screen simultaneously on HTC Evo, because those buttons are just extension of screen touch panel, so the touch is not recognized.
If you'll think up how to bind all that actions to 4 buttons I'm listening :P
werwolf
Engineer
Engineer
Posts: 2
Joined: 24 Nov 2010 17:38

Re: Android port

Post by werwolf »

This is an amazing OpenTTD Android port! Runs very nice on my Galaxy S.
I use BigGUI addon and it is like a charm.

I put the right click on the "menu" key, and now it is easy to reach the drop down menus like exit current game.
And I navigate with the acceleration sensor, excellent.

I can even download online content and join Internet multiplayer games, amazing.

2 minor things, can we get the AI working? That makes single player full usable.
How can I set my multiplayer name permanently? If I write a name on the top right in the multiplayer window, the game forgets it when i join the net game and says type /name to set my name other than default. Looks like it doesnt remember my entered name, can i edit some .cfg file to have my name changed permanently?

Keep up the good work, very nice job
pelya
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 18 Nov 2010 19:48
Contact:

Re: Android port

Post by pelya »

I've added a bug for GUI usability changes on Android.
http://bugs.openttd.org/task/4270
I will add other features such as trackball mouse from SDL side.
Comment if you need something else.
SHADOW-XIII
Tycoon
Tycoon
Posts: 14275
Joined: 09 Jan 2003 08:37

Re: Android port

Post by SHADOW-XIII »

thanks.
the replacement for drag&drop to click-once-to-start-and-once-more-to-stop dragging is the most crucial, looking forward for it !
what are you looking at? it's a signature!
User avatar
NekoMaster
Tycoon
Tycoon
Posts: 4001
Joined: 16 Aug 2008 22:26
Skype: neko-master
Location: Oshawa, Ontario, CANADA

Re: Android port

Post by NekoMaster »

Might I suggest a reworking of the GUI's so that more screen space can be devoted to playing rather then GUI. For the main toolbar at the top why not try making it so that it can be reduced to a small button to the left or right (or center) with a [<], [>] or a [\/] button to summon the bar when needed but can be configured to auto hide when you choose to build something or open a new window (company window, vehicle lists, etc)

Also, if a scaling alg. can be implimented maybe we could shrink the size of some graphical buttons or make a newgrf that includes smaller graphics (or a combination of both if people want to play with newgrfs that add stations, waypoints, etc)

I may not have an android (both types :p) but I'd love to see a port to it for if I ever do get an android
Image Proud Canadian Image
Nekomasters Projects! (Downloads available on BaNaNaS!) \(>^w^<)/
# NARS ADD-ON SET 2CC | 2cc Rapid Transit For Me! (2ccRTFM) | 2cc Wagons In NML (2ccWIN)
# NML Category System (Organize your GRFS!) <- TT-Forums Exclusive Download!
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 52 guests