Android and Game engines

September 6, 2019

[MUSIC PLAYING] All right. So I’m super excited about
talking to you all here at GDC. And I’ve spent
the last few weeks building a bunch of sample
games and a whole bunch of game engines, and I can
confidently say that it is the best time
ever to be a game developer. Our tools are
better, our platforms are more refined and stable,
and our means of distribution is, well, more open and
available than anything we’ve ever had before. So game engines are big
and powerful tools that work across multiple platforms. But sometimes they may
seem to be a bit big and clunky for mobile. Things are not always
associated with game engines or being small, providing
optimal performance, and especially leveraging
platform-specific features. And of course you
want to be small because great small
games get more downloads than great large games. And you want them
to optimally perform because of course
higher performing games get more fun per
watt of mobile power, get better ratings, more play
time, and more downloads. And leveraging platform
features can be key for success. Especially on Android, we have
a huge set of game services that help you to grow, retain,
and yet even monetize your user base. Google Play offers a feature
to help you called multiple APK support to allow you to post
different APKs which target different hardware versions. We’re going to uncover two
of the most important ways in which you can use it, which
is texture formats and ABIs, with a few different
game engines. We’ll also talk briefly
about integrating Google Play game services. And that’s it. I only have five
minutes and I’ve already used a minute and 15 seconds. So, the basic
rules for multi-APK are that we need to APKs
that have a different version number with distinguishing
manifest characteristic that allows Google Play
to filter correctly. Now version networks
are used for priority when the same device can
support multiple versions of the same app. The multiple-APK goal is
how to generate an APK with different version
numbers, different texture format, and different binary
targets in each engine. It’s always a comfort for
me to work with Cocos 2d-x. I think it’s because
like Android it’s free and open source. This game engine delivers small
binaries with high performance. And it’s loaded with
tools to get you in the game from the start. Internally, Cocos supports
just the older formats. But since it’s open source,
it’s relatively easy to add support for others. You need to use
whatever texture packing tool you might be
using to generate sprite sheets with each format. It’ll also be up to you
to pack the correct format to the correct builds. All right. It’s really easy to
find that manifest and make changes at least. Here’s an example of declaring
a build that requires DXT for Google Play. It’s super easy to do
architecture specific builds because it just uses the APK. So a default makefile
looks like this. By adding the V7A ABI
we get an RB7 build. And this gives us
an X86-only build. By putting multiple ABIs on
the line separated by spaces we get a fat build
with both binaries. And Android chooses
the best automatically. There are lots of features that
show how to enter integrate Google Play Game
Services with Cocos 2d-x, and it’s easy because
we have a C++ client. The Cocos team created
their own sample here, showing leaderboards and
achievements as well as turn-based multiplayer. So let’s switch to Unreal. Now texture formats are
really easy with Unreal. You just select
which texture format you want to build against. However Unreal won’t
automatically get your manifest or recheck your
format to allow you to use this to differentiate
multiple APK on Google Play. To that it’s really simple. You create a manifest
requirement additions text file and add the
support GL texture tag. In my case I’ve added the one
for ASTC low dynamic range which is what is currently
supported by high-end Android devices. Now, for ET2, one needs to
require OpenGL [INAUDIBLE] 3.0 in that APK
because there isn’t a hardware extension for it. It’d be great if
someone did a patch to make Unreal do
this on its own. Unreal has built-in support
for Google Play Games servers as just leaderboards
and achievements. It also has support for
licensing, APK [INAUDIBLE] files, add [INAUDIBLE] banner
adds and in-app purchases. You can add your Google
Play app ID here along with mapping for
leaderboards and achievements and follow the
blueprints example given with Tappy Chicken to
show how to integrate them. If you want to do a build for
X86, X86-64, Android expansion pack, you’ll need to rebuild
the editor from source. Not hard just a bit more work. And after all, being
open-sourced is pretty cool. Unity on the other hand will
nicely add the texture format into the manifest file for you. But if you select
ETC2, you’ll want to make sure you manually
set the required GLES version to 3.0. To do this without selecting
the ES3 path in Unity you can take advantage
of manifest overwriting. By creating an Android manifest
file in the plugins directory that contains [INAUDIBLE]
the user’s feature file for the GLES version. This is also how you can
add in customizations you might want to in the manifest. You have to go to
player settings to switch the ABI type
for Unity, which today just supports RMB7 and X86. Unity doesn’t have any built-in
support for Google Play Game Services yet. But fortunately we’ve written
a plug-in that supports almost all Play games features. And if this weren’t
a lightning talk, this is where I go into an
in-depth discussion about how to use this stuff. There are many
other options too. GameMaker and Corona have
great Google Play games services integrations with
Corona also integrating our real-time Liquid Fun
2D particle simulation, Defold from [INAUDIBLE] allow
some amazing real-time changes in a cloud-based
development environment, and Autodesk Stingray
has powerful integration with professional 3-D tools. Remember, have fun, think small,
leverage Play Game services and package the best
binary for you users. Thank you. Here’s how to reach
me and please welcome to the stage, Nathan Camarillo. [APPLAUSE] [MUSIC PLAYING]

Leave a Reply

Your email address will not be published. Required fields are marked *