Please describe your proposed solution
THE GAME
Cardano Racers mission is to create an economically sustainable Cardano dApp that encourages active user participation on the Cardano blockchain. The project was created to incentivize ADA holders to make transactions with their ADA and participate in the ecosystem, rather than just to simply hold and stake their ADA.
Cardano Racers was designed to help increase the number of transactions, wallets, native tokens and smart contracts created on the Cardano blockchain. The dApp utilizes Plutus smart contracts and Cardano native tokens as a means for facilitating new wallet creation, active daily users and increased transaction volume on the Cardano blockchain.
The game is already live on mainnet and can be played at <https://www.cardanoracers.com/>
In order to participate in the game, players must first purchase two NFTs, one representing a race car and the other representing a driver. Each NFT has four attributes on a scale of 1 to 10,000. For the race car the attributes are acceleration, cornering, aerodynamics and maximum speed. For the driver, the attributes are experience, aggressiveness, reflexes and luck. When buying an NFT, a random combination of stats is assigned to the NFT during the minting process.
When entering a race, users pay an entry fee and select a combination of car and driver among their collection and register them on-chain to participate in the race. This selection can be informed by the configuration of the racetrack where the race will take place or the expected atmospheric conditions.
Upon successful registration, the player is ready to pariticipate in the race and play the game. The current format of the game is a combination of a simulation and a videogame consisting of a single lap to the racetrack.
Both the lap time from the simulation and the videogame are combined and prizes are distributed to players with the fastest lap times.
NEXT STEPS
The near-term objectives for Cardano Racers are to smooth out the user experience based on feedback from early players, grow the user base and explore new exciting features.
User experience improvement
Being Cardano Racers an NFT-based game, it attracts users with a significant amount of NFTs in their wallets. This has a negative impact on the user experience when submitting transactions to register in races, as transactions often fail and need to be resubmitted after rearranging the assets in the user’s wallet.
The technical explanation for this is that the on-chain logic enforcing correct registration requires looking for the race car and driver NFTs in the UTxOs provided by the user as inputs to the transaction, but this UTxOs are bloated with different assets, increasing the memory units and CPU steps needed to find the NFTs. Being the maximum memory units and CPU steps capped at 14,000,000 and 10,000,000,000 respectively, when the memory or CPU use exceeds those limits the transaction fails.
The current mitigation for this issue is to redirect users to a third party like DripDropz’s unfrack.it, which helps users to rearrange the assets in their wallets. However, this is an inconvenient procedure that has been identified as the main contributor to the newcomer bounce rate, limiting the growth potential of the game.
The plan to tackle this problem is twofold. Firstly, the current PlutusTx on-chain scripts will be written in a more efficient language like Plutarch or Aiken. This will result in the base transactions consuming less memory and CPU, being further from hitting the limits and therefore increasing the number of scenarios and asset distributions that are correctly handled. Secondly, for the extreme cases which still run into trouble, a built-in service to rearrange the assets will be developed, so that users can seamlessly register without having to leave the site.
Experimental feature - Hydra use case
Hydra is a layer 2 scaling solution for Cardano that takes computation off-chain via isomorphic state channels before settling to the Cardano layer 1, reducing latency and fees while increasing throughput (https://hydra.family/head-protocol/).
Recently, a demonstration of its capabilities was performed by running a subset of the Doom engine on it. By sumbitting one transacation per frame at a rate of 35 frame per seconds on Hydra heads supporting 5 game sessions, a single Hydra head was able to handle 175 transactions per second. This number scales linearly with the number of Hydra heads spun up:
<https://www.youtube.com/watch?v=CGsy9sp3s4w>As part of the commitment of Cardano Racers with increasing the use of the technology developed around Cardano, the game is looking to leverage Hydra in different ways. This has the potential to power a multi-player experience where thousands of players are interacting with the game in real time.
As a first step, the game will add support for NFT auctions that can leverage Hydra to increase the throughput of bids. This will allow players to bid for limited edition or rare cars and drivers without technical constraints imposed by the relatively lower throughput of the Cardano L1, making the auction as fair as it can be.
The intention is to build on top of the existing work to make auctions possible on Hydra, adapting it to the needs of Cardano Racers:
- https://github.com/mlabs-haskell/hydra-auction
- https://github.com/mlabs-haskell/hydra-auction-offchain
By integrating the Hydra auctions into Cardano Racers, the game will become one of the first projects leveraging L2 technology on Cardano, providing a real use case to Hydra and serving as a testing bed of the use of the technology in the wild.
The successful integration of the Hydra auctions into Cardano Racers will pave the way for further innovation around Hydra, opening up the possibility to add new features to enhance the in-game experience.