___ _ _ __
/ __|_ _ ___ _________ _ __| |__ _| |_ / _|___ _ _ _ __
| (__| '_/ _ (_-<_-<___| '_ \ / _` | _| _/ _ \ '_| ' \
\___|_| \___/__/__/ | .__/_\__,_|\__|_| \___/_| |_|_|_|
_ _ |_| _ ___
/_\ _ _ __| |_ _ ___(_)__| | / __|__ _ _ __ ___
/ _ \| ' \/ _` | '_/ _ \ / _` | | (_ / _` | ' \/ -_)
/_/ \_\_||_\__,_|_| \___/_\__,_| \___\__,_|_|_|_\___|
___ _ _
| \ _____ _____| |___ _ __ _ __ ___ _ _| |_
| |) / -_) V / -_) / _ \ '_ \ ' \/ -_) ' \ _|
|___/\___|\_/\___|_\___/ .__/_|_|_\___|_||_\__|
|_|
[Cross-platform Android Game Development]
by TheOuterLinux (https://theouterlinux.gitlab.io)
Last updated: 2024/12/19
So you want to make Android Games? Hopefully the following suggestions
will help the free and open-source people out there figure-out a way to
make Android games as easily as possible. All of the mentioned tools are
cross-platform. However, if collaborating, make sure all members are
using the same versions; "stable" is your friend.
Also, if your target "store" is the Google Play Store, make sure to
research the minimum requirements. At the time of this writing, any new
software added, not to be confused with updating, must be an AAB
(Android App Bundle) file and must have been created using
Android SDK 34 or newer. Unfortunately, at the time of this writing,
according to Android Studio, using Android SDK 34 only covers about
20-some-odd percent of the known Android users.
Anyway...
1. Make sure you have the hard drive space for this nonsense; you will
need about 20GB but the more, the better. You will eventually run
into 'Gradle' stuff and that "monster," along with emulation, will
take-up a LOT of space. Make sure to stop the 'gradle' daemon
properly (gradle --stop) so it will help keep the cache size down;
you can delete the "~/.gradle/cache" folder every once in a while but
you will need an Internet connection the next time building to
populate it again.
2. Make sure 'openjdk-17-jre' and 'openjdk-17-jdk' are installed if
using a GNU/Linux system; some of the projects with certain game
engines are picky about the Java SDK version it wants to use. Worse
case, you can always set the JAVA_HOME environment variable to
some other installed Java SDK version. And yes, you Windows users
reading this will most likely have to add environment variables just
like everyone else the further you get into this.
2. Download and install Android Studio; there is a project called
'sdkmanager' that can be used instead but the Android Studio method
will give you less headaches in the long-run because of having
graphical interfaces and how YouTube tutorials often show people
using it. You can opt to not send telemetry.
3. Install Apache Cordova; you can turn off Cordova's telemetry via
'cordova telemetry off'
4. Install 'apktool' and download 'uber-apk-signer' + 'bundletool-all'.
The 'apktool' is used to extract an APK. The 'uber-apk-signer' tool
is used to sign an already made APK, either store-ready or debug.
The 'bundletool-all' can be used to help convert an APK to an AAB.
5. Install some game engines that support Android export...
However, note that these are not the easiest engines in the world
to use...
A. Godot (C/C++/GScript) [MIT]
a. has several export options and Android APK/AAB's can be built
offline; most exports do not require another system to do so.
b. easy to add SDK paths and keystore information
c. save/load games
d. has an online editor, though I am not sure if that is a good
idea
!!! Difficult to use, both the interface and programming
!!! You will need to make your own contoller overlay
B. Defold (???)
a. has several export options and Android APK/AAB's can be built
offline; most exports do not require another system to do so.
b. Selecting both 32-bit and 64-bit architectures when exporting
creates a universal binary
c. easy to add keystore information
d. save/load games
!!! Difficult to use
!!! You will need to make your own contoller overlay
!!! You need to specify environment variables before you can create
an Android APK/AAB.
C. Ren'Py (Python)
a. has several export options; most exports do not require another
system to do so.
b. save/load games
!!! Exporting to Android will eventually add a LOT more crap to
the Ren'Py folder, even if you already have an Android SDK
installed, to which always grabs the latest.
6. Install some game engines that export as a Cordova project or
as an HTML5 game that can then be turned into an APK/AAB using
Cordova...
A. GDevelop (intermediate to hard)
a. you can either have the GDevelop servers build an Android APK
for you via an account or do it manually yourself, which is not
that difficult.
b. Other systems can be targeted and built via an online connection
and an account. The "manual" version can be done offline via
'Node.js' and 'Electron Builder' but you are mostly limited
to your operating system and architecture.
[See very botton for "manual" instructions and tips]
c. has built-in gampad overlay if you need it on a touch screen
d. games can be saved
e. has an online editor if you can only use a modern web browser
for some reason
f. if connected to the Internet, it has tutorials to play around
with. If you have an account, you can quickly customize other
people's games; however, I am not sure about the license.
!!! Built-in behaviors for "programming" are a bunch of drop-down
something or others that is not easy to understand; I normally
do not like "nodes" in which virtual boxes are attached via
strings but this would perhaps be more helpful in this case.
!!! Very "online" heavy in that you will need to pre-download a
bunch of projects to get started; even an "empty" project is
not included.
!!! Cross-platform desktop builds are only available with an
Internet connection and an account.
B. microStudio (easy; microScrtip, Python, Lua, and Java) [MIT]
a. has HTML5 export which can then be turned into an APK/AAB via
Cordova
b. built-in basic tutorials and a unique "level-up" system the more
you do so as to encourage you to play with it more and learn.
c. library import with public libraries available for easy download
d. has an online editor
e. a CRT effect can be easily applied via CSS and a
sandwich
but no flickering
f. if you click a function and then the question mark icon (?),
a usage explanation pops-up
!!! HTML5 export only, but Cordova can help with that
!!! You have to create your own gamepad overlay if using a touch
screen
!!! You cannot run multiple instances of the desktop version
C. GBStudio (easy to intermediate; nested boxes for "programming")
a. has HTML5 export which can then be turned into an APK/AAB via
Cordova
b. Can, of course, create just an actual ROM for use with flashing
to a real game cartridge or play using an emulator, to which
there are an insane amount of GB/GBC emulators for all sorts of
systems.
b. game save/load works
c. HTML5 export includes virtual gamepad controls
!!! Limited to Game Boy/Game Boy Color rules, such as limited
number of sprites, colors, and unique 8x8 tiles
!!! Creating music/sound effects a rather difficult, though it has
a built-in piano-roll editor
!!! Game ROM could perhaps be "stolen" if someone crawls around
the Android file-system.
D. TurboWarp Desktop (maybe...) [MIT]
a. an offline version of Scratch but with extra plugins; however
there is an online TurboWarp
b. exports to a single HTML file; remember to rename to
"index.html"
c. several plugins for extra functionality, though breaks Scratch
compatibility
!!! Resolution vs. Fullscreen is rather "ify"
!!! You have to make your own gamepad overlay for touch screens
!!! No save/load functions
!!! No scripting language; uses this block-like system than honestly
get really complicated the more you try to get out of it.
*** However, the plugins may offer a solution to some of the
mentioned issues
E. Ct.js
a. it has a built-in method of creating a Gradle project to then
turn into an APK; however, you are better off exporting to an
HTML and then use Cordova to create an APK/AAB.
b. can export to other operating systems and architectures, all at
once, if connected to the Internet; no account required.
7. Grab a copy of the Love2D 11.5 APK or newer; you can use the tools
mentioned in STEP 4 to simply extract the APK, add your "game.love"
file, change some metadata values to make it your own, and then pack
it back up. The 'uber-apk-signer' by default signs APKs as a debug
version but can also sign it officially for app stores. The
'bundletool' is for converting to AAB (Android App Bundle), which
as of August 2024, Google Play Store only takes AAB's made with
SDK 34 or newer.
If you like Love2D (Lua-based) and want to completely avoid
installing Android Studio, Gradle, and Cordova, this is the best way
that I know of to make Android games.
a. no need for Android SDK, Cordova, or Gradle
b. Love2D is a Lua-based language, which is not as hard as C/C++
c. several Lua-based libraries to use, including 'lovepad' for a
virtual gamepad overlay, which still works with 11.5; however,
the only way to test is with a touch screen.
d. Creating a binary for other operating systems is just as easy
via concatting to that system's Love2D binary.
!!! No specific Love2D IDE; you are on your own as far as to what
text-editor to use; I recommend Geany.
!!! Game could be stolen since it is embeded ans is assumed that the
"game.love" file is placed somewhere on the Android system. Love
files are simply ZIP archives with plain-text scripts and
audio/video/image resources inside and the extension renamed.
ONLINE WEB IDE's
------------------------------------------------------------------------
The following is a list of possible online options that may need the
help of projects like Cordova but could make things easier for those
that are have a "do everything in a web browser" habbit.
Further investigation is still needed for many of these items.
Bitsy
-----
"a little engine for little games, worlds, and stories"
https://bitsy.org/
Easy Game Maker
---------------
Create an HTML5 game online; reminds me of a simplified mix between
microStudio and Scratch; project can be saved for later via a JSON file.
https://www.easygamemaker.com/
Godot 4.3 Web Editor
--------------------
Create games using the Godot's online web editor (with limitations)
https://editor.godotengine.org/releases/4.3.stable/godot.editor.html
microStudio
-----------
A free game engine online; program using microScript, Lua, Python, or
JavaScript
https://microstudio.dev/
QBjs
----
An online version of QB64
https://qbjs.org/
Raverie Engine
--------------
A pure WebAssembly (WASM) based game engine/editor that aims to recreate
the vibe of Flash games
https://raverie-us.github.io/raverie-engine/
Ren'Py
------
A free and open-source visual novel engine
https://www.renpy.org/
Scratch
-------
"Scratch is the world’s largest coding community for children and a
coding language with a simple visual interface that allows young people
to create digital stories, games, and animations"
https://scratch.mit.edu/
TurboWarp
---------
"...the better version of Scratch with dark mode, addons, a compiler,
and a lot more"
https://turbowarp.org/editor
Twine
-----
Write interactive stories and presentations
https://twinery.org/2/
POSSIBLE [FUTURE?] OPTIONS BUT THERE IS A CATCH...
------------------------------------------------------------------------
OHRRPGCE
--------
The "OHRRPGCE" project is for creating top-down role-playing games
similar to Final Fantasy for the NES but with 256-colors. They also
have an Android player for RPG project files. However, when running this
player on an Android 14 emulator, it did not work well at all. I also
tried exporting "Vikings of Midgard" as an HTML project to then create
an APK using Cordova but because there are no control overlays, you
would have to figure-out how to make your own; I tried this and it
was buggy as snot. Mouse clicks/screen taps are waaay off anyway.
And besides, when I could get the pause menu to show and then save, it
was not kept. Having that information saved to the "local storage"
(like with web browsers) would make that possible.
WebGM
-----
The WebGM project is a clone of Game Maker classic but online. You
can preview games just fine and even save your progress; however, when
it comes time to export the game, it requires a web server, which
Cordova handles just fine. The problem is that it a very buggy on an
Android system. Sound only sort of works. You cannot save a game as
ini functions do not work. Options regarding resolution do not result
in anything anyone would be comfortable with on a mobile device.
You woulc also have to create your own on-screen controls.
RPG Paper Maker
---------------
You can export the game as HTML5 and then use Cordova to create an APK;
however, the resolution stuff has similar issues to what is mentioned
in WebGM above. There does not appear to be any controller overlay
option.
Desmond
-------
This is web (WASM) project for having a way to emulate Nintendo DS
games online. You can create an APK/AAB using Cordova but the result
is a laggy game in with no controls seem to work, not even the bottom
touch screen.
TIPS AND POSSIBLE ISSUES
------------------------------------------------------------------------
Game Engine Issues
------------------
On a GNU/Linux system, if you are having issues with a game engine
trying to find the Java SDK, Android SDK, and so forth, create a BASH
script similar to the following in which the script is in the same
directory, assuming it was NOT installed using a package manager, such
as placing the extracted program's folder in "~/Applications".
All of the "export" parts should "cover your butt" in regards to engines
looking for SDK's and so forth. The "$DIR" parts help keep things
relative to the script's location, which makes it more portable.
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
JRE='/usr/lib/jvm/openjdk-17'
export JAVA_HOME='/usr/lib/jvm/openjdk-17'
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_AVD_HOME="$HOME/.config/.android/avd"
GRADLE_HOME="$HOME/.gradle/wrappers/"
cd "$DIR"
./GameEngine.bin
````````````````````````````````````````````````````````````````````````
Android Emulator Issues
-----------------------
Use something similar to this BASH script to have the Android Emulator
run a little better on an older computer... Be careful with the
'killall -9 adb' part. Make sure to stop the gradle daemon before
running the emulator to get a chunk of RAM back (gradle --stop).
#!/bin/bash
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_AVD_HOME="$HOME/.config/.android/avd"
export ANDROID_EMULATOR_WAIT_TIME_BEFORE_KILL=20
cd "$HOME/Android/Sdk/emulator"
./emulator -avd Medium_Phone_API_35 -gpu host -lowram -no-metrics -noskin -no-boot-anim -no-sim -use-host-vulkan -feature -Wifi -qemu -m 4G
killall -9 adb
````````````````````````````````````````````````````````````````````````
Missing avd's when trying to run the emulator can be fixed by creating a
file like so... "~/.config/.android/avd/Medium_Phone_API_35.ini" and
then add contents to that file like so but replacing the version numbers
and username in the path...
avd.ini.encoding=UTF-8
path=/home/[replace_me]/.config/.android/avd/Medium_Phone_API_35.avd
path.rel=avd/Medium_Phone_API_35.avd
target=android-35
````````````````````````````````````````````````````````````````````````
Android Studio Issues
---------------------
if using GNU/Linux, add something similar to this to the
"/path/to/android-studio/bin/studio.sh" file if having Java-realted
issues with Android Studio...
JRE="$HOME/Applications/android-studio/jbr"
export JAVA_HOME="$HOME/Applications/android-studio/jbr"
````````````````````````````````````````````````````````````````````````
Ren'Py Issues
-------------
If using GNU/Linux, add something similar to the following at the
beginning of the "renpy.sh" script if using the Ren'Py project...
JRE="$HOME/Applications/android-studio/jbr"
export JAVA_HOME="$HOME/Applications/android-studio/jbr"
export ANDROID_HOME="$HOME/Android/Sdk"
export ANDROID_AVD_HOME="$HOME/.config/.android/avd"
HOWEVER, it still seems like it wants to download its own copy of
Android SDK to its own directory anway. I am not sure why. Be prepared
to have a very large Ren'Py folder.
````````````````````````````````````````````````````````````````````````
Cordova - APK
-------------
When using Cordova to create an APK, here is what I recommend
running in the terminal, or at least something similar to it...
you will have to replace the gradle version numbers and the long
"####..." part for the correct file-path.
export ANDROID_HOME='$HOME/Android/Sdk'
export JAVA_HOME='/usr/lib/jvm/openjdk-17'
export PATH=${PATH}:"$HOME/.gradle/wrapper/dists/gradle-8.9-bin/#########################/gradle-8.9/bin"
cordova create NameOfApp com.NameOfApp.Company NameOfApp
cordova platform add android@13.0.0
Next, replace what is in the "www" folder with your own HTML+CSS+JS
stuff and then run the following, while in the newly created Cordova-
realted directory...
cordova build android
If the emulator says that there is some kind of error, make sure that
the HTML file that starts everything is "index.html"; also, try the
'uber-apk-signer' and 'bundletool-all' tools.
````````````````````````````````````````````````````````````````````````
Cordova - AAB
-------------
When using Cordova to create an AAB, here is what I recommend
running in the terminal, or at least something similar to it...
you will have to replace the gradle version numbers and the long
"####..." part for the correct file-path.
export ANDROID_HOME='$HOME/Android/Sdk'
export JAVA_HOME='/usr/lib/jvm/openjdk-17'
export PATH=${PATH}:"$HOME/.gradle/wrapper/dists/gradle-8.9-bin/#########################/gradle-8.9/bin"
cordova create NameOfApp com.NameOfApp.Company NameOfApp
cordova platform add android@13.0.0
cordova plugin add cordova-android-play-asset-delivery
Next, replace what is in the "www" folder with your own HTML+CSS+JS
stuff and then run the following, while in the newly created Cordova-
realted directory...
cordova build android --release -- --packageType=bundle
If the emulator says that there is some kind of error, make sure that
the HTML file that starts everything is "index.html"; also, try the
'uber-apk-signer' and 'bundletool-all' tools.
````````````````````````````````````````````````````````````````````````
Gradle Issues
-------------
Gradle versions supposedly can be replaced by running...
./gradlew wrapper --gradle-version=8.9
...while in the gradle project directory, but I keep getting errors
realted to gradle 9.0 and I have no idea why. Meaning, it may be
pointless to "skip ahead," in a manner of speaking, by compiling older
Gradle projects found around the World Wide Web.
------------------------------------------------------------------------
IT IS MUCH EASIER JUST TO LET THE GDEVELOP PROGRAM WITH AN INTERNET
CONNECTION AND AN ACCOUNT HANDLE THE ELECTRON BUILDS FOR OTHER OPERATING
SYSTEMS OTHER THAN YOUR OWN. But, if you must insist on doing it
yourself, open a terminal and run the following (have 'nodejs' package
installed first)...
sudo npm install npm@latest -g
sudo npm install electron -g
cd "/path/to/GDevelop_Created/Electron_Directory"
electron-builder --linux
...This installs some things via 'npm' and then creates an unpacked
folder, a snap package, and an AppImage for GNU/Linux. Replace
the "--linux" part with your operating system, such as
"--windows" or "--macos"
...to build DEB packages (Debian/Ubunt), a bit more work is required...
However, the generated AppImage should work just fine on most modern
GNU/Linux systems.
...it also appears as though an x86_64 GNU/Linux system cannot be used
to create "--ia32" (Intel/AMD 32-bit) or ARM-based options. If you want
to manually build for other architectures, you will have to build them
on those machines while running GNU/Linux.
PSST... CORDOVA HAS "ELECTRON" AS A PLATFORM OPTION...