How to Create an Android Game with Unity?
The number of mobile video game users is higher than ever, so it is not surprising that a force behind the growth of the gaming industry has been mobile video games. In 2020, smartphone games accounted for 57% of video gaming revenue worldwide. As smartphones usage continues to grow, mobile games revenue is expected to be on track to surpass the 100 billion dollar mark by 2023.
Of all Android app downloads, mobile games constitute about 21%, and this percentage is expected to increase in 2021. With many investors and developers coming out with outstanding games in 2021-2022, the mobile gaming industry will present many business opportunities over the next period.
What features do Android video games have?
There are millions of games on Google Play, but only a few have become popular worldwide such as PUBG mobile and Clash Royale. However, if we look more closely, we can see that games which broken records and become insanely profitable have some common essential features.
Social Features create a strong sense of community, motivate players to invite their friends to the gaming app. increase the rate of buying the game, and keeping users long-term. Social features in Android games allow creating an engaged community of users, similar to the social networking platforms. Some examples of social features are:
- Activity feeds – This is exciting for players because they can share their in-app experience and view their friends’ progress.
- In-game chats – This in-game element has a double benefit: it gives users a real-life gaming experience while saving them from the inconvenience of changing the application to communicate with their friends.
- Push notifications notify players whenever someone mentions them in a comment, receives a gift, it’s their turn to play, etc. Thus, notifications keep players engaged and return them to the application, even if they have closed it.
- Guilds help users create communities based on common interests, game styles, and levels of involvement. Such communities are an additional reason why players want to stay in the game for as long as possible.
Constant updates and new features
Android games can become monotonous and boring. To keep the game attractive in the long run, developers need to use new updates and features to add a new dynamic. Thus, players receive constant value and will tend to come back to the game.
Social Media platforms for connecting with players
Thanks to social platforms, it is now more accessible for the publisher to purchase data from users. Thus they can actively seek to interact with players and build a community of engaged players. In addition, there is a significant advantage for the player: he can connect directly with his profile in the Android gaming app without bothering to create an account manually.
The monetization strategy fits every target audience
Ideally, publishers should have a monetization strategy based on each target audience. The Android game should provide multiple options for users to pay. For example, the game app can provide a range of prices for different unlockables. People can spend $ 39.99 or $ 10 and get a subsequent unlockable within that amount.
What kinds of Android video games can be made with Unity?
There are many different kinds of games in the Play Store, so that players can get a good mix of categories, including first-person shooters (FPS), role-playing games (RPG), platformers, racing games, puzzlers, strategy games, and more. Android games can be of different genres, and every player has their own preference. However, according to App Annie, in the first half of 2020, hyper-casual games dominated the global mobile market.
Three of the top 5 grossing mobile games featured real-time multiplayer gameplay – from PvP battle, co-op play to MMORPGs – proving that this genre can be as popular on smartphones and PCs.
Creating Android games with Unity: step by step
Unity is one of the most popular game engines that game developers love to use in their projects. With Unity, they can create 2D and 3D games for Android: from basic 2D sprite games to games featuring large complex 3D worlds. In addition, game developers can experience a vast marketplace of prebuilt art and code assets, both free and paid, available for use in Unity projects. They also have a wide range of official and community information and education resources to support their Android gaming projects.
STEP 1: Set Up Unity & Android Studio
Before you begin, make sure you have the latest version of Unity to avoid errors and bugs. Also, any game on mobile platforms requires the respective SDK installed on your computer; for Android, you need Android Studios, which can be downloaded from developer.android.com, following the instructions on the website.
After installation, it is recommended to install the drivers for the phone by opening Android Studio, clicking Configure> SDK Manager, then clicking Launch Standalone SDK Manager. Without Android Studios installed, you can’t develop a gaming app.
STEP 2: Setting Up Project & Creating Particle Prefabs
Setting up Project. To make the process simpler, it’s good to create folders in your assets folder from the beginning:
To create settings:
- Go to File> Build Settings.
- Here access the Android option and click on “Switch Platform” in the bottom left corner.
- Save the scene by either pressing Ctrl + S or choosing “Save Scene” in the File Menu.
- Save this scene as “Main Scene” in your “Scenes” folder. This operation cannot be done without Android Studios, so it is necessary to install it, as we said above.
Creating Particle Prefabs. Particles are helpful tools that game developers use to create fog, dust, flames, explosions, and all sorts of effects. The effect on resources is usually minimal, as Particles uses small 2D images animated to give the effect needed, hence the name Particles.
Let’s take an example. Here is an image with a small object on a black background. To start, save the image in your Textures folder.
Set the Texture Type to Texture by clicking on the image in your Textures folder, selecting the appropriate value in the Inspector, and then clicking Apply.
Create a Particle System and make sure that the Texture of the Particle System is set to the Star Texture by expanding the Shader and selecting the Star Texture in the box on the right.
To make the background transparent and optimize for Android, select the Mobile / Particle / Alpha Blended Shader by clicking the drop-down box next to Shader, then Mobile> Particles> Alpha Blended.
Change the name at the top in the Inspector to “Explosion” and do the same in the Hierarchy. Then drag this Explosion Particle System from the Hierarchy to your Prefabs folder in the Project view. This way, you will create a prefab of that Particle System.
STEP 3: Creating & Adding Effects Script
Creating the Script. Here begins the programming part. In the beginning, create a new C # Script in your Scripts folder (click on Scripts folder, then Right Click in the Project Window> Create> C # Script) and label this Script as “SpecialEffects.” Then, open it up in your desired IDE (Integrated Development Environment) and start writing the code to create the Script.
Adding the Script to the Scene. Create a new Empty Game Object, label it as Scripts and drag the Script from your Scripts folder onto the Scripts Game Object.
Now assign the Variables to their respective Prefabs by dragging the Prefab from the Prefabs folder in the Project View to the Scripts properties in the Inspector Window.
STEP 4: Creating & Adding Touch Controls Script
Creating the Script. Touch controls have the role of triggering effects when touching the screen. The effects depend on the tactile touch: the touch, swipe or pinch to zoom, etc.
The first step is to create a new Script in your Scripts folder and label it “TouchControls.” Then write your code under the Update function.
Adding the Script to the Scene. After writing the code for the Controls Script, add it to the scene the same way as the previous Script, or it won’t work.
These steps were mainly programming. Next, you need to write code to create Menu & HUD, but before that, you need to test what you have created so far.
STEP 5: Testing
Without this step, you will not know if everything you have created works without problems, as you wanted. Ideally, every time you implement a new function, you should test it. There are several testing methods, the most effective being to test on an Android phone as you progress with the development of the gaming app. If you have the correct drivers installed, you can do this easily with Unity.
Go to Build Settings in the File Menu, click on “Add Open Scenes,” and It should add the “Main Scene” to the list and give it the number “0”. After this step, check if your selected platform is Android and your phone is connected to your computer, then click on “Build and Run.”
Many people think that it is challenging to create a video game and requires a lot of knowledge. This is mostly true, but using a game engine like Unity reduces the learning curve and will save you a lot of time.
Because Unity is one of the most used game engines for Android games, the excellent part is that you will find a lot of information and documentation from other developers with the same questions as you.
If you need help with your Android game development journey, at Starloop Studios, you’ll find the top certified Unity game developers you can hire. With ten years of extensive experience, our talented game development experts help you transform your creative dreams into a striking Unity game app by providing cutting-edge gaming solutions and real-time consultation.
Feel free to contact us and schedule a free consultation with one of our Starloopians.