• Register
Post news Report RSS Weekly Developer Update #38:

Our latest dev blog is LIVE, revealing a major backend overhaul for a smoother, faster, more rewarding gaming experience. Check it out to learn how we're harnessing the power of #Motoko and the #InternetComputer to build the future of blockchain gaming.

Posted by on

Weekly Developer Update #38:

Deep Dive into Our Backend Overhaul

Cosmicrafts


Greetings, spacefarers!

Welcome back to our weekly developer update, where we’re thrilled to share the exciting progress we’ve made behind the scenes. With a focus on enhancing your Cosmicrafts experience, we’ve embarked on a major backend refactoring journey.

Embracing Motoko and the Internet Computer

Over the past month, we’ve been immersed in the world of Motoko, especially during the Motoko Summer Camp. This incredible experience allowed us to connect with talented developers, learn from the best in the industry, and rediscover the limitless possibilities of building on the Internet Computer. From crafting personal canisters to establishing DAOs, the camp ignited our passion for innovation and strengthened our resolve to create the best possible gaming experience for you.

🎮 Streamlining Our Architecture for a Seamless Experience

We’ve taken a significant step towards optimizing Cosmicrafts by consolidating our multicanister architecture into a single, powerful controller. This streamlined approach centralizes our databases and logic, resulting in improved performance and a smoother gameplay experience.

oj wrote:

While the ICRC canisters remain independent to adhere to token and NFT standards, this consolidation marks a major milestone in our ongoing quest for thriving.

ot wrote:

In this update, we’ll delve into the specifics of our backend overhaul. We’ll guide you through the major changes we’ve implemented.

From Fragmented to Unified: The Evolution of Our Backend

Previously, Cosmicrafts relied on a complex network of interconnected canisters, each serving a distinct purpose:

  • Main Canister: A central controller responsible for managing interactions with ICRC canisters, minting tokens and NFTs, and storing player data like usernames, preferences, and ELO ratings.
  • Matchmaking Canister: Handled player pairing, lobby creation, and game launch with unique match IDs.
  • Statistics Canister: Saved match statistics, calculated player averages and totals, and maintained related databases.
  • Validator Canister: Verified match results for accuracy and potential cheating, flagging suspicious games for review.
  • Player Canister: Stored user-specific data like friends lists, player profiles, and statistics-derived information.
  • Rewards Canister: Managed mission creation and reward distribution.
oj wrote:

…And of course, the ICRC canisters for tokens (Shards and Flux) and NFTs (spaceships and chests).

Bottlenecks and Delays: The Pain Points of Inter-Canister Communication

While the previous architecture divided responsibilities neatly, it suffered from a significant drawback: inter-canister communication bottlenecks.

Post-Match Processing Delays:

The multi-step process of saving statistics, validating results, updating missions, and claiming rewards involved a cascade of inter-canister calls. This resulted in frustrating wait times for players eager to see their progress reflected in the game.

These delays collectively created a subpar user experience. Simple actions like claiming rewards felt sluggish and unresponsive, detracting from the enjoyment of overall online gaming experience.

The New Main Canister — A Powerhouse of Efficiency and Features

By consolidating statistics, validator, rewards, player, and tournament modules into a single entity, we’ve drastically improved response times and eliminated the cumbersome chain of inter-canister calls. But we didn’t stop there. We’ve also enhanced and expanded existing features while adding new ones.

Key Improvements and Features:

  • Integrated Tournament Module: The previously separate tournament module, designed for esports and concurrent tournaments, is now integrated into the Main Canister. This enables smoother tournament management and participation for both players and administrators.
  • Enhanced Statistics Module: We’ve optimized the statistics module’s logic for better performance, especially when handling multiple simultaneous requests. While subtle, these improvements will be noticeable as more players engage in Cosmicrafts.
  • Validator Refinements: The validator remains largely unchanged but will evolve based on player feedback and in-game analytics. We’re committed to continuously improving the validation process to ensure fair play and discourage cheating.
  • Expanded Rewards System: The rewards module has been significantly expanded. It now supports concurrent missions, including 24-hour, weekly, and never-ending missions that can be renewed upon completion. We’ve also added the long-awaited achievements architecture, unlocking new ways to earn rewards and recognition.
  • Enhanced Player Profiles: Player profiles have received a major upgrade. You can now view other players’ profiles, statistics, and friends lists. We’ve also added new fields like a Discord-style short description, account creation date, and other fun elements to personalize your in-game identity.
  • Optimized ICRC Calls: We’ve implemented asynchronous checks to streamline interactions with ICRC canisters. For example, when opening a chest, both token mints occur simultaneously, and NFT upgrades handle ownership checks and metadata updates concurrently. This optimization results in faster and more efficient transactions.
  • Bug Fixes: We’ve diligently addressed various underlying issues that were impacting the game, ensuring a smoother and more polished experience for everyone.

What’s Next: Referral Rewards to Fuel the Cosmicrafts Community

But we’re not stopping there! In our upcoming updates, we’ll be introducing a referral system that directly rewards players for inviting their friends to join Cosmicrafts. This system will be a key part of our strategy to grow the community and create a more vibrant and engaging ecosystem for everyone.

oj wrote:

Get ready to earn rewards while sharing the excitement of Cosmicrafts with your friends!

As always, we value your feedback and encourage you to share your thoughts and suggestions with us. We’re committed to making Cosmicrafts the best it can be, and your input is invaluable in that journey.

Until then, commanders, keep exploring the cosmos and conquering the stars!

Onward to the stars!

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: