Our project is part of the Native Track.


As a team, we were inspired to build a platformer game (possibly the first platforming game on NEAR?) that incorporates blockchain features to specifically reward players.

The problem: Most blockchain games reward investors (individuals who buy tokens but, for the most part, do not engage with the game) rather than players (users). very expensive due to an up front investment needed to acquire the necessary NFTs to play. This, in turn keeps players aways since the rewards from playing the game, often go back to the investors, again, individuals who purchase tokens, but not necessarily engage with them game.

The solution: We believe that players should be rewarded in order to grow an interactive gaming environment and build a strong community. Together, our team built Relik, a Play-to-Earn NFT platformer prototype built on the NEAR blockchain. It combines intense action with narrative-driven gameplay and focuses on rewarding players above all.

What it does

Relik is a simple platformer action RPG, where every in-game character and item is represented as an NFT. Our game also has a currency (Fungible Token) called $GOLD.

The game rewards players through:

  • $GOLD Tokens - As players explore and play the game they can earn $GOLD. Players earn $GOLD from defeating enemies, and finding treasure chests. Players can then use $GOLD anywhere on the NEAR blockchain. Players are the only ones that can mine $GOLD. There is no other way to generate $GOLD, which means players control the supply.

  • $LOOT NFT - In game LOOT is represented as an NFT. NFTs can only be minted, and initially acquired by players by finding treasure chests, and LOOT dropped from monsters and enemies in game. This gives players the power, as they are the ones who can acquire the NFTs first, and then if they wish they can sell on a secondary market. NFTs are pre-minted and sent to an admin wallet, which then distributes the NFTs to players as they play the game.

  • NFT Leveling Mechanic - As players play the game, their NFTs gain experience points and have the ability to level up. This rewards players because as their character NFTs level up they become more powerful, thus increasing their power + value

How we built it

Our project contains the following components:

Fungible Token Contract - We deployed an in game currency, $GOLD. The supply is 1B gold tokens. These tokens can only be "mined" by playing the game. Players are able to acquire $GOLD by defeating enemies (including bosses), and also finding treasure chests. As they acquire the tokens in game, the $GOLD tokens are distributed to the player in real time via an admin wallet.

** Non Fungible Token Contract** - We utilized the standard NFT contract but added a couple of methods. The most important method we add was the increase_exp function. This allows Relik NFTs to earn experience points, and level up over time. This allows players that engage with the game to increase the power of their NFTs. Once the NFT reaches 1000 experience points, the NFT's level increases by 1. This grants the NFT extra stat bonuses, which can be very useful in game.

Platformer Game - We built this part using C# and the Unity Game Engine. To allow the players to link their wallet we opened the web browser to a web app hosted by us, to allow players to go through the NEAR wallet connection flow. Upon successfully connecting, we pass the wallet data to our server, from here the Unity game pings the server to pull the wallet data. You can view the Unity Game Files on the "Game" branch of our github repo: https://github.com/gescobar129/project_relik/tree/game

Front End - The front end is a simple web app developed using React, that allows users to 1) View Relik NFTs owned by a specific wallet, while also 2) working in conjunction with the Unity Game Engine to allow players to link their NEAR wallet via the Near web wallet connection flow.

Backend/Cloud Function - Our backend utilizes the firebase cloud function sdk and hosted the "admin" wallet (in production we would need to better secure this wallet). The admin wallet is in charge of 1) rewarding NFT Loot picked up by the player, by sending the Loot to the appropriate wallet 2) rewarding players with $GOLD tokens and 3) increasing the experience points for a given NFT being used by the player.

Challenges we ran into

The main challenge we faced was not being able to find a currently maintained Unity module that integrates NEAR, as a result, we had to create our own work around for this.

Accomplishments that we're proud of

  • Creating a seamless UX where the player can focus on playing the game without worrying about signing transactions. We strongly believe that the UX we created with Relik is important if blockchain is to be adopted by the mainstream.

  • Allowing users to connect their NEAR wallet to a unity game. This got us excited, because we envision AAA gaming will allow players to link their wallets for rewards.

What we learned

We learned how to work with Fungible Token and Non Fungible Token Contracts on NEAR. We also learned how accounts work on the NEAR blockchain.

What's next for Relik

  • Polish up the game mechanics
  • Create a DAO to allow players to control how the Relik game grows and develops over time
  • LEVEL NFT - we want to mint LEVEL NFTs that can be owned by either a DAO or an individual wallet. Whenever a player dies a portion of $GOLD token rewards go to the LEVEL NFT owner. The owner of the LEVEL NFT can set different properties (enemies, in game events, bosses, etc) which in turn changes the actual level within the game!
  • Multiplayer feature - We want to allow players to invade other players to allow for PVP (Player vs Player) combat
  • Improve onboarding UX by generating NEAR wallet in the background for new players, this way there is less friction on signup
Share this project: