The popular game werewolves now becomes digital. In this social deduction game, different fractions (werewolves, villagers etc.) try to seize control of the village through an interactive voting system. During the night the werewolves awake and kill one of the sleeping unknowing villagers. Furthermore hidden magical creatures like the witch, cupid or seer act in their secretive manner. During the day the villagers try to free their town by voting on who's secretly a werewolf.
An integrated voicechat allows the crucial discussions during the voting phases to take place.
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).
gradle project
build.gradle
file and choose Run Build
The following extensions can help you get started more easily:
vmware.vscode-spring-boot
vscjava.vscode-spring-initializr
vscjava.vscode-spring-boot-dashboard
vscjava.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 werewolf-server
and hit the play button to start the server. If it doesn't show up, restart VS Code and check again.
You can use the local Gradle Wrapper to build the application.
./gradlew
./gradlew
./gradlew.bat
More Information about Gradle Wrapper and Gradle.
./gradlew build
./gradlew bootRun
You can verify that the server is running by visiting localhost:8080
in your browser.
./gradlew test
./gradlew test jacocoTestReport
We welcome contributions to enhance and improve the Werewolves game. If you would like to contribute, please follow these steps:
We appreciate your contributions and will review your pull request as soon as possible.
The lobby aggregates players and roles and is responsible for assigning players to their respective roles.
Because a lobby can be used for multiple games, it does not aggregate a game object.
The Game class aggregates information about the current state of the game, like the current stage or the
results of passed polls. It also serves as the main access point to logic components for the service layer.
Voting is the main component of the game, all actions are executed via votes of one or more players.
This complexity is modeled in the poll class (Poll instead of Vote, in order to not confuse the noun and verb vote).
The poll class aggregates its participants, its options with their corresponding actions and what happens when a poll is tied.
The application was built in a modular approach to easily allow extending it. The following features are not yet implemented but could improve the Game play:
Implementing further roles could make the Game more interesting. E.g.
Also see https://werwolf.fandom.com/de/wiki/Werwolf-Rollen-Sammlung for further roles.
Storing Game Statistics for every user would provide interesting insights into the abilities of each user. The following benchmarks could be interesting:
Currently users are only able to play a game, if they have a group of friends that are currently online and exchange the join lobby code. To allow users to play the game with strangers it would make sense to develop an open lobby listing feature, where users can view and select from available lobbies. This can be implemented by providing a user interface that displays the open lobbies along with relevant details such as lobby name, number of players, and game settings. Players can then select a lobby from the list and join directly.
Additionally users that are in a lobby should be able to invite users (by their username or similar) to join the game.
The application was developed for the SOPRA 23 course by:
We would like to thank the following people for their contributions during the project:
This project is licensed under the GNU GPLv3 License - see the LICENSE.md file for details