Work in Unity3D: Basics of creating games. Creating a game on Android Lessons Unity 5 3D games for Android

  • 07.06.2021

Unity 3D will be an indispensable assistant for those who professionally approach the task of creating quality material. The application integrated ready models, scripts and textures that can be supplemented with your own content - images, sounds and video recordings.

Finished products created in Unity 3D are compatible with almost all popular platforms - ranging from mobile phones and ending with Smart TV TVs.

Program capabilities:

  • learning Unity engine;
  • flexible multifunctional editor;
  • high compilation rate;
  • easy in mastering the interface;
  • compatibility with a large number of platforms.

Principle of operation

To use the program, you need to download the Unity Hub platform, and you can try the functions of the free version of Personal through it. It is available at the volume of monetization of up to 100 thousand dollars annually.

In addition to the free option, you can subscribe to two other extended versions:

Unity Plus (~ $ 25 Monthly) - provides limited access to the Customer Success Advisor service, collects information about failures on user devices, monitor reviews.

Unity Pro (~ $ 125 Monthly) - maximum subscription option. Provides support from professional developers, it allows to obtain priority access to support from the program creators, includes improved features for monitoring performance and collect statistics.

Building all gaming actions is based on a fairly high-quality physical core of the program (PhysX), from which the behavior of models depends. Due to the possibility of importing textures and objects, the product can be given uniqueness or use the tools integrated developer. It is important to understand that each object created in this designer is a specific set of scripts and events, which can be managed independently.

For professional work with Unity 3D, it is necessary for some time to get acquainted with the interface and the capabilities of the application. To do this, on the Internet you can find a lot of rollers or visit specialized courses, which are held in many major cities.

It should be noted that to work with 3D graphics you need to have a modern computer with a hardware video card.

Pros:

  • practically limitless functionality to create projects;
  • support for browser 3D graphics;
  • compatibility with game consoles and modern TVs;
  • a large number of visualization tools;
  • there is a free version.

Minuses:

  • to create a high-quality product, specific knowledge is needed;
  • there is no possibility of very fine configuration of the physical core of the program;
  • there is no interface translation into Russian.

You can download UNITi 3D not only to prepare a competitor to a popular online jaggernaut toy (which is also drawn by the tools of the hero of our review), but also to create chic three-dimensional presentations. Let it take a little longer, but the Wow effect for the audience is guaranteed.

To meet the capabilities of the platform, it is enough to download the free version of Unity 3D. If you need access to the source code, take a look toward the paid versions.

Analogs:

  • Game Editor - a free app to create games;
  • CONSTRUCT 2 is a popular game designer, distinguished by a simple interface.
  • CONSTRUCT 2 is a powerful program for creating 2D projects.

Development of mobile applications is one of the most profitable classes in the computer industry. The creation of a game on Android costs several hundred or thousands of dollars, and profit can reach a million dollars. In this regard, many people are interested in developing applications for phone. In this article, you will learn how to create a game on android from scratch through a computer, which engine and the designer is better to choose.

No successful game costs without beautiful graphics, so creating a design is one of the most important stages of development. The design on the Android OS is implemented using the "Design Document" or Dzepock. You need to start creating a toy from his detailed study. The file contains:

  1. Object models;
  2. Functional specifications;
  3. Gaming content;
  4. Interface.

Consider each of the items in more detail.

Object models

This is information about the functionality of each subject. Object models are responsible for the possibility of buying and selling objects, as well as for improving the game characteristics of characters.

Functional specifications

Here is described by gameplay, the main features of each character. Also here is a description of the features of game items - weapons, aidheeks, armor and others. In fact, the functional specifications are the rules for which the gameplay occurs. The better this section will be worked, the easier it will create a high-quality android game.

Game Content

This is a text game filling. It describes the dialogs of characters and what the weapon can be damaged, how much health will take off, what characteristics will increase when using various equipment. It also contains a detailed description of each subject.

Interface

The interface is how the user will interact with the game. It includes the buttons with which you can manage the character, and the menu partitions: for example, play, account, settings, top players, help. If you do not have experience in creating applications for Android, before creating your own download from the Play Market and analyze the popular games and move the best solutions to your project.

Game engine

The basis of any game is the engine. This software that allows you to develop and run it. It contains a whole range of programs, including a rendering engine, a physical engine, sound, animation and much more. To facilitate the process of writing programs, third-party developers create their own game engines specifically for android applications.

Each of them offers various functions: Some are designed for 3D, others for 2D, multiplatform can be supported. There are a huge amount of such engines, but if you are new to, it is better to choose one of the most popular, as all the necessary functions will be present.

UDK.

Torque 2D / 3D

What is a game designer?

The designer is a program that combines the gaming engine and an integrated development environment. The designer makes the development process available to people who do not have programming skills. Some of the designers allow you to create games of certain genres, others have a maximum functionality, but cost much more money. For a beginner creator of mobile applications, the choice of the designer is one of the most responsible moments, because the fate of the future application will depend on its capabilities.

The designer allows you to create games of various genres for Windows, Android and iOS. It offers a large selection of finished locations, objects, characters and sound decorations, so the creation of the first android game does not take much time. Users familiar with JS and C ++ programming languages \u200b\u200bcan use the built-in GML. The only drawback is that the program is not translated into Russian.

Conclusion

Creating a game for Android is not quite simple, but a very profitable business. If you decide to develop a game and earn on it, first work the idea. Next, write "Design document" and decide on the game engine that can mostly reveal its potential. After that, you can proceed directly to the creation of the application in the constructor.

Video

To get acquainted in more detail with the process of creating android games, read the series of videos on this lesson.

POST Views: 19 374

We told about how you can create your Android game with the Unreal Engine engine. In this article, we will consider another no less popular motion engine Unity.

Unity is a very famous engine among Indy developers. In essence, this is a cross-platform engine that allows you to develop 3D- I. 2d.-games. A feature that the Unity allocates among other engines is the low threshold of entry for beginners in the presence of a rich toolkit for professionals. The cross-platform allows you to develop applications for any platform, starting with desktop games and ending with mobile.

Separately, it is worth saying about the subscription system, since Unity is not completely free product. There are several types of subscriptions:

  • Personal. A free version containing all the basic functions of the engine. Has the following limitation: income per year or the volume of attractive means should not exceed 100000$ .
  • Plus.. Per 35 dollars a month Various reports and analytics are provided, as well as the ability to change the sewn screen, 20% - buy shopping discount in ASSET Store. And various minor advantages. Has the following limitation: income per year or the volume of attractive means should not exceed 200000$ .
  • Pro.. Per 125 dollars a month Includes all the advantages of the version Plus. And additionally professional service and premium support. Without restrictions on the turnover or volume of funds.
  • Separate versions for business (used by large companies).

Thus, indi-developers with small budgets should be enough Personal or Plus.otherwise you have to make a subscription Pro.. This article will use the free version for the first launch.

Step 1. Install Unity

In order to start installing Unity, you need to go to the Unity Store website, where you are prompted to select a subscription type. As mentioned above, choose Personal.

Then it will be prompted to accept the terms of use and download the installer. You can also familiarize yourself with the system requirements for working with Unity.

After starting the installer, it will be prompted to choose which components must be installed. Since we need to create an app under Android, deliver the checkbox on Android Build Support. Also, if you wish, instead of unity can be installed VISUAL STUDIO COMMUNITY 2017 For programming on C #.

After that, it will only be left to select the installation path and start installing Unity.

Step 2. Registration and Configure Unity

After completing the installation and running Unity, we are invited to enter your account.

Then it will be prompted to choose a subscription again, they will also focus on Personal. In this case, it will be necessary to confirm that the company's annual income is less than $ 100,000, or that UNITY is used for learning purposes.

At the end, it is proposed to pass a small survey in which you need to answer what you do and for what purpose install Unity.

Step 3. Creating a new project

Configuring Unity, we fall on the selection screen \\ creating a project. Here you need to click NewTo create your new project.

After that, in the window that appears, it is proposed to enter the name of the project and the directory where it will be located. Also do not forget to check the box on 3DTo use the editor in 3D mode.

Having finished with this, click Create Project.To create a project. After that, the editor window opens with a pre-generated scene.

We will not yet be able to deal with the imprint of the programming and take the ready-made game for example. For this there is here ASSET Store.which contains a huge number of ready-made models, animations, sounds (and even games), both paid and free.

To open the Asset Store, you need in the menu Window. choose ASSET Store. (key combination Ctrl-9.).

The store window opens. We introduce in the search string " flappy Bird STYLE EXAMPLE GAME"And open the free example that we will use in our project.

Press Download And thereby downloading it, you can then import yourself into the project. To do this click ImportAfter that, a warning appears that the project settings after imports will be changed.

Agree to import, you will see the window in which you need to select which components to import. Choose everything and click Import.

After completing imports in the project browser, you will see new files. These are the game files. To open the scene in the editor, expand Flappy Bird Style. - Scenes and double click on Main..

As a result, a game scene will appear in the 3D editor window.

You can check how the game works, right in Unity by clicking on the button. Play. above the editor window.

Step 4. Setting up Android tools

Note: If you are using Android Studio.You already have all the necessary components already installed and therefore you can safely switch to the next step.

In order to collect the resulting Android game, you need to set the following tools:

  • Java Development Kit (JDK). You can download it from Java. By clicking on the link, you will see at the very top Java Platform (JDK), click by Download Next to the inscription, then select your operating system and start downloading. After that, just follow the instructions of the installer.
  • Android SDK.. The easiest way to establish the current version is downloading Android Studio, with which this SDK comes. To do this, go to the site of Android Studio and click Download Android Studio.. The Android Studio installer set the basic components of the Android SDK required to develop on Android.

Step 5. Preparing a project for running

To begin with, you need to change the development platform on Android. To do this, open the FILE menu and select Build Settings.

In the window that appears, you need to choose Android And then click Switch Platform.

Switching the platform reports that we will collect an application for Android. This means that when we collect the application, Unity will create APK file.. Switching the platform also causes Unity to import all assets project anew. It will not take much time on a small project, but keep in mind that in large projects this operation may take a long time.

Now we need to specify the name of the package for the application.

Note: Package name is a unique application identifier, it is written in the reverse DNS style in the format com.companyname.ProductName.. After publishing an application on Google Play, the package name cannot be changed.

To do this, go to the menu Edit. and choose Project Settings - Player.

The right part of Unity will open a window with many different settings, such as the application version, target and minimal SDK, the choice of icons, etc. Here we need in the block Other settings to find Identification and set the package name in the field Package Name.. If you wish, you can also change other parameters.

Now it remains only to specify the path before Android SDK and JDK. To do this, go to the menu and choose Edit - Preferences..

In the window that appears, you need to go to External Tools. and in the fields SDK and Jdk. Specify the appropriate paths, then close the window.

Step 6. Assembly and running an application

It is time to collect your first application on Unity. To do this, select the Select menu File - Build Settings. A window will open, you will need to add the scene to be collected. Since we have this scene is already open in the editor, just press enough Add Open ScenesTo add it to the assembly, after adding you will see it in the Scene list.

It remains only to click BuildAfter which Unity will start assembling the application. Before this you can be asked to select a folder where the applications collected files will be saved, as well as the name APK file.

Note: At the moment, if you have an alpha version in Android SDK Build-Tools. (version 28.0.0-RC1), when assembling the grade will give an error. To fix it, simply delete this version from Android SDK.

As a result, in the folder that you specified, a collected APK file will appear, ready to install on the emulator or on the real device.

Let's see what is inside the assembled APK. To do this, use the utility APK Analyzerwhich is part of Android Studio,

The size of the APK file in the uncompressed form is 21.1 Mb.in compressed 20.9 Mb.. As you can see from the graph, most of the volume occupy third-party libraries added by Unity. Then B. assets.all resources are located in the scene assembled. File classes.dex. Contains everything 89 Classes I. 479 methods.

In addition, if you look into Androidmanifest.xml.The application consists of one activity.

Conclusion

That's all. In this article we learned to install and configure Unity, and also collected our first Android application.

Unity is the engine on which most of the modern games are built on different platforms. Through the engine, it is actually creating games focused on launching on computers (Windows, Linux, MacOS), mobile phones, tablet computers (Android, iOS) and even game consoles PlayStation, Xbox, Nintendo.

How to create games in unity?

The basis of Unity is a component-oriented concept. In fact, any game consists of the mass of objects diluted with additional components. For example, during the creation of the platformer, we create a GameObject, which additionally attach a graphic component to it, which is responsible for displaying the character, and the control component, it provides the character control by mouse, keyboard, joystick or touchscreen. The engine does not impose restrictions on the number of similar modules. You can add so many components to GameObject as needed. All work on the engine is built on the creation of GameObject and applying suitable components to them.

Newbies can mislead the visible simplicity of the process, although it is not. To create a unique and popular game will have to write a lot of components from scratch. More precisely, in the Unity environment it is called a script. The native language creation language is C #, but also partially used by JavaScript and Boo (Cropped Python Option). Create our own components is not easy, you can even say - this is a complex procedure directly tied to classical programming. Without the availability of a sufficient level of knowledge in programming, it will have to be unavassed.

Supported platforms

Many large projects prefer UNITY due to a huge list of platforms compatible with the engine. The finished application is really run on any computer operating system, popular mobile platforms and SmartTV. What to say, even browser games and applications for specific platforms ( like Tizen Os.) Preferably developed on UNITY.

However, here is not so smooth. If necessary, you can write specific algorithms based on low-level code, under the same Android you need to have thorough knowledge of Java.

The same is true of iOS. Another feature of the iOS is that under it is possible only from a computer or a tablet from Apple. In the absence of a MacBook or a similar device, the release of the game quickly stalls and Unity is not at all, Apple itself imposes a similar limitation. The output is simple: if there are iOS-development in the plans, you should choose a suitable device for assembly in advance.

How and where to develop a game on the engine?

The long-term game development process can be carried out both within Windows and Mac OS X. already exist versions of the editor under Linux, but it is not yet necessary to count on their stable work. Most of the time to create the game, the developer is conducted inside the Unity editor. You still have to write a lot of time to write code of scripts, we can create it either in standard monodevelop, or in any editor of a third-party developer. Now actively use Visual Studio, as well as Sublime Text, but only with due tuning.

Developing games for devices with Android OS requires an approach similar to the development of IOS. On the other hand, the hardware of Android devices is not subject to clear standards, which makes you solve the issues that are missing when working with iOS. There are also distinctions between unity versions for Android and iOS.

Preparation of the development environment for Android

Before you can test your games on the device, you will need to prepare a development environment. In particular - download and install the Android SDK of the desired platform and add your device to the system (this process is different for Windows and Mac). This is written in detail on the Android-Developer's website, as well as additional information can be provided by the manufacturer of your device. Since this is a rather complicated process, we prepared a small instruction that will help you prepare everything you need to develop. If you need more information, you can get it on the Android-developer portal.

Access Android features

Unity provides API to access the Android entry tools and settings. Available classes are documented on the Writing code page for Android assemblies.

Binding C, C ++ or Java code to scripts

Unity allows you to call functions written in C / C ++ directly from scripts (Java functions can be caused by an indirect way). To find out how from Unity to access features from a native code, visit the plug-ins for Android.

Occlusion Culling (clipping invisible geometry)

Unity provides Occlusion Culling support, which is very useful when optimizing mobile platforms. More information can be found on the Occlusion Culling page.

Setting the initial screensaver

Screensaver displayed when starting the game can be configured - see this page for more information.

Solving problems and error messages

There are many reasons due to which your application crashes or does not work properly. Our Android specific task guide will help you deal with the causes of errors in the shortest possible time. If, after reading the manual, you assume that the problem is in Unity - you should draw up an error message. Refer to this page for instructions.

Like Unity for Android differs from the desktop version

JavaScript with strict typing

To improve performance in the Android version of Unity, dynamic typing in JavaScript is always disabled (as if each script is automatically used #Pragma Strict). It is important to remember if you transfer the project to the Android with older platforms, and if you encounter the compilation errors - the problem is to seek primarily in typing. With such errors, it is usually easy to cope with such errors, making sure that the types of all variables are explicitly indicated or given when initialized.

Although Unity Android and supports DXT / PVRTC / ATC texture, Unity unpacks textures into RGB format (A) when executed if these compression methods are supported on a specific device. It may seriously affect the performance of the GPU drawing, therefore it is recommended to use ETC format. It is the actual standard for Android, and must be supported by all modern devices. On the other hand, ETC does not support the alpha channel, and sometimes 16-bit RGBA textures will be the best choice on quality criteria, size and rendering speed where the alpha channel is needed.