TheComamba / UnKenny

A FoundryVTT module providing NPCs with artificial intelligence.
MIT License
2 stars 4 forks source link

Worlds Variable and roles Variable (Feature Request) #40

Open Vagabondluc opened 5 months ago

Vagabondluc commented 5 months ago

It would enhance the immersion and contextual relevance of NPC interactions to introduce world variables and specific locations for NPCs within UnKenny. For instance, if the narrative includes distinct locations like Baldur's Gate and Waterdeep, incorporating local information—events, rumors, or crises—would allow NPCs in each location to provide tailored responses reflective of their environment. This would result in a more nuanced dialogue where NPCs in Waterdeep are aware and can discuss local happenings distinct from those in Baldur's Gate.

TheComamba commented 5 months ago

I like the idea. In all possible implementation paths that I came up with I had to dive into foundry, javascript and handlebars a bit, because I am inexperienced in all three. So before I do that, let's work out the specs together. I imagine a dialogue to create and edit something like roles, which are coupled with preamble snippets. So for example I could add the role "Waterdeep-Citizen" with the snippet "You know that the local mill has been overrun by killer-dolphins.", but I could also add a role like "Pirate" with the snippet "You talk like a pirate.". In the unkenny edit dialogue you could then add or remove an arbitrary number of roles and thus create your average waterdeep citizen, your waterdeep pirate, and your generic pirate. The snippets are prepended to the actor-specific preamble. Does this sound like the feature you are looking for? Do you have any further suggestions? Is "roles" the best name, or should it be "traits" or "snippets" or something completely different?

Vagabondluc commented 5 months ago

Thank you for reaching out to discuss the feature. While I'm not deeply familiar with coding, I've explored your idea with the help of ChatGPT, especially focusing on integrating OpenAI technologies. This helped me grasp the complexity and potential of your project.

To contribute, I'd like to share a template I've previously used for creating NPCs in ChatGPT. It structures the NPC's details in a table for quick reference, with a more detailed backstory and personality description. This format ensures the NPC is both vivid for readers and practical for gamemasters to use in D&D campaigns. Here's the basic structure (for the complete one, see below my message):

I'm refining this approach for Unkenny (see included document), exploring how to utilize a journal system for dynamic prompt assembly. Could we leverage ID-tagged journal entries to simplify prompt creation, allowing Unkenny to craft prompts from stored snippets?

Incorporating elements like factions, roles, places, circumstances, quests, attitudes, and the 5 Ws (What, When, Where, Who, Why, and How) can enrich the narrative. This framework might help structure the complex inputs into Unkenny more effectively.

I've noticed challenges with maintaining secrecy for NPC motivations in ChatGPT interactions. Perhaps a macro system with a keyword-triggered dialogue, similar to Fallout 1's approach, could manage this. Keywords could activate specific prompts, allowing nuanced interactions based on player choices.

A feature I'm keen on is exporting conversations to Discord, complete with NPC portraits. A logging mechanism to track interactions would also be beneficial, especially for a Westmarch-style campaign where players can discover quests and schedule adventures in a dynamic town setting.

I've shared some discussions with ChatGPT regarding NPC creation and insights into Unkenny's potential (see included Markdown file). Feel free to use these ideas to enhance your project. I see great potential in Unkenny and am excited to see where you can take it.

Best, Pierre-Luc Marsan PS (my complete prompt for npc generation) {{Description}} Create a unique NPC for a D&D campaign. As a professional creative writer, your task is to develop a well-rounded, detailed, and comprehensive personality that fits within D&D's alignment framework. The character should be a unique blend of traits, styles, and mannerisms, but avoid direct references to existing characters.

The NPC should be designed for easy roleplaying by a gamemaster. The table should provide a quick reference, while the text block expands on the character's backstory and personality. Use explicit language and provide in-depth details to create a vivid and engaging character that will make a lasting impression on the reader. Be imaginative, detailed, and explicit in your descriptions. When introducing a new element, explain its origin and context . Avoid vagueness and provide depth to the details you create.

Please structure your NPC using the following table format in a markdown:

Category Details
----------------- -----------------------------------------------------------------------------------------------
Name [NPC Name]
Race [NPC Race]
Role/Profession [NPC Role/Profession]
Appearance [Brief description of NPC's physical appearance]
Alignment [NPC's alignment (e.g., Lawful Good, Chaotic
Neutral, etc.)]
Motivations [short One-line summary of NPC's main goals or
desires]
Personality [short One-line summary of NPC's key personality
traits]
Flaws [short One-line summary of NPC's key flaws or
weaknesses]
Mannerisms [short One-line description of NPC's notable habits
or behaviors]
Speech [short One-line description of NPC's speech
patterns or notable phrases]
Knowledge
Available knowledge [One-line summary of knowledge NPC readily
shares]
Hidden/Secret knowledge [One-line summary of knowledge NPC keeps
secret]
Bonds [short One-line summary of NPC's important
relationships]
Roleplaying cues [Brief list of cues for roleplaying this NPC,
e.g. "Speaks slowly", "Often looks nervous"]

Backstory:

[Provide a concise backstory for the NPC here, expanding on the details provided in the table. This should give the gamemaster a deeper understanding of the NPC's motivations, personality, and relationships, as well as any important events in their past. Each sentence should introduce new information.]

Personality:

[Write a detailed personality description, divided into four distinct sections: 1) Motivations and Goals; 2) Morals and Ethics; 3) Personality; 4) Flaws.]

The goal is to provide enough information for the gamemaster to understand the NPC and roleplay them effectively, but not so much detail that it becomes overwhelming or difficult to reference quickly. The backstory should add depth to the NPC, but the table should be sufficient for basic roleplaying. Your answer should contain a maximum of 500 words.

Message ID: @.***>

TheComamba commented 5 months ago

Wow, that was a lot of input, thank you! I have derived several separate issues from your answer:

42, #43, #44, #45, #46

Could you elaborate what you mean by "logging mechanism"? Foundry logs the conversation in form of the Chat, so you are obviously looking for something else.

Vagabondluc commented 5 months ago

I'm really happy with your enthusiastic reply, thanks a lot!

Regarding the logging feature, I was thinking that if we have Discord integration, that could serve as our log. I'm curious, could we set up a separate Discord channel for each scene, or maybe integrate Discord's role tags? This way, players in a particular town won't see messages they shouldn't be able to see.

I might need to give you a bit more background on what I'm trying to do. I'm setting up a West Marches style game, where there are a bunch of players all in the same world. This world in Foundry will always be accessible. There are going to be several small towns, and between games, players are sort of "stuck" in the last town they were in unless they're moving as part of their downtime activity. I'll need to clear the chat in Foundry now and then, and I'm hoping to have NPCs that can hand out quests.

Not sure if you're familiar with the West Marches setup, but if not, here's a quick summary: West Marches is a type of campaign focused on exploration and discovery, with a large pool of players sharing the same persistent world. Players organize their sessions based on their schedules, forming parties to explore new areas, delve into dungeons, or follow up on rumors and quests. The game world is dangerous and uncharted, with players mapping it out as they go. This structure supports a large group of players without requiring everyone to be present at every session, and the world evolves based on their actions and discoveries.

To add, one interesting way a player might choose a quest is by responding to an unkenny message in Discord from an NPC.

This way, you get the gist of the kind of game I'm trying to run and why these features are so important to me.

Message ID: @.***>

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Sans virus.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>