-
-
You reached the end of the quiz!
-
That's everyone's dream character sheet
-
Vision- "Empower the Artists", "Make Ethical AI Art". We are onboarding artists like Risto to get data ethically to train our AI.
-
Brainstorming session with Timothy Simpson, identifying the gaps in character personalisation, and so we quized it
-
Burn the dice to mint!
-
"Flying in the clouds", we plan to use SD Automatic 1111 on AWS (currently using SD Automatic 1111 on runpod for cost optimisation)
Inspiration
We imagined stepping into the world of Dungeons & Dragons (D&D) as a beginner and feeling a deep connection with our character from the very beginning. Keeping it simple and engaging for amateur players and promoting experienced players to build stronger communities, we envision a platform that not only unleashes creativity but also engages D&D players with a vibrant community of AI art enthusiasts, DMs and artists and prompt engineers. By fostering a thriving community, we aim to keep users connected, inspired, and coming back for more. But we're not done yet. We've added a thrilling twist to the mix. We wanted to give users a stronger reason to mint their character. Hence, we unlocked the next step of the user adventure! We prepare them to face a randomly chosen monster and delve into a captivating quest.
What it does
- The Quiz-based character-sheet generation feature makes it easier for a beginner to understand their character and relate to it personally. At the end of the quiz, the user gets a character sheet pdf with their character description and character AI-generated avatar, making it easier for them to understand the role their character will be playing.
- Provides a platform to engage with the community and encourages people to be creative with AI art and prompt engineering. This also gives users a reason to come back and stay connected to the community much longer. Currently, this contribution hosts a front end that queries a prompt of the week challenge from a smart contract, a the prompt is a suggestion to generate an AI scene to mint as an NFT. This prompt is chosen from the smart contract with Chainlink VRF and the choice rotates once a week thanks to Chainlink Automation. On the front end, users can "like" an NFT, from contracts that mint the AI images as NFTs, that most closely aligns with the prompt. These likes are saved to a database which can be queried to find the owner of the most popular NFT.
- Backstory and Quest Feature- Thanks to the magic of ChatGPT, our app provides users with a short but enticing backstory that sets the stage for user's D&D game, fueling excitement and immersing users in a rich, immersive world. Starting with a random monster, the program logic checks the user's character sheet values, if the user has the proficiency in say two skills required to defeat the monster, the user wins the battle, and that too in an epic way, written by ChatGPT. Now say, the user has only one skill required to defeat the monster, it's a win too for the user, but less great. In the worst case, if the user doesn't have any proficiency, the user loses this fight in the backstory itself, and everyone remembers it forever. Because it's on the blockchain! But you can roll another die and hope to fight another monster or level up your character by playing D&D. So basically, after rolling the die (VRF Randomness) which gives a random monster, our app provides the user with a quest. The quest involves defeating a specific monster at a given location in the backstory. So the backstory adds depth to the quest, potentially providing context or narrative elements related to the monster and the location. And in the quest, user is given the task to play D&D and locate the monster and confront it again.
How we built it
- Quiz-based character-sheet generation feature- We built it using HTML, JS, CSS and PHP to create the quiz, process the form submission and display the generated character, and generate a character sheet with all the character image and stats. The image is generated by making a POST request via txt2img fastAPI to the SD running on cloud GPUs and processing the base64 image received in response.
- Community Social Media Engagement Feature- This uses a solidity smart contract that is chainlinked with VRF and Automation, NextJS/React for the frontend, alchemy-sdk to collect and present NFTs along with the prompt of the week info, and mongo database is used to track the likes.
- Backstory and Quest Feature- Used the functions-hardhat-starter-kit and OpenAI API to integrate ChatGPT with our app using Chainlink Functions to generate backstory of players fighting different monsters generated by VRF Randomness and continuing the quest to seek the monster. So we used Chainlink Functions and VRF Randomness here. Added additional logic to identify the monster's exposure to defeat in certain moves and whether the play has those defeat methods as an important strength in their character sheet or not.
Challenges we ran into
A. Creating the "prompt of the week" challenge, hurdles described by teammate Sean Francis-
The plan was to create a contract that housed prompts suggestions; "Create a dragonborn having tea time", "Generate a scene of a dragonborn falling off a bridge". etc etc. Chainlink Automation would choose a new prompt once a week and VRF would make it random. This would be posted to Twitter for community members to like and retweet and the winning NFT of the week would be paid out a big bag of Ceptor Dice. Sounds like fun right? Well, little did I know I'd hit mountains upon mountains I'd have to reconsider my route and what kind of goals were achievable.
"How do we query from a blockchain a variable?"
My first attempt was to use a QuickAlert from QuickNode. This would read transaction data and deliver it to a webhook. I initially ran into two obstacles, reading the transaction data as it was in hexidecimal, and where to run the webhook? I tried filtering the transaction data to only read events from my smart contract but I still had trouble interpreting the transaction logs. I found a site to host a webhook to receive the transaction alert, but between the cost and the inability to interpret the data, I was at a lost. A teammate, Alexathims, gave me the suggestion to use alchemy-sdk to read the contract variable directly, thereby skipping all of what I previously researched.
If it works, it works, progress was made.
My next hurdle was my Twitter API usage. While I figured out how to scrape Twitter data using Twitter-scraper from Apify, my understanding of the Twitter API had me concerned. I programmatically made a "hello world" tweet, but it required me to go to the website to retrieve a PIN to authenticate my tweet. I didn't know if this was the free version of the Twitter API and I'd have to go on a paid plan for an automated tweet.
After lamenting about this issue (while putting this in the back burner for other parts of the project) I received a suggestion due to time constraints to instead skip Twitter and make a frontend page to query likes from. That I did, though admittedly I wish I pushed forward with Twitter.
Using a frontend and making a minimalistic page where I pulled NFT data from contracts and had a nice banner showcasing the current prompt chosen by Chainlink's VRF, changing once per week via Automation, I had a couple hurdles. Initially, I intended to query likes and retweets from Twitter posts on AI generated in response to Ceptor Club's Prompt Challenge of the Week post. How do I do this on my minimalistic page?
So I created a like function where you can "heart" an NFT you like that aligns with the Prompt of the week displayed. But then I ran into a major roadblock of mongodb. Ceptor Club has a backend mongo database, but I've never used mongodb in my life! Despite given the suggestion, I didn't speak up on my ignorance, and pushed it in the back burner to work on other parts.
Big mistake!
It came to bite me in the rear in the final week where I scrambled to get help, and in the nick of time, got an example "post to mongodb" script which I used to get my feet wet and eventually figured out how to create updates to log the relevant NFT data, the owner, the contract address, the token Id, and log the addresses of those who liked each NFT so I can query the most popular NFT to reward its owner.
HOWEVER,
when it came time to use Chainlink functions, I hit a roadblock that wasn't going to budge given the mere hours I had left in this hackathon. Functions doesn't allow npm modules to be executed, I had to use only API requests. It was too late to setup a RESTful API interface to do so so I can programmatically reward the winning NFT owner.
Overall, it was a constant struggle learning new technology after new technology after new technology. It's fun looking back, though I wish I was more hyper focused as I lost time wallowing in hesitancy, only figuring things out after asking for help or committing the time to push through.
And ChatGPT is a godsend. It may not have solved all my problems, but it's an incredible companion nonetheless
~ Sean Francis
B. Backstory and Quest Feature-
Becoming adaptable to new tech stack when working with new teammates, handling CORS errors on the server side.
C. Backstory and Quest Feature-
Realised that Chainlink functions have a buffer size of 256 bytes so the response generated by chatGPT was limited to very few tokens.
Learning leadership skills
Was less aware of everyone's features at the start but understood that as a team leader, it is my duty to understand my teammate's blocker's and help my best to get them unstuck. This required me to get out of my comfort zone, be very communicative, and learn 2x times about technical stuff and celebrate each other's achievements together.
Accomplishments that we're proud of
All of us worked on distinct features, yet we stayed very closely connected and learnt to communicate well to discuss each other's blockers and helped each other learn and resolve our doubts. It is worth mentioning that all of us were working with unique skills and different tech stacks; for example, we used HTML, JS, and PHP for one feature and Next.js for another feature, so we kept our tools flexible and it helped us accomplish a diverse and adaptable environment in the team, helping us focus more on harnessing the strengths of every team member and fitting everyone's features in good order to build the bigger picture. In the process, we learnt a lot. Spanning from AI to the blockchain, from PHP to Next.js, from SFTP to GitHub, and the list goes on.
What we learned
Technical- Chainlink Functions, Chainlink VRF random number generation, Chainlink Automation, QuickAlert from QuickNode, webhooks, PHP, mongodb Non-Technical- Posting out doubts in team publically, being proactive in communicating ideas, doubts and solutions, and cheering up each other by talking or trying your best to help them in any possible way as even a small effort can make a huge difference.
What's next for Ceptor Club
Make AI train ethically on D&D artist's drawing data, help artists earn and connect to the community and relieve their fear of AI eating their job, by helping them get recognition and means to earn by generating art to fine-tune AI models in their styles.
Important Links
Verified contracts for burning a dice to produce random weapons for the character NFTs.
Character Sheet https://goerli.etherscan.io/address/0x1487b606e74422F63b25dD404860DAD6497b28A0#code
VRF Consumer Contract (Roll for Weapon) https://goerli.etherscan.io/address/0x99acC6c2a1d75f0fFDafE33cab54Fa149e976BCc#code
DIE ERC20 Token Vendor Contract https://goerli.etherscan.io/address/0xF0abD4749f2d802083485493f01aAF1F4dE8E9A8#code
Log in or sign up for Devpost to join the conversation.