On 7DRL2019 and Procedurally Generated Narrative

https://itch.io/jam/7drl-challenge-2019

I’m participating in my first gamejam - 7DRL2019! Here is my plan for the upcoming week.

7 Days to Rigel

I will be working on a game called 7 Days to Rigel - an open-source roguelike murder-mystery built on Python 3.7. Here’s why that’s a good idea, and why it’s a terrible one:

What I’m actually writing

In 7 Days to Rigel, you’re one of seven passengers on a cruise starship headed towards the Rigel system. Unexpectedly, one of the passengers turns up dead, and it’s up to you to ensure the killer does not escape unpunished.

There is no combat or monsters in 7DtR - the investigation happens purely through mingling with the other passengers and trying to find out what they know, and which one of them is the culprit. The game is a double challenge for me - not only will I try to build a complete roguelike in just seven days, it will also serve as the proof-of-concept for a concept I’ve been researching for years now: procedural narrative generation.

If you’re anything like me, the words “procedural narrative generation” bring nothing but bad connotations - they make me think of shitty *“go to and bring me "* quests in RPGs, much less anything that would resemble actual motivations, complications, and intrigues.

There are two main papers I’ve been basing my research on: Noonan, S. 2015. Side Quest Generation using Interactive Storytelling for Open World Role Playing Games., and Tearse, B., Wardrip-Fruin, N., and M. Mateas. 2010. Minstrel Remixed: Procedurally Generating Stories. They’re both amazing and I recommend giving them a read - the gist, however, comes down to this:

The Playwright

7 Days to Rigel will use a three-tiered system for its procedurally generated, emergent narrative. The first tier is the Playwright, an AI director that oversees the procedural generation at a higher level - it makes sure that the generated characters are distinct and interesting, that the murder is actually solvable, and that the player’s only way of solving the murder won’t be to wake up at 3:47 AM exactly on the Rigel’s sixth day and barge into a specific character’s quarters to witness them disposing of the murder weapon. If you compared Rigel to a tabletop roleplaying game, the Playwright would be the Game Master - writing a rough top-down draft of the game’s plot, and making sure things remain fun and interesting.

The Actors

The second tier is the Actor system, which I’ve adapted from an older, unreleased experiment in procedural narrative, Vibropyke. Actors are the characters themselves - the players and NPCs in an RPG - and they each have their personalities, motivations, emotions, and memories. The Actor system allows a character to tell you that they’ve seen another character glancing around nervously around an hour after the murder had occurred, or to yell at you because they’re growing impatient with your unusually silly questions. On a high level, the Actor receives a list of goals from the other two parts of Rigel’s AI, and acts them out - if the game decides that it’s time for Alice and Bob to have a private discussion about what they witnessed, then instead of Alice and Bob immediatelly running off towards the closest tile out of the player’s sight, Alice’s Actor will try and find an opportunity to talk to Bob, inform him she wants to chat in private, set up a time and place - all the while making sure she doesn’t look suspicious, and watching out for eavesdroppers. The Actor might decide that a good time for the meeting would be in s couple hours, and spend the time until then at a table in the bar, appreciating the infinity of space from behind the ship’s windows. Once a goal has been set, it’s the Actor’s job to act it out, in character.

Where’s the Logic in all this?

The third tier is the Logic layer, handled in 7 Days to Rigel by MiniKanren. The Logic layer finds intermediate goals - if the Playwright makes a character decide to find a weapon to defend themselves in case they were attacked, the Logic layer will then find the intermediate goals - “Learn if there are any weapons on the ship”, “Learn the location of a weapon”, “Reach the location of a weapon”. If the location of the weapon in question would be eg. in another character’s quarters, an intermediate goal could be “Befriend that character to have them invite you in”, or “Break into that character’s quarters”. After receiving the tree of intermediate goals, the Actor will then decide how to act on them - eg. who, how, and where to ask whether there are any weapons on the ship.

This is a difficult problem, and something I’ve only very roughly done before, but I am going to take this chance to try and build at least a working proof of concept.

There are also other issues at hand - the matter of generating the actual map of the starship will be one I know beforehand I will struggle with and waste a lot of time on. Regardless, I am excited to see if I can hit 7DRL’s time limit.

I will report tomorrow with a summary of Day 1!