In this guide we will be creating a Loot Box Asset and implementing it in a game. You can find other guides that explain how to create other types of Assets in the Working with Assets section in the How-to guides of the LootLocker documentation.
A Loot Box is an Asset that has been assigned the Loot Box Complexity. The Loot Box Complexity adds the ability to have LootLocker randomly select an Asset from predefined groups of Assets. The Loot Box Complexity uses rarity groups to randomly select which Asset a player will receive when an Asset with this Complexity is opened. Each rarity group can be populated with Assets and then assigned a weight to define its Rarity. The Assets within a rarity group are selected at random (no weighting) once a rarity group has been selected.
Before you create the Asset, you will want to configure a Loot Box Asset Context, so that LootLocker know what and how you plan on using the Asset in your game.
An Asset Context is a way to group and describe Assets. All Assets must be assigned an Asset Context when being created. Defining the Context of an Asset lets your game know what type of Asset it is, and lets LootLocker know what sort of information or logic will be stored in the Asset and any special relationships it should have, for example with Character Classes and Default Loadouts.
The Context Configuration menu can be found in the Game Settings menu by clicking the
Settings icon on the left bar of the Management Interface.
Click on the
Context Configuration tab at the top of the Game Settings menu. You should be taken to a menu that looks like this.
To create a new Context, click the
Add Context button. As we want to create a Loot Box Asset, select
Loot Box from the Complexity dropdown menu.
Next we will want to fill in the rest of the information about the Context. A detailed explanation about each of the Context options can be found here.
Name: Loot Box
Friendly Name: (can leave this blank if the Friendly Name is the same as the Name)
User Facing?: Yes
Depends On: Independent (No Asset)
Save Contexts to save this Context. It should now look like this:
Now lets navigate to the Asset Manager to create the Loot Box Asset. The Asset Manager can be accessed by clicking the
Content button of the side bar and selecting
To create an Asset, click the
Add Asset button in the top right corner of the Asset Manager. Fill in an Asset Name and select the
Loot Box Context from the drop down menu. Click
Create to create the Asset.
Once the Asset has been created, you will be taken to the Asset's page where you can see all of it's stored information and data. The most important fields when setting up a Loot Box are in the
Loot Box Contents tab at the top of the Asset's page. This is where we will define the content of the Loot Box by creating rarity groups, and then assign those groups a rarity weight.
To start, we will navigate to the Loot Box Contents tab and click the
Add Group button to create our first rarity group.
In the group, click
Add Asset to add an Asset to this group. This will display a model where you can search through all of your Assets to select the intended Asset for this group. Groups can have as many or as few Assets as you want - it's up to you and how you want the Loot Box to work. For our Loot Box, we are going to create two groups, with two Assets in each group. Here's how it looks set up:
Now we will set the rarity weight of each group. To do this, enter a number (any number above 1) into the
Weight field of each group. As you enter a number you will see the rarity ratio and percentage change. This demonstrates how likely it is that this group will be selected when the Loot Box is opened by the player.
For our Loot Box, we will set the weight of the first group to
9 and the second group to
1 so that the chance of receiving an Asset from the first group is
90% and the chance of receiving an Asset from the second group is
The final step is to activate the Asset so that it is sent to the game and players can access the Asset. To do this, click the
Activate button on the right side of the Asset menu. Clicking Activate will automatically Activate and save any changes you have made to the Asset.
All of the work we've done so far has been in the Stage Environment of LootLocker - where you can make changes to Assets and settings and easily test those changes before sending them to the Live Environment for your players to see in their game. While we usually suggest testing all changes against the Stage Environment first, for the purpose of this tutorial we will push the new Asset to the Live Environment and test it there.
To push the Loot Box Asset to the Live Environment, click the
Review Changes button in the side bar of the Management Console.
This will take you to the Differences screen where you can see all the differences between the Stage and Live Environments of your data in LootLocker. To calculate these differences you will need to switch to the Live Environment by clicking the
Switch to Live button on this screen. This will automatically switch you to the Live Environment and calculate the differences between the two states. You should see the Loot Box Context and Assets you created in this tutorial.
Since we want to push both the new Asset and the new Context information we will tick the boxes next to both entries and then select
Push Selected to Live. In the confirmation modal that appears, click
Merge to merge the changes into the Live Environment.