TileVille: On-Chain Strategic City Development Game

This topic is to discuss the proposal submitted by @satyambnsal
Please see below for the details of the proposal and discussion.

24th June,2024
Current status: Funded
Funding Note: The Tileville game has been in development for a while. The game is playable and the team has been delivering quality work from gameplay experience to involvement in the ecosystem. The risk of funding this project is low. We find this to have a high impact on introducing new users to the Mina protocol ecosystem. The budget is in line with the work proposed.

13th June,2024
Current status: Under Consideration.
Opened for community discussion on : 13 June, 2024.

3 Likes

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.

entity_model

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
4 Likes

Like TileVille.I think this game may become an entry point for blockchain players to enter the Mina ecosystem. Looking forward to attractive game activities when it is officially launched. You can refer to Bullshark Quest of Sui Network.

4 Likes

Given that TileVille aims to leverage zero-knowledge proofs for various in-game mechanics and interactions, how does the use of zero-knowledge proofs enhance the security and fairness of the game compared to traditional gaming models? Additionally, what challenges do you anticipate in implementing these proofs within the gameā€™s architecture, and how do you plan to address them?

2 Likes

Could you provide information about TileVilleā€™s social media presence? Specifically, which social media platforms do you actively use to interact with your community? I would like to follow you because your project seems interesting to me :grinning:

2 Likes

You can follow TileVille on twitter x.com. Game developer twitter ā€“ x.com. Also check out ZkNoid, ZK gaming platform twitter ā€“ x.com. Updates of TileVille game can be found there as well

3 Likes

Thank you for asking such an insightful question.

One key advantage of zero-knowledge proofs is that they eliminate the need for players to trust a centralised authority or server. Instead, players can independently verify the correctness of game actions and results without revealing sensitive information, such as their strategies or game states.
One concrete example is user is able to prove that he/she played the game fairly and got X score without revealing the tiles placement. this is important because for a same competition, map remains the same and player wouldnā€™t want other players to copy the tile placement strategy.

However, implementing zero-knowledge proofs within TileVilleā€™s architecture poses several challenges. One major challenge is the computational complexity and overhead associated with generating and verifying these proofs given the gameā€™s complex rules. Smooth UX plays a critical role in this aspect as when user will be submitting the proof, it will roughly take 2-3 minutes, so informing the user whatā€™s going on behind the scene in the mean time becomes more important in this scenario.

As the game rules and associated proof generation is complex, it is important to carefully craft contracts to ensure their correctness, security, and resistance to potential attacks or vulnerabilities. To address these challenges, TileVille leverages the expertise and existing infrastructure provided by our collaboration with ZKNoid, a provable gaming platform built on the Mina blockchain.

3 Likes

We are right now present of X and plans to increase our presence on other social media platforms like Farcaster, Discord.
Follow us on X here

4 Likes

Thank you for such an interesting answer to my question :grinning:

2 Likes

You have absolutely no publications and practically no subscribers. How are you going to win over the audience?

1 Like

Youā€™re right that starting with no existing audience or publications can make building a following more challenging. Once the MVP version is out(which we are really close to!), we would actively engage with audience through comments, social media, live streams, etc.

2 Likes

Engaging with the audience through comments, social media, and live broadcasts sounds like a good plan. However, I am curious to know the details: How do you plan to generate initial interest and attract the attention of this audience in the first place, given the competitive environment and your lack of subscribers or previous publications?

2 Likes

Design a points system, hint on Twitter that there may be an airdrop event, find some KOLs to promote this possible ā€œairdrop eventā€, boom, get lots of subscribers.

2 Likes

I also have similar idea in mind and working with minanft to launch a collection. we would award early users with ERC721 items.

3 Likes

This is great idea to encourage people play

2 Likes

Hi there, Minapolis OG player here, it was very addictive! I really looking forward to the improvements you mention in your proposal.
Few things Iā€™d like to mention:

  • ensure you donā€™t underestimating time it take for integration of backend to the frontend.
  • in your budget you mention ā€œCity, builder NFT asset design and deployment on Mainnetā€, could you please elaborate what do you mean here? How would ā€˜ island ownershipā€™ work?
  • could you shine some light on whatā€™s needed/missing for deployment on Mainnet?
  • you mentioned user app analytics in backend section of milestones, how/what are you planning to analize? Wouldnā€™t simple fronted analytics tools be enough ?

Looking forward to playing the new version of TileVille :slight_smile:

3 Likes

Thank you for your feedback and interest in TileVille! As a TileVille OG player, your insights are especially valuable. Iā€™m glad to hear youā€™re looking forward to the improvements. Let me address your points:

  • Backend-Frontend Integration: Youā€™re absolutely right about the potential challenges of backend-frontend integration. Weā€™ve factored in extra time for this in our timeline, but weā€™ll remain vigilant and adjust if needed.
  • Every city you built as part of the game play will be mintable at the end of the game. These cities will have various traits like number of windmills, parks, street layout, etc.
  • I guess there is a misunderstanding. when we say backend, we mean everything user is not directly interacting with. In end, analytics will be integrated in game UI only.
    We infact are currently experimenting with the Posthog solution and assessing its feasibility.
2 Likes

This application is approved for Funding.

The Tileville game has been in development for a while. The game is playable and the team has been delivering quality work from gameplay experience to involvement in the ecosystem. The risk of funding this project is low. We find this to have a high impact on introducing new users to the Mina protocol ecosystem. The budget is in line with the work proposed.

3 Likes

Weā€™re excited to share our progress and are pleased to report that we are on track with our mentioned milestones. Your support has been instrumental in bringing TileVille closer to realizing its full potential as an engaging, on-chain strategic city development game on the Mina blockchain.

  1. User Journey Implementation:
  • Created a profile page displaying past games and performance
  1. NFT Marketplace:
  • Launched a fully functional NFT marketplace
  • Enabled minting and ownership of TileVille Builder NFTs
  • Integrated NFT display and management in user profiles
  • Marketplace link: TileVille
  1. Smart Contract Enhancements:
  • Resolved the tree structure implementation challenge
  • Developed logic for randomly setting hill areas on the map at game start
  1. Score Calculation:
  • Created methods to calculate combined scores for all three tiles placed by a player
  • Implemented specific scoring logic for different tile types (windmills, trees, roads)
  1. Game Mechanics:
  • Expanded the game mechanics to support multiple tile types
  • Implemented rules for connecting the city center to ports
  1. GitHub Repository:

These milestones showcase significant progress in both the frontend user experience and backend smart contract development for TileVille, setting a strong foundation for the final phase of the project.

2 Likes

Deliverables Summary

We are pleased to report the successful completion of the mentioned milestones, meeting and exceeding many of the objectives outlined in our original proposal. This summary highlights our key achievements and deliverables.

Completed Deliverables

1. Protokit Runtime Module Development

  • Fully implemented score calculation for all existing tile types
  • Developed modules to support the current game map
  • Integrated random hill generation at game start
  • Implemented comprehensive test suite with high coverage

2. Game Features Enhancement

  • Introduced a speed version of the game for more dynamic gameplay
  • Refined existing gameplay mechanics for enhanced strategic depth

3. Backend-Frontend Integration

  • Implemented real-time updates and synchronization of game data
  • Developed APIs for seamless communication between components

4. TileVille Protokit App Chain Deployment

  • Optimized for efficient on-chain operations

5. User Experience and Retention Enhancements

  • Refined UI for improved intuitiveness and visual appeal
  • Implemented leaderboards and achievement tracking
  • Added user engagement features like score sharing on Twitter and Farcaster frames

6. Ownership and Governance

  • Integrated NFT functionality for minting player-constructed cities

7. NFT Marketplace

  • Created a dedicated marketplace for TileVille NFTs
  • Implemented secure trading and ownership transfer mechanisms

8. Pallad Integration

  • Successfully integrated Pallad for joining competition

9. Analytics Implementation

  • Deployed analytics tools to track user engagement

10. Ecosystem Collaborations

  • Deepened integration with ZKNoid, leveraging their SDK and bridging infrastructure
  • Enhanced partnership with MinaNFT for seamless NFT creation and management

Additional Achievements

  1. Speed Version: Developed and implemented a fast-paced version of TileVille, adding variety to gameplay options.

  2. Community Building: Established a vibrant Discord community and implemented a referral program.

  3. Performance Optimization: Achieved significant improvements in load times and in-game performance.

  4. UI Improvements: Made substantial enhancements to the user interface for a more engaging player experience.

Conclusion

The TileVille project has successfully evolved from its MVP stage, becoming a more engaging and sustainable on-chain gaming experience. While we focused on refining and optimizing the existing gameplay rather than expanding to multiple map sizes or additional tile types, weā€™ve introduced exciting new features like the speed version of the game. Weā€™ve not only met many of our initial objectives but also expanded in areas that enhance user experience and community engagement.

The combination of improved gameplay, community ownership potential, and the groundwork for decentralized governance positions TileVille as an innovative example of blockchain-based gaming on the Mina ecosystem. The successful integration with Pallad, and the development of our NFT marketplace demonstrate our commitment to leveraging cutting-edge blockchain technology.

We extend our gratitude to the Mina community, our partners, and all stakeholders who supported this journey. While weā€™ve made significant strides, we acknowledge that some aspects of our original proposal, such as multiple game levels and additional tile types, remain as potential future developments. We look forward to the continued growth and evolution of TileVille in the blockchain gaming space, guided by our communityā€™s feedback and the ever-advancing blockchain technology landscape.