Ported to Android (almost)


The port to Android is pretty much finished, and if nothing goes wrong it should be up on Google Play Store next week.

Quick comparison between PC / Android:


Exploring dungeons requires keyboard interaction for actions such as moving or opening the menu, so I just needed to translate that into on-screen buttons.


Most menus received modifications in the way of resized buttons. The small buttons are fine for a mouse on a computer, but they are too small to reliably tap on a small screen on a phone. The bigger size makes them much more manageable. Scrollbars also received a slight resizing. The overall resizing of elements also means that there are now a few more scrollbars that weren't needed before.

And naturally, there's the issue of aspect ratios. For PC I forced everything into a 16:9 aspect ratio, resizing if needed, but you cannot really do that in a phone given how small they are. It would look horrible. So a different menu configuration is needed for each common aspect ratio.

The most straightforward solution would be to make many different menus for different aspect ratios and then offer the player the one that most closely corresponds to their phone. That would be hell to maintain for a single person. I have way too many menus. So instead, I'm using a single menu for all aspect ratios and resizing elements appropriately with a canvas scaler. All UI elements just need to be anchored to corners of the screen, and then they will expand or shrink as needed. This definitely needed a bit of tweaking and testing, but it seems to work fine.


It's far from perfect. At higher aspect ratios there's a bit of empty space between elements, but at least there are no overlapping buttons. And this means I can use a single menu scene for both PC and Android for all aspect ratios, which makes it significantly easier to maintain and update if needed.

And then there's the issue of shaders. I use ShaderGraph for certain effects, and while they looked just fine on Android, I noticed that many slowed the game down to a halt. After much testing I found the culprit: noise generation. Many of my graphical effects used random noise generation to achieve certain "random" behaviors such as UV distortion and whatnot. It turns out Android is not powerful enough to do this every frame, so anything that used noise generation had to go.

The solution? Well, I didn't care about the noise "generation" per se, I just needed noise at all. So instead of generating random noise on the run, I just feed the system a .png file with pregenerated noise, and loop it if needed. The final result is not quite as nice, but it does the work and runs smooth.

As an example, here's a moderately complex PC shader that generates three different monochrome Voronoi noise signals every frame, each with a different offset and speed, and then combines them as the respective RGB channels of a single output texture (after sampling and whatnot). I swear it is far simpler than it looks. It's just telling Unity to generate three different signals and then combining them.


For Android, the basic idea is the same: create three different Voronoi signals somehow and combine them. The problem now is that we cannot generate noise on the run on Android, so we have to emulate it by passing it a static image that kind of looks like Voronoi noise and then sampling it three times at different offsets and scales. It doesn't look quite as good and it is unneededly contrived, but at least it runs fast on Android.


So basically, porting to Android required quite a bit of tinkering around. No part was excessively difficult or anything, but there were just too many little things to keep track of. But it's done now, and I've done everything I could to keep my code as platform-agnostic as possible, so the game shouldn't require any more massive adaptations like this one going forward.

And that sure was quite the wall of text. So thanks for reading. Now I'll just wait until Google decides to approve the app.

Get Ubiquatopia

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.