Building an RPG with Unity 2018
上QQ阅读APP看书,第一时间看更新

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 amount of collectible items that can be used for different purposes within the game to help them progress through the journey. Therefore, RPGs needs to provide a mechanism to help the player store, retrieve, and organize the content relevant to their journey. Take a look at the following screenshot:

Inventory

As the player progresses throughout 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 these interactions 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 might 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, an example of which is shown in the following screenshot:

Items will be stored and managed by the inventory system

The simplicity or 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 of the items that are usually collected in a game:

  • Weapons
  • Armor
  • Clothing
  • Special objects

Some of the items are collected or discovered by world exploration, and some of the items are specifically traded throughout 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 usually either increases the player character's ability and/or experience or decreases it. This can get pretty complex if you dig deeply 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 limiting the amount 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 the quantity to five?

These are the 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.