Solo Live Event System #
Creating engaging solo experience live events in your game offers a unique way for players to earn rewards through personal achievement. Unlike tournament based live events, these solo events focus on individual participation where the more a player engages, the more they’re rewarded.
In this guide we’ll explore the process of creating a solo live event using Nakama and Hiro where players can complete a number of stages and receive lucrative rewards for their efforts, similar to Fortnite’s battle pass system.
Prerequisites #
To follow this guide you’ll need to:
Once that’s out of the way, you can familiarize yourself with the full project code we’ll be using in this guide by cloning the Solo Live Event repository from GitHub.
Server-side #
Let’s start by taking a look at the server-side code we’ll be using to implement the quest mechanics, beginning with the main.go
file.
main.go
#
You can reference the full code for this file in the linked repository above. Here we’ll break down the key components of the code.
InitModule
function
#
Next we define our InitModule
function, which is called when the server starts up. Here we’ll initialize the Hiro systems - Achievements and Economy - we’ll be using, and register the RPC functions we’ll be implementing.
|
|
Hiro system definitions #
Next we define the Hiro system definitions we’ll be using to implement the live event within our game. These are defined in the base-economy-dev1
file and base-achievements-dev1
file respectively.
Economy #
The Hiro Economy system enables you to define and manage the currencies that players can earn and spend in your game, and also define the currencies and amounts that each player begins the game with.
|
|
Here we define the currencies and amounts that each player begins the game with, as well as the items that each player begins the game with.
Achievements #
The Hiro Achievements system allows you to define and manage the various achievements within your game. These can be one-off or recurring achievements that players can complete to earn various rewards or prestige. Achievements can also have specific pre-conditions that a player must meet before they can contribute towards their completion. They can also have nested sub-achievements should your gameplay design require this.
|
|
For our game, we have created a solo live event achievement that consists of several sub-achievements. These sub-achievements map to the various progression stages within our live event, each of which will reward the player upon completion.
Client-side #
SoloLiveEventGameCoordinator
#
This file bootstraps our game with a list of systems to be used, and provides a list of systems for deterministic start-up. In our case, we’re initializing the Economy and Achievements core systems from Hiro.
|
|
SoloLiveEventManager
#
The SoloLiveEventManager
manages all calls to our Hiro systems, and creates system observers for each system to handle UI updates based on system changes.
|
|