Cicanci | Creating an RTS Game in Unity 2023 | E-Book | www2.sack.de
E-Book

E-Book, Englisch, 548 Seiten

Cicanci Creating an RTS Game in Unity 2023

A comprehensive guide to creating your own strategy game from scratch using C#
1. Auflage 2023
ISBN: 978-1-80461-535-5
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection

A comprehensive guide to creating your own strategy game from scratch using C#

E-Book, Englisch, 548 Seiten

ISBN: 978-1-80461-535-5
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection



Building a successful real-time strategy game is challenging, because of both the complex mechanics and the need to strike a balance between different elements, ensuring that players enjoy creating and executing strategies against the game's AI.
Creating an RTS Game in Unity 2023 will teach you how to install and set up the Unity game engine, create a new 3D project, and build a level editor to make it easier to modify and add maps to a game. The RTS game will start to take shape while you learn to implement different core systems such as melee and ranged battles, unit spawners, camera controls, dynamic mapping generation, basic enemy AI, and the pathfinder algorithm. You'll also get to grips with implementing command units to perform actions, crafting and producing resources, basic physics and collision detection, and building an RTS game from scratch using C# and the latest features of the Unity game engine.
By the end of this book, you'll be able to make professional and high-quality end-to-end RTS games using the best practices and techniques from the gaming industry.

Cicanci Creating an RTS Game in Unity 2023 jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


Table of Contents - Introducing Real-Time Strategy Games
- Setting Up Unity and the Dragoncraft Project
- Getting Started with Our Level Design
- Creating the User Interface and HUD
- Spawning an Army of Units
- Commanding an Army of Units
- Attacking and Defending Units
- Implementing the Pathfinder
- Adding Enemies
- Creating an AI to Attack the Player
- Adding Enemies to the Map
- Balancing the Game's Difficulty
- Producing and Gathering Resources
- Crafting Buildings and Defense Towers
- Tracking Progression and Objectives
- Exporting and Expanding your Game


Preface


Real-time strategy (RTS) is a very challenging and competitive game genre, one of the first esports before the term even existed, and the base for many other genres and subgenres, showing the importance of RTS to the game industry.

My first contact with PC gaming was in the late 1990s, and I have unforgettable memories of and, especially, – two amazing RTS games that got me into PC gaming. In the last couple of decades, the RTS genre has expanded into other subgenres and was also the foundation for multiplayer online battle arena (MOBA) hits such as and .

With the Unity Engine, one of the most used game engines in recent years, we have everything that we need to build the most amazing games. In this book, we will get the most out of the built-in features in the Unity Engine, allowing us to focus on creating an RTS game that has mechanics and gameplay inspired by the classics of this genre.

You could say that we are living in a golden age of game development, where we are no longer limited by technology but by our own creativity!

Who this book is for


If you are a beginner game developer who wants to learn the skills to develop a professional RTS game, a programmer thinking of getting into the games industry and need to develop a portfolio, or even an indie game developer who is looking for inspiration to release your own games, this book is for you.

Professional game developers and programmers with experience in C# or game designers and artists that seek a practical guide to bring game ideas to life will also benefit from this book.

What this book covers


In , , we will learn what an RTS game is, the level and game design characteristics of this genre, and see the game design document of , the game you will make in this book.

In , , we will install the Unity Engine and our IDE, as well as setting up our project and importing the packages we will use from the Unity Asset Store.

In , , we start developing the first features of our RTS game by creating a level scene and the map using Prefabs, and then we will create a custom editor tool to speed up the level design and implement the camera movement.

In , , we will create our game UI using Unity’s Canvas and UI elements, and we will also add more cameras to render 3D objects in the UI.

In , , you will learn how to create a flexible system to configure units using ScriptableObjects, spawn the new Warrior unit using the Object Pooling pattern, and update the UI using the Message Queue pattern.

In , , we will see how to select the units on the map and give them a command to move to any position in a scene.

In , , you will learn how to implement the attack and defense for the units using the Command pattern, and we will add a new Mage unit and create a ranged attack by throwing a fireball.

In , , you will learn the different strategies to implement a Pathfinder algorithm, and then we will see how we can use the unit’s NavMesh system with our units.

In , , it is time to start adding enemies to our game by creating a configuration and spawning each of the three different types – an Orc, a Golem, and a Dragon.

In , , you will learn how to set up Unity’s physics settings, detect collision and calculate damage, and make enemies chase the units.

In , , we will create spawn points on the map to add enemies in the level configuration and make them patrol a specific area, and we will also create fog to cover the unexplored parts of the map.

In , , you will learn how to use unit tests to simulate battles between units and enemies, as well as how to analyze the results and iterate on a character’s configuration to balance the difficulty.

In , , you will learn how to produce resources automatically and command units to gather resources on the map.

In , , we will add buildings to upgrade the resource generation, learn how to upgrade units to make them stronger, and add a new tower defense unit to protect the settlement against enemies that are within its attack range.

In , , you will learn how to create and track objectives that will help in the game progression to determine whether the player won or lost the game.

In , , you will learn how to export your game for desktop platforms manually and then automate the process using a build system, as well as see how you can expand the game by adding more content.

To get the most out of this book


To get the most out of this book, a basic understanding of programming concepts and the C# programming language is required. Some experience with any game development engine or framework would be an advantage.

It is recommended that you familiarize yourself with the Unity Engine features and the interface. The Unity website has a lot of beginner-friendly content that can help you get a good understanding of the engine quickly.

Since we will develop an RTS game, it is also recommended that you play a few RTS games or watch gameplay videos on YouTube, especially the games and , which are the ones we will use as a reference and inspiration to develop the features of our game.

Software covered in the book

Operating system requirements

Unity Engine version 2023.1 or above

Windows or macOS

Visual Studio Code or Visual Studio 2022

Windows or macOS

C#

Windows or macOS

You will need an internet connection to download Unity, IDEs, and the assets required for the project. The disk space required for Unity Engine 2023.1 and Visual Studio Code or Visual Studio 2022 may vary, but make sure you have at least 30 GB of disk space before installing the software. The project itself should require at least 4 GB. Although it is not required, a dedicated graphics card is recommended.

You can find more information about the Unity Engine requirements in their documentation at https://docs.unity3d.com/2023.1/Documentation/Manual/system-requirements.html.

Download the example code files


You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Creating-an-RTS-game-in-Unity-2023. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used


There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, folder names, filenames, and pathnames. Here is an example: “Add the following new Start method to the LevelManager class.”

A block of code is set as follows:

using UnityEngine; namespace Dragoncraft {   public class LevelManager : MonoBehaviour   {     private void Start()     {     }   } }

When we wish to draw your attention to a particular part of a code block, the relevant lines or...


Cicanci Bruno:
Bruno Cicanci is a software engineer and game developer with professional experience on different technologies and platforms. Since 2009, Bruno helped to develop and publish many games, mainly using Unity for mobile devices. He writes about game development on his personal blog, which led him to present many talks at universities and events. Bruno holds a Computer Science BS. Degree and a specialization and Game Production and Programming. In the last decade, he worked at prestigious game studios such as Glu Mobile, Electronic Arts, and Aquiris. He is currently developing games and reusable technologies at Ubisoft. Originally from Sao Paulo, Brazil, Bruno currently resides in London, UK with his wife and two adorable cats.



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.