Inspiration
The usual game applications based on Web 2.0 lack the concept of transparency, fairness and NFT ownership. There must be a gaming platform where players can get the experience of owning NFTs and also use them in-game. The player also gets the surety of fairness of the gaming algorithm.
The major problems that we focussed to work on in the project are:-
- Inducing the sense of ownership among players (NFTs)
- Ensuring fairness in-game through Chainlink VRF2
- GUI to use the NFT to play penalty shootout game
- Proof of ownership
What it does
- Web3Football provides gamers with the experience of a thrilling penalty shootout game where the player can opt to play as both striker and goalkeeper. The gamers can earn in-game tokens to buy their desired player NFTs from the marketplace.
- The gamers can own NFTs of various famous football players and build their own dream teams. The player NFTs are distinguished into three categories(I, II, III), based on their real-life skills. The rarity of top-level cards makes the game more exciting and engaging.
- The chances of winning the game are increased by having higher-level cards. The gamers will strive to earn more points and unlock better cards.
- Also, as there is no need for prior knowledge of Blockchain it can easily be played by any native seamlessly.
How we built it
- The fairness of the result is ensured by leveraging the random outcomes of the Chainlink VRF V2. The randomly generated word is processed to be used during the determination of the toss result and as a computer choice during the game.
- ERC721 is used to create non-fungible tokens of globally famous football players. The in-built functions of OpenZeppelin are used to mint the NFT cards and give ownership to the gamer. Keccak256 is used to assign unique IDs to the NFTs. The NFT is added to the gamer's owned cards after successful minting.
- The penalty shootout interface is selected based on the difference between the cards level of the striker and goalkeeper. The more the difference between them, the higher the chance of scoring or saving a penalty. The algorithm is better explained in the image gallery.
- For making the GUI we used React for the front end and Web3.js for the integration of the front end to the smart contract.
Challenges we ran into
- As the generation of random words by Chainlink VRF v2 takes a considerable amount of waiting time, we need to think of ways to compensate for the waiting time by engaging the gamer in different tasks.
- Features like PvP, auction of player NFTs and leaderboard system could not be added due to Time Constraints but can be implemented as we convert this game into a full-fledged application.
- As the minting of NFTs takes a considerable amount of time waiting period for a contract to execute it makes the overall program slow as in other DApp as well.
- The algorithm for the game needed to be changed in order to minimize the number of transactions made by the player during the game.
Accomplishments that we're proud of
- Created a web3 game where users can not only own NFTs, but also use them to earn points and get more NFTs.
- Providing an easy interface for the user to actually use their NFTs.
- Bringing the thrill of a penalty shootout just like Argentina vs France in the 2022 FIFA World Cup to every gamer.
- Able to make the game completely fair using Chainlink VRF v2. Implementing a meta-theme UI which provides the user with an extravagant experience of playing in Web3.
What we learned
- Learnt new technologies like Chainlink and ERC721 during the making of the project during this hackathon and implemented them into the project as per the requirement.
- Collaborated in a team to make the project using the strength of each other and learnt various new things quickly during the process.
What's next for Web3Football
- We can implement this in a Mobile Application to further increase the accessibility and use cases multi-folds.
- Adding more features like:-
- Player vs player mode, different gaming modes
- Leaderboard concept
- Making league systems and tournaments
- Auction of player NFTs
- Limited time available NFTs
Built With
- javascript
- react
- solidity
- tailwind
- truffle
- web3.js
Log in or sign up for Devpost to join the conversation.