During the bumpathon my team and I would like to further push the envelope on what is possible with onchain gaming. There are too many mobile game reskins that call themselves a web3 game. These games are built with 95% of their functionalities based on off-chain technology. These games label themselves as Web3 based on some gimmicky NFT or token utility.
My team and I have have already build a full-on chain game called Bumpies Brawl Quest. We would like to push our game further and add more Web3 functionality to our game with features such as cooperative on-chain boss raiding, decentralized voting of story progression, and interoperable equipment sharing across different games and platforms. We want to deliver what web3 games has been promising since 2021 to the players on the Base Network.
Upon launch, Bumpies, a non-preminted NFT collection, faced server crashes due to high minting demand. Each 2000x2000 pixel trait image required significant processing power, and simultaneous requests led to excessive memory consumption, high CPU load, and prolonged I/O operations. Despite using powerful Amazon EC2 instances, the servers couldn't handle the concurrent layer requests, leading to frequent crashes and latency issues.
Technical Challenges:
High-Resolution Image Processing: Required substantial computational resources to process and layer dynamically.
Concurrent Requests: Led to race conditions and resource contention.
Server Crashes: Due to high CPU and memory demand from simultaneous image processing tasks.
Scalability: Initial architecture couldn’t handle peak loads, causing performance bottlenecks.
Solution Implemented:
Pre-Rendering Strategy: Created a pool of pre-rendered Bumpie images stored in a cloud database, reducing computational load during minting. Batch processing covered all trait combinations and stored them with metadata.
Randomized Fetching Mechanism: A random function fetches pre-rendered images from the database at minting, assigning corresponding metadata to NFTs. This maintained rarity category drop rates using a weighted random selection algorithm.
Database Optimization: Optimized schema and indexing for fast image retrieval. Images and metadata were stored in Amazon S3, with metadata managed via Moralis for Ethereum integration.
Synchronization Mechanism: Periodically checks older blockchain records to verify and assign metadata to any missed mints, ensuring data consistency and integrity.
Tracks Applied (2)
GAMING with thirdweb
Technologies used
Jimp: For image processing and manipulation.
Node.js: As the primary development framework for the backend.
Ethers.js: For interacting with the Ethereum blockchain.
AWS S3: For storing high-resolution trait images and pre-rendered Bumpie images.
AWS EC2: For scalable computing power and auto-scaling capabilities.
Moralis: For backend and database management
ensuring seamless integration with the blockchain.
React: For building user interfaces.
Vercel: For deploying and hosting front-end applications.
Cheering for a project means supporting a project you like with as little as 0.0025 ETH. Right now, you can Cheer using ETH on Arbitrum, Optimism and Base.
Discussion