Skip to content

About

Dynamic evolution of non-player characters' motivations in a RPG game using a language model

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

64 Commits

Folders and files

Repository files navigation

Shadows of the Crown II

An LLM-powered 2D RPG where every conversation shapes the fate of the kingdom...

Shadows of the Crown II returns you to a medieval world teetering on the brink of rebellion. Sent by the King to the restless province of Tarnstead, you must navigate a dangerous web of conspiracies, interacting with powerful mages, cunning smugglers, and weary tavern keepers. This game is a direct sequel to Shadows of the Crown and assumes that the player remained loyal to the King.

Gameplay GIF

Click on the gameplay GIF to watch the whole gameplay.


This repository contains the source code for Shadows of the Crown II (repo name: dynamic-evolution).

language Python build Pygame platform Windows Linux macOS release 1.0.0

🛠 Requirements

  • Python 3.10+
  • pip

All required Python packages are listed in requirements.txt. To enable dialogue generation, you must generate your own Groq API key.

⚙️ Setup

1️⃣ Clone the repository

git clone https://github.com/skipdudes/dynamic-evolution.git
cd dynamic-evolution

2️⃣ Create a virtual environment

python -m venv .venv

3️⃣ Activate the virtual environment

🪟 Windows

.venv\Scripts\activate

🐧 Linux / 🍎 macOS

source .venv/bin/activate

4️⃣ Install dependencies

pip install -r requirements.txt

5️⃣ Create an .env file in the project root

GROQ_API_KEY=your_api_key_here

Replace your_api_key_here with your personal Groq API key.

▶ Running

Run the main script:

python main.py

🧠 Custom LLMs

This project heavily relies on the openai/gpt-oss-120b model provided via the Groq API. The game's prompt engineering, narrative logic, and system architecture have been meticulously tuned specifically for this model. Proper functionality and stability are only guaranteed when using it.

Experimenting with other models: You are free to modify the code to test other LLMs at your own risk. However, please keep in mind that the game may become highly unstable or break entirely. If you choose to use an alternative model, it must:

  1. Be a highly advanced model capable of complex reasoning.
  2. Natively support Tool/Function Calling.
  3. Strictly adhere to JSON formatting.

Note: In this game, the LLM is not just a chatbot - it acts as a core logic engine. It must precisely generate structured data to execute in-game actions like giving items, teleporting NPCs, or updating quests. If a model fails at Tool Calling, the game will not function.

📜 License

This project is licensed under the MIT license.

🎨 Credits

This project was brought to life using the following tools and assets:

👤 Author

Copyright © 2026 Marcin Chętnik

About

Dynamic evolution of non-player characters' motivations in a RPG game using a language model

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages