Table of Contents
Fetching ...

You Have Thirteen Hours in Which to Solve the Labyrinth: Enhancing AI Game Masters with Function Calling

Jaewoo Song, Andrew Zhu, Chris Callison-Burch

TL;DR

A novel approach to enhance AI game masters by leveraging function calling in the context of the table-top role-playing game "Jim Henson's Labyrinth: The Adventure Game" improves the narrative quality and state update consistency of the AI game master.

Abstract

Developing a consistent and reliable AI game master for text-based games is a challenging task due to the limitations of large language models (LLMs) and the complexity of the game master's role. This paper presents a novel approach to enhance AI game masters by leveraging function calling in the context of the table-top role-playing game "Jim Henson's Labyrinth: The Adventure Game." Our methodology involves integrating game-specific controls through functions, which we show improves the narrative quality and state update consistency of the AI game master. The experimental results, based on human evaluations and unit tests, demonstrate the effectiveness of our approach in enhancing gameplay experience and maintaining coherence with the game state. This work contributes to the advancement of game AI and interactive storytelling, offering insights into the design of more engaging and consistent AI-driven game masters.

You Have Thirteen Hours in Which to Solve the Labyrinth: Enhancing AI Game Masters with Function Calling

TL;DR

A novel approach to enhance AI game masters by leveraging function calling in the context of the table-top role-playing game "Jim Henson's Labyrinth: The Adventure Game" improves the narrative quality and state update consistency of the AI game master.

Abstract

Developing a consistent and reliable AI game master for text-based games is a challenging task due to the limitations of large language models (LLMs) and the complexity of the game master's role. This paper presents a novel approach to enhance AI game masters by leveraging function calling in the context of the table-top role-playing game "Jim Henson's Labyrinth: The Adventure Game." Our methodology involves integrating game-specific controls through functions, which we show improves the narrative quality and state update consistency of the AI game master. The experimental results, based on human evaluations and unit tests, demonstrate the effectiveness of our approach in enhancing gameplay experience and maintaining coherence with the game state. This work contributes to the advancement of game AI and interactive storytelling, offering insights into the design of more engaging and consistent AI-driven game masters.
Paper Structure (49 sections, 1 equation, 15 figures, 7 tables)

This paper contains 49 sections, 1 equation, 15 figures, 7 tables.

Figures (15)

  • Figure 1: An example of a pre-written adventure location in "Jim Henson's Labyrinth: The Adventure Game".
  • Figure 2: A dialogue between a player character (PC) and the game master (GM). This example shows how the AI GM uses different functions calls. Here, activate_test is called when the PC tries to do something challenging, add_item is called when the PC wants to add a new item to the inventory, and use_item is called when the PC tries to use an item in the inventory. The use_item fails because the PC asks to use a "Super Speed potion" (which they do not have) instead of the "Super Strength potion" (which they do).
  • Figure 3: Steps involved in a single function call during gameplay: (1) The player message is added. (2) The game master agent makes a prompt with the chat history, game state, and function definitions. Then it requests an API call with the prompt. (3) The API determines whether to call a function or not. If it is needed, it chooses a function and parses/sets corresponding arguments from the chat history. (4) The API returns a function call message. It also comes with the parsed arguments. (5) When a function call is triggered, the pre-defined logic of it runs and returns the result message. (6) The game master calls the API with the updated chat history. (7) Again, it determines whether a function should be called or not. (8) If it is not needed, a normal response message is returned.
  • Figure 4: Overview of the game simulation. 1) The scene initialization step generates the starting scene state. 2) The player character creation step returns the created player states. 3) In the main logic, the actual game proceeds by the game master and player party. 4) The game terminates according to the success/failure condition and exports the gameplay log data.
  • Figure 5: The definition of activate_test function which is called when a player should roll the dice. Each function definition has @ai_function annotation, function name, argument annotations, docstring, function logic, and the return value. In the actual implementation, the function logic part is a code block to perform the logic.
  • ...and 10 more figures