Skip to main content

LLM-powered top-down RPG game

Project description

My RPG (Multiplayer-Ready)

A fully networked, Thick-Host/Thin-Client RPG engine driven by autonomous LLM agents.

Run

First, install dependencies:

pip install -r requirements.txt

Multiplayer Mode

1. Start the Dedicated Host Server (Headless):

python main.py --host

(The server will start listening on 0.0.0.0:5555 by default).

2. Start a Thin Client:

python main.py --join 127.0.0.1

(You can launch as many clients as you want. The server will dynamically assign them IDs like remote_1, remote_2 and replicate the state).

Singleplayer / Dev Mode (Local Bypass)

To run the game locally without network serialization overhead:

python main.py

Example

Player 1 (The Host):

  1. Runs python main.py --host
  2. Opens a new terminal and runs an HTTP tunnel wrapper: ngrok http 5555
  3. Copies the forwarding URL provided by ngrok/your tunelling service (e.g., https://1234-abcd.ngrok-free.app).

Player 2 (The Client):

Runs python main.py --join 1234-abcd.ngrok-free.app (The engine automatically maps this to wss://1234-abcd.ngrok-free.app and successfully routes the TCP streams through the HTTPS tunnel).

LLM Setup

OpenAI (fallback)

If Ollama fails to initialize, it falls back to OpenAILLM().

Set the following environment variables:

  • OPENAI_API_KEY
  • OPENAI_BASE_URL (optional; defaults to https://api.openai.com/v1)
  • OPENAI_MODEL (optional; required if OPENAI_BASE_URL is specified)

You can place these in a local .env file, then specify their path: `python main.py --env-file .env'

Controls

  • Arrows: move player
  • SPACE: interact with nearby NPC, objects, doors, containers, and items.
  • ENTER: Open a dialogue -> Type + ENTER: speak aloud, will be broadcasted to all nearby NPCs.

Note: For best performance, prefix your message to a specific NPC with '(To npc_name)', or Whisper to them via the interaction menu (must be standing close to them).

  • TAB: open inventory
  • D: drop the currently selected item in your inventory, will prompt a dialogue to specify amount to drop.
  • L: Global NPCs and event log.
  • ESC: close dialogue

Interaction options

The following options are available in the interaction menu, subject to each object/entity type:

  • NPCs: Get their attention, Whisper to them, Give them gold
  • Doors: Openning them (if unlocked, or when the correct key is possessed in inventory when locked), Knock on them
  • Containers: Take away or Store items.
  • Workstations/Harvestable objects (e.g. trees): harvest/craft new items from them at the expense of some specific resources (if applicable).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

callai_rpg-0.1.1.tar.gz (77.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

callai_rpg-0.1.1-py3-none-any.whl (88.4 kB view details)

Uploaded Python 3

File details

Details for the file callai_rpg-0.1.1.tar.gz.

File metadata

  • Download URL: callai_rpg-0.1.1.tar.gz
  • Upload date:
  • Size: 77.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.10

File hashes

Hashes for callai_rpg-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7858731ccc2a59c9db34cab8c9afcedac9f9b53a1322a0a116f0fc43e63cce3b
MD5 e474dac0e2d70bc1fb1d2ed9fd392907
BLAKE2b-256 9412d1af3c1fa66e5c884c541c79de9adfc06904fe5694cccb353ec923dd91a0

See more details on using hashes here.

File details

Details for the file callai_rpg-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: callai_rpg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 88.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.10

File hashes

Hashes for callai_rpg-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 46e4bb2a2cdd7a68bb6489b8e42c5725dcbc37d31e55e6abf5606b61c07aa6a9
MD5 621634560b1a6dac470b4834ccf7ad6e
BLAKE2b-256 7c91ad0ba71016f3bf59c2537e438095ae3f491544247194606bee707f9dc396

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page