Welcome to the exciting world of GPTuessr, a cutting-edge online multiplayer game that blends the classic fun of drawing and guessing games with the latest in AI-driven art technology. Inspired by popular games like “skribbl,” GPTuessr offers a unique platform for friends to connect, laugh, and unleash their creativity from anywhere in the world. At the heart of GPTuessr is our innovative use of DALL-E, an advanced AI that generates stunning images in real-time based on player descriptions. This not only adds an inventive twist to the traditional drawing elements but also enriches the gaming experience by allowing players to interact with AI in a dynamic and entertaining way. Our game is designed to be more than just a pastime; it's a fusion of art and technology, creating a playground where imagination meets the digital canvas. With features like user authentication, sophisticated lobby management, and intuitive game logic, all powered by DALL-E and ChatGPT’s APIs, GPTuessr is crafted to be accessible and enjoyable across various devices. By choosing to implement GPTuessr as a web application, we ensure that no matter where you are or what device you use, the experience is seamless and engaging. Prepare to guess, giggle, and gaze at AI-generated art that brings your wildest descriptions to life. Join us at GPTuessr, where every game is an adventure in creativity and fun!
- OpenAI API - For image generation with DALL-E and ChatGPT for similary check between two sentences
- Spring Boot - Backend Framework
- React - Frontend Framework
- Gradle - Build Tool
- stompjs - Websocket Library for the client
- WebScoket - Websocket Library fom Spring Boot for the server
The GameController class communicates with the client side via endpoints, managing REST requests. It processes information exchanged with these endpoints through the GameService class.
The GameService class works in conjunction with the GameController to manage game data and oversee the game process. It is responsible for handling the game logic and ensuring that the game runs smoothly.
The DALL-E class serves as a client to interact with the OpenAI DALL-E API to generate images based on the image description provided by the user. It sends requests to the API and processes the responses to provide images for the game.
The ChatGPT class is specifically engineered to facilitate interaction with OpenAI's ChatGPT model for the purpose of evaluating the similarity between textual inputs. This class leverages sophisticated prompt construction and API communication strategies to precisely assess and quantify the degree of similarity between two sentences.
The Game class orchestrates the setup and management of a game environment, designed to facilitate interactions and gameplay among multiple users. It acts as a central hub, maintaining crucial game state information and is also responsible for controlling the game's lifecycle, including starting the game, managing rounds, and tracking the progress of each game session
Download your IDE of choice (e.g., IntelliJ, Visual Studio Code, or Eclipse). Make sure Java 17 is installed on your system (for Windows, please make sure your JAVA_HOME environment variable is set to the correct version of Java).
If you consider to use IntelliJ as your IDE of choice, you can make use of your free educational license here.
- File -> Open... -> SoPra server template
- Accept to import the project as a
gradle project - To build right click the
build.gradlefile and chooseRun Build
The following extensions can help you get started more easily:
vmware.vscode-spring-bootvscjava.vscode-spring-initializrvscjava.vscode-spring-boot-dashboardvscjava.vscode-java-pack
Note: You'll need to build the project first with Gradle, just click on the build command in the Gradle Tasks extension. Then check the Spring Boot Dashboard extension if it already shows soprafs24 and hit the play button to start the server. If it doesn't show up, restart VS Code and check again.
- Clone the client-repository onto your local machine with the help of Git. You can find the client-repository information here README.md
git clone https://github.com/sopra-fs24-group-32/sopra-fs24-group-32-client.git- Then clone the server-repository
git clone https://github.com/sopra-fs24-group-32/sopra-fs24-group-32-server.gitYou can use the local Gradle Wrapper to build the application.
- macOS:
./gradlew - Linux:
./gradlew - Windows:
./gradlew.bat
More Information about Gradle Wrapper and Gradle.
./gradlew build./gradlew bootRunYou can verify that the server is running by visiting localhost:8080 in your browser.
./gradlew testYou can start the backend in development mode, this will automatically trigger a new build and reload the application once the content of a file has been changed.
Start two terminal windows and run:
./gradlew build --continuous
and in the other one:
./gradlew bootRun
If you want to avoid running all tests with every change, use the following command instead:
./gradlew build --continuous -xtest
- The main branch is automatically mirrored onto Google Cloud App Engine via GitHub workflow
We recommend using Postman to test the API Endpoints.
If something is not working and/or you don't know what is going on. We recommend using a debugger and step-through the process step-by-step.
To configure a debugger for SpringBoot's Tomcat servlet (i.e. the process you start with ./gradlew bootRun command), do the following:
- Open Tab: Run/Edit Configurations
- Add a new Remote Configuration and name it properly
- Start the Server in Debug mode:
./gradlew bootRun --debug-jvm - Press
Shift + F9or the use Run/Debug "Name of your task" - Set breakpoints in the application where you need it
- Step through the process one step at a time
Have a look here: https://www.baeldung.com/spring-boot-testing
Like in every game there are always features that can be added in the future. Some of them could be the following:
- A feature that could be implemented would be to change the evaluator for the image description guess. Instead of ChatGPT being the evaluator and distributing the points, there could be a gamemode where the host has to rank the descriptions by correctness or all players in the lobby have to vote for the best description.
- Since Open AI's ChatGPT is constantly evolving and can also recognize images, there could be a mode where one competes against ChatGPT instead of real people.
- Enable players to link their social media accounts to the game. Implementing this functionality will necessitate that new developers incorporate APIs for social media sharing.
This game was brought to life by a group of five dedicated students who designed and implemented it as part of the Software Engineering Lab course at the University of Zurich during the spring semester of 2024.
- Roger Jeasy Bavibidila- rogerjeasy
- Eduard Gash - eduard54
- Nicolas Huber - nicolasHuber3
- Nicolas Schärer - NlcoIas
- Eric Rudischhauser - Ericode99
We are grateful to Fengjiao Ji (feji08) for her consistently helpful guidance and insightful comments.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details
