hand drawn area map
Talvare town map
Crypt boss room
wilderness map room
AI generated pixel art "blue slime"
AI generated pixel art "green slime"
AI generated pixel art "fire slime"
AI generated pixel art "king slime"
AI generated pixel art "cultist"
AI generated pixel art "bandit"
AI generated pixel art "troll"
AI generated pixel art "troll boss"
Unique quest Objects
open ai assistants
We are a team of geeks and we focused on building the best possible product. We apologize for the low quality video and the absence of a pitch. Please try the game for yourself and read this presentation.
Almost exactly 2 years ago, our destines started converging towards creating game. I (Mourad) had just won a small prize at a hackathon for making a small game with RPG Maker with wallet connection enabled but with barely any story. And David had just launched his game, Shattered Realms, made with RPG Maker with a deep universe and was just missing the technical elements to make it a web3 game. We met in Discord for a community that was maintaining a MMO plugin for RPG Maker. After a quick chat about what's missing in the Web3 gaming ecosystem and what we could build together, we decided that we had to do all these things.
The creation of Tal, our innovative roguelite JRPG, is fueled by a profound passion for JRPGs and inspired by a blend of nostalgic and modern gaming elements. Our deep connection with the rich narratives and intricate character development of JRPGs, especially those from the SNES era in the 90s, shaped our vision for Tal. We aimed to recapture the essence of these classic games and elevate them to current indie games quality by leveraging blockchain technology, opening up to new economic models, and AI bringing virtually infinite game content. This blend of 'old tech meets new tech' is pivotal in our approach, as we seek to reinvent classic gaming experiences for a new era.
As we discovered the existence of the tools provided by Chainlink (notably CCIP, Chainlink Functions and Automation), and Avalanche (with its novel consens mechanism allowing it to achieve quick finality, as well as the possibility to easily deploy app-specific subnets) has further inspired us and pushed us to explore new possibilities in gaming. TAL, therefore, stands as a tribute to the past and a bold leap into the future, merging the nostalgia of 90s RPGs with the cutting-edge potential of modern technology.
What it does
Tal is a mix of Roguelite, Tactical RPG and classic JRPG genres. The game invites players to embody an adventurer who landed in the town of Talvare after escaping a tormented past. The backstory itself is AI generated in a way to remain consistent with the game universe, but it always leads to this new beginning. The town of Talvare consists of a central area with a job board and a few villagers living their autonomous lives.
On launching the game, the players can connect their wallet in order to join the on-chain adventure. If this is their first visit, they are invited to customize the look of their character, and from then on, the character and their in-game progress is tied to their wallet account. At any point in the game, they can mint their character as an NFT on any of the 3 supported chains: Ethereum, Avalanche and Sepolia. Then they can always bridge over their character to any of the 2 other chains using CCIP.
Every 6 hours (final period to be determined during playtests), a Chainlink Function triggers the generation of new quests that will become available to all players via the job board. The quests are generated by our custom OpenAI assistant, trained to produce consistent content that blends perfectly with the game universe. Players have then 6 hours to complete as many of these quests before the next batch lands on the game. By grinding quests, players will earn loot and have a chance at upgrading their character's stats through XP Tomes or their equipment when they find better alternatives.
A special amount of care was dedicated to the battle system. With classic JRPG combat system, we felt like it got very quickly repetitive and boring. We have implemented a Tactical battle system that turns every combat into a strategic mind-bender.
One of the most innovative aspects of TAL is the concept of GTPV - Game Time Played Value. We believe that your time and effort in the game world should be rewarded. With TAL, players can monetize the time they invest in the game. This system not only adds an extra layer of excitement but also opens up new avenues for players to benefit from their gaming skills and strategies. Each player starts with a GTPV score of zero and can improve that score by completing quests and providing items in the market that other players needed. This is meant to reward players who are participating in the ecosystem and making the game more enjoyable for everyone. Players who simply log-in daily, beat some monsters in the training grounds and quit get much lower rewards.
Our primary goal with Tal is to elevate the 'fun factor' of our games to new heights while also introducing a revolutionary way to monetize gaming. We are committed to creating an immersive, enjoyable, and rewarding experience that resonates with both casual and hardcore gamers.
How we built it
The Back-End is a Typescript project that runs in a docker compose stack, along with Redis and PostgreSQL. It opens HTTP routes for fast querying indexed on-chain data and plays a pivotal role as a middleman between Chainlink Functions and OpenAI. Since we are using a custom OpenAI assistant, the flow didn't work directly with Chainlink functions as it would with a regular chat request: the process requires submitting the prompt, then querying the status every few seconds until it is marked as "completed" before we can get the response. We built a controller on our API that does just that and sends back a hash of the full response to the DON as this is the response we need to store on-chain in order to mark a quest as complete once the player has discovered everything there was to discover in that quest.
For our custom OpenAI assistant, we have trained it to always generate valid JSON fitting our
QuestInterface schema. A Quest typically has a title, a description, a list of tasks, and a dungeon. The dungeon is a list of rooms connected by one of their 4 sides (north, east, south, west) and may contain monsters, items and/or NPCs. The generation of rooms itself could have very easily been done without an LLM, but with ChatGPT4 as a basis model, the advantage is the ability to generate dialogue lines for the NPC, task descriptions and rewards that always remain consistent with the game universe.
We wanted our players to be able to play without worrying about gas fees. That was actually a problem that was always hindering our imagination when trying to think of fun gameplay elements. By leveraging Avalanche subnets we definitely solved this issue. We created an EVM subnet with custom precompiles that allow us to mint native currency to new players (after the back-end verifies that they have completed the initial tutorial), allowing them to spend gas on quests.
What we did to make this process simpler is that we deployed a smart contract and gave it the right to mint native currency to new players as well as save their address in storage to avoid doing so twice for the same address. We also built 2 other smart contracts that we deployed to our subnet and plan to deploy on the 3 chains we want to support:
- the CCIP enabled Characters NFT contract: this contract can be bridged over to a known supported chain and contract address (managed by the admin) and don't require an external contract to proceed with the minting and transferring of the NFTs. When an NFT is bridge to another chain, it is first transferred to the contract itself then a CCIP message is sent. The receiving function will either mint a new NFT to the recipient if this is the first time this tokenId is requested, or transfer the NFT from the contract to the recipient if that NFT was already bridged from that chain before. To avoid awkward situations where the same token ID would be minted in 2 different chains, mints are authorized by an ECDSA signature from our API which handles the numbering and ensures each token ID is only ever minted once, regardless of the chain it is minted on.
- the Quest contract is a Chainlink Functions client, it sends request to Chainlink Functions and asks it to run a remote JS file stored on IPFS. That's the file that calls our Quest generation API route and returns the hash of the quest to be stored in a mapping.
The idea is that when a player completes a quest in-game, the back-end will reveal the original response from OpenAI. The client can then submit it to the contract which will hash it and check that it is indeed a valid quest that was requested less than 6h ago and that this player is solving it for the first time. With this mechanism, we are able to track the Game Time Player Value in a completely transparent and tamper-proof way, on-chain.
Challenges we ran into
Developing Tal, presented our globally dispersed team with significant challenges, particularly in time management, given the tight 30-day deadline to evolve the game from a mere concept to a functional demo. The complexity of synchronizing workflows across different time zones, coupled with the need to harmonize game design, blockchain integration, and AI elements, tested our technical and project management skills. Despite these hurdles, our team's dedication and diverse expertise enabled us to adapt, prioritize tasks somewhat efficiently, and successfully produce a hopefully convincing proof of concept.
Accomplishments that we're proud of
C'mon have you played it yet? We are hella proud of this game, made in 30 days!
We are proud of a lot of things about this project be maybe the thing we are the most proud of is how we managed to train an OpenAI assistant to become a reliable dungeon master for our game. Originally, after watching the ChatGPT/Chainlink Function Youtube live made by Zubin, we tried it for fun (and also because if feels magic when it works), but we didn't really see ourselves using a conversational AI unless we could guarantee that it would be 100% consistent and never break the immersion. We started by training a custom GPT and saw incredible results after a while, then we discovered that custom GPTs aren't available via API calls, so we switched over to the Assistants API and redid the training from scratch and now we can make an API call to OpenAI and get a great quest that looks like it was planned all along.
Ideally this would be part of our presentation video but as all of this is being done a bit last minute, here's a separate video that showcases the custom OpenAI assistant: https://youtu.be/bJMRvlrpkTw
Not only that but we built a parser on the back-end that creates all the relevant database entries from an OpenAI response and spit it back to the game front-end in a way that allows it to make the dungeon rooms and the monsters, items and NPCs in it just as imagined by our assistant.
The first playthrough on a dungeon that was freshly generated by OpenAI truly felt crazy!!
What we learned
Before this hackathon, the only Chainlink product we had ever used was the VRF. During this hackathon we learned how to use CCIP, Chainlink Functions and Chainlink Automation. We learned how to deploy an Avalanche subnet and run a validator node on it. On a broader way, we learned to count on each other for help, guidance and to trust one another to handle their tasks.
What's next for Tal
While we believe Tal has successfully demonstrated the concept we wanted to prove with the integration of blockchain and AI in a JRPG format, we acknowledge that some of our ambitious goals are yet to be fully realized. The journey ahead involves the complete implementation of an ever-evolving game universe, integrating user actions into the narration,
Our immediate objective is to develop the full spectrum of game features. This includes enhancing the AI-generated content for more diverse and dynamic storylines, quests, and character interactions, as well as expanding the blockchain elements to game items and game currency. We want our next wow feeling to be when we list items for sale in a shop with one account on Avalanche and buy it with another account on Ethereum.
As we progress with gameplay elements, we will soon seek a widespread release. Our goal is to bring this innovative gaming experience to the mass market, reaching a broad audience of both JRPG enthusiasts and players new to the genre. This involves not just marketing and distribution strategies but also ensuring that the game is accessible and appealing to a diverse range of players. We aim to make Tal a benchmark in gaming innovation, showcasing the potential of blending traditional gaming elements with cutting-edge technologies. After they see this game, no one will ever call Web3 gaming a scam.
An integral part of our vision for Tal is to reward players genuinely for their time and effort in the game. We plan to fully implement and refine our Game Time Played (GTPV) system, which will allow players to earn tangible rewards for their gameplay. This system should be designed to be fair, transparent, and valuable, providing players with more than just entertainment but also a sense of achievement and recognition.
We believe that Tal has the potential to be a tipping point in the gaming community. By successfully integrating blockchain and AI in a manner that enhances the gaming experience and not just as an excuse to slap buzzwords on our project description. Tal could spark wider adoption of these technologies in the industry. Our vision is for Tal to be a catalyst for change, paving the way for a new era of gaming where technology, creativity, and player rewards converge to create experiences that are engaging, innovative, and transformative.