A Better Roleplay System
With GPT-4 generating responses, a dialogue system in place, an explorable world, and a turn-based RPG framework, the next step was to give the companion a personality. Up to this point, the companion AI could respond - but it didn’t have a distinct identity. There was no consistency, no perspective, and no values, morals, or driving forces behind the character being played.
This led to the creation of the Persona System, a framework for turning character sheets into prompt-ready role-specific guides for GPT-4 to utilize in roleplay. Inspired by Dungeons & Dragons, I began drafting a structured breakdown of how to define a character for the AI to play. The base of each persona starts with simple information: a name, class, moral alignment, and character background. This forms the foundation of who the companion is and where they come from. But this alone is not enough to simulate believable, consistent, and reactive behavior. To do so, I developed three expanded categories that influence how GPT responds: Roleplay Descriptors, Dialogue Controllers, and Interaction Behaviors.
Roleplay Descriptors help GPT-4 “act” the part. The companion’s backstory and motivation are key (justice, revenge, survival, greed). These core drivers influence how the AI interprets decisions and events. I also included a personality summary to reinforce tone and attitude, as well as a clear outline of the companion’s moral boundaries - things the character would never do, no matter what. Violating these leads to serious breakdowns in trust.
Dialogue Controllers define how the companion sounds. I specify their speech style (formal, poetic, vulgar, casual), and include some sample dialogue blocks to give GPT a model for sentence structure and tone. A third element, Potential Dialog Topics, gives the AI a menu of possible conversation starters during downtime. These aren’t strict limits, just inspiration to keep responses aligned with the character persona.
Interaction Behaviors maps how the companion reacts to the player during certain contexts. I list quirks (odd habits, strange beliefs), interaction triggers (specific things the player might do to provoke a response), and behavioral responses (how the companion might react - positively, negatively, or with uncertainty). Together, these details help shape how the companion expresses itself through gameplay.
Currently, the system includes three core personas and two experimental ones:
The Paladin - Morally good, but hides a zealot’s intensity beneath a disciplined exterior
The Warlock - Morally evil, seductive, and manipulative. Encourages the player to explore darker impulses.
The Rogue - Morally Grey, selfish, driven by coin and self-preservation, but open to influence.
The Berzerker - Loud, boisterous, and sometimes really annoying and dumb, but means well.
The Sorceress - Whimsical and naive, she absorbs the player’s traits, adopting their morality as her own.
Initial tests with the Paladin persona were promising. The character responded with appropriate righteousness and restraint. However, the system struggled with personas that had internal contradictions - like the Paladin’s hidden zealousness. GPT-4 wasn’t able to shift the tone or intention mid-response, suggesting it has difficulty processing layered or dual-natured personalities without more prompting support. This is something I’ll be exploring further as the system evolves.