Inspiration
When pondering how to maximize "entertainment" for our users, we decided that by utilizing generative, non-repeating gameplay that changes every time a game was run, the game would have infinite replayability and content, thus also supplying limitless entertainment value. Then, we decided to combine this idea with a game that seems to embody completely opposing concepts: Chess. The game of chess has been played for thousands of years, and in that timespan, the rules have not budged an inch. So, what happens when we combine the dynamic capabilities of Gemini with the static game of Chess? Enter: Dementia Chess.
What it does
Dementia Chess is a game that is designed for endless content and fun. It is multiplayer supported, allowing for players to face each other across the internet. At the start of every game, new chess pieces are generated that have completely different movesets and capabilities, and then each are placed at random on the board. Then, the players take turns making moves with these new pieces until checkmate is delivered.
How we built it
We first wrote our own multiplayer solution that allows for players to connect to a lobby together using sockets. Then, we defined a generalized schema to model arbitrary movements across the board and capabilities for pieces, and then we used the Gemini API to generate structured output abiding to those schemas, and then created new chess pieces with its data. To validate and execute the moves that the clients attempt, we wrote code that would use the generated movesets and see if the attempted move was possible.
Challenges we ran into
One of the hardest challenges of our game was creating a data structure that allowed for both the program and Gemini to understand and write to. We wanted the freedom and creativity of artificial intelligence, but we also needed its output to be understood by our code logic. To solve these issues, we arrived at a structure that uses arrays of vectors to represent possible moves along with other variables that define how the piece behaves, such as whether it jumps or slides, how many moves it can make, its range, and more. Gemini could write to any of these variables and thus have almost complete control of the pieces' abilities.
Accomplishments that we're proud of
When we first tested the multiplayer functionality of the game, it was incredibly satisfying to see us connected to the same lobby on different laptops. This specific functionality took a lot of effort and testing to implement correctly as we had to write a custom networking solution for lobbying. However, with multiplayer finally completed, it was nice to know that any two people from anywhere in the world could now enjoy our game and play it together.
What we learned
- How to structure a project with many complex and intertwined parts
- How an AI to coding pipeline works, and how to cleanly represent the AI data in code
- How to connect computers through sockets and bring them into the same lobby ## What's next for Dementia Chess For the future, we plan to diverge from chess entirely, and move to broader topics. We hope to take this idea of having AI alter and generate content in games to an even greater level, where it will become an actual possibility to have a world where anything that can be imagined will be possible.


Log in or sign up for Devpost to join the conversation.