The game development industry is one of the fastest-paced and most rapidly evolving fields in software development. So is the ecosystem of tools that surrounds it.
Building a game from scratch requires deep knowledge and technical expertise in graphics, animation, and programming. To help save time and resources, the game developer community has built and leveraged countless tools to help them create stunning games with increasing efficiency. Today, most developers turn to game engines to streamline the entire process.
Game engines help developers add things such as input, physics, rendering, scripting, collision detection, artificial intelligence, and so much more without having to program them explicitly. Basically, they’re designed to help you build games without having to reinvent the wheel.
Even better, many of these tools are cross-platform, so they support other system types and versions. The phrase “Build one, use everywhere” applies here.
There are plenty of game engines to choose from, and thet best option is not always obvious, especially if you’re new to the field. In this guide, we’ll focus on some of the best and most popular game engines for mobile game development, breaking down pros, cons, and common use cases for each.
Launched by Unity Technologies in 2005, Unity is one of the most popular game development engines. If you’re a seasoned gamer, some of the big names that were built with Unity, including League of Legends and Iron Man.
Unity is a cross-platform game engine to boot and includes and ample collection of tutorials to help beginners get started. For these reasons, Unity is my favorite engine for mobile game development.
Take a look at the pros and cons below.
Unity has support for C#, Unity script (also called JavaScript) and boo (not so popular at the time of writing).
Below is a script in C# that chooses between a win or draw in a simple unity game.
void CheckPlayersDeath() { // 1 if (deadPlayers == 1) { // 2 if (deadPlayerNumber == 1) { Debug.Log("Player 2 is the winner!"); // 3 } else { Debug.Log("Player 1 is the winner!"); } // 4 } else { Debug.Log("The game ended in a draw!"); } }
Unreal Engine first came to light in the Unreal game, a first-person shooter published in 1998. Originally developed by Epic Games, it was made open source in 2005. You can download Unreal Engine on GitHub for free.
Popular games developed with Unreal include Batman: Arkham Asylum & City, A Way Out, and Biomutant.
Unreal also has support for windows, iOS, Linux, Oculus Rift, PlayStation, Xbox, and so many others platforms. I would highly recommend it for a team of game developers, but Unreal Engine may be too beastly a task for a single programmer to tackle on their own.
Let’s look at a class definition that Unreal will generate automatically once you create a C++ class that will be extended by Blueprint later.
#include "GameFramework/Actor.h" #include "MyActor.generated.h" UCLASS() class AMyActor : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties AMyActor(); // Called every frame virtual void Tick( float DeltaSeconds ) override; protected: // Called when the game starts or when spawned virtual void BeginPlay() override; };
Solar2D is a 2D game development engine that was released in 2009. It was designed to allow game developers develop 2D games for iOS, Android, and desktop. It is free and open-source.
With Solar2D, you can build directly from the Solar2D simulator or integrate your project with Android studio to add native features. Solar2D has support for iOS, Android, and Window.
Some games developed with Solar2D include Designer City, Zip Zap, and Gunman Taco Truck.
If you’re looking to start your game development journey with a free and open-source gaming engine, you might want to consider switching to Solar2D. If you’re already familiar with Lua programming language, you’ll find it especially easy to get started with Solar2D.
The following code snippet will create a some objects in the Solar2D game engine using Lua.
local obj1 = display.newRect (groupA, x1, y1, 100, 100) obj1:setFillColor (1, 0, 0) local obj2 = display.newRect (groupA, x2, y2, 200, 100) obj2:setFillColor (1, 1, 0) local obj3 = display.newRect (groupA, x3, y3, 100, 200) obj3:setFillColor (0, 1, 1)
To trigger a rotation of the created objects on screen rotation:
local function onOrientationChange (event) local currentOrientation = event.type if currentOrientation == "portrait" then transition.to (groupA, {rotation = -90, time = 1000, yScale = -1}) elseif currentOrientation == "portraitUpsideDown" then transition.to (groupA, {rotation = -90, time = 1000, xScale = -1}) elseif currentOrientation == "landscapeLeft" then transition.to (groupA, {rotation = 180, time = 1000, yScale = -1}) elseif currentOrientation == "landscapeRight" then transition.to (groupA, {rotation = 0}) -- Or how to set the default orientation again? end end Runtime:addEventListener ("orientation", onOrientationChange)
If you love to explore new technologies and have time to learn, Solar2D is certainly worth a try.
SpriteKit is a game development engine released by Apple in 2013. As such, it’s widely considered the best option for developing Apple-based games.
SpriteKit has support for iOS, macIS, tvOS and watchOS and integrates well with GameplayKit and SceneKit. It also has support for Swift.
This engine includes virtually all the necessary resources, including physics and lightening animation, to make the game development process enjoyable and hassle-free.
Notable games developed with SpriteKit include Spacequest, Tricky Wall, and Rapid Cube.
SpriteKit uses the Swift programming language. The code snippet below adds a sprite to a game.
/ 1 let player = SKSpriteNode(imageNamed: "player") override func didMove(to view: SKView) { // 2 backgroundColor = SKColor.white // 3 player.position = CGPoint(x: size.width * 0.1, y: size.height * 0.5) // 4 addChild(player) }
SpriteKit is a great option if you’re looking to build 2D games for the iOS operating system.
Formerly known as Ideaworks3D Limited, Marmalade SDK is a game development engine created by Marmalade Technologies Limited. This cross-platform engine supports Windows, iOS, and Android devices.
Gaming assets developed on Marmalade can be exported to other 3D modelling and animation tools such as Maya or Autodesk. The engine also supports 2D game development.
Some games built using Marmalade include Cut the Rope, Backbreaker, and Call of Duty: Zombies.
The code sample below is a .mkb
file, which is the file extension for Marmalade projects. The .mkb
file specifies all the necessary source files, libraries, and build options that must be implemented to complete the project in Marmalade.
# # Main MKB file for Hello project # # Modules used by this project subprojects { iwgx } # The files that make up the project (source, data etc.) files { [SourceCode] (source) Main.cpp } # Settings to configure the deployment process deployments { name="Hello" caption="Hello World" }
We specified the main.cpp
, which is a C++ file that contains the following C++ snippet.
//--------------------------------------------------------- // Learning Mobile Game Development with Marmalade // Chapter 1 - Hello //--------------------------------------------------------- // Marmalade SDK includes #include "IwGx.h" #include "s3eConfig.h" #include "s3eDevice.h" //--------------------------------------------------------- // Main entry point //--------------------------------------------------------- int main() { // Initialise Marmalade modules IwGxInit(); // Set a default message, then check the ICF file to see if // a proper message has been specified char lMessage[S3E_CONFIG_STRING_MAX] = "Hello!"; s3eConfigGetString("APP", "Message", lMessage); // Set screen clear colour to black IwGxSetColClear(0, 0, 0, 255); // Draw text at double default size IwGxPrintSetScale(2); // Loop until we receive a quit message while (!s3eDeviceCheckQuitRequest()) { // Allow device to process its internal events s3eDeviceYield(0); // Clear the screen IwGxClear(); // Display our message on screen IwGxPrintString(10, 10, lMessage); // Flush IwGx draw buffers to screen IwGxFlush(); // Swap screen double buffer IwGxSwapBuffers(); } // Terminate Marmalade modules IwGxTerminate(); return 0; }
Building and compiling does the rest. Check the official documentation for more details.
This is just a quick snapshot of what the mobile game developer community has to offer, but the five game engines we discussed in this guide represent a wide range of use cases and should help you determine what kind of tools you need for your next project.
Now that you’ve seen a basic rundown of the stregths and weaknesses associated with some of the most popular mobile game engines, it’s up to you now to pick one and start doing what you do best: creating incredibe mobile experiences.
Install LogRocket via npm or script tag. LogRocket.init()
must be called client-side, not
server-side
$ npm i --save logrocket // Code: import LogRocket from 'logrocket'; LogRocket.init('app/id');
// Add to your HTML: <script src="https://cdn.lr-ingest.com/LogRocket.min.js"></script> <script>window.LogRocket && window.LogRocket.init('app/id');</script>
Would you be interested in joining LogRocket's developer community?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up nowCompare Prisma and Drizzle ORMs to learn their differences, strengths, and weaknesses for data access and migrations.
It’s easy for devs to default to JavaScript to fix every problem. Let’s use the RoLP to find simpler alternatives with HTML and CSS.
Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.
Bypass anti-bot measures in Node.js with curl-impersonate. Learn how it mimics browsers to overcome bot detection for web scraping.
2 Replies to "Why reinvent the wheel? These 5 mobile game engines can give you a head start"
Nice explanation..
Statment about Solar2D “Not suitable for creating business apps” is totally wrong. The group I work for, and myself, chose Solar2D (ex CoronaLabs) for this purpose.