Procedural Content Generation or (PCG) is a technique used in video game design to create
game content as users play through a video game.
Historically, PCG has been successful in generating expansive growing worlds, dungeons, and populating
them with non-player characters (NPCs).
This work moves PCG towards adding dialogue delivered quests into the already existing
arsenal of PCG, improving a player’s immersion and experience, not only through their actions,
but with their words as well.
We define a “quest” as a task that an NPC requests to be accomplished.
For example, “Go mine 20 iron ore in the Iron Hills”.
Together, with our quests, we generate a “dialogue”, in which the quest can be introduced and delivered
during conversation, providing additional background information that may not have previously
been known.
Unlike narrative planners and story sifters, that focus on overarching story and narrative
generation, our work focuses on these quests and dialogues.
There are two types of limitations that affect textual PCG that we attempt to balance.
Deterministic generation, constrained by predefined rules, tends to be too rigid and can lead
to repetitive patterns and a lack of novelty in generation.
However, the benefits of deterministic processes is that they can be contextually grounded,
and remain predictable and accurate.
On the other hand, stochastic content generation based on neural networks or other machine-learned
processes, suffer from the inverse problem of occasional erratic and incoherent content
generation.
This causes the generated text to oftentimes be unrelated to the game world, leading to
a diminished player experience.
To bridge this gap, this work proposes creating procedurally generated content that is constrained
by world state and genre conventions while still being novel and responsive to player
input.
This is accomplished via a content generation framework that integrates key facts and entities
from the game world, stored within a knowledge base, with a fine-tuned large-scale language
model.
To begin, the framework parses user input to deterministically extract facts and entities
from an external knowledge graph which are filled into a quest template, generating potential
quests.
An example of a knowledge graph can be seen here.
Of the potential quests generated from the knowledge graph, the quest which is most inline
with the player’s desire is then chosen to move forward in the pipeline.
This quest is deterministically generated to ensure that the quest being assigned to
the player is as accurate and achievable as possible.
The next step in the pipeline is to pass the generated quest to the large-scale language
model.
The language model’s purpose is to generate a believable, novel, dialogue which the NPC
would provide, when giving or explaining the quest to the player.
By providing the world context, embedded in the form of a quest to the fine-tuned language
model, the language model remains constrained, within reason, to the game world and genre.
The level of detail and creativity leveraged within the dialogue is intended to add a more
personalized atmosphere to the quest giving task, thus improving the interaction of players
with their NPC counterparts.
In summary, our pipeline “Uses game world facts and entities from a knowledge base with
a large-scale language model to generate immersive quests,
selects the most appropriate quest inline with player input
and uses the language model to generate a believable and personalized dialogue, enhancing
the interaction between players and NPCs.”
Here are some examples generated using our pipeline.
To verify our results, we chose to focus on dialogue quality, the player responsiveness
of our generations, and a novel relevancy score.
A description of our models, and the relevant baselines used in evaluation, are listed and
described here.
Model abbreviations will be seen in evaluation graphs.
The purpose of our survey was to capture the fluency to measure the English grammaticality
of the text,
coherence to measure the internal consistency,
novelty to measure how original the text seems,
and creativity to measure how interesting and engaging the text seems.
Survey respondents were recruited from students enrolled in computer science courses at Brigham
Young University,
and were asked to evaluate a random sample of 16 title-dialogue pairs taken from three
of the four models which were also randomized.
In total, 208 people responded to our survey.
We were able to find that three of the four language models were able to achieve Likert
scores similar to those received by human-crafted quests from the World of Warcraft video game.
In an effort to evaluate both the quality of our knowledge graph-verbalized quests and
the extent to which our framework impacts player experience and satisfaction,
we conducted a user study from a subset of the online survey participants.
Each of our (N=124) users was presented with our system and received some general instructions
on how it worked.
In the instructions, we stated that each interaction should be treated as if they (the player)
were walking up to a new NPC for the first time with the intention of obtaining a quest.
We then invited them to initiate a text-based conversation with the NPC.
Because we have not yet implemented any additional conversational abilities in the system,
their initial introductory phrase was sufficient (regardless of its semantic content) to trigger
the internal quest generation process.
For the purposes of this playtest, we generated different tuples for each user prompt using
three different methods:
an option from our normal, knowledge graph-based model, a randomly-selected hand-written option
from the World of Warcraft training data, and an option drawn from a naive, baseline
4-gram language model.
Each generated tuple was then blindly shown to the testers, who were asked three questions:
"Q1: Which prompt did you feel was most responsive to your input?"
"Q2: Which prompt did you feel was most exciting/creative (i.e.
Which would be the most fun to do in a game)?"
"Q3: Write 2-3 sentences explaining your answers to Q1 & Q2."
To better understand why participants often preferred prompts retrieved from the WoW dataset
(which were selected randomly) to prompts generated by either of the responsive models,
we conducted qualitative analysis of the user responses.
We found that prompts generated by our pipeline and the n-gram model often seemed disassociated
with the input in semantically incongruent ways,
whereas the participant felt that the human-written example from the WoW dataset, while less directly
related to the user’s input, contained enough foundational information for them to justify
that it was the most "responsive"
(i.e., "because it gave me a specific task to do").
We observed that many participants initiated NPC conversations with a generic phrase such
as "How can I help you" or "Do you have any quests?",
likely as a result of the user study being presented in a web interface rather than in
a video game format.
Without the larger context of a game world and ongoing storyline, the initial text entered
by study participants lacked the specificity needed to create truly personalized quests.
We anticipate that a more embedded study involving ongoing gameplay and repeated NPC interactions
over time would elicit more specific quest solicitations.
In addition to the survey and user study, we also propose a method for measuring the
relevance of a given dialogue to its associated quest.
The relevancy score is broken down into two parts:
part 1, we measure how important individual lemmas from the quest are to the dialogue
by counting how often each non-stopword from the quest appears in the dialogue.
Part 2, we count how many unique non-stopword lemmas from the quest appear in the dialogue.
The formal relevancy score equation can be seen here.
Notably, despite the relatively small size of our primary model, DRG-M, its relevance
scores mirror those of hand-written quests more than any other model.
Our empirical results suggest that player engagement and overall satisfaction can be
improved by
(a) allowing the player to participate in the co-creative process of quest design,
and (b) using world-consistent quest descriptions as the impetus for neural NPC dialogue generation.
Long-term, we envision potential extensions of our framework in which all NPC speech,
rather than just quest-related dialog, is generated via automated means.
We also envision fully co-creative game environments in which dialogue generated by the language
model becomes the impetus for updates to the world state.
For example, if an NPC asserts that a specific item is located "Under that hill there", the
in-game knowledge graph could be updated to include a "location" relationship between
the item and a nearby hill,
and ensuing gameplay would proceed accordingly.
The core contributions of this work include
(a) the demonstration that large-scale language models can be constrained to conform with
a world knowledge graph and used for quest generation along with a corresponding dialogue
presentation,
(b) the presentation of a dynamic quest generation pipeline that is responsive to free-form text
entered by the user, allowing quests to become in-game instantiations of user goals and desires,
and (c) an exploration of user responses to the presented pipeline which can be used to
inform and improve the deployment of our system in expanded contexts.
Our work shows that using a language model with a knowledge graph has important implications
in procedural content generation and user experience.
We hope this will contribute to ongoing discussions and inspire further research in this field.