Building an RPG with Unreal 4.x - Steve Santello - E-Book

Building an RPG with Unreal 4.x E-Book

Steve Santello

0,0
43,19 €

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

Mehr erfahren.
Beschreibung

Get to grips with building the foundations of an RPG using Unreal Engine 4.x

About This Book

  • Utilize a mixture of C++, Blueprints, and UMG to create a role playing game (RPG) efficiently
  • Create reusable code chunks and elements that can easily be integrated into other games
  • A cost effective, step-by-step guide to building and customizing an entire framework for your RPG

Who This Book Is For

If you are new to Unreal Engine and always wanted to script an RPG, you are this book's target reader. The lessons assume you understand the conventions of RPG games and have some awareness of the basics of using the Unreal editor to build levels.

What You Will Learn

  • Program gameplay elements in C++ in Unreal
  • Create custom game data for entities such as players and enemies
  • Create a turn-based combat engine
  • Design menu systems and blueprint logic
  • Create an NPC and dialog system
  • Integrate equipment and items
  • Develop the foundations of a saving and loading system

In Detail

Now that Unreal Engine 4 has become one of the most cutting edge game engines in the world, developers are looking for the best ways of creating games of any genre in the engine. This book will lay out the foundation of creating a turn-based RPG in Unreal Engine 4.12.

The book starts by walking you through creating a turn-based battle system that can hold commands for party members and enemies. You'll get your hands dirty by creating NPCs such as shop owners, and important mechanics, that make up every RPG such as a currency system, inventory, dialogue, and character statistics. Although this book specifically focuses on the creation of a turn-based RPG, there are a variety of topics that can be utilized when creating many other types of genres.

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

Style and approach

You will follow a series of lessons detailing the elements that contribute to an RPG. By the end of the book, you will have considerably leveled up your ability to make your own game

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

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 270

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 Unreal 4.x
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
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. Getting Started with RPG Design in Unreal
Tools for game design
Google Drive
Google Docs
Google Spreadsheets
Pencil and paper
The design and concept phase
Concept
Design
Describing the game's features and mechanics
Tropes in existing role-playing games
Stats and progression
Classes
Special abilities
RPG design overview
Setting
Exploration
Dialogue
Shopping
Gold
The pause screen
Party members
Equipment
Classes
Soldier
Combat
Combat stats
Combat actions
Attack
Ability
After combat/victory
Loot
Experience
Experience and leveling
Stat increases
Learning abilities
Game over
Choosing the right formula
Summary
2. Scripting and Data in Unreal
Downloading Unreal
Downloading Visual Studio
Setting up Visual Studio for Unreal
Adding the Solution Platforms drop-down list
Disabling the Error List tab
Setting up a new Unreal project
Creating a new C++ class
Blueprints
Creating a new Blueprint
Adding a Blueprint to the scene
Blueprints for Actor classes
Using Data Tables to import spreadsheet data
The spreadsheet format
A sample spreadsheet
The Data Table struct
Importing the spreadsheet
Querying the spreadsheet
Summary
3. Exploration and Combat
Creating the player pawn
The Pawn
The GameMode class
Adding the skinned mesh
Defining characters and enemies
Classes
Characters
Enemies
Party members
The GameInstance class
Turn-based combat
Performing actions
Making decisions
Target selection
Dealing damage
Combat UI with UMG
UI-driven decision making
Creating the game over screen
Summary
4. Pause Menu Framework
UMG pause screen initial setup
UMG background color
UMG text
UMG buttons
The UMG inventory submenu
The UMG equipment submenu
Key binding
Button programming
Summary
5. Bridging Character Statistics
Getting character data
Getting player instances
Displaying stats
Summary
6. NPCs and Dialog
Creating the NPC Character Blueprint
Interacting with the NPC
Dialog box setup
Creating an NPC welcome box
Adding an NPC talk box
Summary
7. Gold, Items, and a Shop
Setting and getting gold instances
Item data
The shop screen framework
The item button framework
Linking the item data
Summary
8. Inventory Population and Item Use
Creating the FieldPlayer Booleans
Determining whether the inventory screen is on or off
Logical difference between the inventory and shop items
Finishing the inventory screen
Buying items
Using items
Summary
9. Equipment
The weapons Data Table
Setting the weapon and equipment screen variables
Creating the weapon button
Revisiting the equipment screen
Setting the equipment screen Text Blocks
Correcting the character stats when equipping
Summary
10. Leveling, Abilities, and Saving Progress
XP and leveling source code
Data Table starting values
Displaying levels and experience in the pause menu
Applying the correct damage in combat
Setting up the abilities array
Abilities logic
Saving and loading game progress
Saving
Loading
Summary
Index

Building an RPG with Unreal 4.x

Building an RPG with Unreal 4.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 authors, 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: January 2016

Production reference: 2100816

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78217-563-6

www.packtpub.com

Credits

Authors

Steve Santello

Alan R. Stagner

Reviewers

Patrick Dinklage

Scott Hafner

Marcin Kamiński

Alankar Pradhan

Commissioning Editor

Edward Bowkett

Acquisition Editor

Tushar Gupta

Content Development Editor

Divij Kotian

Technical Editor

Taabish Khan

Copy Editors

Trishya Hajare

Rashmi Sawant

Project Coordinator

Neha Bhatnagar

Proofreader

Safis Editing

Indexer

Hemangini Bari

Production Coordinator

Shantanu N. Zagade

Cover Work

Shantanu N. Zagade

About the Authors

Steve Santello is a well-seasoned educator and veteran of the game industry from Chicago, Illinois, USA. His cross-disciplinary study in art, design, programming, and project management has allowed him to explore every facet of game development. As an educator, he has used his passion to teach others about game development, and has populated the game industry with many talented developers over the years. He has worked on over 10 different titles as a 2D and 3D artist for the Chicago game developer Babaroga. With Babaroga, he worked as one of the four artists on many mobile titles published by EA such as Spore Origins, The Godfather Game, and Pictionary: The Game of Quick Draw. He also worked on many mobile titles published by Disney Interactive, such as Hannah Montana In Action and Meet the Robinsons. He and his development team also developed a number of original IPs such as Babaroga Eats Children and BEES!.

Since 2006, Steve has also been a university professor. He helped pioneer the Digital Entertainment and Game Design program at ITT Technical Institute in St. Rose, LA, and also the Game and Simulation Programming program at DeVry University in Addison, IL. He has also served as an adjunct professor at the Illinois Institute of Art, Chicago, where he taught game prototyping as a team manager and acting producer. On the side, he developed game and simulation prototypes and plans to release his first two independent games, which were developed with Unreal Engine 4 sometime in 2015. He has writing contributions in Game Development Essentials: Game Interface Design 2nd Edition, Kevin Saunders and Jeannie Novak, Delmar Cengage Learning. In that book, he wrote about the past, present, and future of the user interface in games, which included breaking down the HUD in games such as Deadspace, and talked about how he and his team designed the user interface in Spore Origins.

Steve is currently working towards tenure as a CIS gaming instructor at the College of DuPage in Glen Ellyn, Illinois, USA. Although he is very proud of his success, he knows that all his combined experiences have played a major role in where he resides today.

Alan R. Stagner is an independent developer. He was introduced to programming by his father; he sought out different ways to create games in a variety of languages. Most recently, he found the Unity game engine and was instantly hooked, and discovered his love of multiplayer game development. He has also dabbled in database and server programming from time to time, mostly involving PHP and MySQL, with recent forays into ASP.NET.

About the Reviewers

Patrick Dinklage was born in 1987 in Datteln and now lives in Dortmund, Germany. He is a professional software developer, music producer, and music label owner who has also gathered experience in game development through modding, university, and projects in his free time.

Patrick started working with games by modifying them, starting with the Nintendo 64 using a gameshark for RAM hacking. He went on to found a successful modular C++ modding system for Command & Conquer: Red Alert 2 – Yuri's Revenge. The system is still being developed to date under the name Ares by a new team.

In the mid 2000s, he started work on several Unreal Tournament 2004 mods, including VCTF4—a version of capture the flag with vehicles and four teams. The more outstanding TitanRPG is a standalone role-playing game system tailored for the packed online action of UT2004, with features such as leveling to power up abilities, item inventory, healing, creature summoning, construction, and so on. This way, he could gather a deep knowledge of the Unreal Engine concepts.

Besides modding, he developed a Java binding to the C++ multimedia library SFML that can be used as a core to build games.

Professionally, he worked as a Java developer for seven years in an established service enterprise that develops phone, computer network, and system management solutions. Currently, he is studying IT at the technical university in Dortmund, Germany, with the goal of obtaining a master's degree and then a dissertation. Here, he has worked on several experimental game projects using the Unity 3D engine, and is currently helping to develop a virtual reality biking game with the aim of motivating cardiac patients to do their daily training.

Finally, he is a keen gamer (explorer type—in love with huge and deep worlds); furthermore, he produces music under the name Veasna and runs a small music label called Goa Trance Music in the relatively niche genre of Goa trance.

Scott Hafner is a professional game designer with over 10 years of experience in the video game industry. Over the course of his career, he has worked as a producer, game designer, and level designer on a range of platforms and genres including MMOs, third-person shooters, and RPGs.

I would like to thank my fiancée for her continued encouragement and support in all that I do!

Marcin Kamiński works for Nordic Games as a programming consultant and has his own company, Digital Hussars. Previously, he worked for Artifex Mundi, CI Games, CTAdventure, and Vivid Games. His main fields of expertise are artificial intelligence and network programming. For 14 years, he has helped develop great games for PC, consoles, and mobiles.

Marcin was also the reviewer of the book Blueprints Visual Scripting for Unreal Engine, Brenden Sewell; Unity iOS Essentials, Robert Wiebe; and Unity 2D Game Development Cookbook, Claudio Scolastici; all published by Packt Publishing.

Alankar Pradhan is from Mumbai, Maharashtra, and he did his schooling at I.E.S.'s CPV High School. He is an ambitious person who loves interacting with new people, dancing, kickboxing, traveling, spending leisure time with friends, or playing games on a PC and mobile. Games have been always a passion in his life. More than just playing the game, how things work was his main curiosity. Hence, he decided to pursue his career in game development. He graduated with a BSc (Hons) in software development from Sheffield Hallam University, UK. He received his master's in video game programming and management (videogame director) (BAC+5 equivalent) from DSK Supinfogame where he undertook industry-oriented projects to increase his skill sets and gave his best to do so. He worked as a game programming intern at The Walt Disney India Pvt Ltd. During his internship, he worked on a live project called Hitout Heroes. His name was added to the credits due to the notable work he accomplished. He also interned as a game programmer with DSK Green Ice Games and then continued working as a video game programmer on a game targeted for PC and consoles. The game Death God University (D.G.U.) was released on 1st July 2015. Another project he is working on is The Forsaken Mountains.

Alankar has worked on many small projects in a team and also individually so as to sharpen his own skills in various languages such as C#, C++, Java, Unreal Script, Python, Lua, Groovy/Grails, HTML5/CSS, and so on. He is familiar with engines such as Unity 3D, Unreal Development Kit, Visual Studio, and also SDKs such as NetBeans, Eclipse, and Wintermute. In 2013, his dissertation on Comparison between Python and Lua in Gaming Industry was published as a book. He has even worked as a technical reviewer on the books Creating E-Learning Games with Unity, David Horachek, and Learning Unreal Engine iOS Game Development, Muhammad A. Moniem.

Alankar likes to read, listen to music, and write poems and short stories at times. He has his own website (http://alan.poetrycraze.com) where he posts his poems and has also published a book called The Art Of Lost Words, which is available through Amazon. He can be reached at <[email protected]>. His portfolio site is alankarpradhan.wix.com/my-portfolio. He is available on Facebook at www.facebook.com/alankar.pradhan.

We are so often caught up in our aim that we forget to appreciate the journey, especially the people we meet on the way. Appreciation is a wonderful feeling, it's way better if we don't overlook it. I hereby take this opportunity to acknowledge the people who directed me and inspired me in this initiative.

I would like to express my sincere thanks to my parents who always instilled and believed in me. I am also thankful to my loving other half, Supriya, for her constant support and encouraging words that helped me to reach this level.

Last but not the least, I would like to thank all the people who are directly or indirectly involved with this book and who helped me in some way.

www.PacktPub.com

Support files, eBooks, discount offers, and more

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

Free access for Packt account holders

If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view 9 entirely free books. Simply use your login credentials for immediate access.

Preface

Now that Unreal Engine 4 has become one of the most cutting-edge game engines in the world, developers both AAA and Indie alike are looking for the best ways of creating games of any genre using the engine. Upon Unreal's first release, it was known as a great first-person shooter game engine, but with the success of games such as WB's Mortal Kombat, Chair Entertainment's Shadow Complex, and Epic Games' Gears of War, along with highly anticipated upcoming games such as Capcom's Street Fighter 5, Comcept's Mighty No. 9, and Square Enix's Final Fantasy VII Remake, Unreal has proven itself to be one of the greatest engines to use when creating virtually any genre of game. This book will lay the foundations of creating a turn-based RPG in Unreal Engine 4.

What this book covers

Chapter 1, Getting Started with RPG Design in Unreal, alerts the reader to the various preparation steps required to make an RPG before jumping into Unreal. In order to avoid potential obstacles to progress, the example content is provided and briefly introduced.

Chapter 2, Scripting and Data in Unreal, walks the reader through using C++ to program gameplay elements in Unreal, creating Blueprint graphs, and working with custom game data in Unreal.

Chapter 3, Exploration and Combat, walks the reader through creating a character that runs around the game world, defining character data and party members, defining enemy encounters, and creating a basic combat engine.

Chapter 4, Pause Menu Framework, covers how to create a pause menu with inventory and equipment submenus.

Chapter 5, Bridging Character Statistics, covers how to keep track of the player's stats within the menu system.

Chapter 6, NPCs and Dialog, covers adding interactive NPCs and dialogue to the game world. The reader will learn how to use Blueprints to define what happens when an object or NPC is interacted with, including using a set of custom Blueprint nodes to create dialogue trees.

Chapter 7, Gold, Items, and a Shop, covers adding interactive NPCs and objects to the game world. The reader will learn how to use Blueprint to define what happens when an object or NPC is interacted with, including using a set of custom Blueprint nodes to create dialogue trees. The user will also be creating items that can be bought in a shop using the gold dropped by enemies.

Chapter 8, Inventory Population and Item Use, covers populating an inventory screen with items and using the items when not in combat.

Chapter 9, Equipment, covers the creation of equipment and equipping weapons and armor from an equipment screen.

Chapter 10, Leveling, Abilities, and Saving Progress, covers adding abilities to the game, keeping track of experience for each party member, awarding experience to party members after combat, defining leveling and stat updates for a character class, and saving and loading player progress.

What you need for this book

The required software: all chapters require Unreal Engine 4 version 4.12 or above along with either Visual Studio 2015 Enterprise/Community or above or XCode 7.0 or above.

The required OS: Windows 7 64-bit or above, or Mac OS X 10.9.2.

The required hardware: Quad-core 2.5 GHz or faster, 8 GB of RAM, and NVidia GeForce 470 GTX or AMD Radeon 6870 HD or above.

Who this book is for

If you are new to Unreal Engine and always wanted to script an RPG, you are this book's target reader. The lessons assume that you understand the conventions of RPG games and have some awareness of the basics of using the Unreal editor to build levels. By the end of this book, you will be able to build upon core RPG framework elements to create your own game experience.

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 from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. 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.

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/BuildingAnRPGWithUnreal_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. Getting Started with RPG Design in Unreal

Role-playing games are highly complex things. Even within the RPG genre, there is a diverse range of games with wildly different mechanics and controls.

Before even a single line of code is written, it's important to figure out what kind of RPG you want to make, how the game is played, whether the game should be turn-based or real-time, and what stats the player will have to concern themselves with.

In this chapter, we will cover the following topics which show how to design an RPG before you begin making it:

Tools for game designThe design and concept phaseDescribing the game's features and mechanicsTropes in existing RPGsRPG design overview

Tools for game design

While you can always type everything in Notepad and keep track of design decisions that way, there are a variety of tools available that can help when working on the design document.

Of particular note is the Google suite of tools. These tools come free with a Google account and have many applications, but in this case, we'll take a look at applying them to game design.

Google Drive

Google Drive is a cloud-based file storage system like Dropbox. It comes free with a Google account and has up to 15 GB of space. Google Drive makes sharing files with others very easy, as long as they also have a Google account. You can also set up permissions, such as who is allowed to modify data (maybe you only want someone to read but not change your design document).

Google Docs

Integrated with Google Drive is Google Docs, which is a fully featured online word processing application. It includes many features such as live collaborative editing, comments, and a built-in chat sidebar.

The bulk of your design document can be written in Google Docs and shared with any potential collaborators easily.

Google Spreadsheets

Just as with Google Docs, Google Spreadsheets is also directly integrated with Google Drive. Google Spreadsheets provides an Excel-style interface that can be used to keep track of data in a handy row/column format. You can also enter equations and formulas into cells and calculate their values.

Spreadsheets might be used, for example, to keep track of a game's combat formulas and test them with a range of input values.

Additionally, you can use spreadsheets to keep track of lists of things. For example, you may have a spreadsheet for weapons in your game, including columns for name, type, damage, element, and so on.

Pencil and paper

Sometimes, nothing beats the trusty method of actually writing things down. If you have a quick idea popped up in your head, it's probably worth quickly jotting it down. Otherwise, you'll most likely forget what the idea was later (even if you think you won't—trust me, you probably will). It doesn't really matter whether you think the idea is worth writing down or not—you can always give it more thought later.

The design and concept phase

Just as how a writer works from an outline or mind map, or an artist works from a rough sketch, nearly all games start from some sort of a rough concept or design document.

A design document's purpose is to describe nearly everything about a game. In the case of an RPG, it would describe how the player moves around the game world, how the player interacts with enemies and NPCs, how combat works, and more. The design document becomes the basis upon which all the game code is built.

Concept

Usually, a game starts with a very rough concept.

For example, let's consider the RPG we'll be making in this book. I might have the idea that this game would be a linear turn-based RPG adventure. It's a very rough concept, but that's OK—while it may not be a terribly original concept, it's enough to begin fleshing out and creating a design document from.

Design

The design document for the game is based on the previous rough concept. Its purpose is to elaborate on the rough concept and describe how it works. For example, while the rough concept was linear turn-based RPG adventure, the design document's job is to take that further and describe how the player moves around the world, how the turn-based combat works, combat stats, game over conditions, how the player advances the plot, and a lot more.

You should be able to give your design document to any person and the document should give them a good idea of what your game will be like and how it works. This, in fact, is one of the big strengths of a design document—it's incredibly useful, for example, as a way of ensuring that everyone on a team is on the same page so to speak.

Describing the game's features and mechanics

So, assuming you have a very rough concept for the game and are now at the design phase, how do you actually describe how the game works?

There are really no rules for how to do this, but you can divide your theoretical game into the important core bits and think about how each one will work, what the rules are, and so on. The more information and the more specific, the better it is. If something is vague, you'll want to expand on it.

For instance, let's take combat in our hypothetical turn-based RPG.

Combatants take turns selecting actions until one team of combatants is dead.

What order do combatants fight in? How many teams are there?

Combatants are divided into two teams: the player team and the enemy team. Combatants are ordered by all players and followed by all enemies. They take turns in order to select actions until one team of combatants is dead (either the enemy team or the player team).

What sort of actions can combatants select?

Combatants are divided into two teams: the player team and the enemy team. Combatants are ordered by all players and followed by all enemies. Combatants take turns in order to select actions (either attacking a target, casting an ability, or consuming an item) until one team of combatants is dead (either the enemy team or the player team).

And so on.

Tropes in existing role-playing games

Even though RPGs can vary wildly, there are still plenty of common themes they frequently share—features that a player expects out of your game.

Stats and progression

This one goes without saying. Every RPG—and I do mean every RPG—has these basic concepts.

Statistics, or stats, are the numbers that govern all combat in the game. While the actual stats can vary, it's common to have stats such as max health, max MP, strength, defense, and more.

As players progress through the game, these stats also improve. Their character becomes better in a variety of ways, reaching maximum potential at (or near) the end of the game. The exact way in which this is handled can vary, but most games implement experience points or XP that are earned in combat; when enough XP has been gained, a character's level increases, and with it, their stats increase as well.

Classes

It's common to have classes in an RPG. A class can mean a lot, but generally it governs what a character's capabilities are and how that character will progress.

For instance, a Soldier class might define that, as an example, a character is able to wield swords, and mainly focuses on increased attack power and defense power as they level up.

Special abilities

Very few role-playing games can get away with not having magic spells or special abilities of some sort.

Generally, characters will have some kind of magic meter that is consumed every time they use one of their special abilities. Additionally, these abilities cannot be cast if the character does not have enough magic (the term for this varies—it might also be called mana, stamina, or power—really, anything to fit the game scenario).

RPG design overview

With all that aside, we're going to take a look at the design for the RPG we will be developing over the course of this book, which we'll call Unreal RPG.

Setting

The game is set in an open field. Players will encounter enemies who will drop loot experience, which will increase the player's stats.

Exploration

While not in combat, players explore the world in an isometric view, similar to games such as Diablo. In this view, players can interact with NPCs and props in the world, and also pause the game to manage their party members, inventory, and equipment.

Dialogue

When interacting with NPCs and props, dialogue may be triggered. Dialogue in the game is primarily text-based. Dialogue boxes may be either linear, the player simply presses a button to advance to the next dialogue page, or multiple-choice. In the case of multiple-choice, the player is presented with a list of options. Each option will then proceed to a different page of dialogue. For instance, an NPC might ask the player a question and allow the player to respond "Yes" or "No", with different responses to each.

Shopping

A shop UI can also be triggered from a dialogue. For example, a shopkeeper might ask the player whether they want to buy items. If the player chooses "Yes", a shop UI is displayed.

While in a shop, players can buy items from the NPC.

Gold

Gold can be attained by defeating monsters in battle. This gold is known as a type of enemy drop.

The pause screen

While the game is paused, players can do the following:

View a list of party members and their statuses (health, magic, level, effects, and so on)View abilities that each party member has learnedView the amount of gold currently carriedBrowse an inventory and use items (such as potions, ethers, and so on) on their party membersManage items equipped to each party member (such as weapons, armor, and so on)

Party members

The player has a list of party members