Book Image

Building an RPG with Unity 2018 - Second Edition

By : Vahé Karamian
Book Image

Building an RPG with Unity 2018 - Second Edition

By: Vahé Karamian

Overview of this book

In a role-playing game (RPG), users control a character, usually in the game's imaginary universe. Unity has become a top choice for developers looking to create these kinds of immersive RPGs. Building an RPG with Unity 2018, based on building some of the most common RPG features, teaches you tips, tricks, and techniques that can be applied to your own game. To start with, the book guides you through the fundamentals of role-playing games. You will learn the necessary aspects of building an RPG, such as structuring the game environment, customizing characters, controlling the camera, and designing other attributes such as inventory and weapons. You will also explore designing game levels by adding more features. Once you have understood the bigger picture, you will understand how to tackle the obstacles of networking in Unity and implement multiplayer mode for your RPG games. By the end of the book, you will be able to build upon the core RPG framework elements to create your own immersive games.
Table of Contents (16 chapters)
Title Page
Copyright and Credits
Packt Upsell

Testing our network-enabled PC and NPC

At this point, we have all of the assets needed to test out our network-enabled RPG characters. There is one final step that we need to perform if you have not done so already.

Select the NetworkManager GameObject in the Hierarchy window, and from the Inspector window, you will need to make sure certain things have been assigned in the SpawnInfo section.

Player Prefab should be assigned to your player character prefab. Mine is named PC-CC-Network-1. Make sure Auto Create Player is set to True.

You will also register your NPC prefabs and other network-enabled non-character prefabs in the Registered Spawnable Prefabs. I have the barbarian prefab named B1-Network-1 assigned, barbarian_helmet_01_LOD0_Network, and shield_01_LOD0_Network.

Take a look at the following screenshot:

Alright, at last, we can do a build. Let's go ahead and make a stand-alone build of our game. Make sure that the current scene is in the build configuration:

Go ahead and launch two instances...