Book Image

Gamification with Unity 5.x

Book Image

Gamification with Unity 5.x

Overview of this book

Are you looking at implementing gamification techniques for your business and wondering where to get a complete rundown of all the tricks and techniques? Well, you have come to the right place! This book will start right from the basics such as gameplay elements and their functionalities before gradually moving onto creating your first gamification project from scratch. You’ll be given the tools and shown how to perform various techniques for creating gamified applications in different contexts. Finally, you will implement various game elements into Unity, publish your own task management application, and get to know the best practices and approaches when designing gamified experiences.
Table of Contents (16 chapters)
Gamification with Unity 5.x
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

What is game design?


So, as we have discussed, many types of game exist and therefore design approach. There are different ways that you can design, implement, and create games. Now, let's take a brief look at how games are made and more importantly, what they are made of:

  1. Generating ideas involves thinking about the story that we want to tell, or a trip that we may take the player on. At this stage, we're just getting everything out of our head and onto paper. Everything and anything should be written, the stranger and more abstract the idea, the better. It is important at this stage not to feel trapped by thinking an idea may not be suitable. Often, the first few ideas that we create are the worst, and the great stuff comes from iterating all the ideas that we put down in this stage. Talk about your ideas with friends, family, even online forums are a great place to get feedback on your initial concepts. One of the first things that any aspiring game designer can begin with is looking at what is already out there. A lot is learnt when we succeed, or fail, especially why and how. Therefore, at this stage, you will want to do a bit of research about what you are designing. For instance, if you're designing an application to teach English, not only should you see what other applications exist, but also how English is actually taught, even in an educational environment. It doesn't have to stop there either. Observing how games teach ideas and concepts can also provide you with ideas to implement into your own gamified application.

    Tip

    While you are generating ideas, it is also useful to think about the technology and materials that you will use along the way. What game engine is better for your game's direction? Do you need to purchase licenses if you are intending to make your game commercial? Answering these kinds of questions earlier on can save many headaches later on when you have your concept ready to go, especially if you need to learn how to use the software as some have steep learning curves.

  2. Defining your idea is not just a beautiful piece of art that we see when a game is being created. It can be rough, messy, and downright simple, but it communicates the idea. It might even be worthwhile to show an example of the process from other games, such as the initial sketch of an object, its iterations, and then its final outcome. Not just this, it also communicates the design of the game's space and how a player may interact and even traverse it. Concept design is an art in itself and includes concepts on environments, characters puzzles, and even the quest itself. We take the ideas that we had during the idea generation and we flesh them out. We begin to refine them, to see what works and what doesn't. Again, at this stage it is important to get feedback. The importance of feedback is vital. When we are designing games, we often are caught up, we are so immersed in our ideas, and to us they make sense. We have sorted out every detail (at least for the most part it feels like that). However, you aren't designing for you, you are designing for your audience and getting an outsider's opinion can be crucial and even offer a perspective that you might not necessarily have thought of. This stage also includes the story. Life without existence is like a game without a story. What kind of story do you want your player to be a part of? Can they control it, or is it set in stone? Who are the characters? The answers to these questions breathe soul into your ideas. While you are designing your story, keep referring to the concept that you have created, the atmosphere, the characters, and the type of environment that you envision. Some other aspects of your game that you will need to consider at this stage are:

    • How will your players learn how to play your game?

    • How will the game progress? This may include introducing different abilities, challenges, levels, and so on. Here is where you will need to observe the flow of the game. Too much happening and you have a recipe for chaos, not enough and your player will get bored.

    • Number of players that you envision playing your game (even if you intend for a co-op or online mode).

    • What are the main features that will be in your game?

    • How will you market your game? Will there be an online blog that documents the stages of development? Will it include interviews with different members of the team? Will there be different content that is tailored for each network (such as Twitter, Facebook, Instagram, and so on)?

  3. Bringing it together is thinking about how all your ideas come together and how they work, or don't. Think of this stage like creating a painting. You may have all the pieces, but you need to know how to use them to create the piece of art. Some brushes (such as story and characters) work better with other paints (for example, game elements, mechanics, and so on). This stage is about bringing your ideas and concepts into reality. This stage features design processes such as:

    • Storyboards, which give an overview of how the story and gameplay evolve throughout the game.

    • Character design sheets, which outline characteristics about who your characters are and how they fit into the story.

    • Game User Interfaces (GUI's), which will provide information to the player during gameplay. This may include elements such as progress bars, points, and items that they collect along the way.

  4. Prototyping is where things get real...well relatively. It may be something as simple as a piece of paper or something more complex such as a 3D model. You then begin to create the environments or the levels that your player will explore. As you develop your world, you will take your content and populate the levels. Prototyping is where we take what was in our head and sketched out on paper and use it to sculpt the gameful beast. The main purpose of this stage is to see how everything works, or doesn't . For example, the fantastic idea of a huge mech-warrior with flames shooting out of an enormous gun on its back was perhaps not the fantastic idea that it was on paper, at least not in the intended part of the game.

    Tip

    Rapid prototyping is fast and rough. Remember when you were in school and you had things such as glue, scissors, pens, and pencils, well that is what you will need for this. It gets the game to a functioning point before you spend tireless hours in a game engine trying to create your game. A few bad rapid prototypes early on can save a lot time than one digital one. Lastly, rapid prototyping isn't just for the preliminary prototyping phase. It can be used before you add in any new features to your game once it's already set up

  5. Iteration is like what an iron is to a creased shirt. You want your game to be on point and iterating it gets it to that stage. For instance, that awesome mech-warrior that you created for the first level was perhaps better as the final boss. Iteration is about fine-tuning the game, tweaking it so that it not only flows better overall, but also the gameplay is improved.

  6. Playtesting is the most important part of the whole process once you have your game at a relatively functioning level. The main concept here is to playtest, playtest, and playtest. It cannot be emphasized enough about the importance of this stage. More often than not, games are released buggy, with problems and issues that could have been avoided during this stage. As a result, players lose interest, reviews contain frustration and disappointment, which let's face it we don't want after hours and hours of blood, sweat, and tears. The key here is to not only playtest your game, but to playtest it in multiple ways, on multiple devices, with a range of different people. If you release your game on the PC, test it on a high-performance one and a low-performance one. The same process should be applied for mobile devices (phones and tablets) and operating systems! We will cover this in more detail in Chapter 8, Break, Destroy and Rebuild - The Art of Playtesting and Iteration.

  7. Evaluate your game based on the playtesting.

    Tip

    Iterating, playtesting, and evaluating are three steps that you will go through on a regular basis, more so as you implement a new feature or tweak an existing one. This cycle is important. You wouldn't buy a car that has parts added without being tested first so why should a player buy a game with untested features?

  8. Build your game and get it ready for distribution, on CD or online as a digital download.

  9. Publish your game! Your baby has come of age and is ready to be released out into the wild where it will be a portal for players around the world to enter the world that you (and your team) have created from scratch. The publication process will be covered in more detail in Chapter 9, Graduating your Project to Completion.

Conjuring the elements

Think about the fundamental components of life; we have atoms, cells, neurons; we have many things that are combined to create the structure. Games are no different. Games are like chemistry, you combine the right elements and mechanics (which we will discuss shortly) and you have the potential to cause an impressive reaction, a type of gameplay; of course keep in mind that it can always work in reverse!

To begin, games are made of a range of different elements. Elements can be considered as the what of game design. What does the player get for killing enemies, for completing objectives consecutively and on time? Does the player get a badge, some points, or do they level up and become higher ranked? All these things are combined to create unique experiences.

The following is a list of the basic game elements that we will discuss and cover throughout this book. In addition, this list provides you with a basic overview of some of the most popular game elements that can be found in any game:

  • Avatars are representations of players in games. You can think of them as 2D such as an icon, or even 3D such as the actual character that you play. They can be make-believe; user-created, or even the user themselves.

  • Achievements represent some type of accomplishment. The process of obtaining achievements may be through varying challenges of varying levels of difficulty, exploration, as with the case of hidden achievements, or locked achievements that require you to have obtained something earlier in order to unlock the achievement. In general, achievements are often built around different types of behavior.

  • Badges are icons that you receive for doing a particular action(s) and/or completing objectives. They differ from achievements in the sense that they are usually a visual representation of achievements (or groups of them). Examples may include trophies, like on the Playstation Network.

  • Bars (such as progress bars) indicate various factors such as health, mana, and experience levels. They can come in many shapes and forms. For example, progress bars can be segmented, they can be one continuous bar, and they can be circular, rectangular, and colored.

  • Bonuses act as an extra something to contribute towards other rewards. They may come in the form of additional items, more experience, aid in completing an achievement (such as extra coins). For example, if you kill twenty enemies within 30 seconds, you get extra points as opposed to if you kill them within 30 minutes.

  • Collectables include anything that you can and want to collect such as pens, postcards, coins, stamps, and so on. Similar things exist within games. In some cases, these items can be used, traded, or sold for other items; in other cases, they are just there for the sake of it, so you can boast to other players that you have something or a lot of something that is relatively special to the game. Many games have one-time collectables during festive times of the year such as Christmas or Halloween.

  • Combos require the player to group items together to perform a certain behavior or obtain particular items. For example, if you're playing a fighting game such as Tekken or Street Fighter, pressing certain buttons in sequence will result in a combined attack. Combos can also include the player combining various elements together to create or obtain a greater item.

  • Countdowns/timers are just like the days in reality that come and go, games incorporate the element of time in various ways. For example, to avoid the player idling for too long, designers may limit the amount of time that it takes a player to complete an objective. They usually push a player to improve so that the time they take to complete an objective becomes more efficient. Time limits are not necessarily used just to improve the player's efficiency, or as idle time, they can be used to increase the difficulty by giving the player less time to do something. It can also add a sense of urgency and tension to the game's atmosphere.

  • Currency whether virtual or real currency can be used to obtain items (in the real and virtual world). In some games, such as EVE Online, actual stock markets exist that influence the price of virtual goods. Some examples of virtual currency include ISK (EVE online), Gil (Final Fantasy), Lingots (DuoLingo), and coins and gems (Clash Royale and many other casual games).

  • Difficulty allows the user to select a level of difficulty before they engage with an experience that can increase the level of immersion. Common types of difficulty include levels of easy, medium, and hard; time constraints; limited resources such as ammunition, weapons, medical supplies, stronger and/or an increased number of enemies; and damage (for example, the amount of times that you can be shot at until you have no health left).

  • Easter Eggs are a special secret event that a user can discover. They can be various types such as inside jokes from the developers, or even the community. Some great examples include the elevator rave in Crysis 2, the disco party in Stanley Parable, or the giant ocean bunny in Saints Row 2.

  • Feedback provides information about the user's interaction, which is important for not only motivating the player, but to also let them know about their interaction. This can be after a particular action, duration, or series of actions and behaviors. Types of feedback can be a dialogue box on the screen saying something like Well done! or even an audio clip indicating a right or wrong action.

  • Items include anything from useful objects that you receive (physical and/or digital) for performing a particular action, exploration, to additional ammunition, medical supplies, and power-ups, which can be items in games that your player can obtain, require, and eventually use. The distribution of items, their availability, and where they are located will depend on how challenging you want your experience to be as well as the reward schedule that you are planning to implement.

  • Leaderboards are a great way of showing to the rest of the world that you are number one (or at least ranked somewhere). Your rank among other users is based on a parameter(s) such as points, achievements, kill/death ratios, and so forth. Leaderboards can be based on all-time scores; momentary ranking such as daily, weekly, and even monthly player's scores.

  • Levels are a way of providing a sense of progress to a player. They can be in the form of varying levels of difficulty, or the strength of abilities that a player has. In addition, levels can also indicate the natural progression of the player to another location as they advance through the game. An example of levels would be progressing through different areas and locations such as those within God of War and Army of 2.

  • Permadeath as the name suggests, the death of a character or player during gameplay is permanent. If the player wants to continue, they must start from the beginning.

  • Points are usually numerical in value and due to a player performing an action. Points can be added or subtracted depending on what the action was. For example, if the aim is to shoot enemies the player gets a point; if on the other hand, they shoot their teammate, they may lose points.

  • Quests are part of a player's journey that may include various obstacles and challenges that they are required to overcome. You can think of quests like parts of a story. For example, the overall story is about a prince rescuing a trapped princess, but each part of the story such as defeating enemy hordes, surviving the wilderness, and finding the necessary ingredients to make a potion to save her, are all quests.

  • Score is the total amount of points that the player has accumulated throughout sections of the game. They can be totaled at a specific moment, or at the end of a quest, or even the game. Depending on their importance to the overall objective, will determine how the score is displayed.

Getting elemental

Something to consider when using elements is how will they be obtained by your player? More often than not, when designing gaming experiences, we can be swept up in our own imagination. Adding a badge here and a point there might sound pretty fun, but it can become overwhelming to the player, and in some cases they might ask...why? Why am I getting a badge for doing something that I had to do anyway? Because it was fun...right? We will look at using game elements in more detail later in this book, but if you have some ideas now, such as creating an awesome fitness application that will use badges to keep users engaged, ask yourself why you are adding the badge and how it is supposed to keep the player motivated.

In this book, the term game element refers to the Greek word stoikheion meaning component or part. Thus, game elements are the components of games that contribute to an experience. They include things such as badges, points, levels, and so on. Think about the games that you play. Do they have elements in common? Do most of the games consist of badges, points, and levels?

If you are trying to create a narrative-heavy story, you might consider using elements that are targeted towards immersing the player into the story. For example, quests, narrative, progress bars, and even levels can help to contribute to such an experience. The narrative is what defines the gameplay, quests help to break the narrative into interactive chunks, and progress bars can provide a player with a sense of accomplishment as they advance throughout the game.

If, on the other hand, you want to create a competitive environment, elements such as points, status, levels, leaderboard, and badges can help to facilitate that. For example, a game that encourages students to learn their times tables might compare students against each other in a leaderboard. They are ranked on the amount of questions that they get right: one point for a correct answer minus one for an incorrect one. After a while the points begin to accumulate, the student transcends through different levels; as a result they begin to get a higher status, from Novice Mathematician all the way to Genius. Finally, each level and status is indicated with a badge that is attached to a student's profile.

Tip

Before you start to create any game or even add additional elements, look at the games that already exist. Play and play often, because not only will you get ideas about how games use the same elements in various ways, you can get a better idea about whether or not what you are trying to do will work. If you don't have the time to play, watch gameplay videos online (YouTube and Twitch.io). Even walkthrough books can offer a detailed step-by-step guide about how the player is expected to progress through a level.

Getting mechanical

This book refers to the term mechanic based on the late Middle English term (mechanic) meaning relating to manual labor. Therefore, how a player obtains an element can also be important. Having the what is great, but then having the how is even better. A player will get a badge, but how they will get it is the mechanic. Does the player have to win, trade, die, or collect certain elements before they can obtain them? For example, does the player have to collect five stars to get the star badge? These are considerations that each game designer needs to take into account when adding each new game element. In the following list, we can see a list of common game mechanics, some of which we will be using in the project for this book.

  • Aiming to direct an object to interact with another or to target an enemy can provide a player with a sense of precision and control, for example, the ability to shoot an enemy that is far in the distance rather than limiting the player to hand-to-hand combat. Aiming can be anything from aiming to kill an enemy or to hit a button from a distance.

  • Building can allow the user construct parts of the interactive experience. Building can allow the player to develop the environment around them. In games like the Civilization series, building is a core component in gameplay because it can allow the player to advance through the game in various ways.

  • Collecting allows players to collect items for use later on. Collecting items may be seasonal (such as Christmas) and have expirations (for example, you can only collect items for one week). The main objective here is to let the hoarder free inside of us.

  • Creating allows users to create their own content. This may be within defined parameters or unrestricted parameters. Creating often allows the user to customize their experience, allowing them to personalize their interaction and adding another layer of personalization. Ultimately, the player has designed something that is created.

  • Customizing allows the user to customize elements of their experience, which can provide a more tailored experience based on what a player likes or doesn't like. Customization may be simple (for example, name change) or extensive (such as name, aesthetics, features, and so on).

  • Disabling disables features in an interactive experience (for example, location settings and profile privacy), which can provide the player with a sense of authority as well as an option to control the gameplay. This can be disabling buttons to lock out other players, closing doors on enemies, disarming enemies and/or opponents, and so on.

  • Enabling the player to activate features in an interactive experience (such as location settings and profile privacy). Just like disabling, enabling can be about opening a locked door, and providing enemies with weapons to enable them to progress.

  • Finding items encourages the user to explore the environment to locate particular items to further the interactive experience. This can be searching chests for a particular weapon, collecting feathers like in Assassin's Creed, or looking for someone in particular to complete a mission.

  • Gifting another user an item in the form of a gift. This can be to gain rewards for yourself or to provide something for someone else. Who said true altruism is dead?

  • Keeping items can be as part of an inventory, as collectables, or for use later. Providing the ability for users to keep objects means that they can use them later. Of course, it is possible to limit the amount of objects that a player can keep at any one time, in total or based on the weight. For example, some inventories place emphasis on the amount of weight that a player can carry and in some instances items are very heavy, meaning that there is less room for other items.

  • Losing is not always favorable, but sometimes necessary, especially if we eventually want one victor!

  • Making allows the user to make items; this is different from creating because a player uses existing elements to make something, for example, providing the user with parts of an item so that they can make it later. It's like finding different parts of a jigsaw puzzle, then ultimately putting them together at the end.

  • Obtaining items during the interactive experience can be from other players (both real and NPC's), during events (such as from bosses), through performing particular behaviors, and so on.

  • Organizing items in a particular order (for example, color, shape, size, weight, and so on) can improve a player's efficiency when it's needed such as during an intense battle. Organizing can be manual or automatic depending on what is being organized. Some of the most popular organization options are in inventory systems where players can order the items that they have.

  • Punishing a player for failing to complete an action correctly can end quite badly for a player depending on how the designer decides to punish them. For example, if they failed to meet an objective within a time limit they might lose the option of getting an achievement, or they might have to begin the entire mission again. It is also possible for other players to deliver and receive, and give to each other. For example, if a player is not contributing enough to a clan or not at a high enough level, it is possible that they will be kicked out and not permitted to rejoin until they reach a desired level.

  • Repairing items for use at a later stage, even in real-time, can add a range of different experiences. For example, repairing weapons at certain locations within a map encourages players to take more care about how they use them and how often. During real-time situations, such as during an intense fight, players are able to repair their weapons, armor, and so on, in real-time, such as a mech-warrior in Lost Planet 2.

  • Revealing elements of the experience are revealed or can be revealed if conditions are met. For example, a user will reveal the next level only once they have finished the current one. Revealing can be expected or completely surprising to the player. From a twist in the narrative, location of an enemy, or even the location of an epic weapon, revealing can be as dramatic as you wish.

  • Sending allows the user to send items, messages, and so on, to other players to increase the social element, which can be a useful mechanic in games where collaboration and cooperation are important.

  • Shooting another object with a projectile whether it is a grapple hook or bullet to get from A to B can change the way that a player engages with not only an environment, but also other players (if they are required to shoot them!).

  • Trading items between individuals or groups can encourage social interaction amongst players. Like sending, trading is also an exchange of items, yet it is reciprocal, meaning that it goes both ways. For example, I will give you this mighty sword for 10 Elderflower potions. If this deal is agreed to, then the trade takes place. Trading systems operate in different ways, such as sometimes you can trade with NPC's within games, or with players. It all depends on how and who you want your players interacting with and what is more important in terms of social interaction.

  • Using things in games allows the user to engage with a particular feature(s). The ability to use something as opposed to not using it can either create elation or frustration for a player. Imagine you're in the final minutes of the last wave of Zombies, then out of nowhere you see a rocket launcher; unfortunately, it's only there for aesthetics and not for use. This situation can vary the player's overall level of engagement with the game. The world may have been a better place if they could have used it and stopped a Zombie Apocalypse...we'll never know.

  • Voting allows a player to have a say that can impact future experiences/interactions with the process of voting. Voting may influence the experience of a single user or all users. We can vote to kick a player from a map, to choose a map, to decide on what options are more favorable. Voting brings an element of democracy to your experience, which of course allows players to have a say, but not allowing a system of voting and dictating choices to a player can create an interesting atmosphere.

  • Winning is what we all strive for when we play games. How a player wins can be anything from natural progression throughout the game, killing a boss, or even choosing to sacrifice your co-op friend for the greater good. I want to lose...said no one ever!

Difference between gameplay and game mechanics

For many, gameplay and game mechanics have subtle differences, if any at all. The main difference, which is presented in this book, is that game mechanics are the basic building blocks of gameplay. Therefore, if we consider the game mechanic list in previous sections, these are mechanics, and gameplay would then result as a combination of these. For example, the combination of shooting an enemy to obtain items, and winning is a gameplay that is typically featured in shooting games.

In any case, while some may refer to the previous list as only gameplay, there are other lists that consider them as mechanics, and there are varied definitions about the exact term. The descriptions in this book aim to not only simplify terms, but to also consolidate a list of common vocabulary. Of course, you are encouraged to view other lists and references of game mechanics, some of which can be found at http://gamestudies.org/0802/articles/sicart, which provides a comprehensive explanation about the different perceptions, definitions, and approaches to the concept of game mechanics and gameplay; and other lists such as https://badgeville.com/wiki/Game_Mechanics or https://en.wikipedia.org/wiki/Game_mechanics.