Reader small image

You're reading from  Unity 2022 Mobile Game Development - Third Edition

Product typeBook
Published inJun 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781804613726
Edition3rd Edition
Languages
Tools
Right arrow
Author (1)
John P. Doran
John P. Doran
author image
John P. Doran

John P. Doran is a passionate and seasoned Technical Game Designer, Software Engineer, and Author who is based in Incheon, South Korea. His passion for game development began at an early age. He later graduated from DigiPen Institute of Technology with a Bachelor of Science in Game Design. For over a decade, John has gained extensive hands-on expertise in game development working in various roles ranging from game designer to lead UI programmer working in teams consisting of just himself to over 70 people in student, mod, and professional game projects including working at LucasArts on Star Wars: 1313. Additionally, John has worked in game development education teaching in Singapore, South Korea, and the United States. To date, he has authored over 10 books pertaining to game development. John is currently a Technical Game Design Instructor at George Mason University Korea. Prior to his present ventures, he was an award-winning videographer.
Read more about John P. Doran

Right arrow

Remote Config

Getting a new build of your game exported can take quite a bit of time. It takes time to actually make the changes in the Unity Editor, and then you have to export the game and upload a new version on each of the app stores you are targeting. Then, you have to spend time waiting for them to approve the app and for everyone to actually download it.

One of the things I talk to my students about is creating projects that can be easily changed without having to open the Unity Editor. This can be done using data-driven development practices – such as building levels or encounters using text files, AssetBundles, or Unity’s Remote Config (previously Remote Settings) menu – allowing us to instantly modify variables in copies of the game that are already out.

In this chapter, we’re going to see just how easy it is to set up Unity’s Remote Config system, and how we can utilize it for a simple example, by changing the difficulty of our game...

Technical requirements

This book utilizes Unity 2022.1.0b16 and Unity Hub 3.3.1, but the steps should work with minimal changes in future versions of the editor. If you would like to download the exact version used in this book, you can visit Unity’s download archive at https://unity3d.com/get-unity/download/archive. You can also find the system requirements for Unity at https://docs.unity3d.com/2022.1/Documentation/Manual/system-requirements.html in the Unity Editor system requirements section. To deploy your project, you will need an Android or iOS device.

You can find the code files present in this chapter on GitHub at https://github.com/PacktPublishing/Unity-2022-Mobile-Game-Development-3rd-Edition/tree/main/Chapter11.

Remote Config setup

In order for us to use Remote Config, the first thing we’re going to need to do is add the Remote Config package to our project. So, let’s take a look at how we can do that using the following steps:

  1. From the Unity Editor, open the Services window of the Package Manager (shown in the top-right part of the next screenshot) by either clicking on the cloud button at the top left of the screen or going to Window | General | Services.
Figure 11.1: The location of the Services button

Figure 11.1: The location of the Services button

If all goes well, you should see something like the following screenshot:

Figure 11.2: Package Manager | Services

Figure 11.2: Package Manager | Services

  1. From there, scroll down and click on the Remote Config package, and then click on the Install button at the bottom right. If all went well, you should see something like the following screenshot:
Figure 11.3: The Remote Config packages installed

Figure 11.3: The Remote Config packages installed

  1. Close...

Integrating Game Overrides into gameplay

Now that we can see how to get those values and how the system works, let’s see how we can actually integrate it with our project and have it affect gameplay:

  1. Open up the gameplay scene if it isn’t open already, and create a new GameObject by going to GameObject | Create Empty. Name the new object Remote Config Manager and reset its position.
  2. Then, from the Project window, go to the Assets\Scripts folder and create a new C# script called RemoteConfigManager.
  3. Attach the newly created RemoteConfigManager component to the RemoteConfigManager object we created in step 1. If all went well, your project should look similar to the following screenshot.
Figure 11.10: Adding RemoteConfigManager

Figure 11.10: Adding RemoteConfigManager

  1. Back in the Project window, double-click on the RemoteConfigManager script to open it with the script editor of your choice and replace its script with the following:
    using UnityEngine;
    using...

Summary

In this chapter, we learned how we can use Remote Config to make adjustments to our games on the fly.

Important note

There’s a lot more that you can do with Remote Settings. You can learn more about Remote Config and how to use it to work with non-default parameters at https://docs.unity3d.com/Manual/UnityAnalyticsRemoteSettingsComponent.html.

With this, we have all of the implementation details of our game complete, but our game right now is pretty bare. In the next chapter, we will look into ways to make our game more polished, using features such as particle systems and screen shake.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Unity 2022 Mobile Game Development - Third Edition
Published in: Jun 2023Publisher: PacktISBN-13: 9781804613726
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
John P. Doran

John P. Doran is a passionate and seasoned Technical Game Designer, Software Engineer, and Author who is based in Incheon, South Korea. His passion for game development began at an early age. He later graduated from DigiPen Institute of Technology with a Bachelor of Science in Game Design. For over a decade, John has gained extensive hands-on expertise in game development working in various roles ranging from game designer to lead UI programmer working in teams consisting of just himself to over 70 people in student, mod, and professional game projects including working at LucasArts on Star Wars: 1313. Additionally, John has worked in game development education teaching in Singapore, South Korea, and the United States. To date, he has authored over 10 books pertaining to game development. John is currently a Technical Game Design Instructor at George Mason University Korea. Prior to his present ventures, he was an award-winning videographer.
Read more about John P. Doran