Referral rewards are a great way to encourage your players to share your game. With HypeHype’s Player Info & Social Actions nodes it is possible to get and use info about who is sharing your game and who is coming to your game from those shares giving you a variety of ways to reward players for sharing your game.
The easiest way to add Referral Rewards to your game is with the Share game sign with popup and referral rewards pre-made. Add it from the Asset Library and follow the included instructions to connect it to your game's logic.
If you'd like to build the system for yourself and better understand how it works keep reading.
The first part of our logic will be a check to see if the player has any referrals to redeem. For this we need 4 nodes: Player Info, Number, Math Operator & Compare
Now this Compare Node is checking if the player has referrals to redeem each time it is executed. Next let’s set up our UI.
There are a variety of different ways you could create and display the info about your referral rewards. In this example we have 3 different popups created with User Interface nodes.
This popup appears when the player has no referrals to redeem. It should give some info about how the referral rewards work, what the rewards are and a button to share the game.
This popup appears when the player has rewards to redeem. It should tell the players how many referrals they have to redeem and include a button to redeem the rewards.
This popup appears after the button has been pressed on either of the previous popups. It should thank the player for sharing the game and encourage them to check back in to claim their rewards. This could also include buttons to prompt other social interactions.
Check out the User Interface Node entry to learn more about creating your own User Interfaces.
Next we will set up the rewards logic. How this will work for your game depends heavily on what kind of rewards you want to give and how your systems to support them work. In this example we will be using the resource system from the Skin Shop Template that includes Coins & Gems as collectable resources saved in a Function Source.
For this part we’ll need to add 4 more Nodes: Social Actions, Math Operator, Number & Function Caller
With this we have the system to give the referral rewards, just a few more links and our system will be working.
Now that the rest of the logic is set-up we can connect our User Interface nodes to it.
Our logic chain is almost ready. In the next step we’ll set up a trigger to initiate the referral rewards flow.
The next thing we need is a way to initiate the share flow so we can begin testing. There are a wide variety of ways to do this but a very popular one in many HypeHype games is an area trigger. When the player walks into the designated area the appropriate popup will appear. For this we’ll need to add a Collision Detector Node and an object to act as the area trigger. In this example we are using the object Rounded Corners Selector to visually identify the area to the player and an invisible cube to act as the area trigger.
At this point our logic chain should be working, just two more important things and it’s ready for release.
When rewarding players it’s very important to ensure you are saving any critical data related to the rewards. This ensures that the player keeps their rewards between sessions. In this example we have 3 critical Number nodes that need to be saved.
Player Save Settings are found in the Logic tab of the Toolbar.
Select the Number tab and find the nodes you want to save. In this example those nodes are the Gem & Coins nodes found in the resource system and the Redeemed Referrals node from the logic chain we just created.
Note: it’s important to name your nodes so you can find the right ones in Player Save Settings.
Now everything should be working but before we release it’s always important to test our logic to make sure.
In this case we’ll need to add one extra node to fake the increasing amount of referrals. Temporarily replace the Player Info Node with a Number node so that you can manually increase the number of referrals between tests. This will ensure that your calculations and rewards are working properly over multiple sessions.
When testing try to think of ways the flow could fail and try to break it. Once you are happy with the results get rid of the number node and reconnect the Player Info Node where it belongs. Now your Referral Rewards System is ready to release.