Building and Porting Mobile Games with Unity

Tuesday 5/5/20 09:05am
|
Posted By Ana Schafer
  • Up0
  • Down0

Snapdragon and Qualcomm branded products are products of
Qualcomm Technologies, Inc. and/or its subsidiaries.

In the Beginning

Can you imagine what it may have been like to be one of the very early video game developers? They had full control of the game’s design, development process, and even the hardware itself, and they often developed in solo or in very small teams. They not only created the game’s code, but also the art and sounds that gave those original games such a sense of character and charm. Of course, those early developers also faced big challenges including tight hardware limits (e.g., 64k or less of available memory), low-level languages like assembly, and rudimentary development tools.

As hardware improved and new platforms came along, the nature of game development continued to evolve. With the ability to handle more realistic art and sounds along with new types of media like 3D graphics and movies, game teams onboarded new types of contributors including artists, sound engineers, game designers, tool developers, and producers. As a result, game programming was no longer just about writing graphics and gameplay code. It was now about building data-driven tools and pipelines so that content creators could view their assets in-game and across platforms, ideally with little reliance on developers to recompile the game’s executable.

Despite these efforts, developers still faced numerous challenges. For one, they had to assign resources to ensure that the game and its assets worked on each target platform. With very different rendering processors on each platform, there was often a disconnect between how assets looked in art tools versus how they were rendered by the game on a given platform. Also, the increasing complexity of platforms and the growing codebases to support all of these subsystems, led to long compile and build times. Languages like C, not only made it easy to introduce bugs like memory leaks and pointer stomps, but also facilitated years of unstructured legacy code that became difficult to manage, and even more difficult to build upon in a truly object-oriented way as C++ was adopted.

A New Way Forward

Throughout this evolution, many developers sought to create tool chains and even full-on game development platforms that would allow them to work in concert with content creators, within the same environment. Although approaches have varied over the years, the goal was always the same: create once and deploy to many. More specifically, to generate a data-driven executable that runs on all platforms and abstracts away the hardware, such that programmers and content creators can focus on the game logic and assets knowing that they’ll look and behave the same on all target platforms. Thankfully a few tool companies got it right along the way, one of which is Unity.

Unity offers a cross platform real-time 3D engine that supports the creation of 2D, 3D, VR, and AR games, and has even been adopted outside of the game industry. Unity is centered around a visual, tool-oriented development workflow, in which game logic and art assets are brought together in the Unity Editor (available for Windows, Mac, and Linux) to author a game. Unity then generates an executable for one or more target platforms including PCs, Macs, game consoles, and mobile devices.

Some of Unity’s notable objects and features that game developers should become comfortable with include:

  • Scenes: define the game’s environment (e.g., world)
  • GameObjects: represent characters, props, cameras, etc..
  • Prefabs: GameObjects that have been populated with specific properties from which instances can be created.
  • Scripts: C# scripts containing game logic to control various objects. Developers can optionally include assemblies written in other .NET languages outside of the Unity Editor.
  • Plugins: ability to use plugins to invoke Java and C++ code written outside of Unity to gain additional access to system-level resources.
  • Per-platform Build Settings: developers can customize the build output for each target platform to a certain degree.

Mobile game developers in particular will be interested in Unity. During the early days of mobile development, mobile platforms were often developed or ported separately from their mainstream PC and game console counterparts. This was due to the unique differences of mobile phones and tablets, most notably their input methods (e.g., touch screens, accelerometer, gyroscopes, etc.) which were so different from that of traditional gamepads and keyboards. As mobile gaming became hugely popular, game teams supporting multiple platforms could no longer treat mobile devices as outlier build targets. Thanks to tools like Unity, this no longer has to be the case. Today, 50% of all games and 55% of all new mobile games are created using Unity.

Snapdragon Elite Gaming with Unity

In 2019 we introduced our vision for the Snapdragon® 8 Series Mobile Platforms and talked about how it contributes to increased realism in games. We also provided some information about our collaboration with Unity to ensure that both mobile game and XR developers get optimal performance of their build targets when running them on our Snapdragon platforms. This means the final build output generated by Unity can take advantage of our Snapdragon performance, despite the fact that Unity abstracts away much of the hardware. Today, our Snapdragon Elite Gaming vision continues in our latest premium offering: the Snapdragon 865 mobile platform.

Developers should find the build process straightforward. In Unity, it’s just a matter of selecting Android as the target, configuring some Android-specific build settings, and invoking a build. Unity will then build, deploy, and run the game on the Android device attached to the development PC via USB. Developers interested in building output for the Snapdragon 855 or Snapdragon 865, can do so using the following hardware development kits which can be attached to the development PC:

Conclusion

Game development has come a long way since the early days. Thanks to tools like Unity, developers now have a simpler approach to cross platform development, and a shared environment in which they can work alongside content creators. Most importantly, Unity has achieved the long-standing goal of developing once and building to multiple platforms, while still capturing platform-specific benefits such as those offered by Snapdragon mobile platforms, which power many of today’s mobile devices.

Unity is available as a free download from https://store.unity.com/download. Independent and small developer studios with less than $100,000 in gross revenues can download the personal version of Unity for free, while larger organizations can download other versions from https://store.unity.com. Mobile developers can find more information about Android-specific development topics here. Unity also provides Unity Learn, which has additional learning resources.

If you’ve created any Android games or demos with Unity that run on Snapdragon devices, we would love to showcase them on our game projects page. You can submit your project on our project submission page.

Snapdragon and Snapdragon Elite Gaming are products of Qualcomm Technologies, Inc. and/or its subsidiaries.

Sections: