Decision-Making Framework

After building the environment and giving GPT-4 a voice within the game world, the next step was to give players something to do - and, more importantly, something to decide. Since LEAF is structured like a turn-based role-playing game, I needed a framework that gave the player meaningful choices while also feeding data to the AI companion. These decisions needed to feel both systemic and emotional. So I began building a flexible event-based decision system.

The core of this system revolves around four key types of events. Each of these events are designed to reveal and shift the trust dynamic between the player and the AI companion.

  1. Combat Encounters: These events trigger battles, either randomly or based on player choices. They transition the game into the turn-based combat state where the player and companion both act.

  2. Social Encounters: These events involve NPC interactions and dialogue decisions. They influence how the companion AI perceives the player’s morality and consistency.

  3. Loyalty Tests: These are either visible or hidden. They may involve direct interaction, like asking the player to spare an enemy or an indirectly through player inputs that influence trust and respect in the eyes of the companion AI, such as stealing or acting greedy.

  4. Memory Tests: These test how well the player understands their companion. Dialogue sequences may quiz the player about the companion’s values, preferences, or past experiences. Player responses influence the trust and respect that the companion may hold for the player.

In combat, the player is presented with four core options that define their approach to conflict and strategy. Choosing to Attack initiates a direct strike against the enemy, reinforcing a more assertive or aggressive player style. Using an Item introduces a tactical layer, allowing the player to heal, buff, or support themselves or their companion. The option to Flee allows the player to exit combat, often with consequences that may alter the AI’s perception of their bravery or reliability. Finally, the option to Show Mercy adds a moral complexity to the system - sparing a defeated enemy may trigger a strong reaction from the companion, who will interpret that choice through the lens of their own values.

Outside of combat, the player’s decisions are more social and reactive. Dialogue choices during conversations with the companion or NPCs help shape how the AI interprets the player’s moral alignment or intentions. These choices may also be remembered later in the game and tested during Memory or Loyalty events. Interactions with NPCs - such as deciding how to respond to a stranger, shopping with a merchant, or resolving a dispute - can leave a lasting impression on the companion as well. Often, these interactions are embedded with moral dilemmas that reveal whether the player acts selflessly, pragmatically, or ruthlessly.

To further support the RPG experience, I began integrating additional genre conventions into the prototype. A simple health system was implemented to track damage. The turn-based combat system handles the flow of encounters, sequencing player, companion, and NPC actions. An item inventory system was added to offer tactical options during combat and collection of items and valuables within the game through looting or shopping mechanics.

Ultimately, the decision-making system is the backbone of how the companion evolves. Every choice - whether it’s in combat, dialogue, or exploration - will feed the AI’s perception of the player. It’s not just about winning or losing fights, collecting the strongest gear, or finding the shiniest items. It’s about whether your companion thinks you made the right call.

Previous
Previous

A Better Roleplay System

Next
Next

Yarn Spinner Dialogue System