The International Simutrans Forum

 

Author Topic: Simutrans for Android: is it possible?  (Read 27293 times)

0 Members and 1 Guest are viewing this topic.

Tontarelli

  • Guest
Simutrans for Android: is it possible?
« on: December 20, 2010, 02:10:05 PM »
Well, I am a fan of simutrans, just love it. So I have device that runs on android, I'd love to play it there. Is it possible? I've seen Czech android discussion but I don't understand a thing.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Simutrans for Android: is it possible?
« Reply #1 on: December 20, 2010, 02:49:32 PM »
Since android uses SDL, download sourcecode and compile should work straight forward.

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Simutrans for Android: is it possible?
« Reply #2 on: May 23, 2012, 01:21:27 AM »
I have attempted to compile an app for android with the drunken 10 step guide, but I'm totally stuck at step 4, trying to compile SDL 2.0.  :-[

I will say, that this is not for the faint of heart and the guides for compiling SDL for android are outdated by quite a bit.

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2348
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Simutrans for Android: is it possible?
« Reply #3 on: May 23, 2012, 07:58:28 PM »
I have tried to play openTTD on android tablet, but it's almost unplayable without mouse. So it's not only about compiling, but also about some adjustments of user interface for touchscreen.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Simutrans for Android: is it possible?
« Reply #4 on: May 23, 2012, 10:24:12 PM »
OpenTTD has double size interfaces. The UI of standard also moves (slowly) to a scalable interface. That would also allow for larger buttons. Apart from dragging (which is not really needed), I am not sure where mouse sopport is indepensable in simutrans.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Simutrans for Android: is it possible?
« Reply #5 on: May 23, 2012, 11:14:52 PM »
Touch devices can use long press.
So, press can be left click,
long press ctrl + click,
normal drag move the map or the dialog,
long press + drag could be drag tool...

Offline sdog

  • Devotee
  • *
  • Posts: 2039
Re: Simutrans for Android: is it possible?
« Reply #6 on: May 23, 2012, 11:20:23 PM »
building ways is almost impossible without draging ways. The method clicking at start and end tiles produces not very predictable results (rail tracks with sudden 90 degree curves). Building double track that way is not possible. Ctrl-click is also most of the time necessary to build double track, especially at diagonal track sections.

The interesting thing is, often adjustments to UI for tablet use also improve desktop use (recent example is gimp, but also gnome shell or ubuntu unity)

A way to solve the building and get rid of the ctrl click would be: Painting the way.
- The player paints a curve on the screen, where she wants the way to be built.
- A second click or tap on the line causes the way to be built.
- The chosen way is marked by a blue overlay (similar to the overlay indicating routes)
- way builder builds way connected between adjoining path tiles


Exceptions:
- diagonal too close to an existing diagonal same way type.
- ambiguous sections (eg way more than a tile wide)
- illegal way building

In those cases the problematic sections change are highlighted in red or yellow.

Yellow requires the player to touch/click again to build (that is joining parallel tracks for example) Red requires clarification by re-painting, or a click on a blue, unproblematic section that will in turn be built. If the red, illegal path, is not adjoining a blue proposed way it will just dissapear. (E. g. pull line crossing a river, with a way without fords. on either side of the river the path is highlighted in blue, the river tile red. touching either blue branch causes it to be built. when both sides are built, there are tracks up to the river the red path dissapears. [An alternative, make rivers yellow, clicking would build the default bridge for the waytype/speed] Same example, instead of touching blue and building, touching red would remove the whole path or cause any other resolution to be found)

Offline falconne

  • *
  • Posts: 51
Re: Simutrans for Android: is it possible?
« Reply #7 on: May 24, 2012, 02:32:52 AM »

A way to solve the building and get rid of the ctrl click would be: Painting the way.


I tried creating a design mode a while back. I ended up deciding it causes too much complication, and it would be better to have the bulldozer produce a full refund for a short period after building.


I think there's more design changes needed before the current UI can be effective on a touchscreen device, especially phones. The UI elements would need to be bigger, which means the dialogs would have to be less busy.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Simutrans for Android: is it possible?
« Reply #8 on: May 24, 2012, 04:45:40 AM »
I can't see how Simutrans can be played in full on a handheld device. It would have to be some kind of Simutrans Light, more suited for simpler gameplay and smaller maps than requested by players on computers with larger displays. Simutrans Light could share the underlying code, but would have a different set of paks. Except that one might use Simutrans on a handheld device to check in on a running networked game, without intention of doing any serious building or administration.

Offline transporter

  • *
  • Posts: 136
Re: Simutrans for Android: is it possible?
« Reply #9 on: May 24, 2012, 06:26:40 AM »
I think Simutrans is only possible with something larger than the Galaxy Note. Since it has a stylus it would be more accurate. But using your fingers on a screen that small isn't practical. I downloaded TTD and it was really awkward to use.

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Simutrans for Android: is it possible?
« Reply #10 on: May 24, 2012, 07:47:13 PM »
I was trying to compile it for my asus transformer w/ dock. One neat thing for this model is that you can use keyboard and mouse if you have the dock.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Simutrans for Android: is it possible?
« Reply #11 on: May 24, 2012, 10:12:24 PM »
Just a remark: Until a year or so, way building with just clicking was the only way to do ...

Offline Vladki cz

  • Devotee
  • *
  • Posts: 2348
    • My addons, mostly roadsigns
  • Languages: EN, CS
Re: Simutrans for Android: is it possible?
« Reply #12 on: May 27, 2012, 08:35:26 PM »
Just a remark: Until a year or so, way building with just clicking was the only way to do ...

Yep, and in those times, the only way to build double diagonal track was (for me) to build it tile by tile.
And that is maybe one of the reasons why I was not playing simutrans for some time in favor of openttd.
But now I prefer simutrans.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17764
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans for Android: is it possible?
« Reply #13 on: May 28, 2012, 06:27:37 AM »
As Ters says, the full game will probably be a bit much for Android devices. Experimental has in some areas (particularly private car route finding, although that code is probably inefficient) been hitting the limits of what desktop computers can manage without unacceptable performance. Standard is lighter than Experimental, but one would still need to be restricted to a fairly small game (in modern Simutrans terms, at least) for it to be workable, and with a small size pakset (pak128, for example, would probably be too large).

I should note, however, that Standard (but not Experimental) has in the past sucessfully been ported to iOS.

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Simutrans for Android: is it possible?
« Reply #14 on: May 28, 2012, 08:00:28 AM »
"ported" to iOS - kind of. The existing one lacks any kind of usable UI.

The main issues are adding hooks to many sections of the game to allow it to interface with the native UI elements provided by iOS or other mobile platforms. E.g. when you tap on a text entry field to begin editing it there needs to be a hook to allow iOS/Android to show the software keyboard and focus the entry box, and then to hide it again when done.

That's just one example though. The first step is to extend the current events system to add touch events, then provide platform-dependant hook methods for native UI functionality (which could benefit non-touch platforms too). It's a lot of work which I had planned to undertake once I got the OSX port working nicely and added to the app store (this would give a full working implementation of the game within a Cocoa shell along with package management for in-game download of paksets which is another needed feature on mobile platforms).

Anyway, as with all things I can't work on any of this until after my exams are finished. So if someone else wants to make progress in the meantime be my guest. Just don't under-estimate the work - it isn't just a case of compiling the source...

(In terms of performance, if you stick to smaller maps then it should run just fine. Recent phones are very capable computing devices)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Simutrans for Android: is it possible?
« Reply #15 on: May 28, 2012, 08:03:43 AM »
[...]and with a small size pakset (pak128, for example, would probably be too large).
I actually thought large pak-sets, but small maps would be the thing for handheld devices. The tiles must be roughly fingre sized to so that players can reliably hit just one tile. As these small devices are getting quite high dpi, a tile size of 64 might be too small. The drawback of making it easy to click is that you can only see an area of a few tiles2. To get an overview, one would have to zoom out. One could of course also zoom in to edit, but one would then have uglier graphics when editing. Or the paks could contain graphics for two zoom levels, so that both look as good as it gets.

What really makes the light version lighter is a reduction in tools and gameplay complexity. Otherwise the tool bar would fill almost the entire screen, or would have to be remade into some system of submenus which would make finding the tool more difficult.

I imagine the most complex dialogs will fill most of these small screens, especially since the size of clickable things would most likely have to be increased. They must either be simplified or removed, losing some functionality, or made into full screen dialogs. When entering a full screen dialog, the game should perhaps pause automatically, except the minimap. Dialogs that allow you to click on something to locate it in the map would need to put themselves into the background, from where they can quicly be restored as they were.

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Simutrans for Android: is it possible?
« Reply #16 on: May 28, 2012, 08:37:10 AM »
I made a screen shot to see what sort of UI problems you would have on android tablets. Most common size is 1280x800, but the bottom bar eats up around 60 to 80 pixels, so you might be looking at closer to 1280x720.

The current icon size, I think it's 48 pixels, is not large enough. I think around 2x the size, 96 pixels, would be finger friendly. The android buttons are roughly 96pixels wide, but, clearly, they are more rectangular compared to the simutrans buttons.

Since I know space will be at a premium, 80 pixel square would be the most minimum for most fingers.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Simutrans for Android: is it possible?
« Reply #17 on: May 28, 2012, 07:07:17 PM »
There are scrollable menu bars; z9999 did them a while ago. Those are shown, when a maximum menubar width and height are exceeded (specified in simuconf.tab, toolbar_max_width and toolbar_max_height).
« Last Edit: May 28, 2012, 07:38:20 PM by prissi »

Offline Bricktop

  • *
  • Posts: 14
Re: Simutrans for Android: is it possible?
« Reply #18 on: December 24, 2012, 01:14:54 AM »
Sorry for necro bumping, but I would like to take a look at the port that ӔO made.

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Simutrans for Android: is it possible?
« Reply #19 on: December 24, 2012, 01:59:02 AM »
I never made the port, or at least I never got anything useful out of it.
The only thing I made was a 1280x800 screen shot that I used to see how it would look on an android device.

Either way, I've abandoned it, because now you can buy x86 tablets in a reasonable size.

I've tested simutrans out on an Intel atom Z2760 and i5-3317U and from what I can tell, a small game of simutrans standard will run on the atom, while the i5 will happily run simutrans experimental with 13000 convoys.

Seeing as how current ARM SoC vastly underperforms a Z2760 in computation, I don't see anything less than a Tegra4 or qualcomm S4 1.5Ghz will be able to run simutrans in any decent manner.
« Last Edit: December 24, 2012, 02:06:49 AM by ӔO »

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1148
    • Simutrans-BLOG
  • Languages: ES
Re: Simutrans for Android: is it possible?
« Reply #20 on: December 29, 2012, 03:51:33 AM »
Expand to mobile platforms can give much fame to Simutrans, in my humble opinion 8)






News of Simutrans on facebook

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17764
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans for Android: is it possible?
« Reply #21 on: December 29, 2012, 11:50:02 AM »
Expand to mobile platforms can give much fame to Simutrans, in my humble opinion 8)

The trouble is that no mobile device has a processor capable of running all but very small games in Standard, and one that did would use all its battery in a few minutes...

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Simutrans for Android: is it possible?
« Reply #22 on: December 29, 2012, 01:17:18 PM »
Honestly, don't mobile devices have at least the power of older desktops (e.g. Pentium 1 and 2) for which we still keep compatibility?
Sure it would be advisable a dedicated pakset, like 32 comic.
It might be a showcase project in google play (formerly Android market) which could introduce many new players to Simutrans and lure them into downloading the desktop version.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Simutrans for Android: is it possible?
« Reply #23 on: December 29, 2012, 03:05:57 PM »
Maybe in some areas, maybe not in others. Different arcitectures might be hard to compare. Even different families of PC (x86-based) CPUs are hard to compare. The days of just looking at the clock frequency are long gone.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Simutrans for Android: is it possible?
« Reply #24 on: December 29, 2012, 09:57:42 PM »
A Pentium 1 was with <120 MHz; those have indeed be surpassed by current smartphone. But thos had trouble to run a 128x128 map with 5 fps.

A normal smartphone is probably just enough to run a 256x256 map with 15fps. (Depends also much on the screensize.) But the interface is not up to touchscreens, and the battery will be empty in like in the batterery drain benchmarks (few hours at most).

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17764
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans for Android: is it possible?
« Reply #25 on: December 29, 2012, 10:06:03 PM »
I do have a pipe-dream about a "Simutrans Investor" app.: the main game (I was imagining Experimental, but in principle it could work with Standard) could be modified so that players have no "free" money with which to start the game, but must rather raise money, and then continue to raise money thereafter if they wish to expand beyond their current bank accounts. Players of "Simutrans Investor" (either on desktop or smartphone) would start with a pot of money and be able to invest it in different players' companies in the game (by way of bonds, for example), and their goal would be to make successful investments (monies would be lost if the players went bankrupt).

Alternatively, one might have a monitoring app for online games which will give players finance and line statistics, and the latest news/chat from the ticker.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2256
Re: Simutrans for Android: is it possible?
« Reply #26 on: December 29, 2012, 11:13:41 PM »
The problem is current smartphones, while they might have a raw processing power similar to that of an early Pentium III are hugely different in architecture - they are likely to have 2 or more cores, which simutrans makes relatively little use of. Nevertheless, a reasonable sized map (up to 512x512 I would have said) should be playable on the latest iPhone, iPad, and top end Android devices. Tablets would be easier to use with the screensize, but touch interface is still a problem.

As for a monitoring app - the best way for this would be for the server to output statistics to an XML file (or similar) that was then read by the app. Transferring the entire saved game over a 3g connection (or even wireless) would not be fun, especially for other people facing a pause while this went on, and the phone would likely struggle to run the game even without most of the graphics.

I'm not sure how you would prevent abuse with a "Simutrans Investor" app - what is to stop people logging in on their phones to invest in the same company they are running on the computer, potentially many times?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17764
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans for Android: is it possible?
« Reply #27 on: December 29, 2012, 11:29:49 PM »
As for a monitoring app - the best way for this would be for the server to output statistics to an XML file (or similar) that was then read by the app. Transferring the entire saved game over a 3g connection (or even wireless) would not be fun, especially for other people facing a pause while this went on, and the phone would likely struggle to run the game even without most of the graphics.

Yes, it'd definitely have to be done this way.

Quote
I'm not sure how you would prevent abuse with a "Simutrans Investor" app - what is to stop people logging in on their phones to invest in the same company they are running on the computer, potentially many times?

The only way to prevent this sort of abuse, I think, would be (1) to limit the number of investors per game; and (2) require some sort of identity verification to ensure that no investor was a player, or vice versa. The latter might be more trouble than it is worth. As I wrote - a pipe dream...

Offline Ashley

  • Coder/Patcher
  • Devotee
  • *
  • Posts: 1288
    • entropy.me.uk
Re: Simutrans for Android: is it possible?
« Reply #28 on: December 30, 2012, 01:09:53 AM »
If I were going to implement this I'd design a REST interface and build it into the game server, such that data could be queried by the app (or anything else which wanted to get at it).

As for mobile platforms, IMO (as I've said before) the biggest problems are the UI (interfacing with "soft" keyboards and touch events) and pausing/resuming the game when you open/quit the app. Processing power is, IMO, really not any more of an issue than on the desktop version - battery life is much more of a concern!

Offline hreintke

  • *
  • Posts: 167
Re: Simutrans for Android: is it possible?
« Reply #29 on: December 30, 2012, 11:09:14 AM »
LS,

More or less off topic but I agree with Timothy on the REST interface. Would open a lot of opportunities.

Herman

Offline Bricktop

  • *
  • Posts: 14
Re: Simutrans for Android: is it possible?
« Reply #30 on: December 31, 2012, 02:13:33 PM »
I actually think You're all underestimating the power of androids :D, with the flux of new cheap 7 inch nexus devices, and cheap 5,5 inch "phablet"s its only a matter of time people will be playing more "serious" games on their mobiles. Only thing we need now is a android sdl port or an actual tutorial . To all who still doubt how simutrans would be played on mobiles, please check the android port of Theme Hospital. Its called CorsixTh and it performs pretty decent on my tegra 3 device.

Offline AP

  • Devotee
  • *
  • Posts: 1202
  • Languages: EN
Re: Simutrans for Android: is it possible?
« Reply #31 on: December 31, 2012, 02:37:36 PM »
Alternatively, one might have a monitoring app for online games which will give players finance and line statistics, and the latest news/chat from the ticker.

This would be VERY useful. Especially if it could provide alerts to key items, e.g. player-vehicles which had just become "stuck".

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Simutrans for Android: is it possible?
« Reply #32 on: December 31, 2012, 02:46:16 PM »
I would think of a program & app to interface with a net game without downloading the save.
It could query the server and get
1) the mini map updates every minute or so without vehicles
2) a minimap vehicles overlay updated every second
3) some financial data
It could send back to the server some basic commands (e.g. Add a vehicle to a line cloning existing ones) which would executed if possible or ignored.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17764
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Simutrans for Android: is it possible?
« Reply #33 on: December 31, 2012, 03:10:04 PM »
I think that the minimap thing would not be easy, as most servers are compiled without graphics, and the minimap requires the graphics modules that are omitted in the server builds.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Simutrans for Android: is it possible?
« Reply #34 on: December 31, 2012, 04:49:46 PM »
The minimap is compiled without any graphic routines. However it costs very much time to compute it. Thus only the visible region is show, and it is only updated every month. A server continiously updating the minimap may be too much. Furthermiore I think a minimap without options is not very useful, some people want to see ownerships, vehicles or other stuff. The only way to compute it, is to actually work with the map data, i.e. join a game.