Skip to content

skipdudes/AdventureGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shadows of the Crown

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...

Gameplay GIF

Click on the gameplay GIF to watch the whole gameplay.


This repository contains the source code for Shadows of the Crown (repo name: AdventureGame).

🛠 Technologies & Requirements

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:

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.

⚙️ Building & Setup

1. Clone the Repository

Clone the repository into your desired directory:

git clone https://github.com/skipdudes/AdventureGame.git

2. Set Up the Python Dialogue Server

Navigate to the ChatServer directory, which contains the Python server script, and follow these steps:

  1. Create a virtual environment:
python -m venv .venv
  1. Activate the virtual environment:
source .venv/bin/activate

    (On Windows use .\.venv\Scripts\activate instead)

  1. Install dependencies:
pip install -r requirements.txt
  1. Create an .env file 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.

3. Build the Game

  1. Open ShadowsOfTheCrown.sln in Visual Studio 2022.
  2. Select your desired configuration (e.g., Release x64).
  3. 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.

4. Copy SDL2 Runtime Libraries

After building, copy the following DLL files into the bin/<Configuration>/<Platform>/ folder (the same directory as shadows-crown.exe):

  • SDL2.dll from:
GameEngine/Vendor/SDL2-2.30.8/lib/<Platform>/
  • SDL2_image.dll from:
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.

5. Copy Game Data

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>/.

▶ Running

1. Start the Python server

From the ChatServer directory, activate your virtual environment (if not already active) and run:

python server.py

2. Launch the game

Run 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.

📜 License

This project is licensed under the MIT license.

🎨 Credits

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.

👥 Authors

Copyright © 2024 Marcin Chętnik, Andrzej Woroniecki, Marta Makowska

About

An adventure game based on models of interactions with NPCs with specific motivations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors