A pixel art RPG full of intrigue, murder, and conspiracy...
Shadows of the Crown is a 2D RPG set in the medieval era. You take on the role of a Royal Guard, entrusted by the King with the mission of finding those responsible for the murder of a high-ranking nobleman at the royal court. As you conduct your investigation, you uncover that the crime was a carefully orchestrated act by an organized group, and shadows are gathering over the entire kingdom...
Click on the gameplay GIF to watch the whole gameplay.
This repository contains the source code for Shadows of the Crown (repo name: AdventureGame).
The game engine is written in C++ using the SDL2 library. During dialogues, the player's input is sent to a Python-based server, which communicates with the game over HTTP. The server then connects to the Groq API to utilize the Llama 3 language model. Once the model processes the input, the response is returned to the game through the same communication channel. This approach makes the gameplay more dynamic and ensures that interactions with NPCs are varied and feel natural.
Game requirements:
- C++ 17
- SDL 2.30.8
- SDL_image 2.8.2
- JSON for Modern C++ 3.11.3
- cpp-httplib 0.18.1
Server requirements:
- Python 3.10+
- Uvicorn
- FastAPI
- python-dotenv
- Groq
Note: The C++ project was developed using Visual Studio 2022 (with the Desktop Development with C++ workload installed), and the Python server with PyCharm Community Edition. To enable dialogue generation, you must generate your own Groq API key.
Clone the repository into your desired directory:
git clone https://github.com/skipdudes/AdventureGame.gitNavigate to the ChatServer directory, which contains the Python server script, and follow these steps:
- Create a virtual environment:
python -m venv .venv- Activate the virtual environment:
source .venv/bin/activate (On Windows use .\.venv\Scripts\activate instead)
- Install dependencies:
pip install -r requirements.txt- Create an
.envfile and add your Groq API key:
GROQ_API_KEY=<your-api-key-here> Replace <your-api-key-here> with your personal Groq API key, then save and close the file.
- Open
ShadowsOfTheCrown.slnin Visual Studio 2022. - Select your desired configuration (e.g.,
Release x64). - Build the solution via Build -> Build Solution.
If the build completes successfully, the game executable shadows-crown.exe will be located in:
bin/<Configuration>/<Platform>/where <Configuration> matches your selected build type (e.g., Release) and <Platform> is either x64 or x86.
After building, copy the following DLL files into the bin/<Configuration>/<Platform>/ folder (the same directory as shadows-crown.exe):
SDL2.dllfrom:
GameEngine/Vendor/SDL2-2.30.8/lib/<Platform>/SDL2_image.dllfrom:
GameEngine/Vendor/SDL2_image-2.8.2/lib/<Platform>/Make sure <Platform> matches the architecture you built for (x64 or x86).
You can skip this step if you already have SDL2 installed system-wide and in your PATH.
The game requires assets from the GameEngine/Data directory. Copy the entire Data folder and place it next to the shadows-crown.exe file, in bin/<Configuration>/<Platform>/.
From the ChatServer directory, activate your virtual environment (if not already active) and run:
python server.pyRun shadows-crown.exe from the bin/<Configuration>/<Platform>/ folder. The game will now be able to communicate with the dialogue server and generate dynamic NPC responses.
This project is licensed under the MIT license.
The game uses fonts from Nb Pixel Font Bundle and Nb Pixel Font Bundle 2, created by Nimble Beasts. Character and level sprites were sourced from RPG Maker XP.
Copyright © 2024 Marcin Chętnik, Andrzej Woroniecki, Marta Makowska