News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Updated Simutrans 122.0 r9274 - APK for Android

Started by krosk, August 16, 2021, 01:59:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

krosk

Hello Simutrans fans, android gamers,

Fresh from my build machine.

Link to Simutrans for Android, v122.0 r9274, SDL1.2 backend; signed by a non-official authority (me basically)
EDIT: link deleted; go to github to get newer APKs: https://github.com/aburch/simutrans/releases/tag/Nightly

What works?
I can install it on a POCO X3. Set installation from unverified sources if you please.
I can launch a new game.
It has only pak64 - Maybe additional paks can be added into the data folder of simutrans, I did not try.
More than that and it is unknown territory; let me know if you manage to play with it.

How has it been done?
This port is unofficial. Here is the repository of this work: https://github.com/krosk/simutrans-android-docker-build.

It builds over the work of pelya (https://github.com/pelya/commandergenius) on sdl 1.2 for android, his 2013 early port of Simutrans, and his fresh attempt in June 2021. On SourceForge (https://sourceforge.net/projects/libsdl-android/files/Simutrans/) there is an APK for version 121.0, unfortunately tagged for broken video.
My contribution is:
- troubleshooting pelya's latest attempt at building Simutrans... and finding a rather simple fix
- figuring out which modern pieces are required to build an Android APK with Simutrans
- making a Dockerfile to standardize a working build environment, combining pelya's repo, Simutrans repo, and Android SDK/NDK

Why?
Simutrans is a good free open source game, but as of yesterday there was only one version from 2013 remaining available for Android. Other community-driven, big, free open source games (CDDA comes to mind) have Android ports, so it is a bit sad/unfortunate to not being able to play Simutrans on the go. My understanding from scouring the forum past topics on the subject, is that there is not a lot of interest, time, and Android expertise from the current maintainers to build and maintain an Android version: Build environment is seems the biggest obstacle for targeting Android. If it is hard, obtuse, or impossible to build, you cannot get people on board. So I faced head-on this obstacle.

The docker format allows anyone familiar with it to pick up the Dockerfile and build Simutrans without having to go through the headache of setting up the environment. In hope that this inspires more regular releases for Simutrans, and maybe someday directly from the Simutrans team?


Enjoy!


krosk

Quote from: Yona-TYT on August 16, 2021, 02:06:47 PM
Forbidden Error 403  ???
Permissions fixed. Try again?
EDIT: Link fixed to a public one too.

prissi

Thank you for your very welcome addition.

I would like to build and release it, mainly using Github actions. I tried to use the pelya setup (I asked him and he did update his build mechanism thi year). However, it seems his build only works in a very specific setup, which I could not reproduce in a decent amount of time. Furthermore, SDL 1.2 has some drawbacks (like missing IME support) and does not automatically detect the language setting.

Having said that I am very grateful for setting this up. However, the readme seems a little short on how to actually suceed. Docker is not really an option, since the server I cammand have severe limits in hard disk space. Gihub has the ndl, but again may attempt were not successful (because I do not really have any Android programming experience.) I will see if you docker file can help to set up a nightly buld (and thus release) server.

It would be great if we could get an android folder that uses cmake (or whatever) for download and build an Android version for each nightly to stay in sync with development.

Yona-TYT

#4
I've given it a preview, and the biggest drawback is that I can't click the options icon on the toolbar, it sends me to the keyboard input method.
Another thing that is not is that it is impossible to zoom in and out with 2 fingers, is it possible to implement that?.

krosk

Quote from: prissi on August 16, 2021, 02:39:40 PM
Thank you for your very welcome addition.

I would like to build and release it, mainly using Github actions. I tried to use the pelya setup (I asked him and he did update his build mechanism thi year). However, it seems his build only works in a very specific setup, which I could not reproduce in a decent amount of time. Furthermore, SDL 1.2 has some drawbacks (like missing IME support) and does not automatically detect the language setting.

Having said that I am very grateful for setting this up. However, the readme seems a little short on how to actually suceed. Docker is not really an option, since the server I cammand have severe limits in hard disk space. Gihub has the ndl, but again may attempt were not successful (because I do not really have any Android programming experience.) I will see if you docker file can help to set up a nightly buld (and thus release) server.

It would be great if we could get an android folder that uses cmake (or whatever) for download and build an Android version for each nightly to stay in sync with development.

prissi, I am happy that this work is garnering your interest towards a nightly Android build, which would be awesome. I am not an Android programmer either, but I will gladly contribute as long as I have momentum on this project.

A few comments:
- pelya's has done some work for his android port of SDL2, but it is outdated and I could not manage to build the APK with it. But at this stage, there is no alternative to his port of SDL and his building scripts to generate APKs.
- Please forgive the readme which is VERY light in explanations, let alone details (technical or not). It was a dump for personal notes so I do not forget commands. To setup the build environment, you will have more information from the docker file and the comments.
- I understand docker not being an option for the build server. So be it !
- I have not been in contact with pelya, so I do not know his specific setup. However, the dockerfile starts from a fresh ubuntu 18.04 machine, installs the bare minimum dependencies, retrieves source from specific versions, downloads a pakset.
Then I fire up a docker container and launch ./build.sh simutrans. The APK is generated that way.

Quote from: Yona-TYT on August 16, 2021, 02:53:55 PM
I've given it a preview, and the biggest drawback is that I can't click the options icon on the toolbar, it sends me to the keyboard input method.

Yona-TYT, quite annoying right? The position of the on-screen button for the keyboard, hopefully, can be configured. When you start the app, there is a SDL splashscreen with a "Change device configuration" button at the top. Touch it, then navigate through the menus
- On-screen keyboard
- Customize on-screen keyboard layout
move that pesky arrow out of the corner then validate.

Regarding the zoom in/out with 2 fingers, if it is available in OpenTTD, it should be possible in simutrans. I do not know if it is the case.

krosk

#6
I have looked into github actions; I am tinkering with example yaml workflows at https://github.com/krosk/simutrans-android-docker-build/actions.
- First is a transcript of the dockerfile into a yaml pipeline, and builds simutrans from the GH machine, which
- Second is an alternate way, which is building the dockerfile, and running a container which builds simutrans, then extract the APK from the container

They run from my repo right now so they are not ready for the simutrans repo.

It is looking good so far (as I have experience of these tools), so a nightly for Android seems within reach.



_______

EDIT: Follow up on https://forum.simutrans.com/index.php/topic,21062.0.html. I propose we leave this topic as is, which focus was simply the release of a tentative APK.

MobileGlotze

I play it on my tablet now. Very big thx for this! I make a videoserie about playing simutrans on Android! But it is in german ;D

prissi

The Android experience is still very beta. For instance, the arrows of the number input do not work well. I am currently working mostly of fixing these and other issues with Android/SDL2 finger GUI, so we can release a somewhat working Android together with the next stable. The next apk from the github nightly may as well be much better again.

Anyway, feedback is greatly appreciated.

MobileGlotze

Sounds pretty good! I saw it with the number input. But the android version works rlly good. I was surprised how good. Sorry for my bad english.

MobileGlotze

Herr is my Video about Simutrans on Android. It is in german


prissi

Tjanks for the mostly positive feedback. BTW. The arrows in the schedule are just for moving schedule entries up and down. Loading and unloading is automatic ...

MobileGlotze

Ah! Thank u! Yeah, I didn't play simutrans for a long time and forgot something 🙈