DEV Community

Cover image for Proof of Concept of an Achievement System for Rarity
Emanuele Ricci
Emanuele Ricci

Posted on

Proof of Concept of an Achievement System for Rarity

I think that everyone here knows already what Rarity is right?

TLDR; Rarity is a project created by Andre Cronje. You can think about it as D&D on the blockchain. Rarity is deployed on Fantom Opera (FTM) because of its speed and low-cost fees.

What I really liked about Rarity is the idea of a framework of Smart Contracts. Each smart contract is like a building block (Contract) that interacts with other building blocks. For example, the core block is the Summoner. Each summoner can have skills, grind golds, level up, craft equipment, or adventure into a Dungeon.

Every building block can be created by anyone, not just the creator of the game, it just needs that the community recognize it and start using it. This is a fully decentralized game.

And the cool thing is that everything and I mean everything is owned by the Summoner that is an NFT itself. You don’t own golds, the summoner does. You will not find items inside your wallet as NFTs, your summoner will be the owner.

Why create an Achievement System?

I wanted to be part of this. I wanted to be part of a stepping stone that is creating a new kind of game development mechanics. I wanted to be able to contribute to it and learn from this experience. That’s why I’ve come with the idea to create an Achievement System for the Summoner that other contracts need to call like a decentralized API.

What does it do?

For the summoner

  • Track the total amount of achievement points earned by the summoner while playing the game
  • Track the list of achievements earned

For the other contracts

  • Enable a way to unlock achievements when the user interacts with a contract
  • Enable to unlock content if the user has reached a certain amount of achievements points

How does it work?

To make it works and not allow random contracts to spam achievements I needed to make some ground rules. This is just a PoC and I hope to get some feedback that will allow me to find a more elegant and scalable solution.

The ground rules are these:

  • Achievements are bonded to the Summoner and not the Player
  • Summoner’s achievements are unique. You can’t unlock the same Achievement more than one time (at least for the moment).
  • Only whitelisted (approved by the Achievement System owner) contracts can add Achievements Metadata
  • Each contract can add a maximum of 10 achievements (this number needs to be defined better)
  • A contract can unlock a summoner’s achievement only if it’s the owner. For example, ContractA can unlock AchievementZ to summoner only if that specific achievement has been added by the ContractA itself. ContractA cannot ask the system to unlock an achievement owned by ContractB.

Whitelisting contracts and achievements at the moment is the only way I had in mind to solve the spam/garbage issue that could come.

What does this enable for the ecosystem?

  • Players are more engaged to play the game to earn achievements
  • Contract with achievements will be used more
  • The overall longevity of the Rarity game is extended
  • Other contracts / dApp could enable some content only if the user has reached a minimum level of achievements points
  • Achievements points (that’s just an idea) could be “burned” to purchase specific item payable with achievements points instead of golds
  • More concepts to come

What needs to be done? How could you help?

If you want to follow the development of the project just head over these links:

This is still a Proof of Concept so it needs to be polished and things can change.

What I don’t like of the current implementation

  • “centralized” way to whitelist contracts that can add and unlock summoner’s achievements
  • contracts needs to hold FTM in order to whitelist and unlock achievements because it costs gas
  • the current “flow” it’s not superfluid, each contract must be whitelisted by hand and they need to implement a method that calls the whitelistAchievements

Every feedback, suggestion, and PR is very appreciated so don’t hesitate to create a GitHub issue or DM me on twitter!

Top comments (0)