This article is about the android operating system and developing and
publishing games for it.
Getting it to work
This process has only been tested for the Ubuntu Operating System and
revision r870, and I have not been able to get it to fully compile yet.
Some reports indicate that this process may have broken in more recent
revisions (r973).
First, you should have a working copy of ENIGMA already (and, by
extension, LateralGM). Ensure that it is up-to-date, or at least matches
the revisions that this article has been tested/confirmed for. Also,
ensure that you have all other relevant prerequisites installed and
up-to-date.
You will also need a copy of the Android
SDK and the Android
NDK.
- Unzip the SDK to a sensible location. Here we will assume that it is
/home/username/android/android-sdk-linux_x86
- Unzip the NDK inside of the resulting SDK directory. Here we will
assume that it is
/home/username/android/android-sdk-linux_x86/android-ndk-r4-crystax
# In trunk/ENIGMAsystem/SHELL/Makefiles/, copy MacOSX/Android and
MacOSX/AndroidSym into Linux/ and change their contents so that they
reflect the location of your ndk. For instance:
Replace:
cd Platforms/Android/EnigmaAndroidGame/jni && /Users/alasdairmorrison/Documents/AndroidSDK/crystax/ndk-build
with
cd Platforms/Android/EnigmaAndroidGame/jni && /home/username/android/android-sdk-linux_x86/android-ndk-r4-crystax/ndk-build
Once installation is done, it's time to load up your game and invoke the
compiler.
- Start up ENIMGA/LateralGM.
- Load/Create your game, and ensure that it has aspects that seem
compatible with an Android.
- For a first-time game, I'd recommend something very simple, such
as a single room with a color background, just to make sure it
works.
- Change the compiler to the Android compiler.
- Open Enigma Settings (either by double-clicking the tree node or
through the Enigma > Settings menu).
- Open the API tab, and locate the "Compiler" dropdown.
- Change the selected compiler to Android compile.
- Confirm your selection by clicking the Green Checkbox in the
top-left corner.
- Compile/Run by clicking Engima -> Run. It should start compiling
things with a lot of lines starting with "Compile++"
Meta: At this point, my terminal looks like
this and my Progress Console looks like
this
Game Requirements
- You should limit input methods to mouse events, since android input
is entirely touch-based. Other input methods like the keyboard would
require android to have a virtual on-screen keyboard displayed for
the user to interact with. (More information is needed here for
mouse and keyboard support and specifics)
- Android does support 3d, however it uses its own GLES graphics
system. This system is mostly similar to GL, with some performance-
and under-the-hood- differences.
- Android offers additional support to multi-touch. At the current
time, no functions are immediately provided to handle this
capability, but it would be fairly simple to add.
- View size should be tailored to the device you are targeting. If
your view is the full room, the room should be sized accordingly as
well. Other than that, the size is up to you. (More info is needed
here for device size specifics)