RPG Character Design

RPG Character Design

This tutorial by Vahé Karamian, the author of Building an RPG with Unity 2018 – Second Edition, will discuss the design of amazing RPG characters and take a look at some attributes and characteristics that you need to design and implement.

Character definitions

To have a meaningful and interesting RPG, the game should usually have more than one character class. One of the main characters is, of course, the Player Character (PC). You’ll first see the implementation of the PC, and then you’ll start defining and designing the other character classes—the Barbarian class, the Villager class, and the Orc class.

The character models demonstrated here are from the Asset Store. You can either download the same characters or design your own.

Character assets

The following assets will be used from the Asset Store for the character models:

  • Fantasy Horde - Barbarians
  • Fantasy Horde - Villagers
  • Fantasy Horde - Orc

It’s time to take a look at some of the attributes that the player will have in general.

Base character class attributes

The following is a list of attributes that will be part of the Base Character class:

  • Character class name
  • Character class description
  • List of attributes:
    • Strength
    • Dexterity
    • Endurance
    • Intelligence
    • Social standing
    • Agility
    • Alertness
    • Vitality
    • Willpower

The attributes you define for your characters depend on the character type, but there will be some similarities between all character attributes. That’s why it’s a good idea to implement these similarities in a base class that will be shared with all character classes.

To keep things simple, you will use only the five primary statistics for now, as follows:

  • Strength: Strength is a measure of how physically solid a character is. Quality controls the most extreme weight the character can lift, skirmish assault as well as harm, and hit focuses. Protective layer and weapons may likewise have a strength prerequisite.
  • Defense: Defense is a measure of how flexible a character is. Protection, more often than not, diminishes harm taken by either a rate or a settled sum for each hit.
  • Dexterity: Dexterity is a measure of how deft a character is. Skill controls assault, development speed, precision, and also dodging an adversary's assault.
  • Intelligence: Intelligence is a measure of a character's critical thinking capacity. Knowledge regularly controls a character's capacity to understand remote dialects and their aptitude in enchantment. Now and again, insight controls what number of aptitude focuses the character gets at level up. In a few recreations, it controls the rate at which encounter focuses are earned, or the sum expected to level up. This is joined with shrewdness once in a while and additionally self-control.
  • Health: Health decides whether the character is alive or dead.

The attributes listed are attributes that will be inherited by all character classes. Now put this into code. Create a new C# script and name it BaseCharacter.cs. Here’s the class:

Code

namespace com.noorcon.rpg2e 
{ 
   public class BaseCharacter 
   { 
      public string Name; 
      public string Description; 
 
      public float Strength; 
      public float Defense; 
      public float Dexterity; 
      public float Intelligence; 
      public float Health; 
   } 
}

Character states     

States are an important part of the character design. They will also drive the kind of actions and movement you will need to create for each state. For instance, your character will need to at least have the following states implemented:

  • Idle
  • Walking
  • Running
  • Jumping
  • Attacking
  • Die

Your character may have more states defined; this is something that you, as the designer of the game, will need to identify and eventually implement. Each one of the states identified will need to be implemented as an animation. The person creating the character models will usually also develop the animations for the character.

For instance, the Orc model has the following states/animations defined:

https://dz13w8afd47il.cloudfront.net/graphics/9781788623469/graphics/42db9244-5691-428a-a535-f784c07655d5.png

You may consider implementing the states entirely or partially. The theory and practice are the same either way.

You can also use RawMocap data to animate the models, since the models being used are Mecanim-ready, including Face Rigs.

The Mecanim Animation System was introduced with Unity 5. It is used for the following purposes:

  • Creating easy workflow and setup of animations on humanoid characters
  • Retargeting animation from one character to the next
  • Previewing the animation clips
  • Managing complex interactions between animations with a visual tool
  • Animating different body parts with different logic

Go ahead and download the asset from the Asset Store right now. Do a search on Raw Mocap Data for Mecanim in the Asset Store.

https://d1ldz4te4covpm.cloudfront.net/graphics/9781788623469/graphics/3e8dbd6e-7f5e-4f56-9b4e-739bac6d9258.png

When creating your character models, it is a good idea to follow the proper bone structure set up for your characters. This will make controlling the states and the animations of your character easier, as well as reusing your Animation Controller on multiple characters. This is also true if you are going to use a character from the Asset Store.

Character model

You should now consider how your player character is going to look. There are several approaches that can be taken. An easy way would be to have a predefined hero where the player does not have many options or much choice when it comes to customization of the character. The other way would be to provide the player the ability to change and modify their character to an extent or fully. This all really depends on your budget!

You may use the Asset Store to download predefined characters that can be used as placeholders for your game while you create your own. You can even use some of the characters that are freely available through the Asset Store and modify them for your needs.

Once you have determined your character model, the next step is to configure it and customize it for your game. The character model used here can be visually modified to represent several unique characters.

Default character models

Here is a set of character models that have been purchased from the Asset Store for the sake of this tutorial.

Barbarian

This model contains several body types—fat, regular, and skinny—which are set up by blendshapes on the body and cloth. It comes with 15 different body and accessory textures, one weapon texture, and two shield textures. This gives you a good range of unique character definitions and customization to enhance the range of different NPCs for the RPG.

Take a look at how to utilize them when doing character customization. See the following screenshot for an example of a barbarian:

https://d255esdrn735hr.cloudfront.net/graphics/9781788623469/graphics/9a14cb79-cf80-469c-8d93-07207eecf876.png

Villager

The Villager models give you two groups of models: child and adult. In the adult group, you have the male, female, and monk types. There are 16 male, three monk, eight female, four child, and two equipment textures provided. For the female type, there are two types of texture: standard hair, used for loose hair, and hat, used with head accessories such as a hat.

There are two different sets of animations: one for the Adult mesh type and one for the Child mesh type. The child type has fewer states compared to the adult. See the following screenshot, depicting a male, female, and child villager:

https://d1ldz4te4covpm.cloudfront.net/graphics/9781788623469/graphics/b393baf1-3de3-474d-8462-55dcdd4d666b.png

Orc

The Orc model is a bit different in its structure. All body-type meshes are part of the main structure; there are three main models: Fat, Average, and Athletic. There might also be some legacy animations, which you must take care of when you start the configuration and programming of the Orc class. See the following screenshot of an orc:

https://d255esdrn735hr.cloudfront.net/graphics/9781788623469/graphics/4bb8af3c-73a0-4219-8e41-1541a6eceb2a.png

Time to get started

Drag and drop the Barbarian model from your project into the scene. You will need to study your character model carefully, and understand how it is built so that you can modify it during design time and during runtime, if necessary.

This particular model has several visual elements attached for weapons, clothing, and so on. Your model may have been configured differently; if so, you will need to create your own attachment points and instantiate the weapons and/or other character-related assets accordingly. See the following screenshot:

https://dz13w8afd47il.cloudfront.net/graphics/9781788623469/graphics/faa282cb-5398-4f69-b1f2-413e3c50eae3.png

Select your character model and investigate the structure of the model. You will notice that there is a certain pattern and naming convention to the model hierarchy, as shown in the above screenshot. Some models might have animations attached. To check them, you will need to select the model from the Project window and select the Animation tab in the Inspector window to get a list of the embedded animations for the model, as shown in the following screenshot:

https://d255esdrn735hr.cloudfront.net/graphics/9781788623469/graphics/49349682-1678-4dfc-a7b1-7036438e9750.png

In the Inspector window, select the Animations tab shown in the preceding screenshot, and notice the Clips section for all the animations developed for your character model, as indicated in the following screenshot:

https://d255esdrn735hr.cloudfront.net/graphics/9781788623469/graphics/8bc4f602-fa93-40ec-853b-d6a4c7f04baa.png

Notice that the animation clips have a start time and an end time. The actual character model is visually displayed at the bottom of the Inspector window.

Rigging your model

There might be times that you will need to Rig your model to make it suitable for your game. This can be achieved by selecting your model source, and from the Inspector window selecting the Rig tab, as shown in the following screenshot:

https://dz13w8afd47il.cloudfront.net/graphics/9781788623469/graphics/9e4b0658-f46b-487d-a41f-251e4bddcbe4.png

In the Rig tab, there are several options that you can apply to your model. Assuming that your character is of Humanoid type, you will need to select the Humanoid Animation Type if not already selected. The Avatar Definition can also be either created from the model or assigned if you have an avatar defined. Finally, you can click on the Configure... button to see the configuration of the rigged model. See the following screenshot:

https://d1ldz4te4covpm.cloudfront.net/graphics/9781788623469/graphics/2e8fb680-b8b1-4c80-ad5e-54c9d8d0258f.png

Notice from the above screenshot that your model has a mapping defined for its skeleton. If your model is of the Humanoid type, and if your model structure has been named properly, the system will automatically assign the correct bones and joints. If your naming is not per Unity specification, you can navigate your model structure and manually assign each point in the BodyHeadLeftHand, and Right Hand.

The Muscles and Settings tabs will enable you to define and restrict the movement of the joints for your model. These can be very useful and practical for creating more realistic movements for your characters. You can study these topics further on your own, as they would require an entirely new tutorial or two to cover them.

Creating characters entails more intuition than craft—you are the creator and you have the final say in how a character appears and behaves. As far as the craft goes, you can learn even more nuances about how to build immersive role playing games with Building an RPG with Unity 2018 – Second Edition. Taking an advanced approach, the book skips the basics of programming and puts more emphasis on the strategy, planning and implementation of the code to guide you through building an amazing gaming experience.

0 Comments
Leave A Comment

Please login to post your valuable comments.

Join the newsletter

Get the latest vLemonn news first

share