TileVille: On-Chain Strategic City Development Game
Project Background
TileVille is a revamped version of MINAPolis game that participated in last MINA navigators program.
TileVille is an innovative on-chain strategic city development game built on the Mina blockchain. The gameās core premise revolves around players constructing and managing their own cities on the fictional island of Nicobar using hexagonal tiles representing trees, roads, and windmills.
The gameās MVP version, currently live, features a single map where players participate in competitions by paying an entry fee. During these competitions, players aim to earn the highest score by strategically placing tiles and adhering to specific rules, such as connecting the city center to the port with road tiles for bonus points, creating parks with tree tiles, and optimally placing windmills on hills.
Upon completion of a competition, the total prize pool is distributed among the top three players, with 65% going to the first place, 22% to the second, and 13% to the third. Players can track their rankings on a leaderboard and access their past game statistics and winnings on a dedicated profile page.
Proposal Overview
While the TileVille strategic city development game on the Mina blockchain has a solid foundation with its MVP version, it currently faces several challenges that hinder its potential for growth and user retention. the game lacks a fully on-chain implementation and a player experience-focused user interface. Additionally, the existing game functionality is limited, not enough for user retention, and the Protokit code is not yet connected to the frontend, resulting in a suboptimal user experience.
The proposed solution aims to address these limitations and transform TileVille into a fully-fledged, engaging, and sustainable on-chain gaming experience. The primary objectives are as follows:
-
Complete Protokit Runtime Module Development: The current Protokit runtime module lacks essential functionality, such as score calculation for tree tiles. We propose to complete the development of this module, ensuring that all game mechanics are accurately implemented and integrated with the broader system.
-
Develop Additional Game Levels and Features: To enhance user engagement and retention, we will develop four additional game levels with larger maps and introduce new tile types, such as residential, commercial, and industrial. These expanded gameplay mechanics will provide players with more strategic depth and replayability.
-
Integrate Backend Contracts with Frontend: To provide a seamless user experience, we will connect the backend smart contracts with the frontend, enabling real-time updates and synchronization of game data and player interactions.
-
Deploy TileVille Protokit App Chain: By deploying the TileVille game as a dedicated Protokit app chain, we aim to create a secure and scalable environment tailored specifically for the gameās needs, enabling efficient and reliable on-chain operations.
-
Enhance User Experience and Retention: Throughout the development process, we will prioritize creating an intuitive and visually appealing UI, optimizing the overall user experience. Features such as player invitations, leaderboards, and achievement tracking will be implemented to encourage user engagement and retention.
-
Ownership and Governance: Aligning with the principles of decentralization and community ownership, we will enable players to mint their constructed cities as NFTs, granting them true ownership over their digital assets. Additionally, we will introduce a decentralized governance system, allowing NFT holders to vote on proposed changes and new features, fostering a transparent and community-driven development process.
By addressing these key areas, the proposed solution aims to elevate TileVille from a proof of concept to a fully-fledged, on-chain strategic city development game that offers a compelling and sustainable experience for players. The combination of expanded gameplay, community ownership, and decentralized governance will position TileVille as a pioneering example of blockchain-based gaming, unlocking its true potential for growth and adoption.
Ecosystem impact
The projectās ecosystem impact can be summarized as follows:
Expansion of the Mina User Base: TileVilleās unique blend of strategic gameplay, city-building mechanics, and blockchain integration will attract a diverse range of users to the Mina ecosystem. By offering an immersive and engaging gaming experience, TileVille has the potential to onboard new users who may be unfamiliar with blockchain technology or the Mina protocol, thus expanding the user base and driving adoption.
Advancement of Gaming on Mina: As a pioneering on-chain gaming project on the Mina blockchain, TileVille will serve as a catalyst for further innovation and development in the realm of blockchain-based gaming. Its successful implementation will demonstrate the capabilities of the Mina protocol for hosting complex and interactive gaming experiences, paving the way for future projects and attracting more game developers to the ecosystem.
Economic Stimulus and Token Utility: The integration of participation fees, rewards, and NFT sales within TileVille will drive economic activity and token utility within the Mina ecosystem. As players interact with the game and acquire in-game assets, they will be incentivized to hold and utilize the Mina token, contributing to the overall health and growth of the ecosystem.
Ecosystem collaborations
Project has established strategic collaborations with ZKNoid, a provable gaming platform, and MinaNFT, a leading non-fungible token (NFT) platform on the Mina blockchain.
Collaboration with ZKNoid
ZKNoid is a pioneering platform that aims to revolutionize the gaming industry by leveraging the power of zero-knowledge proofs and blockchain technology. TileVille has utilized ZKNoidās SDK to develop critical runtime modules for the game, such as competition management and reward distribution systems. This collaboration ensures that TileVilleās on-chain gaming mechanics are built on a robust and secure foundation, benefiting from ZKNoidās expertise in provable gaming.
Additionally, TileVille plans to leverage ZKNoidās bridging infrastructure in the future, enabling players to pay participation fees and make in-game transactions using ZKNoidās native token. This integration will provide additional payment options for players and contribute to the overall token utility and adoption within the Mina ecosystem.
Collaboration with MinaNFT
MinaNFT is a prominent NFT platform on the Mina blockchain, offering a secure and user-friendly environment for creating, trading, and managing digital collectibles. TileVille has partnered with MinaNFT to enable players to mint various digital collectibles within the game.
These collectibles will have diverse use cases, ranging from unlocking exclusive game features such as additional maps and levels, to granting voting rights in TileVilleās future DAO. By leveraging MinaNFTās infrastructure, TileVille can seamlessly integrate NFT functionality, allowing players to truly own and trade their digital assets within the game.
Audience
TileVilleās target audience encompasses a diverse range of individuals, united by their shared interests in strategy games, city-building mechanics, and blockchain technology. The game appeals to strategy and city-building enthusiasts who relish the challenge of strategic planning and resource management. It also attracts blockchain and crypto advocates drawn to the gameās on-chain implementation, decentralized governance, and integration of NFTs and token rewards. The play-to-earn model caters to gamers seeking to monetize their gaming skills, while urban planning and economics enthusiasts may find the city-building mechanics intellectually stimulating. With its unique blend of gameplay and blockchain elements, TileVille has the potential to captivate a tech-savvy demographic across a broad age range, particularly those intrigued by the concepts of decentralization and community ownership.
Architecture
In order to talk more about the proposed architecture additions and changes, lets first understand the current architecture.
Current Architecture
Game follows a Entity Component System pattern with following entities.
click here to see the O1JS code implementation of these entities.
Game backend is implemented as a protokit runtime modules. At a top level TileVilleGameHub module implements a runtime method addGameResult
for the entire game play. this top level module extends another runtime module called GameHub
which implements runtime methods for creating competition, managing leaderboard, depsoiting game entry fees, etc.
Game initialisation phase uses generateTileMapBySeed to generate an empty tile map with mapās center occupied by castle.
Also createTrihexDeckBySeed is used to generate a deck of 25 triplets(tile sets), during game play, tripets from this deck gets shown to user and user places the tiles on the map.
Proposed Architecture Additions and Changes
To achieve the desired goals and expand TileVilleās functionality, the following architectural additions and changes are proposed:
- TileVilleGameHub calculate score: Complete ProtokitGameHub module to calculate score for tree tiles.
- Expanded Game Mechanics: New runtime modules will be developed to incorporate additional game mechanics, such as score calculation for different tile types (e.g., residential, commercial, industrial).
- Frontend Integration: The existing Protokit runtime modules will be integrated with a robust frontend interface, enabling real-time updates and synchronization of game data and player interactions. This will involve developing APIs and establishing communication channels between the backend and frontend components.
- Protokit App Chain Deployment: TileVille will be deployed as a dedicated Protokit app chain, providing a secure and scalable environment tailored specifically for the gameās needs and enabling efficient on-chain operations.
- NFT Minting and Ownership: Modules for minting player-constructed cities as NFTs and enabling island ownership will be developed. These modules will leverage the MinaNFT platformās infrastructure for secure and user-friendly NFT management.
Proposed Design
- Menu Structure
Six main menu items: Play Game, Guide, Leaderboard, User Profile, Marketplace, and Roadmap & FAQ.
- User functionality
- New players start with the Guide section, an interactive walkthrough for the game.
- Players then proceed to the Play Game section, where they can view active ongoing competitions, participation fees, rewards, and join by clicking the āJoin Nowā button.
- After clicking āJoin Nowā and paying the participation fees, players are redirected to the game screen to start playing.
- At the end of the game, players can view their final score.
- The Leaderboard section displays rankings for all competitions.
- The User Profile section allows players to view their past games, winnings, and owned NFTs.
- The Marketplace section enables players to purchase NFTs, which will be reflected in their profile upon successful purchase.
- An option to create a competition will be available in the Competitions page, where teams can host their competitions (currently in alpha mode, with the TileVille team creating competitions on behalf of users who fill out a Google form).
- UX Enhancements
- Intuitive and user-friendly interface design.
- Clear navigation and information hierarchy.
- Visual cues and animations to guide users through the gameplay experience.
- Responsive design for optimal viewing across different desktop devices.
- Seamless integration of blockchain components (e.g., wallet connectivity, transaction confirmations) for a smooth user experience.
- Accessibility Considerations
- Appropriate color contrast and font sizes for improved readability.
- Performance Optimization
- Efficient rendering techniques for smooth gameplay.
- Optimized asset loading and caching strategies.
- Minimized network requests and data transfer.
- Security and Privacy
- Secure wallet integration and transaction handling.
- Adherence to best practices for data privacy and user consent.
- Implementation of best coding practices.
The design of TileVilleās user interface and overall user experience will prioritize intuitive navigation, visual appeal, and seamless integration of blockchain components, ensuring an engaging and accessible gameplay experience for players of all skill levels.
Vision
TileVille envisions a future where blockchain technology and gaming converge, creating immersive and empowering experiences for players worldwide. By leveraging the power of the Mina blockchain, TileVille aims to revolutionize the way we perceive and interact with city-building games, while fostering a vibrant and decentralized gaming ecosystem.
Existing Work
- First version of game contracts along with test cases are completed. this includes game initialization, processing tile placement for windmill tiles. see the test cases here.
- Game frontend MVP is completed and deployed here
- Our game runtime modules are compatible with ZKNoid.
Budget & Milestones
We are the team of three full-time working members who are consistently contributing to the Mina ecosystem. The following tasks will be implemented by the team members
Mid-Point milestones
- Contracts
- Method to initialise the game with tile decks, remaining moves.
- Set hill areas randomly on the map when game starts.
- Calculate score methods that calculates combine score for all three tiles placed by player.
- User Interface
- Design and basic implementation of user journey that includes joining a competition, paying participation fees, seeing past games on profile, leaderboard page, and redeeming reward.
Final Milestones
- Contracts
- Runtime module to support tilemap of different sizes for multiple game levels.
- Test cases with more than 90 percent coverage.
- Backend
- TileVille protokit appchain deployed and persistance db that doesnāt lose state upon restart.
- Analytics to track user engagement.
- User Interface
- Design for all the states mentioned in design section, connection with the tileville appchain backend.
- User engagement UI elements like share score to twitter and farcaster frames.
Project Timeline : 2 Month
Budget Requested : 18500 MINA
Budget Breakdown:
- Contract development(5000 MINA)
- Contract method implementation for calculating game score.
- Contract method to support mutliple map sizes.
- Tests implementation
- Frontend design (2000 MINA)
- Design for all the responsive screens mentioned in design section.
- Front-end Developent(6000 MINA)
- Implementation for all the screens mentioned in design section.
- Front-end smart contracts integration (2000 MINA)
- City, builder NFT asset design and deployment on Mainnet(2000 MINA)
- Protokit appchain deployment with persistent DB (1500 MINA)
Wallet Address: B62qqhL8xfHBpCUTk1Lco2Sq8HitFsDDNJraQG9qCtWwyvxcPADn4EV
Team Info
This section provides details about team.
We are a team with diverse skillset.
Satyam Bansal
Github: satyambnsal (Satyam Bansal) Ā· GitHub
- Software developer and open-source contributor with eight years of experience.
- Contributor to O1JS and Cairo zk projects.
- Winner of Multiple ZK hackathons including dex building with Noir.
- Experience working with Degen Ape Academeny as a core developer.
- Educator on zk topics here.
Yash Mittal
UI developer
Github: yassmittal (Yash Mittal) Ā· GitHub
- UI developer with 2 years of experience.
- Won Dojo Gamejam for dodgeballer project.
- Crypto Entusiast
Ankita Dixit
UI/UX designer
- Designer of ZilPepe
- Winner of Multiple Hackathons including zkSync nft quest.
Risks & Mitigations
- Graph Data Structure Implementation in Smart Contracts
Risk: Implementing graph data structures in smart contracts is challenging, especially for tracking connected tiles like tree tiles to form parks.
Mitigation: Collaborate with the ZKNoid team to create a graph on the frontend and pass a proof to the zk program. This approach allows the contract to only verify the proof, simplifying the on-chain logic.
- State Persistence
Risk: The current version of the protokit sequencer does not use a database to persist network state, leading to potential loss of state upon network reset.
Mitigation: Implement persistent database in protokit.
- Scalability Issues
Risk: As the game scales with more maps, levels, and players, performance issues may arise, particularly with on-chain computations and state management.
Mitigation: Optimize smart contract code for efficiency and performance.
Implement off-chain computation where feasible, using zk proofs for validation.
Monitor and address performance bottlenecks as they arise.
- Security Vulnerabilities
Risk: Smart contracts are prone to various security vulnerabilities, such as reentrancy attacks, overflow/underflow issues, and unauthorized access.
Mitigation: Conduct thorough security audits of smart contracts before deployment.
Use established libraries and frameworks known for their security.
Implement comprehensive testing, including unit tests, integration tests, and fuzz testing.
- Economic Model Risks
Risk: The in-game economy, including participation fees, reward distribution, and the value of NFTs, may be subject to market fluctuations and player behavior.
Mitigation: Design a balanced and sustainable economic model with mechanisms to handle inflation and deflation.
Regularly review and adjust economic parameters based on player feedback and market conditions.
Implement safeguards against potential exploits of the economic model.
- User Engagement and Retention
Risk: Keeping players engaged and retaining them over time can be challenging, especially in a competitive environment.
Mitigation: Continuously introduce new content, maps, and challenges to keep the game fresh and engaging.
Implement a robust reward system that incentivizes both new and returning players.
- Technical Dependencies
Risk: he game relies on various technologies, including the Mina blockchain, protokit, and zk proof systems, which may have their own limitations and risks.
Mitigation: Maintain close communication with technology providers to stay updated on developments and potential issues.