Version 2.0 - Multiplatform Experiement


Warning: If you have downloaded Windows Version 1.0 through itch launcher, you will have to uninstall and install a new one. I did a funny.

CHANGELOG:

  • Ported to Linux, Mac, HTML5, Android
  • Support for touch screen controls
  • itch launcher friendly
  • 2 new natural blocks to place: Wood, Leaves (DearFox)
  • Floor is now a textured stoprock (DearFox)
  • Mild music track edit (Trotim)
  • Sound effects for placing and removing blocks
  • Crosshair
  • Menu tweaks: control info and slight license edit


BLOG (from gamedev to gamedev, nothing for players):

This took a while to figuring out the more technical info, such as setting up all the ports and learning little details. It sure was a learning experience.

I guess we can start with touch screen implementation I made. It's rather basic, I know. And it might little sense to have it turned on by default on PC platforms, I don't know any touch screen device control for PC that isn't Steam Deck. Worse, it makes it feel more bootleg-like on those platforms, so better press H when you start the game, at least that's my impression for people. But the experiment of not using any macros to change scripts per platform was worth it.

Said experiment did not go well at all. Turns out that Godot's GUI system paradigm breaks into pieces when it meets touch screen. Here is a dillema: The buttons that can pick up true touch controls are TouchScreenButton, mouse input just goes through it, with an interesting setting of hiding them when not on touch screen platform. But TSB is not a true GUI element, instead it's a 2D one thus won't move with aspect ratio shenagians. Meanwhile normal GUI buttons can't pick up touch screen input, so the whole project has "touch emulate cursor" set because placing two buttons on top of each other takes effort. But if, say, you have First Person controls that listens to mouse input, then you don't want project-wise "touch emulate cursor" setting at all. Anyway, that's why I had to place fully transparent ColorRect all over touch screen buttons area that block mouse input, as my way of conserving energy with hacks.

The vibe I get from the system is that it was designed for Keyboard run retro game where you would slap some virtual controls on when doing phone port. I cannot wait for some compatibility breaking updates, such as GUI buttons accepting touch, a proporsal I've seen months before Godot 4.0 release. But to be honest: you can easily hack everything even with gdscript already, plus per platform macros. So it's not a big deal, just not so out-of-box.


Afterwards, I had fun figuring out both itch launcher and porting. The great thing about itch launcher is that if you use butler tool to upload your next versions of game, it will generate a patch and then the launcher itself will use it, a feat missing from browser experience. Get to keep version history, be kind to itch.io server space, the user can even go back to older versions.

So for desktop versions I recommend you to use itch launcher, that should keep future downloads very very small. Protip to fellow devs: don't embed resources into exe. Otherwise Godot makes exporting to Windows, Linux, MacOS simple. Also, I have no idea how MacOS version works, I never had one, I just followed a guide. It's not notarized because I am not spending yearly money, so users of those systems will have to go through hoops to get file running on their system if they downloaded it off browser. But it will be fine on itch launcher, another cool reason to use it.

Now, HTML5 and Godot and itch and itch.io almost go together but not perfect. For export to work at itch.io, I just had to rename "gamename.html" to "index.html". Some other standard well-documented HTML game itch.io setup aside, you also have to turn on "SharedArrayBuffer support" setting on the page. Then it worked on both Desktop and Mobile browser. But on Desktop it performed better on Chrome (gross), while on Firefox captured mouse easily would escape the window all the time and camera very slowly leaned right. Meanwhile on Android I had it perform great on Firefox but Chrome would fail to load sometimes or have scratchy audio. (people are welcome to confirm or deny with their experience)

There are also HTML5 centric UX game choices to make: "Exit" in main menu just freezes window and is pointless, Esc keyboard button is used by HTML5 site to first quit full screen then un-capture mouse and only then goes to main menu on each press, having to have both KB+M and Touch Screen control at the same time, albeit will see.

Worse, currently there are many things that don't work at the moment with HTML5. itch launcher allows you to download HTML5 on any desktop platform, but trying to Godot 4 HTML5 gives you error about "Cross Origin Isolation" not being enabled. I heard that MacOS and iOS can't run it either in browser due to some bug upstream in tech that Godot 4 HTML5 uses. And of course Godot 4.1 itself doesn't yet support C# in HTML5. But Godot 4.2 is right around the corner, so we will see how these will hold up. And I feel Godot 4 HTML5 runs better for me than Godot 3 HTML5.

Finally, Android version. I personally feel that to appeal to Android user, the download must be as small as possible. Godot 4 does take some space that make it a bigger sell for very tiny game. Worse, while I did use butler tool so I can generate patches, there is no itch launcher for Android! Users will have to download 40 MB everytime on their limited plans, oh no. And launcher, sadly, doesn't allow you to download apps for a platform that you can't run, weirdly. But otherwise, apk is apk. Sign it with release key, it took a while to figure out how to export in Godot and why all the steps. Make sure to download exact versions of tools unless it says "and later" in docs. 

Protip to fellow gamedevs: You can throw away .idsig file that Godot generates for Android builds. From what I have read (that means I can be very wrong!), this file itself is "APK Signature Scheme v4" that allows incremental install thing on Android 11+ which may be debug only thing too? I was unable to figure it out fully. But v4 Scheme REQUIRES .apk file itself to be signed with v2 or v3 scheme which phones accept too if .idsig file is not present, thus it means that Godot certainly does it. So it's like a ltitle addon. The reason I threw it out is because I feel that Android users aren't used to extracting .zip archives (that would contain 2 files) and rather have direct .apk download.

Now the only platform I can do that I am missing is Steam Deck. Ahahaha! Which isn't a true platform, but it's more tied to "implement gamepad support" on Desktop platform, either Windows or Linux.

Edit: friend also reports graphical glitches on libre wolf browser for html5 game.

Get FoxyBlocks2023

Leave a comment

Log in with itch.io to leave a comment.