Create a Loot Box
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.

What is a Loot Box?

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.

Configure Contexts

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.
The following steps can only be completed in the Stage Environment. Make sure you are in the Stage Environment before continuing. To learn how to switch environments, click here.
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.
You will notice that there is already one context configured, Feature Unlocks. This is by design as this type of Context needs to exist by default in case it is used to unlock other Contexts.
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)
    Detachable?: No
    User Facing?: Yes
    Depends On: Independent (No Asset)
Click Save Contexts to save this Context. It should now look like this:
You've now set up the Loot Box Context and are ready to create a Loot Box Asset!

Create the Loot Box Asset

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 Assets.
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.
The Assets within a rarity group are selected at random (no weighting) once a rarity group has been selected.
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 10%.

Activate the Asset

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.

Send the Asset to Live Environment

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.
Congratulations, you have now created a Loot Box Asset and merged it into the Live Environment - ready to be sent to your game!
Last modified 30d ago