Slow Rush Studios logo,
    depicting an apprehensive-looking snail rushing forward

Slow Rush Studios

◂  Blooming Hells
News index

Touching Screens

Contents

This game is for PC but odds are that something like 70% of you are reading this on your phone.

So wouldn't it be nice to be able to play the playable web build on your phone too?

Well, I just spent the last 2 days hacking in touchscreen support, so now (maybe) you can!

Touch Gamepad

Most mobile games have control schemes that are totally alien to me: tap on the enemy to jump on the enemy! Tilt left to steer left! Swipe left to see a different potential romantic partner!

Me, though? I'm an old-fashioned guy,1 and I make old-fashioned games,2 so I made an old-fashioned gamepad3 appear on your screen when you first touch it:

Touch gamepad in action, recorded on touchscreen laptop with browser in mobile phone emulator mode. Claw grip optional.
Yes, the gamepad is missing the LB, RB and X buttons - those don't do anything in-game yet.

The touch gamepad also turns off most of the rest of the game's UI (like the top menubar that is sometimes there), since it would be annoying to accidentally interact with those.

All that did mean I had to rewrite my input handling logic yet again, but on the plus side now when you're playing singleplayer you can also seamlessly swap between keyboard-and-mouse or gamepad (or the touchscreen gamepad). And of course if you press the Start button on a gamepad then a new player will still drop in, using that gamepad. 4

Low Graphics Mode

Unbeknownst to me until now, the performance of this game in web browsers on mobile phones is somewhere between "bad" and "shockingly bad". 5

I mean, it does work, but at about 10-15 frames per second instead of the expected 60 frames a second - possibly because the graphics cards in mobile phones have different characteristics vs desktop graphics cards?6 Or maybe I'm just doing something dumb.

Now obviously I could spend a bunch of time fixing the performance, but extracting performance insights on mobile browsers is extremely painful,7 so instead I added a quick "low graphics" toggle:

Graphics on High (default)
Graphics on Low (fallback)
High (normal) vs low graphic settings. Yes, even the background gets skipped in low graphics mode.

I also track the average framerate for the last 2 seconds: the first time that average goes under 25 frames per second it will automatically switch into the low graphics mode. (That happens basically immediately on most mobile devices but you can always switch back & forth if you want.)

Mobile-friendly-ish web build!!‎

Anyway, does the touchscreen gamepad work for you? Please Discord hit me up and say yay or nay!8

Known issues:

Press F1 for help, including to see keyboard/mouse controls. Mobile devices probably won't work! By playing you agree to our Privacy Policy and Terms of Service.

1

For certain values of old-fashioned. I still feel like an imposter whenever anyone talks about their old Atari computer or anything like that.

2

Or at least, I hear that this game gives people retro vibes in a good way (Soldat! Worms! Cortex Command!) and that's good enough for me.

3

Also, not gonna lie: it would be silly to spend a lot of effort on fancy touch controls when this game is intended to be played with a gamepad or mouse & keyboard.

4

Now you may be thinking: if a gamepad's Start button always drops in a new player, how can you open the pause menu when you're playing singleplayer?

Well, the short answer is that there is no pause menu yet.

The slightly longer answer is that it's a problem for future-Caspar to solve when he builds the pause menu, though current-Caspar is thinking that maybe the pause menu should just have an "Add Player" menu option in there.

5

Because previously the game wasn't even playable on a mobile phone.

I suppose I could have used a bluetooth keyboard or something if I was a real go-getter?

6

I am no expert, but as far as I understand: mobile graphics cards have a much lower "fill rate" (number of pixels they can draw per unit of time), so they struggle with drawing things over the top of each other - like drawing partially transparent images.

And full floating point precision maths in shader code run on mobile GPUs might incur a performance penalty too, or something like that?

(I do a lot of both of those things)

7

My in-game profiling UI works, but 1) it's super tiny and 2) the timing information is restricted to "nearest second" granularity.

Normally I can get at least microsecond resolution on timing, even in browsers - or at least I can over in Firefox with some about:config tweaks applied and/or a secure hosted context.

8

So far I've tested on my touchscreen laptop, Android Pixel 7 (Firefox is ok, Chrome is better - just like on desktop) and on a 4-year-old iPad Air and they all seem to work.

I did run into some issues with touch events not being read properly on Chrome on Android (so e.g. you would tap jump and sometimes it would register as a touch being moved rather than a new touch being started), but I hacked in a workaround and that seems fixed now.

◂  Blooming Hells
News index