Building an RPG with Unity 5.x - Vahe Karamian - E-Book

Building an RPG with Unity 5.x E-Book

Vahe Karamian

0,0
38,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Unleash the full potential of Unity to build a fully playable, high-quality multiplayer RPG

About This Book

  • Learn to build a multiplayer real-time strategy game from scratch using Unity
  • Gain knowledge of Unity's UI system to build complex user interfaces
  • See how to build and customize your framework for your RPG games

Who This Book Is For

If you have always wanted to create a high-end RPG using Unity, then this book is for you. Prior knowledge of game development is required and experience working with Unity will be beneficial.

What You Will Learn

  • Construct a framework for inventory, equipment, characters, enemies, quests, and game events
  • See how to load and unload scenes and assets
  • Create multiplayer game settings for our RPG
  • Design a UI for user input and feedback
  • Enhance Game Master to handle all aspects of the RPG
  • Develop a custom pathfinding system
  • Implement AI for character and non-character players

In Detail

Unity is one of the most cutting-edge game engines in the world. Developers are looking for the best ways to create games of any genre in the engine. This comprehensive guide on building an RPG with Unity teaches you high-end techniques currently used in developing modern games - the tips, tricks, and techniques can be applied to your own role RPG.

We begin with an introduction to, and the fundamentals of, RPG games. Moving further, you will learn the necessary parts of building an RPG, such as structuring the game environment, customizing characters, controlling the camera, and designing other attributes like inventory, weapons, and so on.

We also cover designing levels of the game by adding more features to it and making the game more interesting. You will also learn how to get around the obstacle of networking in Unity and be able to implement Multi-Player mode for your RPG games.

By the end of the book, you will be able to build upon core the RPG framework elements to create your own game experience.

Style and approach

This step-by-step tutorial will teach you how to build a multiplayer RPG. In this book you will explore the core concepts of what typical strategy one might need to build a complete game.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 322

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Building an RPG with Unity 5.x
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. In the Beginning
A brief history
Characteristics of an RPG
Story and setting
A glimpse at our cRPG story
Exploration and quests
A glimpse at our exploration and quests
Inventory system
Character development
Experience and levelling
Combat system
User interface and graphics
Existing or upcoming RPG games
Dark Souls 3
Fallout 4
Divinity: Original Sin
Patterns in RPG
Terminology
Contest Tree
Last Man Standing
Negotiated Contest
Summary
2. Setting the Atmosphere
Building our RPG
The story of the Zazar Dynasty
Plot
Exploration and quests
Awakening
The village
Broken forest - the horizon
The kingdom
Asset inventory
Environment assets
Character assets
Level design
Setting the stage
Terrain toolkit in a nutshell
The awakening
Testing the level
Creating the Main Menu
Creating the Game Master
Summary
3. Character Design
Character definitions
Base character class attributes
Character states
Character model
Rigging your model
Character motion
Animator Controller
Animation states
Character controller
Modification to animations
Inverse Kinematics
Summary
4. Player Character and Non-Player Character Design
Customizing the Player Character
Customizable parts
User interface
The Code for character customization
Preserving our character state
Recap
Non-Player Characters
Non-Player Character basics
Setting up the Non-Player Character
NPC Animator Controller
NPC attack
NPC AI
PC and NPC interaction
Summary
5. Game Master and Game Mechanics
The Game Master
Managing game settings and audio
Managing scenes
Improving Game Master
Level controller
Audio controller
Player data management
PC class enhancements
Character customization class update
Changes to UI Controller
Testing
Summary
6. Inventory System
Inventory system
Weighted Inventory
Determining item types
Creating inventory item
Creating the Prefab
Adding Inventory Item Agent
Inventory Items Defined as Prefabs
Inventory Interface
Creating the inventory UI framework
Designing a Dynamic Item Viewer
Adding a Scroll View
Adding Elements to PanelItem and Scroll View
Adding txtItemElement Dynamically
Building the Final Inventory Item UI
Integrating the UI with the actual inventory system
Hooking the category buttons and displaying the data
Testing the Inventory System
Inventory items and the Player Character
Applying inventory items
How It Looks
Summary
7. User Interface and System Feedback
Designing a Heads Up Display
Basic information for a HUD
Our design
HUD framework
Completing HUD design
Panel character Info
Panel active inventory items
Special items panel
Integrating the code
Enemy stats in the HUD
NPC stats user interface
Creating the NPC canvas
NPC health
Enhancing the code
Summary
8. Multiplayer Setup
Challenges of a Multiplayer Game
Initial Multiplayer Game
Fundamental Networking Components
Networking Project
Adding Player Character
Variable Synchronization
Network Callbacks
Sending Commands
Client RPC Calls
Creating the Canon Ball for the Tank
Creating Tank Prefab and Configuring NetworkManager
Adding the Enemy Tank
Building and Testing
Network Enabling RPG Characters
Creating a Scene for RPG
Networked Player Character
Networked Non-Player Character
Synchronizing Player Customization and Items
Spawning NPC and Other Items
Testing Our Network-Enabled PC and NPC
What's Next
Summary

Building an RPG with Unity 5.x

Building an RPG with Unity 5.x

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: October 2016

Production reference: 1101015

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham 

B3 2PB, UK.

ISBN 978-1-78528-500-4

www.packtpub.com

Credits

Author

Vahé Karamian

Copy Editor

Safis Editing

Reviewers

Spencer Grey

Project Coordinator

Sheejal Shah

Commissioning Editor

Ashwin Nair

Proofreader

Safis Editing

Acquisition Editor

Divya Poojari

Indexer

Mariammal Chettiyar

Content Development Editor

Deepti Thore

Graphics

Abhinash Sahu

Technical Editor

Anushree Arun Tendulkar

Production Coordinator

Nilesh Mohite

About the Author

Vahé Karamian is a software consultant and author based in Los Angeles, CA. He has been providing software development services to some of the top pharmaceutical, biotech, and medical device manufacturing companies in the world. His latest clients included Department of Planning and Evox Imaging. Providing web, mobile, and virtual reality experiences.

He came across Unity when he was searching for a game engine for his projects in 2010. The rest is history. He is the founder of the Granada Hills Unity User Group and is actively working with the user community to educate new developers.

He is the author of Introduction to Game Programming: Using C# and Unity 3D. The book targets individuals with no programming background. The objective of the book is to give the reader a good foundation on the fundamentals of programming concepts and the essentials for Unity. It is available in both eBook and paperback editions. Visit www.noorcon.com for more information.

Vahé holds a master's degree in computer science, and is currently lecturing the following topics: Introduction to Computer Science, Data Structures and Algorithms, Operating Systems, Game Design and Development. 

In no particular order, I would like to acknowledge the following individuals who have been working on the reparation and production of this title: Spencer Grey, Divya Poojari, Sweta Basu, Divij Kotian, and Anushree Tendulkar. I am sure there are many more involved in the process. These are the folks who I have had the pleasure to meet during the process. Your comments and feedback were a valuable part of the final result of this work. Last but not least,

I would like to acknowledge my wife Armineh and our two beautiful children Maximilian and Makayla for their support through the long nights in the preparation of this book. Thank you and love you.

About the Reviewer

Spencer Grey is an award-winning designer-developer. He was creative director at Sesame Street’s Interactive group then co-founded Electric FunStuff. For 15 years he was creative and technical lead working with companies such as Sony, Lego, and Scholastic. And developing products with ActionScript and C#. He was technical reviewer for David Brackeen’s Developing Games in Java.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Preface

Everyone wants to make a game, today this is possible more than ever due to the democratization of the game industry and the tools that are used to design and develop games. This books is written with several purposes in mind. Unity has come a long way from its early and humble beginnings. As of the writing of this book, Unity stands at version 5.4. Some games that have been developed using the Unity engine are: Republique Remastered, The Room Three and Mevius Final Fantasy, to name a few.

This book is intended as a reference guide for individuals who want to learn Unity and apply their skills for the creation of a role-playing game.

What this book covers

Chapter 1, In the Beginning, provides a good background of what a role-playing game is. It covers some historical aspects and gives examples of existing role-playing games. It discuss the main aspects of a role-playing game, covers some terminology and prepares the reader for the rest of the chapters.

Chapter 2, Setting the Atmosphere, the chapter sets the theme and atmosphere of the game. We discuss the different types of assets and resources we would need during the creation of our game, introduce a third-person character controller and create our initial level and scripts.

Chapter 3, Character Design, discusses how to define your character and character data. Setup your character model for the mecanim, animator, state machines, blend trees, inverse kinematics, and custom character controller scripts.

Chapter 4, Player Character and Non-Player Character Design, discusses the structure of your character models, customization of your character model, defined the non-player character, looked at pathfinding, animator controller, and the initial NPC A.I. script for the NPC.

Chapter 5, Game Master and Game Mechanics, enhanced the Game Master script, introduced a Level Controller script, introduces an Audio Controller script, discuss the storage of character data and character customization state and the initial user interface for the main menu.

Chapter 6, Inventory System, covers the creation of a generic inventory system, create the necessary scripts, assets/prefabs that represent the inventory items, design of the inventory user interface and how to represent the inventory system and its items.

Chapter 7, User Interface and System Feedback, discusses the design and implementation of a heads up display, player character information panel, active inventory items panel, special inventory items panel are designed and implemented, non-player character health bar and UI are also designed and developed.

Chapter 8, Multiplayer Setup, discusses multiplayer programming using the Unity’s Unet architecture. The chapter illustrates the concepts using two sample projects, the initial project is a tank game illustrating the concepts of server client and data synchronization. The second project applies what we have learned to create a scene supporting our character models.

What you need for this book

Required software: All chapters require Unity 5.4 or above. You will also need an IDE for the editing of the C# code described in this book. This can be done using any text editor, but it is recommended to use Visual Studio on the Windows platform or Mono Develop/Code on Mac OS X.

Required OS: Windows 10 64-bit or above, or Mac OS X

Required hardware: Please see required hardware for running Unity

Who this book is for

This book is written for individuals who want to learn and apply their Unity skills for the creation of an RPG. It is assumed that the reader has the basics understanding and concepts of programming and is comfortable with the basics of Unity's IDE. The books gives a strong and solid foundation of core concepts and topics that can be applied to build your own game experience.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Drill-down in the extracted folder to get to the Unity Package called TerrainToolkit_1_0_2.unitypackage."

A block of code is set as follows:

public void StartGame() { // NOTE: You should put in the name of the Scene // that respresents your level 1 SceneManager.LoadScene("CH1_Awakening"); }

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Go ahead and select a location and a name you desire for your project and click the Create project button."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

Log in or register to our website using your e-mail address and password.Hover the mouse pointer on the SUPPORT tab at the top.Click on Code Downloads & Errata.Enter the name of the book in the Search box.Select the book for which you're looking to download the code files.Choose from the drop-down menu where you purchased this book from.Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

WinRAR / 7-Zip for WindowsZipeg / iZip / UnRarX for Mac7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Building-an-RPF-with-Unity5x We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from http://www.packtpub.com/sites/default/files/downloads/BuildinganRPGwithUnity5x_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.

Chapter 1. In the Beginning

So you want to build a Role Playing Game, or RPG. Well, you might have just started one of the most challenging undertakings you can attempt.

Brief history of the genreCharacteristics of an RPG
Story and settingExploration and questsInventory systemCharacter developmentExperience and levellingCombat systemUser interaction and graphics
Existing or upcoming RPGsPatterns in RPGs

Before we get started, it would be best to get a brief history of the genre and understand some of the key elements you will need to consider throughout the design of your RPG.

A brief history

So what is an RPG? In short, it is a game in which players assume the roles of characters in a fictional setting. Your game design will dictate how the player character will act, advance, and so on…

There are three varieties of RPGs:

TabletopLive ActionComputer RPG (cRPG)

Tabletop and pen-and-paper (PnP) RPGs are conducted through discussion in a small social gathering. There is usually a Game Master (GM) who describes the game world and its inhabitants. The other players describe the intended actions of their characters, and the GM describes the outcomes. This is the format in which RPGs were first popularized, namely through Dungeons & Dragons (D&D).

Live Action Role Playing (LARP) is played more like improvisational theatre. Participants act out their character's actions instead of describing them, and the real environment is used to represent the imaginary setting of the game world. Some live action LARPs use rock-paper-scissors or comparison of attributes to resolve symbolically, while other LARPs use physical combat with simulated arms. A movie can be considered as a simple LARP, the difference would be that in a movie all actions are scripted, and the players do not have to make decisions, whereas in a LARP, the characters can change the outcome of their actions based on their decisions.

Computer RPG (cRPGs) are tabletop RPGs that have been translated into an electronic format. The early cRPGs influenced all electronic gaming, as well as spanning the role-playing video game genre. In short, a cRPG is a video game genre where the player controls the actions of a main character immersed in a well-defined world.

Our book is going to concentrate on the design and development of a cRPG.

Note

Going forward, when we state RPG in the book we are referring to cRPG.

Computer role-playing games take their roots from tabletop versions of the genre. Much of the same terminology, settings, and game mechanics have carried over from the original tabletop games. Some of these similarities include story-telling and narrative elements where, throughout the story the player character will continuously develop in skills and abilities to meet the objective of the game.

Characteristics of an RPG

Role-playing video games typically rely on a highly developed story and setting, which is divided into a number of quests or levels. Players typically control one or more characters by issuing commands, which are then performed by player characters based on their defined abilities and attributes. Throughout the game, these attributes increase or decrease and set the personality of the character.

An RPG usually also has more complex and dynamic interaction mechanics defined and developed between the player character and the world which they are immersed within. These include the interaction with the world environment and also other non-character players defined within the world. Due to these factors, there is usually more time allocated to design and develop the code base which deals with the behavior and artificial-intelligence (AI) handling such events throughout the game.

Key elements of an RPG:

Story and settingExploration and questsItems and inventoryCharacter developmentExperience and levelsCombatUser interface and graphics

Story and setting

The premise of most role-playing games tasks the player with saving the world, or whichever level of society is threatened. There are often twists and turns as the story progresses, such as the surprise appearance of estranged relatives, or enemies who become friends or vice versa.

The game world tends to be set in a historical, fantasy, or science fiction universe, which allows the players to do things they cannot do in real life and helps players suspend their disbelief about the rapid character growth.

As stated previously, RPGs are heavily invested in storytelling. This is one of the main, key entertaining factors of the genre. Due to this fact, when you are developing your RPG, you will need to pay close attention to how you develop your story, and the characters that are within your story. This in turn translates into the kind of environments and settings you will have for your game and characters within the game.

Traditionally, RPGs progress the plot based on decisions that the player character makes during gameplay. This puts a great deal of pressure on the game designer who needs to be able to integrate such forks in the gameplay with the main storyline of the game. This also raises the issue of how to program the game to take into consideration all the different paths within the story.

To make the game more interesting and attractive, the game designer can introduce special triggers within the story to make it more interesting or challenging. This is usually done by introducing new characters and/or areas to discover within the existing level.

The following is a simplified description of the storyline and the setting we are going to be building for our cRPG.

A glimpse at our cRPG story

Once upon a time there was a great kingdom, ruled by the great King Zazar. The ruler of the kingdom was a generous lord to his subjects. The kingdom under the rule of Zazar was peaceful and prosperous, however, over time internal family rivalries and struggles have caused cracks in the strong bond that keeps the kingdom intact.

Due to mysterious events, the great king has decided to move his family away from the kingdom and leave his son with one of his trusted, wise elders. The kingdom was never the same. Until now!

Exploration and quests

The whole idea behind an RPG is the ability for the player to have the freedom to explore the world which they have been immersed into. The more well defined the world is, the more interesting it will be for the player to explore, and in return retain their curiosity and engagement throughout the gameplay.

This is achieved by the narrative of the story developed for the RPG. Players will be specifically given the opportunity to walk around the world and explore their surroundings in order to meet their objectives.

In an open world RPG, the player is free to roam in the world after they have met their objective set by the storyline. In such cases, the player can still explore any area which is no longer needed for the continuation of the quest, but they can spend time exploring the area and maybe meet some other non-player characters that they had not previously met while completing their mission. But generally speaking this is not done by the player, once they meet their objective they are eager to move on to the next quest, hence the question is; how much time and effort do the game designers and developers apply to a region after the main objective is met? The answer would be not much.

Historically, the player follows a linear-sequence of quests in order to realize their goals and objectives within the game. To make the game more engaging, the developer can introduce mini-quests within the main plot of the game at that particular location to give the player the ability to explore and gain more skills and or abilities. Since these are not part of the main storyline, they can be triggered any time a player enters a specific area.

For instance, assume the player has completed the main objective of the level, and is ready to move on to the next objective. Now, imagine that we have created an open world environment where the user can revisit the world anytime they choose. If the player decides to go back and explore a certain area of the world they just completed, and they happen to trigger the event to launch this mini-quest, wouldn't that be a great surprise for the player? Keep in mind that these mini-quests should not affect the main storyline, but they can be used to enhance the player's experience. These types of decisions are important when you are developing your game. If they choose not to take on the challenge you should not penalize them, except if you want to be really mean J.

Quests may involve defeating one or many enemies, rescuing a non-player character, item fetch quests, or location puzzles such as mysteriously locked doors.

A glimpse at our exploration and quests

Our game will have a total of four quests. Each quest will have unique objectives that the player will need to complete. The design and development of each quest will be discussed throughout the book as we progress.

Here is a list of the levels we will be designing:

AwakeningThe VillageBroken Forest – The HorizonThe Kingdom

The game will start by immersing the player in the environment where our hero will be given the basic training he will need to complete his mission.

Inventory system

One of the main functions and features of an RPG is the inventory system. Throughout the game, the user will come across a vast number of collectable items that can be used for different purposes within the game to help them progress through the journey. Therefore, RPGs needs to provide mechanics to help the player store, retrieve, and organize the content relevant to their journey.

When the player is progressing through their journey in an RPG, they interact with the world they are immersed in. The storyline of the game usually forces the player to interact with the surrounding world and other non-player characters. These interactions are usually in the form of some sort of an exchange. Whether this exchange is done through narration to provide the player with a better sense of the quest, or real exchange in terms of items is up to the game designers and developers.

The game needs a way to keep track of all the interactions between the player character and everything and everyone else. One system that is used to keep track of this interaction is the inventory system.

During the gameplay, players usually start off as a very simple character and part of the gameplay is to elevate their character by exploring the world and collecting items that will help them increase their skills and abilities.

For instance, a player can start their journey with very basic clothes. Throughout the quest, they will either interact with a non-character player, such as a merchant who will provide them with a better set of clothes, and or some sort of a weapon to get them started. These items will be stored and managed by the inventory system.

The simplicity or the complexity of the inventory system will be defined by the complexity of the game and the complexity of the characters within the game. In our game we will be designing and developing a generic inventory system that can be applied to many different types of items.

Here are some items that are usually collected in a game:

WeaponsArmorClothingSpecial Objects

Some of the items are collected or discovered by world exploration, and some of the items are specifically traded through the game. If you are setting up a trade system in a game, then you will need to provide the mechanics for the trade. A trade usually takes place while interacting with a non-player character, usually a merchant, and it will use a special window to enable the interaction of the trade to take place.

There is usually a cost associated with any trade. In general, there is a cost associated with everything the player does within the game, and the cost is usually either increasing the player-character's ability and/or experience, or decreasing it. This can get pretty complex if you dig deep into it.

The main point to keep in mind is that everything that the player will need to collect and/or manage will be done through the inventory system. Hence, this is one of the most critical features that you will need to put effort into as a game designer and developer.

One other element that can be used to enhance the gameplay for the player, and push them to strategize their quest, is to limit the number of items they can carry in their inventory.

For instance, in real life, a warrior will have limited ability to carry different types of weapons. Let's assume, that in the real world, a warrior can carry a maximum of five different types of weapon at any given time. Now, in the game world, there might be 20 different types of weapon. Do you allow the player to carry all 20 different types when they discover them? Or are you going to limit them to five?

These are small things that make the gameplay more interesting when planned out properly. There is more to an inventory system, and we will take a look at it in more detail in later chapters.

Character development

As with any other part of the RPG development, character attributes and actions are highly defined by the storyline of the game. These actions in turn are performed indirectly within the game, when the player commands the character to perform a specific task.

For instance, in a given RPG there is going to be at least a couple of character classes. The following are some sample class types:

BarbariansOrcsMagicians/WizardsZombiesHumans

Each character class might even have subclasses of their own with its own uniquely defined attributes. Again, this will be tightly coupled to your storyline for your RPG.

For instance, the player character is technically the hero of our story and of the game. The hero is usually of a certain character class, let's assume the hero is part of the Human Class.

The Human Class or Race then will have some specific characteristics that will be inherited by the player character or any other non-player character of the same type or class.

Note

The character class and race usually determines the abilities of a character within the game, which then define the types of actions the character can perform.

The strength of a character within the game is defined by the character class it belongs to and what type of actions it can perform. The performance of a character is defined by the value of the attributes defined within the character's class and race.

For instance, if we take two different character classes and compare them side-by-side such as a Human and an Orc, the Orc will have far superior strength and brute force then the human. However, the human, may have higher intelligence and problem-solving skills which will out-rate the strength of the Orc if applied properly.

This is another key area where an RPG designer will have to spend a lot of time defining and specifying the design and development of the characters within the game. The sky is the limit when it comes to designing and defining your characters, but there are some key attributes that you will need to consider for any RPG.

Most RPGs allow the player to modify their characters before the game starts or even during gameplay. By default, every character class will have some default attributes and the player is allowed to adjust the values based on some modifier. The basic fundamental features allowed for modification are the sex, class, or race of a character.

These days, character customization is one of the main features that players are looking for in a given RPG. Some games, allow you to modify every aspect of the physical appearance of the player-character, such as the skin color, the eye color, the hair style, and so forth.

It all comes down to the budget and the resources that are available to you during the production of the game. In some games, you can also introduce ethical attributes into the characteristics of the character. For instance, if you allow the ability to kill or rob innocents by standards within the game, then the player will become less liked by the friendly non-player characters and they may not be as friendly or helpful as needed to complete your quest. In other words, you will live by the consequences of your actions!

As a final takeaway, character classes define your character attributes and hence define your character's strength and weaknesses. These physical attributes can be simplified into the following: dexterity and strength, which determine the performance of a character during battle!

Experience and levelling

To engage the player and to get them hooked on the game, game designers use mechanics to enhance the performance of the player-character. The progress is what is termed Levelling or Experience in RPGs.

Levelling and experience are key elements of any role-playing game. A good levelling or experience tree will be defined for any RPG. This allows the player to develop their avatar through gameplay and become functionally more powerful by gaining more skills, points and other resources necessary to complete their quest.

To acquire new weapons, armor, clothing, and/or any other gameplay items defined in the world, the player will need to meet some specific thresholds within the game. These thresholds can be a combination of the player's acquired experience points, financial gains, and or combat experience. There is no right or wrong when it comes to designing any of these hierarchies and or systems. You will need to see which one works for your specific needs and how to best apply them.

In RPGs, the progress of the character-player is measured by counting some defined attributes specified by the game designer. Usually the advancements are defined by the player completing a certain task to get experience points, and slowly the tasks and the point rewards are increased throughout the game. The player then can use the experience points to enhance his or her avatar within the game.

Again, this is highly integrated with the storyline, Character Classes and or Race the player has selected. Some common ways to acquire points are by killing enemies, combating non-player characters of no importance, and performing quests that have been defined within the game.

Just like in real-life, the more you play and apply your skills, the more experienced you become. The accumulation of your experience then will allow you to acquire better weapons and/or armor to strengthen your attack or defense for the next quest. Some games might give the player 100+ points and allow the player to distribute the points across the available character attributes for their avatar. Sometimes, the game automatically applies all of the experience to a specific area such as strength.

Gaining experience will also allow the user to unlock more features and skills to be acquired by the player in during gameplay. This is a great way to monetize your games. In reality, most free games use this principal. They provide the basics of the world and the character for free, and they monetize the game through what is called In-Game purchases to increase either resources and/or character performance.

How is this implemented? Just like the inventory system, we need a way to keep track of the progress of the player's skills. This is usually done through a Skill Tree. Learning or acquiring a particular skill in the tree will unlock more powerful skills and give the player the ability to utilize the skills in the game.

Combat system

Time for battle! This is the moment every player looks forward to during their journey; to kill the boss, the bad guy, the evil war lord! Every RPG has some type of combat or battle component built into the gameplay. This is when the player gets to use all of their acquired skills and experience to destroy the opponent, or be destroyed by the opponent J depending on how the day goes.

Traditionally there have been three basic types of RPG combat systems. What type of combat system you choose to implement for your game is going to have a big impact on the gameplay and also the implementation of the game.

The three types are:

Traditional turn based systemReal-time combatReal-time with pause

Historically, role-playing games used to implement turn-based combat systems. This type of combat system is as follows: only one character could have acted at a given time. During this time, all other characters had to remain still. In other words, they could not have taken any action. This type of combat system is designed to put more emphasis on rewarding strategic planning.

The next type would be Real-time with pause combat system. This type of combat system is also strictly turn-based, but with a catch. If the player waits more than a certain period of time to make a move or issue a command, the game will automatically pass on the command to the other player. This in turn will allow the other player, such as the enemy to take a turn and attack the player.

In this book we will be using a real-time combat system. Real-time combat imports features from action games and creates a hybrid of action and RPG game genre. Action RPG combat systems combine the RPG mechanics of role-playing with the direct, reflex-oriented, arcade-style, real-time combat systems of action games, instead of the more traditional battle systems of RPGs.

In action RPGs, the player has direct control over the character's movement and actions in combat, and an attack button must be pressed to attack enemies in real-time. Action RPGs most often use arcade-style hack & slash combat systems, though many also use fighting, brawling, or shooting mechanics.

The action RPG genre was largely pioneered by Japanese developers during the early-mid 1980s. Nintendo's Shigeru Miyamoto adapted elements from several different types of action RPGs for home consoles and in 1986 created The Legend of Zelda franchise, which is responsible for popularizing the action RPG genre in the Western world since the late 1980s.

Note

Shigeru Miyamoto is best known as the creator of many of Nintendo's most beloved characters and franchises including Mario, Donkey Kong, The Legend of Zelda, and many others. He was also the chief designer of Nintendo's Touch! Generation console series, which includes the Nintendo DS, Wii, and 3DS.

User interface and graphics