Game intelligent NPC based on large language model

By introducing intelligent NPCs based on large language models into the game, the existing NPCs lack intelligent behavior and dialogue capabilities are solved, and the intelligent interaction and memory management of NPCs are realized, and the game experience of players is improved.

CN119075320APending Publication Date: 2024-12-06GIANT MOBILE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411125872.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

NPCs in existing games lack intelligent behavior and flexible dialogue capabilities, and cannot understand the changing environment and engage in anthropomorphic interactions.

Method used

Adopt game intelligent NPC based on large language models, including large language model module, memory management module, chat management module and behavior decision-making module. By semi-automatically constructing training data, generating a variety of chat content, managing memory and decision-making behaviors, the intelligence of NPC is realized. Interaction.

Benefits of technology

It improves the player's gaming experience, enables NPCs to perform intelligent behaviors of various types of people, explore and learn the game world, conduct flexible chats and interactions, and enhances the interaction between NPCs and players.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119075320A_ABST
    Figure CN119075320A_ABST
Patent Text Reader

Abstract

The invention relates to a game intelligent NPC (Network Personal Computer) based on a large language model, which comprises the following modules: a large language model module configured to output a text conforming to a dialogue scene; the memory management module is configured to define long-term memory and short-term memory, and the long-term memory comprises common knowledge, special knowledge, event memory and character memory; the short-term memory comprises events occurring in a preset time period in the environment and memory retrieved from a long-term memory library; the behaviors of the intelligent NPC at any moment are influenced by short-term memory; the chat management module is configured to divide chats into three categories, namely chats among intelligent NPCs, self-speech and self-language of the intelligent NPCs and chats between the intelligent NPCs and players; the chat content meeting the setting is generated according to the character, experience and speaking style of each intelligent NPC; and the behavior decision module is configured to set three steps: intention analysis, action determination and action parameter determination. According to the invention, intelligent behaviors of various people can be made, and the game experience of players is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent game technology, and in particular to a game intelligent NPC based on a large language model. Background Art

[0002] Currently, NPCs (Non-Player Characters) in most games only have mechanical activity modes. Their actions are determined by their current state and pre-written programs. They cannot understand the changing environment and do not have anthropomorphic activity modes. In addition, the existing NPCs' speech content is a limited number of fixed sentences written by humans, and they cannot flexibly have flexible and unlimited conversations with players or other NPCs.

[0003] Therefore, it is necessary to provide a game intelligent NPC based on a large language model that can perform a variety of human-like intelligent behaviors to improve the player's gaming experience. Summary of the invention

[0004] The purpose of the present invention is to provide a game intelligent NPC based on a large language model, which can perform a variety of human-like intelligent behaviors to improve the game experience of players.

[0005] In order to solve the problems existing in the prior art, the present invention provides a game intelligent NPC based on a large language model, comprising the following modules:

[0006] A large language model module, configured to output text that fits the conversation scenario;

[0007] A memory management module, configured to define long-term memory and short-term memory, wherein the long-term memory includes common sense, proprietary knowledge, event memory, and character memory; the short-term memory includes events that occurred within a preset time period in the environment and memories retrieved from the long-term memory bank; the behavior of the intelligent NPC at any time is affected by the short-term memory;

[0008] The chat management module is configured to divide chats into three categories, namely, chats between intelligent NPCs, intelligent NPCs talking to themselves, and intelligent NPCs chatting with players; it is also configured to generate chat content that meets the settings based on the personality, experience, and speaking style of each intelligent NPC;

[0009] The behavior decision module is configured to set up three steps: intention analysis, decision action, and decision action parameters.

[0010] Optionally, in the game intelligent NPC based on the large language model, the large language model module outputs text that conforms to the dialogue scenario in the following manner:

[0011] The training data is constructed in a semi-automatic way, and a large language model is trained to output text that conforms to the dialogue scenario.

[0012] Optionally, in the game intelligent NPC based on the large language model, the method of constructing training data is as follows:

[0013] Use a large language model to generate multiple samples. The large language model is GPT-4.

[0014] Screen out some samples through manual screening;

[0015] The remaining samples were optimized by manual rewriting.

[0016] Optionally, in the game intelligent NPC based on the large language model, the events occurring within a preset time period in the environment are events occurring within the last 12 hours or 24 hours in the environment.

[0017] Optionally, in the game intelligent NPC based on the large language model,

[0018] Some short-term memories are filtered through important rules, summarized by the large language model, and stored in long-term memory; some short-term memories will be forgotten after exceeding the preset time period;

[0019] Long-term memories that are not retrieved for more than 6 or 12 months are forgotten.

[0020] Optionally, in the game intelligent NPC based on the large language model, the character memory is summarized based on the chat between the intelligent NPC and the player or other intelligent NPCs, except for the current intelligent NPC, which is other intelligent NPCs.

[0021] Optionally, in the game intelligent NPC based on the large language model, the chat management module is also configured to use the large language model to determine the appropriate time to end the chat and start the chat.

[0022] In the game intelligent NPC based on the large language model provided by the present invention, a variety of intelligent behaviors are provided for the NPC, including behavioral decision-making, language communication, player interaction, memory management, etc. With these intelligent behaviors, the NPC becomes an intelligent entity that can move freely in the game world. The intelligent NPC can perform a variety of human-like intelligent behaviors, including chatting and making some actions, etc., and the intelligent NPC has memory, so it can explore and learn the game world, and can recognize the game NPC and the player, thereby improving the player's gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A module diagram of a game intelligent NPC provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The specific implementation of the present invention will be described in more detail below in conjunction with the schematic diagram. The advantages and features of the present invention will become clearer based on the following description. It should be noted that the drawings are all in a very simplified form and are not in exact proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.

[0025] Hereinafter, if the method described herein includes a series of steps, the order in which the steps are presented herein is not necessarily the only order in which the steps may be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.

[0026] Currently, NPCs (Non-Player Characters) in most games only have mechanical activity modes. Their actions are determined by their current state and pre-written programs. They cannot understand the changing environment and do not have anthropomorphic activity modes. In addition, the existing NPCs' speech content is a limited number of fixed sentences written by humans, and they cannot flexibly have flexible and unlimited conversations with players or other NPCs.

[0027] In order to solve the problems existing in the prior art, the present invention provides a game intelligent NPC based on a large language model, such as Figure 1 As shown, the game intelligent NPC includes the following modules:

[0028] A large language model module, configured to output text that fits the conversation scenario;

[0029] Specifically, the large language model module outputs text that conforms to the dialogue scenario as follows:

[0030] The training data is constructed in a semi-automatic way, and a large language model is obtained through training and fine-tuning. The large language model is used to output text that conforms to the dialogue scenario.

[0031] The training data is constructed as follows:

[0032] A large language model is used to generate multiple samples (i.e., the automatically generated data in the attached drawings of the specification), preferably, the large language model is GPT-4;

[0033] Screen out some samples through manual screening;

[0034] The remaining samples (i.e., the modified data in the attached drawings of the specification) are optimized by manual rewriting to make the remaining samples more effective.

[0035] A memory management module is configured to define long-term memory and short-term memory, wherein the long-term memory includes common sense, proprietary knowledge, event memory, and character memory, wherein the character memory is summarized based on the chat between the intelligent NPC and the player or other intelligent NPCs (other intelligent NPCs except the current intelligent NPC), and the common sense and proprietary knowledge are set by humans; short-term memory includes events that occurred within a preset time period in the environment and memories retrieved from the long-term memory bank; the behavior of the intelligent NPC at any time is affected by the short-term memory;

[0036] In one embodiment, the events occurring within a preset time period in the environment are events occurring within the last 12 hours or 24 hours in the environment, and the preset time period is set or adjusted according to specific circumstances.

[0037] Some short-term memories are filtered through important rules and summarized by a large language model before being stored in long-term memory; some short-term memories will be forgotten after exceeding a preset time period; long-term memories that have not been retrieved for more than 6 months or 12 months will be forgotten, otherwise they will be long-term memories. The forgetting period is set or adjusted according to the specific situation.

[0038] The chat management module is configured to divide the chat into three categories, namely, chat between intelligent NPCs, intelligent NPCs talking to themselves, and intelligent NPCs chatting with players; it is also configured to use a large language model to generate chat content that meets the settings according to the personality, experience, and speaking style of each intelligent NPC; preferably, the present invention also uses a large language model to determine the appropriate time to end and start a chat.

[0039] The behavior decision module is configured to set up three steps: intention analysis, decision action, and decision action parameters. Specifically, the intelligent NPC will decide what to do based on the current environment, its own memory and other information. For example, when a monster siege occurs, the bounty hunter will make a decision to hunt at the monster gathering point. By breaking down the decision-making process into three steps, the large language model can understand the current environment more accurately and choose more reasonable decision actions and parameters.

[0040] In summary, in the game intelligent NPC based on the large language model provided by the present invention, a variety of intelligent behaviors are provided for the NPC, including behavioral decision-making, language communication, player interaction, memory management, etc. With these intelligent behaviors, the NPC becomes an intelligent entity that can move freely in the game world. The intelligent NPC can perform a variety of human-like intelligent behaviors, including chatting and making some actions, etc., and the intelligent NPC has memory, so it can explore and learn the game world, and can recognize the game NPC and players, thereby improving the player's gaming experience.

[0041] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.

Claims

1. A game intelligent NPC based on a large language model, It is characterized in that Includes the following modules: A large language model module, configured to output text that fits the conversation scenario; A memory management module, configured to define long-term memory and short-term memory, wherein the long-term memory includes common sense, proprietary knowledge, event memory, and character memory; the short-term memory includes events that occurred within a preset time period in the environment and memories retrieved from the long-term memory bank; the behavior of the intelligent NPC at any time is affected by the short-term memory; The chat management module is configured to divide chats into three categories: chats between intelligent NPCs, intelligent NPCs talking to themselves, and intelligent NPCs chatting with players; It is also configured to generate chat content that meets the settings based on the personality, experience and speaking style of each intelligent NPC; The behavior decision module is configured to set up three steps: intention analysis, decision action, and decision action parameters.

2. The game intelligent NPC based on the large language model as claimed in claim 1, It is characterized in that The large language model module outputs text that matches the conversation scenario as follows: The training data is constructed in a semi-automatic way, and a large language model is trained to output text that conforms to the dialogue scenario.

3. The game intelligent NPC based on the large language model as claimed in claim 2, It is characterized in that The training data is constructed as follows: Use a large language model to generate multiple samples. The large language model is GPT-4. Screen out some samples through manual screening; The remaining samples were optimized by manual rewriting.

4. The game intelligent NPC based on a large language model as claimed in claim 1, It is characterized in that Events that occur within the preset time period in the environment are events that occurred in the environment within the last 12 hours or 24 hours.

5. The game intelligent NPC based on the large language model as claimed in claim 4, It is characterized in that Some short-term memories are filtered through important rules, summarized by the large language model, and stored in long-term memory; some short-term memories will be forgotten after exceeding the preset time period; Long-term memories that are not retrieved for more than 6 or 12 months are forgotten.

6. The game intelligent NPC based on a large language model as claimed in claim 1, It is characterized in that The character memory is summarized based on the conversation between the intelligent NPC and the player or other intelligent NPCs, except for the current intelligent NPC, which is other intelligent NPCs.

7. The game intelligent NPC based on a large language model as claimed in claim 1, It is characterized in that The chat management module is also configured to use a large language model to determine the appropriate time to end and start a chat.

Citation Information

Cited By

  • Large model driven NPC implementation system and method

    CN121681769A