Using GPT-4 to create content for tabletop RPGs, such as Pathfinder and Dungeons & Dragons

Right now I’m working on creating some special materials to add some depth to the crafting system in-game. One of my players is a forge cleric (a priest who venerates a deity associated with crafting, specifically metalwork), so he’s been champing at the bit for a better crafting system.

I’ve got my Python app building a conversation to feed the GPT-4 model with all of the information needed (resource types, subtypes, rarity odds, what JSON schema needs to be returned, acceptable values for each property, etc). Additionally, I’ve found I need to feed the API back the history of what it’s already generated or it frequently generates repeats (materials with the same name and/or basically the same uses). However, feeding the history back to the api rapidly increases the tokens used in each message. Currently I’m feeding back a summary of the history (names and descriptions of materials only), and that seems to be helping somewhat.

4 Likes

Nice! I’ve been working on similar over at LitRPG Adventures since GPT-2 in 2019. We should compare notes sometime! Welcome to the forum.

As I have seen the Post I directly thought of you @PaulBellow :wink:

So @Charles.Hunter LitRPG Adventures: AI RPG Generators + Content Library this is the Link to Paul’s Project :slight_smile:

1 Like

Here is a link to the public repo:

Please excuse any architectural mistakes. I’m learning Python as I go with this, I’ve been a .NET / JS dev for my entire career.

It’s part of a larger project that I am building as a FoundryVTT module (and Menyr, when it comes out) that will provide an extensive library of special materials and a allow a GM to effortlessly generate recipes and add depth to crafting systems, an area that suffers from excessive abstraction in every TTRPG I’ve played.

Minerals (Metals, Crystals, Stones) get produced as a singular material. Plants & Creatures get produced with a list of “Parts” that are viable materials, so a “Manticore” would have a “Parts” array that contains information on it’s “Quills”, “Hide”, and/or “Fangs”.

It currently produces special materials like this:

{
  "name": "Windrazer Steel",
  "rarity": 3,
  "value": 60,
  "description": "Windrazer Steel is a rare, lightweight metal that is naturally attuned with airflow and elemental air magic. It is known for its exceptional speed enhancement properties when forged into weapons or armor.",
  "resourceType": "MINERAL",
  "resourceSubtype": "METAL",
  "visualDescription": "Windrazer Steel has a shimmering, pale silver color with a subtle teal-blue sheen on its surface, reminiscent of the sky on a clear day. When struck by light, it emits a faint breeze that gently rustles nearby objects.",
  "specialProperties": [
    "Enhancement of speed-related abilities.",
    "Attuned to elemental air magic."
  ],
  "physicalProperties": [
    "Lightweight",
    "Smooth surface",
    "Pale silver color with subtle teal-blue sheen"
  ],
  "uses": [
    "Making lightweight weapons and armor",
    "Crafting wind-related magical artifacts",
    "Creating airship components"
  ],
  "density": 2.77,
  "weight": 0.61
}