OpenTTD webapp with touch interface for iPhone/iPad

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:

OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

Would you please try it on iPad or iPhone? Simply open this link:

https://pelya.github.io/openttd-touch-webapp

It runs more or less okay in both Chrome and Firefox on my Android phone, but I don't have any Apple mobile devices to test.

Most of the Emscripten porting was already done by Milek7, I've only added fullscreen switching and a few fixes for 1.11 branch.

Running OpenTTD in the web browser is probably the only legal way to get it into the Apple Store, with the GPL code downloaded from the website, and the 'app' consisting of a simple WebView + WebSocket proxy server for multiplayer support. I can only theorize about that, I don't have any Apple desktop PCs to run XCode, and I don't have Apple developer account anyway.

What works: starting new game, downloading NewGRFs, building stuff, savegames, switching into fullscreen mode, FPS is acceptable, adding the link to your home screen.

What does not work: music plays only sometimes, video resolutions are wonky, non-English languages, multiplayer, pinch-zoom, tutorial, text input, cloud saves. All of these can be fixed in the future, except for cloud saves, which I think I'll replace with simply downloading the savegame the same way you download files using a web browser.
User avatar
Aegir
Tycoon
Tycoon
Posts: 2883
Joined: 09 Feb 2004 10:02
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by Aegir »

Scrolling the web browser window on an iPhone XS running IOS 14.4.2 insta-crashes OpenTTD, have to refresh the browser window to get it back.

Edit; should mention, Safari, and it doesn't appear to be scrolling but *any touch input whatsoever*.

Let me know what test cases you want me to go through :-)
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.

14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
User avatar
orudge
Administrator
Administrator
Posts: 25134
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by orudge »

iPhone 12, iOS 14.5 - the title screen loads and works, pressing anything at all crashes it (at which point the music and sound effects start playing!)
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

Thank you. My guess is that it crashes because it tries to enter fullscreen mode. I've disabled fullscreen mode for now, could you please try it again with the same URL?
Do you see the game main menu if you don't tap the screen? Does it play sounds? Does it show an error message about insufficient RAM for sprite cache?
User avatar
orudge
Administrator
Administrator
Posts: 25134
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by orudge »

It now seems to work pretty much perfectly for me!
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

Thanks. There should be an option in the web browser to add the webapp to home screen, it's called 'Add to home screen' in Chrome and 'Install' in Firefox. If you launch the webapp using the home screen icon, it should hide the browser toolbar and open in fullscreen mode automatically.

I'll keep working on it bit by bit.

I'll also need to find some developer with MacBook and $100 to publish 'OpenTTD webapp launcher' app to the App Store, and also explain long and hard about GPL and why the app shouldn't be removed to Apple support. App Store requires your app having some extra functionality compared to your website, the app will open WebView in fullscreen mode and lock it in the landscape orientation, so it kinda barely passes, and in the future it will also have a WebSocket proxy for multiplayer. Would be a shame if it will also have ads, but I won't have any control over that.
User avatar
orudge
Administrator
Administrator
Posts: 25134
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by orudge »

We (as in the OpenTTD project) do have such an account, but we’d need to look and see what we can do.
perverted monkey
Traffic Manager
Traffic Manager
Posts: 161
Joined: 02 Mar 2009 02:07

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by perverted monkey »

A bit of topic, don't know if it can be of any help:
Seems to run fine under Windows 7 with "Firefox" and "Min". Can go fullscreen with F11 under Firefox, not under Min (but it doesn't crash) when in intro menu. In game of course F11 brings the company list. I was surprised of the decent speed under Min, for a long time ago I had tried to run OTTD under Firefox and it was very slow.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

perverted monkey wrote: 07 May 2021 09:28 I was surprised of the decent speed under Min, for a long time ago I had tried to run OTTD under Firefox and it was very slow.
I'll tell you the secret how to make an app run fast. It's -O3 -flto.
User avatar
TGVfan
Engineer
Engineer
Posts: 120
Joined: 10 Oct 2003 19:52
Location: Almere, greater Amsterdam

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by TGVfan »

ohh I like it... Just wasn't able to write something in the console screen. When I klick it the keyboard won't show up.

But for the rest it works pretty good. Keep it coming..
Image
User avatar
TGVfan
Engineer
Engineer
Posts: 120
Joined: 10 Oct 2003 19:52
Location: Almere, greater Amsterdam

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by TGVfan »

Did some more testing.

Joining stations with CTRL button does not work for me on an iPad Pro. Also to release the CTRL button I have to go to game options and change the button size.
Image
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

I've fixed Chinese and Arabic fonts not working.
I'm going to fix CTRL button and text input next week, and also pinch-zoom if I have time.

And here is a screenshot of it in the portrait orientation, for your entertainment.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

I've fixed Ctrl button and text input. I've also disabled zoom, because text edit box would zoom in and there was no way to zoom out, and the game resolution have decreased for some reason after that, making fonts barely readable. You can select different resolution from game options, but all of the resolutions listed there are not wide-screen, so I'm going to fix it next.
Pinch-zoom crashes the debug build of the game, there's some problem with SDL2 and Emscripten.
Also there's a page visit counter now during page load, it's at 200 total visits now. I'm not asking for 70 000 active daily users as with Android version, but this number is still a bit pathetic. I hope this will change if we get a launcher app into the Apple store.
User avatar
TGVfan
Engineer
Engineer
Posts: 120
Joined: 10 Oct 2003 19:52
Location: Almere, greater Amsterdam

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by TGVfan »

Thanks for the updates, time to test again. :wink:
Image
HiTTd
Engineer
Engineer
Posts: 18
Joined: 26 Aug 2019 18:57

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by HiTTd »

The iPhone version is online now, great!!
Link: https://apps.apple.com/us/app/openttd/id1585549844 or just search in the apple app store.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

Grab it while it's available on App Store, it will be taken down eventually. It looks 1:1 identical to the Android version, and I guess it was compiled from the same sources.
merni
Engineer
Engineer
Posts: 11
Joined: 22 Mar 2022 15:41

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by merni »

In the web app version is there a way to upload save files (eg. those created by playing on a normal computer)? This would make it even more amazing...
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by pelya »

Yes it's possible. Click 'Load' - 'Load from network'
The label is intentionally confusing, on Android it will load from the cloud, and I was too lazy to fix it.
merni
Engineer
Engineer
Posts: 11
Joined: 22 Mar 2022 15:41

Re: OpenTTD webapp with touch interface for iPhone/iPad

Post by merni »

pelya wrote: 22 Mar 2022 17:05 Yes it's possible. Click 'Load' - 'Load from network'
The label is intentionally confusing, on Android it will load from the cloud, and I was too lazy to fix it.
Sorry, but that button doesn't seem to do anything on my iPad. When touching it the "Load game" screen just disappears and no menu for uploading a save file is opened.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest