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

Post Reply
pelya
Transport Coordinator
Transport Coordinator
Posts: 301
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: 2810
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 :-)
Former NewGRF Coder and Sprite Artist.

Currently working under the name 'reldred' on Github, IRC and Discord.

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: 24928
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: 301
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: 24928
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: 301
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: 24928
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: 144
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: 301
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.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 8 guests