GptNPC

Natural Language Model Application Prototype in Games - Using Minecraft as an Example

The "GptNPC" project is a recent AI game prototype, an island village scene with lots of AI NPCs within Minecraft, players can freely converse with all islanders, buy/sell items, accept quests, and inquire about information.

01 \ About Project

OpenAI has now opened up its API for the latest version of the model, which has the ability to standardize text and contextual content. This means that it has become very easy to use language models to completely fulfill the chat and interaction of NPCs in games. Starting from here, I have created a Minecraft server plugin, which is shown in the video, to provide a quick preview of a Natural Language Model Application Prototype in Games.

1

I chose Minecraft as the development platform because I believe that it is similar to Roblox and is a suitable prototype platform with a large number of pre-existing items and models, as well as easy model, action, and dialogue creation. Additionally, as a long-time player and developer of Minecraft, I am very familiar with Minecraft-related mod and plugin development, which enables quick development. The content implemented in Minecraft can also be easily transferred to other platforms, such as Unity or Unreal.

1

Let's get start!

02 \ GptNPC: Minecraft NPCs Become More Lively
Map of the village, laid out islanders with different functions

The game's setting is in a village on an island, where there are many villagers with different professions. Each villager also has different functions, and players can communicate with them to sell and buy items, query information, and complete their requests.

All content and actions in the project are dynamically generated by AI and is influenced by environmental information, NPC, and player status. According to the setting, each villager has their own story background, personality and hobbies. When communicating, the villagers will chat with you through the memory of the last time you meet, and the perception of the environment, combined withthe location where they are now, the weather, the season and other information.

Based on the chat messages, villagers will make corresponding actions, such as greeting, nodding and shaking heads. Villagers will also use different emoji in the conversation according to their mood.

Shop With Generated Content

Based on a pre-configured list of items, villagers can provide trade with players by mentioning the purchase and sale of items in the conversation, set store item-list and opening the store's GUI.
Similarly, villagers have a pre-configured list of tasks, including a short description and reward for the number of items requested. When the player triggers a quest with a villager in chat, the villager will lay out these requests to the player.

The configuration of kendrick, as a variant, the config is easy

The whole prototype uses a short list of prompt words as background setting. In addition to this, the prototype shares a large knowledge base that contains information about game items and knowledge. When the player asks a question to a villager or inquires about the use of an item, the villager can provide the player with an answer based on the contents of the knowledge base.

03 \ General Structure and Flows

(Click to view full diagram)

In this prototype, different parts are implemented using a variety of models to achieve maximum efficiency and functionality.

For example, the parts that require contextual chat functionality are handled by GPT-Turbo-3.5, while simpler tasks like understanding content behavior and summarizing dialogue content are handled by Text-Davinci-003 to provide faster response times and save on costs. In addition, knowledge base queries and outputs are handled by Langchain, which can store content in blocks and output as needed. This further saves token resources, and with knowledge base information as background, NPC chat content can become more accurate.

04 \ For the Future: Deeper Communication with Model

This project was created by me two weeks before the Game Developers Conference 2023, when OpenAI had just opened up its API for GPT-Turbo-3.5. This sparked a lot of discussions on various language model applications on the internet, and AI was undoubtedly the hottest topic at this year's GDC. Everyone was inevitably exposed to and discussing this topic, and my project, as a simple and early application, demonstrated well how AI has already reached such a level.

However, this is still only a shallow use of natural language models. We have all seen the model's "understanding" of our language, while the model also has powerful information processing capabilities. These capabilities have not yet been fully utilized, and most people are still exploring the application of AI at a preliminary level. There are already many interesting features that can be implemented, such as bargaining with NPCs to purchase items, persuading NPCs to complete tasks, using the model as a core decision state machine, and outputting richer emotions and behaviors. In the future, AI will definitely bring about huge changes in the gaming industry, and this is the direction that I am now and will keep trying to explore.

<< Back to Homepage