CN114225428A - Interactive control method, device, equipment and storage medium for non-player character - Google Patents

Interactive control method, device, equipment and storage medium for non-player character Download PDF

Info

Publication number
CN114225428A
CN114225428A CN202111466589.0A CN202111466589A CN114225428A CN 114225428 A CN114225428 A CN 114225428A CN 202111466589 A CN202111466589 A CN 202111466589A CN 114225428 A CN114225428 A CN 114225428A
Authority
CN
China
Prior art keywords
reply data
attribute
dialog
conversation
attribute information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111466589.0A
Other languages
Chinese (zh)
Inventor
赵浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202111466589.0A priority Critical patent/CN114225428A/en
Publication of CN114225428A publication Critical patent/CN114225428A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/85Providing additional services to players
    • A63F13/87Communicating with other players during game play, e.g. by e-mail or chat
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides an interactive control method, an interactive control device, interactive control equipment and a storage medium for a non-player character, and relates to the technical field of games. The interactive control method comprises the following steps: the method comprises the steps of obtaining a conversation text of a conversation object in a game scene, which is in conversation with a non-player character, and conversation attribute information of the non-player character, obtaining reply data of the conversation text matched with the conversation attribute information as target reply data according to the obtained conversation text and the conversation attribute information, and then controlling the non-player character to execute interactive operation corresponding to the target reply data. The interaction control method can realize flexible interaction between the non-player character and the conversation object.

Description

Interactive control method, device, equipment and storage medium for non-player character
Technical Field
The invention relates to the technical field of games, in particular to an interactive control method, device, equipment and storage medium for a non-player character.
Background
With the rise of the mobile internet, more and more people select games as a leisure entertainment mode, and meanwhile, more and more game developers join in game development teams, so that the competitive environment is increasingly intense.
To enrich the game scenario, many games have Non-Player characters (NPCs) present in the game. During the course of an actual game, the controlled virtual character may interact with the non-player character and may also interact with other non-player characters. In the current technical solution, for a certain non-player character, if a dialog text of a dialog object is detected during an interaction process with the non-player character, a fixed reply text corresponding to the dialog text is usually queried directly based on the dialog text, and then the non-player character is controlled to perform a dialog based on the fixed reply text.
However, the fixed reply text is generally irrelevant to the conversation scene in which the non-player character is located, that is, no matter what conversation scene the non-player character is located in, the conversation reply is performed based on the fixed reply text, so that the interaction with the non-player character is not flexible enough and relatively single, and the game experience is poor.
Disclosure of Invention
In view of the above-mentioned shortcomings in the prior art, an object of the present invention is to provide a method, an apparatus, a device and a storage medium for controlling interaction of a non-player character, so as to improve the flexibility of interaction of the non-player character.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides an interactive control method for a non-player character, including:
acquiring a conversation text of a conversation object in a game scene, which is in conversation with a non-player character, and conversation attribute information of the non-player character;
acquiring reply data of the dialog text matched with the dialog attribute information as target reply data according to the dialog text and the dialog attribute information;
and controlling the non-player character to execute the interactive operation corresponding to the target reply data.
Optionally, the obtaining, according to the dialog text and the dialog attribute information, reply data of the dialog text matched with the dialog attribute information as target reply data includes:
determining a plurality of pieces of reply data corresponding to the conversation tags from a preset conversation database according to the conversation tags of the conversation text, wherein the preset conversation database comprises: the method comprises the steps that a plurality of groups of dialogue data are obtained, wherein each group of dialogue data comprises a preset dialogue label and a plurality of pieces of reply data corresponding to the preset dialogue label, and each piece of reply data has a corresponding attribute entry;
and according to the dialog attribute information, screening reply data with attribute items matched with the dialog attribute information from the plurality of pieces of reply data to be used as the target reply data.
Optionally, the screening, according to the dialog attribute information, reply data whose attribute entries are matched with the dialog attribute information from the multiple pieces of reply data as the target reply data includes:
matching the dialog attribute information with the attribute items of the reply data to obtain the matching result of the reply data;
and according to the matching result of the reply data, determining reply data with the attribute items matched with the conversation attribute information from the reply data as the target reply data.
Optionally, the matching the session attribute information and the attribute entries of the multiple pieces of reply data to obtain the matching result of the multiple pieces of reply data includes:
screening the attribute items of the reply data according to the conversation attribute information and the attribute items of each piece of reply data to obtain item screening results of each piece of reply data;
determining reply data which passes the item screening from the plurality of reply data according to the item screening result;
screening attribute items of each piece of reply data passing through according to the conversation attribute information and the items, and matching and scoring each piece of reply data to obtain item matching scores of each piece of reply data;
wherein the matching result of each piece of reply data comprises: and the item matching scores of the item screening results and the reply data passed by the item screening.
Optionally, the determining, according to the matching result of the multiple pieces of reply data, the reply data whose attribute entry matches the dialog attribute information from the multiple pieces of reply data as the target reply data includes:
and determining the reply data with the highest item matching score from the reply data as the target reply data according to the item matching score of the reply data.
Optionally, the screening, according to the session attribute information and the attribute entry of each piece of reply data, the attribute entry of each piece of reply data to obtain an entry screening result of each piece of reply data, includes:
comparing each attribute in the dialogue attribute information with the attribute in the attribute item of each piece of reply data to obtain an item comparison result;
if the item comparison result indicates that: all attributes of the attribute items are contained in the dialogue attribute information, and if the data of each attribute in the dialogue attribute information meets the matching condition of the corresponding attribute in the attribute items, the items of the reply data are determined to pass the screening;
if the item comparison result indicates that: and if the dialogue attribute information has partial attributes of the attribute entries, or the at least one attribute has all attributes of the attribute entries, but the data of the existing attributes do not meet the matching conditions of the corresponding attributes in the attribute entries, determining that the entry screening of the reply data does not pass.
Optionally, the screening, according to the session attribute information and the entry, attribute entries of each reply data that pass through, matching and scoring each reply data to obtain an entry matching score of each reply data, includes:
and matching and scoring the reply data according to the data of each attribute in the dialogue attribute information, the matching condition of each attribute in the attribute entry of each reply data and a preset attribute weight to obtain the entry matching score of each reply data.
Optionally, a plurality of sub-databases exist in the preset dialog database, and dialog tags corresponding to different sub-databases are different; determining a plurality of pieces of reply data corresponding to the conversation text from the preset conversation database according to the conversation label of the conversation text, wherein the determining includes:
determining a sub-database where the conversation label is located from the plurality of sub-databases as a target sub-database according to the conversation label of the conversation text;
and determining a plurality of pieces of reply data corresponding to the dialog text from the target sub-database.
Optionally, before determining, according to the dialog tag of the dialog text, the sub-database where the dialog tag is located from the multiple sub-databases as a target sub-database, the method further includes:
dividing the preset dialogue database to obtain a plurality of sub-databases, wherein each sub-database comprises: at least one preset dialogue data of dialogue tags, wherein the dialogue data of each preset dialogue tag comprises: and replying data under each preset dialog tag.
Optionally, before determining, according to the dialog tag of the dialog text, the sub-database where the dialog tag is located from the multiple sub-databases as a target sub-database, the method further includes:
and classifying the multiple groups of dialogue data in the preset dialogue database by adopting a preset dialogue data classification algorithm to obtain the multiple sub-databases.
Optionally, the method further includes:
if the caching function is started, merging the conversation attribute information to obtain an attribute tag value;
caching target dialogue data by taking the attribute label value as a key value, wherein the target dialogue data comprises: a dialog tag of the dialog text and the target reply data.
Optionally, the obtaining, according to the dialog text and the dialog attribute information, reply data of the dialog text matched with the dialog attribute information as target reply data includes:
merging the conversation attribute information to obtain an attribute tag value;
and using the attribute tag value as a key value, and inquiring dialogue data corresponding to the key value from a preset cache to determine reply data corresponding to the dialogue text as the target reply data.
Optionally, the controlling the non-player character to execute the interactive operation corresponding to the target reply data includes:
controlling the non-player character to carry out a dialogue operation with the dialogue object based on the target reply data; or:
and controlling the non-player character to execute the action behavior corresponding to the target reply data to the conversation object.
Optionally, the dialog attribute information includes data of at least one attribute of the following: a dialogue intention of the dialogue text, a state attribute of the non-player character, a relationship attribute of the dialogue object and the non-player character, an environment attribute of the game scene, and a memory attribute of the non-player character.
Optionally, if the session attribute information includes: memory attributes of the non-player character, the memory attributes comprising: historical conversation content of the non-player character and the conversation object, and/or events occurring in the game world that are associated with the non-player character.
In a second aspect, an embodiment of the present application further provides an interactive control device for a non-player character, including:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a conversation text of a conversation object in a game scene, which carries out conversation with a non-player character, and the conversation attribute information of the non-player character;
the second acquisition module is used for acquiring reply data of the dialog text matched with the dialog attribute information as target reply data according to the dialog text and the dialog attribute information;
and the control module is used for controlling the non-player character to execute the interactive operation corresponding to the target reply data.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor, when the electronic device runs, the processor and the storage medium communicate through the bus, and the processor executes the program instructions to execute the steps of the method for controlling interaction of a non-player character according to any one of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the method for interactive control of a non-player character according to any one of the first aspect are performed.
The beneficial effect of this application is:
according to the interaction control method, the interaction control device, the interaction control equipment and the interaction control storage medium for the non-player character, the conversation text of the conversation object and the conversation attribute information of the non-player character in the game scene can be acquired in the interaction process of the non-player character and the conversation object, the reply data of the conversation text matched with the conversation attribute information is acquired as the target reply data according to the conversation text and the conversation attribute information, and then the non-player character is controlled to execute the interaction operation corresponding to the target reply data. In the interaction control method for the non-player character provided in this embodiment, in the process of determining the reply data of the dialog text, the dialog attribute information of the non-player character is dynamically acquired based on the dialog attribute information of the non-player character, and the reply data of the dialog text matched with the dialog attribute information of the non-player character, so that in an actual game scene, as long as the dialog scene between the non-player character and the dialog object changes, the dialog attribute information changes, and the target reply data acquired based on the dialog attribute information also changes, the interaction operation performed by the non-player character is controlled based on the target reply data, which is more flexible and is not fixedly limited to a specific dialog text for interaction, thereby improving the flexibility of interaction performed by the non-player character in the game, and enabling the image of the non-player character in the game scene to be more realistic, the experience of the game is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flowchart illustrating a method for interactive control of a non-player character according to an embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a method for controlling interaction of a non-player character according to another embodiment of the present disclosure to obtain target response data;
fig. 3 is a flowchart illustrating a method for controlling interaction of a non-player character according to another embodiment of the present application, wherein the method includes obtaining target reply data;
FIG. 4 is a flowchart illustrating matching of entries in a method for interactive control of a non-player character according to yet another embodiment of the present application;
FIG. 5 is a flowchart illustrating attribute item screening in an interactive control method for a non-player character according to yet another embodiment of the present application;
FIG. 6 is a flowchart illustrating reply data filtering in an interactive control method for a non-player character according to yet another embodiment of the present application;
fig. 7 is a flowchart illustrating data caching in a method for interactive control of a non-player character according to yet another fourth embodiment of the present application;
FIG. 8 is a schematic diagram of an interactive control device for a non-player character according to an embodiment of the present application;
fig. 9 is a schematic view of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention.
Non-Player roles, also known as Non-user playing class roles (Non-Player Character, NPC): refers to a virtual character that is not manipulated by a user in a game. The types of NPCs that may be present in an actual game scene may include: scenario NPC, battle NPC and other NPC. The scenario type NPC is an NPC providing a story scenario or information for the controlled virtual character, and when the controlled virtual character executes a task in a game scene, the task is accompanied by a corresponding story scenario. In the actual game process, the controlled virtual character interacts with the scenario NPC to obtain corresponding interaction feedback of the scenario NPC, such as dropping the virtual prop, providing prompt information, issuing a new task and the like. The combat-like NPC is an NPC that can combat the controlled virtual character, and the combat-like NPC may be an NPC belonging to the same team as the controlled virtual character or a NPC belonging to a different team from the controlled virtual character. In the actual game process, the controlled virtual character interacts with the battle NPC to obtain corresponding interaction feedback of the battle NPC, such as auxiliary attack, supplement article providing, attack object description providing and the like.
The interaction between the non-player character and the non-player character is used as a communication medium between the player and the game world so as to know corresponding information in the game world, such as guidance for completion of tasks of the player, progress of game scenes, expansion of game stories and the like. Therefore, the interaction improvement of the non-player character in the game is very important for improving the intelligence of the player character in the game scene.
The method for controlling interaction of the non-player character can be applied to a game application program, in the actual application process, a graphical user interface can be displayed on terminal equipment by running the game application program, a game scene is displayed in the graphical user interface, the game scene is provided with at least one virtual character, and the at least one virtual character can be provided with the non-player character. Optionally, the game scene is a simulated environment of the real world, or a semi-simulated semi-fictional virtual environment, or a purely fictional virtual environment. The game scene is any one of a two-dimensional virtual scene and a three-dimensional virtual scene, and the virtual environment can be sky, land, sea and the like, wherein the land comprises environmental elements such as deserts, cities and the like. In the game scene, the form of the non-player character may be at least one of a character image, an animal image, a plant image, a sprite image (such as a fairy), a monster image (such as a food animal), and the like, or the non-player character may also be a landscape image such as a stone, a shop, and the like.
Aiming at the interaction of non-player characters in a game scene, the embodiment of the application provides a plurality of possible implementation modes so as to realize flexible interaction with the non-player characters. The following is explained by way of a number of examples in connection with the drawings. Fig. 1 is a flowchart of an interactive control method for a non-player character according to an embodiment of the present application, where the interactive control method can be implemented by an electronic device running the game application, and the electronic device can be, for example, a terminal device or a server. As shown in fig. 1, the method includes:
step 101: the method includes the steps of obtaining a conversation text of a conversation object in a game scene, the conversation object having a conversation with a non-player character, and conversation attribute information of the non-player character.
In a game scene, a non-player character often needs a certain trigger condition to start interaction, and it should be noted that a conversation object in conversation with the non-player character may be a controlled virtual character operated by a current user, may be other non-player characters, and may also be a controlled virtual character operated by other users. For example, in a massively multiplayer online role-playing game, a controlled virtual character makes a conversation with a non-player character (e.g., a tasking non-player character), at which time a conversation text of the controlled virtual character is acquired, along with conversation attribute information of the non-player character (i.e., the tasking non-player character). For another example, in a role-playing game, a non-player character a makes a conversation with a non-player character B, and if it is necessary to control the interactive mode of the non-player character B at this time, a conversation text of the non-player character a and conversation attribute information of the non-player character B are acquired.
For example, in a scenario of a chat between two characters, if the dialog object is a character, the obtained dialog text is the dialog text of the chat object. If the dialog objects may be multiple characters in a multi-user chat scenario such as a dinner party or a tea session, the dialog texts of the multiple dialog objects need to be acquired.
The above is merely an illustration, and in practical implementation, the dialog objects in the present application are player characters or non-player characters, and the specific number of the dialog objects is not limited.
The above-mentioned dialog attribute information may be used to characterize attributes of the non-player character and the dialog scenario or dialog context in which the dialog object is located. Optionally, the dialog attribute information includes data of at least one attribute of: a dialog intention of the dialog text, a state attribute of the non-player character, a relationship attribute of the dialog object and the non-player character, an environment attribute of the game scene, and a memory attribute of the non-player character.
Wherein the dialog intention of the dialog text, i.e. the dialog purpose of the dialog text. The attribute can be obtained in many ways, for example, the dialog intention of the dialog text can be obtained by manual tagging or natural language processing. If the manual labeling mode is adopted, the user adds a conversation target label to the conversation text according to the content of the conversation text, and then model training can be performed by utilizing the manually added conversation target label so as to extract the conversation intention of other conversation texts. The correct answer can only be given if the dialog intention of the dialog text is understood, and therefore the dialog intention of the dialog text is an important parameter for the reply data filtering.
The state attribute of the non-player character and the interactive operation of the non-player character may also be affected by the state attribute, for example, when the emotions are different, the interactive operation may be different, thereby enabling the non-player character to express more intelligently by acquiring the state attribute of the non-player character. For example, the state attribute of a non-player character can be an emotion (e.g., like, dislike, anger, sadness, surprise, joy, fear, worry, remorse, agitation, thoughts, shy), current mental state, physical state, and the like.
The relationship between the interactive object and the non-player character is similar to that of a real person, and the degree of intimacy and the standpoint of both the interactive object and the non-player character may affect the interactive operation. Thus, the relationship attributes of the session object and the non-player character may include the position, intimacy, and relationship between the two.
The environment attribute of the game scene may be an environment attribute corresponding to the current dialog scene. The interactive operation may also be influenced by the environment, which may include, for example, location, weather, surrounding objects, etc. For example, when a specific object exists in the periphery, the interaction with the surrounding specific object can be realized, so that the interaction is more interesting.
The memory attribute is different from the previous attributes, because the memory attribute can be read or written, the non-player character can write the related data into the memory attribute after completing the interactive operation, for example, the non-player character is attacked by the player, so the memory attribute can record who has attacked the non-player character, and the previous interactive operation can be known by reading the memory attribute when the player talks with the non-player character next time, for example, in this case, the non-player character may possibly dislike the opposite direction.
Optionally, if the session attribute information includes: memory attributes of the non-player character, the memory attributes including: historical conversation content of non-player characters and conversation objects, and/or events occurring in the game world that are associated with non-player characters.
Historical conversation content of the non-player character and the conversation object, for example, if the non-player character and the player describe an object, the memory attribute includes the historical conversation content of the non-player character and the conversation object describing the object. If the object is described again later, the object can be known to be described through the memory attribute, and the object can be revealed to be described once in the interaction.
An event occurring in the game world in association with a non-player character, that is, the event does not necessarily occur between the non-player character and the interactive object, but the event is associated with the non-player character and affects the interactive operation of the non-player character, for example, a strange object NPC is killed by the interactive object, and the strange object NPC is a murder to kill friends of the non-player character, so that the interactive operation may be changed because the interactive object is an emner in the memory of the non-player character.
It should be noted that the memory attribute may be associated with a memory system, and the memory system may be divided into two parts: read and write. The read portion is consistent with other attributes and is read as part of the filter criteria. The writing part can be divided into out-code writing and in-code writing. The out-of-code writing refers to historical conversation contents of the non-player character and the conversation object, or historical events experienced by the non-player character and the conversation object, or historical actions performed by the non-player character and the conversation object, at this time, a variable describing the object, or a variable experiencing the event, or a variable performing the action by the non-player character may be added in the memory, and assigned with a value, for example, 1, indicating that the variable has occurred once, and subsequently, if the object is described again in the interaction, or the event is experienced, or the action is performed, the interaction may be changed, i.e., the fact that i have described the event or performed the action once is revealed in the interaction. In-code writes are events that occur in the game world associated with the non-player character that may be known to the non-player character and written to the memory system, such as when the player kills a monster NPC that is a tie killing his friends, then in the non-player character memory, where the player is an enrty, then the interaction may change.
Step 102: and acquiring reply data of the dialog text matched with the dialog attribute information as target reply data according to the dialog text and the dialog attribute information.
And after the dialog text and the dialog attribute information are obtained, matching the reply data of the dialog text with the dialog attribute information, and obtaining target reply data from the dialog text.
It should be noted that the target reply data may be a piece of reply data, or may be a superposition of multiple pieces of reply data. For example, a dialog text with clear information, such as "hello", after matching attribute information, its target reply data may be a piece of reply data, such as "hello". As another example, for conversational text containing multiple or ambiguous information, such as "hello, where you go? And when the attribute information is not easy to match, splitting multiple dialog texts, namely splitting the dialog texts into two parts of ' hello ' and ' where you go ', respectively matching the attribute information of the two parts of the dialog texts, namely ' hello ', after matching the attribute information, enabling the target reply data to be ' hello ', and enabling the target reply data to be ' I go to the teahouse to shop ', and superposing the two target reply data to obtain the target reply data of the dialog text, namely ' hello ', I go to the teahouse to shop '.
The above is merely an example, in an actual implementation, other forms may exist for obtaining the target reply data, which is not limited in the present application as long as the target reply data replies to the dialog text and matches with the dialog attribute information.
Step 103: and controlling the non-player character to execute the interactive operation corresponding to the target reply data.
And controlling the non-player character to execute the interactive operation corresponding to the target reply data according to the acquired target reply data.
The interactive operations include, but are not limited to: walking, running, swimming, riding a vehicle, making money, shopping, exploring, communicating with other non-player characters, attacking other non-player characters, robbing other non-player characters, berried scholars (i.e., training, such as force training and intelligence training), establishing or joining a group (a group is a group formed by at least two player characters in a game, after joining a non-player character, the non-player character can complete a task together with the character in the group or attack other groups, and a title level can be set in the group), participating in a match, raising pets (pets include animals, plants, beasts and the like), cooking, making articles (include making tools, furniture, props and the like), establishing a marital relationship, breeding the next generation and the like.
In summary, the embodiment of the present application provides an interaction control method for a non-player character, which may be implemented by obtaining a dialog text of a dialog object in a game scene and dialog attribute information of the non-player character during an interaction process between the non-player character and the dialog object, obtaining reply data of the dialog text matched with the dialog attribute information as target reply data according to the dialog text and the dialog attribute information, and then controlling the non-player character to execute an interaction operation corresponding to the target reply data. In the interaction control method for the non-player character provided in this embodiment, in the process of determining the reply data of the dialog text, the dialog attribute information of the non-player character is dynamically acquired based on the dialog attribute information of the non-player character, and the reply data of the dialog text matched with the dialog attribute information of the non-player character, so that in an actual game scene, as long as the dialog scene between the non-player character and the dialog object changes, the dialog attribute information changes, and the target reply data acquired based on the dialog attribute information also changes, the interaction operation performed by the non-player character is controlled based on the target reply data, which is more flexible and is not fixedly limited to a specific dialog text for interaction, thereby improving the flexibility of interaction performed by the non-player character in the game, and enabling the image of the non-player character in the game scene to be more realistic, the experience of the game is improved.
In the interaction control method for a non-player character provided in this embodiment, the acquired session attribute information includes: at least one attribute of conversation intention of a conversation text, state attribute of a non-player character, relationship attribute of a conversation object and the non-player character, environment attribute of a game scene, memory attribute of the non-player character and the like, namely information of at least one attribute is included in reply data screening of interactive operation, and conversation attribute information is obtained from multiple directions, so that the obtained target reply data is more real, and the image of the non-player character can be better shaped.
The interaction control method for the non-player character provided by the embodiment can also lead the reply content of the non-player object to be related back and forth by introducing the memory attribute into the conversation attribute information, so that the interaction is more real, the non-player character is more intelligent, and the game experience is enhanced.
Optionally, on the basis of fig. 1, the present application further provides a lower level implementation of obtaining target reply data based on the dialog text and the dialog attribute information in the interaction control method for the non-player character. Fig. 2 is a flowchart illustrating a method for controlling interaction of a non-player character according to another embodiment of the present disclosure to obtain target response data; as shown in fig. 2, the method for screening reply data with attribute entries matching with the session attribute information from a plurality of pieces of reply data as target reply data according to the session attribute information in the above embodiment may include:
step 201: and determining a plurality of pieces of reply data corresponding to the conversation tags from a preset conversation database according to the conversation tags of the conversation text.
Wherein, the preset dialogue database comprises: and each group of dialogue data comprises a preset dialogue label and a plurality of pieces of reply data corresponding to the preset dialogue label, and each piece of reply data has a corresponding attribute entry.
It should be noted that the dialog tag may be the dialog text itself, or may be a tag set according to the content of the dialog text. For example, if the dialog text has a simple structure, or has a simple content, or can directly find the corresponding reply data in the preset dialog database, the dialog tag may be the dialog text itself, for example, when the dialog text is "hello", since the dialog text can directly find the corresponding reply data in the preset dialog database, the dialog tag may be "hello", that is, the dialog text itself.
For another example, in a part of game scenes, if a dialog text is input by a player character in a form of voice or characters, the reply data may not be found in a preset dialog database due to different spoken expressions, expressions or expressions of the player character, and in this case, a dialog tag of the dialog text needs to be additionally set. The specific way of setting the dialog tag is not limited in the present application, and the following several ways are only examples and should not be construed as limiting the scope of the present application.
In one possible implementation, the dialog text may be labeled by keyword extraction, for example, the dialog text "these brothers are good in the morning", and "good in the morning" is extracted by the keyword, so as to set the dialog label as "good in the morning" or "good in your" and so on.
In another possible implementation manner, labels can also be set for the dialog text in a machine learning manner, for example, a recognition model for dialog purpose is trained, the recognition model can realize recognition for the dialog purpose of the dialog text, and after recognizing the dialog purpose by using the model, the dialog labels are set for the dialog text according to the dialog purpose.
The above is merely an example, and in an actual implementation, there may be other dialog tag setting methods, for example, manual tagging or natural language processing on a dialog tag, and the present application does not limit this.
The preset dialogue database comprises a plurality of groups of dialogue data, wherein each group of dialogue data comprises one or more preset dialogue tags and a plurality of pieces of reply data corresponding to the preset dialogue tags, and each piece of reply data has a corresponding attribute entry. The dialog tag represents the dialog content or the dialog purpose of the dialog text, and can provide a reference for the selection of the reply data. In addition, since the dialog tags do not fully describe the dialog attribute information, each preset dialog tag may include a plurality of pieces of reply data for further filtering according to the dialog attribute information.
Step 202: and screening reply data with the attribute items matched with the conversation attribute information from the plurality of reply data as target reply data according to the conversation attribute information.
And according to the conversation label of the conversation text, after a plurality of pieces of reply data corresponding to the conversation label are determined from a preset conversation database, further screening the plurality of pieces of reply data according to the conversation attribute information, and selecting the reply data matched with the attribute information as target reply data.
By adding the conversation label to the conversation text, the problem that the conversation text of the player character is not expressed and agrees due to various reasons and further cannot be matched with proper target reply data is solved, the flexibility of the application method is further improved, the feeling that the non-player character understands and communicates smoothly is given to the player, the non-player character image is better shaped, and the freshness is brought to the player.
Optionally, on the basis of fig. 2, the present application further provides a lower level implementation that the non-player character performs matching of the reply data based on the session attribute information. Fig. 3 is a flowchart illustrating a method for controlling interaction of a non-player character according to another embodiment of the present application, wherein the method includes obtaining target reply data; as shown in fig. 3, when the reply data whose attribute entry matches the session attribute information is screened from the plurality of pieces of reply data as the target reply data according to the session attribute information as shown in the above embodiment, the method may include:
step 301: and matching the dialogue attribute information with the attribute items of the reply data to obtain a matching result of the reply data.
In a preset dialogue database, each piece of reply data has at least one attribute entry, and the attribute entries of the reply data are matched with the dialogue attribute information, so that the matching results of a plurality of pieces of reply data are obtained. The matching result may be complete matching (the attribute entry representing the reply data is completely consistent with the session attribute information), partial matching (the attribute entry representing the reply data is consistent with a part of the session attribute information, and a part of the session attribute information is inconsistent), mismatching (the attribute entry representing the reply data is completely inconsistent with the session attribute information), and the like.
Step 302: and according to the matching result of the plurality of reply data, determining reply data of which the attribute entries are matched with the conversation attribute information as target reply data from the plurality of reply data.
According to the matching result, the reply data matching the confirmed attribute entry and the session attribute information is used as the target reply data, and when it needs to be explained, if the matching result distinguishing manner in step 301 is used, the confirmed target reply data may be completely matched reply data or incompletely matched reply data according to the actual use requirement, which is not limited in the present application. For example, if the conversation database is large enough, the target reply data may be set to be exactly matching reply data; if the dialog database is limited and there is reply data that cannot be matched with the complete match in the partial dialog text, the target reply data may be set to be born from the partially matched reply data.
The method comprises the steps of obtaining a matching result of a plurality of pieces of reply data by matching attribute items of conversation attribute information and a plurality of pieces of reply data, determining reply data of which the attribute items are matched with the conversation attribute information as target reply data from the plurality of pieces of reply data according to the matching result of the plurality of pieces of reply data, and selecting the reply data with the highest matching degree with the conversation attribute information as the target reply data, thereby further improving the flexibility and intelligence of interaction of non-player characters.
Optionally, on the basis of fig. 3, the present application further provides a lower level implementation of item matching based on session attribute information in the interaction control method for a non-player character. FIG. 4 is a flowchart illustrating matching of entries in a method for interactive control of a non-player character according to yet another embodiment of the present application; as shown in fig. 4, when matching the session attribute information and the attribute entries of the multiple pieces of reply data to obtain the matching result of the multiple pieces of reply data in the foregoing embodiment, the method may include:
step 401: and screening the attribute items of the reply data according to the conversation attribute information and the attribute items of each piece of reply data to obtain an item screening result of each piece of reply data.
According to the dialog attribute information and the attribute items of each piece of reply data, the attribute items of each piece of reply data are screened, so that the screening result of each piece of reply data is obtained, the screening result can be screening pass (indicating that the dialog attribute information meets each attribute item of the reply data), screening fail (indicating that at least one item of attribute information in the dialog attribute information does not meet the attribute item of the reply data), and the like.
Step 402: and determining reply data which passes the item screening from the plurality of reply data according to the item screening result.
Determining reply data that the entry screening passes according to each entry screening result obtained in step 401, it should be noted that the reply data that the entry screening passes may be one or multiple, and there may be differences according to differences of the session attribute information, which is not limited in the present application. It should be further noted that, the user may set a condition that the filtering is passed according to actual needs, for example, the reply data whose session attribute information completely satisfies the reply data attribute entry may be the reply data that passes the filtering, or the reply data whose session attribute information does not completely satisfy the reply data attribute entry, but the percentage of the satisfied reply data attribute entry to the total reply data attribute entry exceeds a set value may be the reply data that passes the filtering.
Step 403: screening the attribute items of each returned data passing through according to the conversation attribute information and the items, and matching and scoring each returned data to obtain item matching scores of each returned data; wherein, the matching result of each reply datum comprises: and the item matching scores of the item screening results and the reply data passed by the item screening.
When a plurality of screened reply data are obtained after screening, the screened reply data need to be further selected, that is, each reply data needs to be matched and scored, and it should be noted that the scoring basis can be the attribute information of the dialog and the attribute items of each reply data that the items are screened through. It should be noted that the specific scoring mode of each attribute item can be flexibly set by the user, for example, for the attribute items related to the state, a mode of setting a score value for one state may be adopted, for example, under the attribute item of "emotion", there are multiple states of "excitement", "distraction", "peace", "hurting", etc., one score value is set for each state, the "excitement" is set to 5 scores, the peace "is set to 4.5, etc. For another example, for an attribute entry related to a numerical value, a score may be set for each numerical value individually, for example, a conversion relationship between the numerical value and the score of the attribute entry may be set, or a numerical value interval may be set for the attribute entry, and a score may be set for the numerical value in each interval.
The matching result of each piece of reply data obtained by the method comprises the item screening result and the matching score of the screened reply data, so that the quantitative representation of the matching degree of the reply data and the dialogue attribute information is realized, and a basis is provided for further selecting the optimal reply data.
Optionally, on the basis of fig. 4, the application further provides a lower implementation of obtaining the target reply data based on the matching scoring condition in the interaction control method for the non-player character. When determining reply data with a property entry matching with the dialog property information as target reply data from a plurality of reply data shown in the above embodiment, the method may include:
and determining the reply data with the highest entry matching score from the reply data as the target reply data according to the entry matching score of the reply data.
In a possible implementation manner, the reply data with the highest matching score is selected as the target reply data, and since the matching score is calculated according to the dialog attribute information and the attribute entry of each reply data passed by the entry screening, the higher the matching score is, the higher the matching degree of the dialog attribute information and the execution entry of the reply data is, the more suitable the reply data is for the current interaction.
It should be noted that, when there is only one reply data with the highest matching score, the reply data is used as the target reply data; when a plurality of reply data with the highest matching score exist, one reply data can be randomly selected from the plurality of reply data as target reply data, or a second set of scoring mechanism can be set to score the plurality of reply data with the highest matching score again, so that one reply data with the highest score is selected as the target reply data.
It should be further noted that, since only a set of conversation data with the highest score is valuable at last, the conversation data in the conversation database may be scored according to the attribute entry of each reply data, and the reply data in the conversation database may be sorted according to the score from high to low, so that once a reply data with a high score is screened, only the reply data with the same score as the reply data needs to be screened, and the subsequent reply data with a low score does not need to be retrieved.
And determining reply data with the highest entry matching score as target reply data, so that quantitative selection of the target reply data is realized, and the selected target reply data is more suitable for the current interactive scene.
Optionally, on the basis of fig. 4, the present application further provides a lower implementation of attribute item screening in the interaction control method for a non-player character. Fig. 5 is a flowchart illustrating attribute item screening in an interactive control method for a non-player character according to yet another embodiment of the present application; as shown in fig. 5, in the above embodiment, when the method filters the attribute entries of each piece of reply data according to the session attribute information and the attribute entry of each piece of reply data, and obtains a result of filtering the entry of each piece of reply data, the method may include:
step 501: comparing each attribute in the dialogue attribute information with the attribute in the attribute item of each piece of reply data to obtain an item comparison result;
and comparing each attribute in the dialogue attribute information with the attribute in the attribute entry of each piece of reply data one by one to obtain the result of entry comparison.
Step 502: if the item comparison result indicates that: all attributes of the attribute items are contained in the dialogue attribute information, and the items of the reply data are determined to pass the screening if the data of each attribute in the dialogue attribute information meets the matching condition of the corresponding attribute in the attribute items.
It should be noted that the dialog attribute information needs to be matched with all attribute entries of the reply data, each attribute in the dialog attribute information is compared with attribute entry data in the database, and if each attribute in the attribute entries can find a corresponding attribute in the dialog attribute information and the attribute satisfies the matching condition of the attributes in the attribute entries, the entries of the reply data with the attribute entries are screened.
For example, the session attribute information includes blood volume 50 and two attributes of goodness, and the attribute entries of the database are: if the session attribute information is good, the entry of the reply data is screened, because the Chinese character good attribute of the session attribute information matches with the good attribute of the attribute entry, and the attribute entry does not limit the blood volume.
Step 503: if the item comparison result indicates that: and if the dialogue attribute information has partial attributes of the attribute entries or at least one attribute has all the attributes of the attribute entries, but the data of the existing attributes do not meet the matching conditions of the corresponding attributes in the attribute entries, determining that the entry screening of the reply data does not pass.
If the dialogue attribute information is only matched with partial attribute entries of the reply data, each attribute in the dialogue attribute information is compared with attribute entry data in the database, and if at least one attribute in the attribute entries cannot find the attribute corresponding to the attribute in the dialogue attribute information, the entry screening of the reply data cannot be passed. In addition, if at least one attribute of the dialogue attribute information does not meet the matching condition of the attribute in the attribute entry, the entry screening of the reply data does not pass.
For example, the session attribute information includes blood volume 50 and two attributes of goodness, and the attribute entries of the database are: the blood volume is more than 30, the character is good, the ground is neutral order, although the dialogue attribute and the attribute entry have two attributes of blood volume and character, the dialogue attribute information does not have the attribute of ground, namely only a part of attributes in the data entry in the dialogue attribute information, and the entry screening of the reply data is not passed. For another example, the attribute entries of the database are: although the session attribute has all attribute information in the attribute entries, the session attribute information has a blood volume 50 that does not satisfy the matching condition that the blood volume in the attribute entries is less than 30, and the entry screening of the reply data fails.
Comparing each attribute in the dialogue attribute information with the attribute in the attribute item of each piece of reply data to obtain an item comparison result, judging whether item screening of the reply data passes or not according to the item comparison result, and further refining item screening conditions.
Optionally, on the basis of fig. 4, the present application further provides a lower implementation of the matching scoring process in the interactive control method for the non-player character. In the above embodiment, the screening, according to the session attribute information and the entry, the attribute entry of each reply data that passes through, and matching and scoring each reply data to obtain the entry matching score of each reply data may include:
and matching and scoring the reply data according to the data of each attribute in the dialogue attribute information, the matching condition of each attribute in the attribute entry of each reply data and the preset attribute weight to obtain the entry matching score of each reply data.
In practical implementation, the influence of each attribute in the attribute entry on the interaction may be different, so that the importance degree of the attribute entry can be indicated by setting the attribute weight and using the attribute weight. It should be noted that, the setting of the attribute weight of each attribute item may be set subjectively or professionally by the user, or the attribute weight of each attribute item may be obtained by using a method such as machine learning or deep learning, and the specific setting mode of the attribute weight is not limited in the present application.
By setting the attribute weight, the influence of some important attribute items on the selection of the target reply data is strengthened, so that the selection of the target reply data is more accurate.
Optionally, on the basis of fig. 2, the present application further provides a lower implementation of performing reply data screening based on the split sub-databases in the interaction control method for the non-player character. FIG. 6 is a flowchart illustrating reply data filtering in an interactive control method for a non-player character according to yet another embodiment of the present application; as shown in fig. 6, in the method in the above embodiment, a plurality of sub-databases exist according to a preset dialog database, and dialog tags corresponding to different sub-databases are different; when determining multiple pieces of reply data corresponding to a dialog text from a preset dialog database according to a dialog tag of the dialog text, the present application also provides a possible implementation manner of an interactive control method for a non-player character, which may include:
step 601: and determining a sub-database where the conversation label is positioned from the plurality of sub-databases as a target sub-database according to the conversation label of the conversation text.
And dividing the preset conversation database into a plurality of sub-databases, wherein each sub-database corresponds to at least one conversation label. Therefore, the unique sub-database can be confirmed according to the conversation label, reply data screening is carried out in the sub-database, and screening time is effectively shortened.
Therefore, when a plurality of pieces of reply data corresponding to the dialog text are determined from the preset dialog database according to the dialog text, the dialog tag can be determined according to the dialog text, and the sub-database where the dialog tag is located is determined as the target sub-database.
Step 602: and determining a plurality of pieces of reply data corresponding to the dialog text from the target sub-database.
And matching the reply data in the target sub-database, and determining a plurality of pieces of reply data corresponding to the dialog text.
By dividing the conversation database, the reply data screening process is optimized, and the screening time is saved.
Optionally, on the basis of fig. 6, the present application further provides a lower implementation of partitioning a plurality of sub-databases in an interaction control method for a non-player character. In the foregoing embodiment, before determining, according to the dialog tag of the dialog text, the sub-database where the dialog tag is located from the plurality of sub-databases as the target sub-database, the method may include:
dividing a preset conversation database to obtain a plurality of sub-databases, wherein each sub-database comprises: at least one preset dialogue data of dialogue tags, wherein the dialogue data of each preset dialogue tag comprises: reply data under each preset dialog tag.
Because the preset dialogue database has too many entries, if each screening needs to be performed one by one from the preset dialogue database, the time consumption is very long and a large amount of memory is occupied, and in order to reduce the time consumption for screening, namely the memory consumption for screening, the preset dialogue database can be divided into a plurality of sub-databases, and each sub-database comprises at least one kind of dialogue data of the preset dialogue tag. The dialogue data includes: the dialog data of each preset dialog tag comprises reply data under the dialog tag. Therefore, according to the conversation label, a unique sub-database can be found, and then reply data screening can be carried out in the sub-database.
It should be noted that, when creating the sub-databases, the data size of each sub-database may be set relatively uniformly, so that it takes a long time to perform the reply data screening on each sub-database. In addition, the setting of the dialogue labels with larger discrimination is also beneficial to obtaining better sub-database selection effect.
Optionally, on the basis of fig. 6, the present application further provides a lower implementation of sub-database partitioning for the local area conversation tag in the interaction control method for the non-player character. In the foregoing embodiment, before determining, according to the dialog tag of the dialog text, the sub-database where the dialog tag is located from the plurality of sub-databases as the target sub-database, the method may include:
and classifying a plurality of groups of dialogue data in a preset dialogue database by adopting a preset dialogue data classification algorithm to obtain a plurality of sub-databases.
The problem that the sub-database is unbalanced in division may exist due to the subjective influence of a user or the problem of insufficient data volume when the sub-database is divided into the preset dialogue database, so that a preset dialogue data classification algorithm can be adopted to classify a plurality of groups of dialogue data in the preset dialogue database, and a plurality of sub-databases are obtained.
And a plurality of sub-databases are obtained by utilizing a preset dialogue data classification algorithm, so that the sub-databases can be accurately divided more efficiently.
Optionally, on the basis of fig. 2, the present application further provides a lower implementation of session data caching based on the merged attribute tag in an interaction control method for a non-player character. Fig. 7 is a flowchart illustrating data caching in a method for interactive control of a non-player character according to yet another fourth embodiment of the present application; as shown in fig. 7, the method includes:
step 701: if the cache function is started, the dialogue attribute information is merged to obtain an attribute tag value.
After the cache function is started, the dialogue attribute information is merged and processed to obtain an attribute tag value. It should be noted that the merging process may be all the session attribute information in the session attribute information or may be partial attribute information, which is not limited in this application and may be set by the user according to actual needs. For example, each dialog attribute information matched with the target reply data in the dialog attribute information may be merged to obtain an attribute tag value; or merging the conversation attribute information related to the score in the matching process of the target reply data in the conversation attribute information to obtain the attribute tag value.
Step 702: caching target dialogue data by taking the attribute label value as a key value, wherein the target dialogue data comprises: a dialog tag for the dialog text and target reply data.
And taking the attribute label value as a key value for subsequent calling, and caching the conversation label of the conversation text and the target reply data. After caching, if the subsequent dialogue attribute information is the same as the attribute tag value, the cached target reply data can be directly called for replying.
The target conversation data is stored through the cache, network delay is reduced, the time for requesting the content from the cache is shorter, the response speed of interaction can be obviously achieved by using the cache, and a user can repeatedly use the local cache to achieve better experience.
Optionally, on the basis of fig. 1, the present application further provides two possible implementation manners of the non-player character performing an interaction operation based on the target reply data.
In one possible implementation, the non-player character is controlled to conduct a dialog operation with the dialog object based on the target reply data.
According to the specific reply information contained in the target reply data, the specific reply operation can be to control the non-player character to perform a dialogue operation with the dialogue object based on the target reply data, for example, to the dialogue text of "hello", and the target reply data can include the reply operation of "dialogue" and the reply operation content of "hello", that is, the non-player character performs a dialogue operation with the dialogue object, specifically, to reply to the dialogue object of "hello".
In another possible implementation manner, the non-player character can be controlled to execute the action behavior corresponding to the target reply data to the conversation object.
Besides controlling the non-player character to carry out the dialogue operation with the dialogue object based on the target reply data, the action behavior corresponding to the target reply data can be executed to the dialogue object.
The following describes an interactive control device, an electronic device, a computer-readable storage medium, and the like for executing the non-player character provided in the present application, and specific implementation processes and technical effects thereof are referred to above, and will not be described again below.
The embodiment of the application provides a possible implementation example of an interactive control device of a non-player character. Fig. 8 is a schematic diagram of an interactive control device for a non-player character according to an embodiment of the present disclosure.
As shown in fig. 8, the interactive control device 100 for a non-player character includes:
a first obtaining module 81, configured to obtain a dialog text of a dialog object that performs a dialog with a non-player character in a game scene, and dialog attribute information of the non-player character;
the second obtaining module 83 is configured to obtain, according to the dialog text and the dialog attribute information, reply data of the dialog text matched with the dialog attribute information as target reply data;
and the control module 85 is used for controlling the non-player character to execute the interactive operation corresponding to the target reply data.
Optionally, the second obtaining module 83 is specifically configured to determine, according to a dialog tag of the dialog text, multiple pieces of reply data corresponding to the dialog tag from a preset dialog database, where the preset dialog database includes: the method comprises the steps that a plurality of groups of dialogue data are obtained, each group of dialogue data comprises a preset dialogue label and a plurality of pieces of reply data corresponding to the preset dialogue label, and each piece of reply data has a corresponding attribute entry; and screening reply data with the attribute items matched with the conversation attribute information from the plurality of reply data as target reply data according to the conversation attribute information.
Optionally, the second obtaining module 83 is specifically configured to match the session attribute information with attribute entries of multiple pieces of reply data to obtain a matching result of the multiple pieces of reply data; according to the matching result of the plurality of reply data, determining reply data with the attribute items matched with the conversation attribute information from the plurality of reply data as target reply data
Optionally, the second obtaining module 83 is specifically configured to, according to the session attribute information and the attribute entry of each piece of reply data, filter the attribute entry of the piece of reply data to obtain an entry filtering result of each piece of reply data; determining reply data which passes the item screening from the plurality of reply data according to the item screening result; screening the attribute items of each returned data passing through according to the conversation attribute information and the items, and matching and scoring each returned data to obtain item matching scores of each returned data; wherein, the matching result of each reply datum comprises: and the item matching scores of the item screening results and the reply data passed by the item screening.
Optionally, the second obtaining module 83 is specifically configured to determine, according to the entry matching score of each reply data, a reply data with a highest entry matching score from the reply data as the target reply data.
Optionally, the second obtaining module 83 is specifically configured to compare each attribute in the dialog attribute information with an attribute in an attribute entry of each piece of reply data to obtain an entry comparison result; if the item comparison result indicates that: all attributes of the attribute items are contained in the dialogue attribute information, and if the data of each attribute in the dialogue attribute information meets the matching condition of the corresponding attribute in the attribute items, the items of the reply data are determined to pass the screening; if the item comparison result indicates that: and if the dialogue attribute information has partial attributes of the attribute entries or at least one attribute has all the attributes of the attribute entries, but the data of the existing attributes do not meet the matching conditions of the corresponding attributes in the attribute entries, determining that the entry screening of the reply data does not pass.
Optionally, the second obtaining module 83 is specifically configured to perform matching scoring on each piece of reply data according to the data of each attribute in the dialog attribute information, the matching condition of each attribute in the attribute entry of each piece of reply data, and a preset attribute weight, so as to obtain an entry matching score of each piece of reply data.
Optionally, the second obtaining module 83 is specifically configured to determine, according to the dialog tag of the dialog text, a sub-database where the dialog tag is located from the multiple sub-databases as a target sub-database; and determining a plurality of pieces of reply data corresponding to the dialog text from the target sub-database.
Optionally, the second obtaining module 83 is specifically configured to divide the preset dialog database to obtain a plurality of sub-databases, so that each sub-database includes: at least one preset dialogue data of dialogue tags, wherein the dialogue data of each preset dialogue tag comprises: reply data under each preset dialog tag.
Optionally, the second obtaining module 83 is specifically configured to classify, by using a preset dialogue data classification algorithm, a plurality of groups of dialogue data in a preset dialogue database to obtain a plurality of sub-databases.
Optionally, the apparatus further comprises: a cache module:
the first merging processing module is used for merging the dialogue attribute information to obtain an attribute tag value if the cache function is started;
the cache module is used for caching target dialogue data by taking the attribute tag value as a key value, and the target dialogue data comprises: a dialog tag for the dialog text and target reply data.
Optionally, the second merging processing module is configured to merge the session attribute information to obtain an attribute tag value;
the second obtaining module 83 is specifically configured to use the attribute tag value as a key value, and determine, from the dialog data corresponding to the key value queried in the preset cache, that the reply data corresponding to the dialog text is used as the target reply data.
Optionally, the control module 85 is specifically configured to control the non-player character to perform a dialogue operation with the dialogue object based on the target reply data; or controlling the non-player character to execute the action corresponding to the target reply data to the conversation object.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
The embodiment of the present application provides a possible implementation example of an electronic device, which is capable of executing the interactive control method for a non-player character provided in the foregoing embodiment. Fig. 9 is a schematic diagram of an electronic device according to an embodiment of the present application, where the electronic device may be integrated in a terminal device or a chip of the terminal device, and the terminal may be a computing device with a data processing function.
The electronic device includes: a processor 901, a storage medium 902 and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating via the bus when the control device is running, the processor executing the program instructions to execute the steps of the above-mentioned interactive control method for the non-player character. The specific implementation and technical effects are similar, and are not described herein again.
Embodiments of the present application provide possible implementation examples of a computer-readable storage medium, which is capable of executing the method for interactive control of a non-player character provided in the foregoing embodiments, where the storage medium stores a computer program, and the computer program is executed by a processor to perform the steps of the method for interactive control of a non-player character.
A computer program stored in a storage medium may include instructions for causing a computer device (which may be a personal computer, a server, or a network device) or a processor (which may be a processor) to perform some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A method for interactive control of a non-player character, comprising:
acquiring a conversation text of a conversation object in a game scene, which is in conversation with a non-player character, and conversation attribute information of the non-player character;
acquiring reply data of the dialog text matched with the dialog attribute information as target reply data according to the dialog text and the dialog attribute information;
and controlling the non-player character to execute the interactive operation corresponding to the target reply data.
2. The method of claim 1, wherein the obtaining, as the target reply data, the reply data of the dialog text matched with the dialog attribute information according to the dialog text and the dialog attribute information comprises:
determining a plurality of pieces of reply data corresponding to the conversation tags from a preset conversation database according to the conversation tags of the conversation text, wherein the preset conversation database comprises: the method comprises the steps that a plurality of groups of dialogue data are obtained, wherein each group of dialogue data comprises a preset dialogue label and a plurality of pieces of reply data corresponding to the preset dialogue label, and each piece of reply data has a corresponding attribute entry;
and according to the dialog attribute information, screening reply data with attribute items matched with the dialog attribute information from the plurality of pieces of reply data to be used as the target reply data.
3. The method of claim 2, wherein the screening the reply data having the attribute entry matching the dialog attribute information from the plurality of reply data as the target reply data according to the dialog attribute information comprises:
matching the dialog attribute information with the attribute items of the reply data to obtain the matching result of the reply data;
and according to the matching result of the reply data, determining reply data with the attribute items matched with the conversation attribute information from the reply data as the target reply data.
4. The method of claim 3, wherein the matching the dialog attribute information and the attribute entries of the plurality of reply data to obtain the matching result of the plurality of reply data comprises:
screening the attribute items of the reply data according to the conversation attribute information and the attribute items of each piece of reply data to obtain item screening results of each piece of reply data;
determining reply data which passes the item screening from the plurality of reply data according to the item screening result;
screening attribute items of each piece of reply data passing through according to the conversation attribute information and the items, and matching and scoring each piece of reply data to obtain item matching scores of each piece of reply data;
wherein the matching result of each piece of reply data comprises: and the item matching scores of the item screening results and the reply data passed by the item screening.
5. The method of claim 4, wherein the determining, from the plurality of pieces of reply data, reply data whose attribute entry matches the dialog attribute information as the target reply data according to the matching result of the plurality of pieces of reply data, comprises:
and determining the reply data with the highest item matching score from the reply data as the target reply data according to the item matching score of the reply data.
6. The method of claim 4, wherein the screening the attribute entries of each piece of reply data according to the dialog attribute information and the attribute entries of each piece of reply data to obtain the entry screening result of each piece of reply data, comprises:
comparing each attribute in the dialogue attribute information with the attribute in the attribute item of each piece of reply data to obtain an item comparison result;
if the item comparison result indicates that: all attributes of the attribute items are contained in the dialogue attribute information, and if the data of each attribute in the dialogue attribute information meets the matching condition of the corresponding attribute in the attribute items, the items of the reply data are determined to pass the screening;
if the item comparison result indicates that: and if the dialogue attribute information has partial attributes of the attribute entries, or the at least one attribute has all attributes of the attribute entries, but the data of the existing attributes do not meet the matching conditions of the corresponding attributes in the attribute entries, determining that the entry screening of the reply data does not pass.
7. The method of claim 4, wherein the screening attribute entries of each reply data passing through according to the session attribute information and the entries, and matching and scoring each reply data to obtain an entry matching score of each reply data comprises:
and matching and scoring the reply data according to the data of each attribute in the dialogue attribute information, the matching condition of each attribute in the attribute entry of each reply data and a preset attribute weight to obtain the entry matching score of each reply data.
8. The method of claim 2, wherein a plurality of sub-databases exist in the preset dialog database, and dialog tags corresponding to different sub-databases are different; determining a plurality of pieces of reply data corresponding to the conversation text from a preset conversation database according to the conversation label of the conversation text, wherein the determining comprises the following steps:
determining a sub-database where the conversation label is located from the plurality of sub-databases as a target sub-database according to the conversation label of the conversation text;
and determining a plurality of pieces of reply data corresponding to the dialog text from the target sub-database.
9. The method of claim 8, wherein before determining the sub-database of the dialog tags from the plurality of sub-databases as the target sub-database according to the dialog tags of the dialog text, the method further comprises:
dividing the preset dialogue database to obtain a plurality of sub-databases, wherein each sub-database comprises: at least one preset dialogue data of dialogue tags, wherein the dialogue data of each preset dialogue tag comprises: and replying data under each preset dialog tag.
10. The method of claim 8, wherein before determining the sub-database of the dialog tags from the plurality of sub-databases as the target sub-database according to the dialog tags of the dialog text, the method further comprises:
and classifying the multiple groups of dialogue data in the preset dialogue database by adopting a preset dialogue data classification algorithm to obtain the multiple sub-databases.
11. The method of claim 1, wherein the method further comprises:
if the caching function is started, merging the conversation attribute information to obtain an attribute tag value;
caching target dialogue data by taking the attribute label value as a key value, wherein the target dialogue data comprises: a dialog tag of the dialog text and the target reply data.
12. The method of claim 1, wherein the obtaining, as the target reply data, the reply data of the dialog text matched with the dialog attribute information according to the dialog text and the dialog attribute information comprises:
merging the conversation attribute information to obtain an attribute tag value;
and using the attribute tag value as a key value, and inquiring dialogue data corresponding to the key value from a preset cache to determine reply data corresponding to the dialogue text as the target reply data.
13. The method of claim 1, wherein said controlling said non-player character to perform an interactive operation corresponding to said goal response data comprises:
controlling the non-player character to carry out a dialogue operation with the dialogue object based on the target reply data; or,
and controlling the non-player character to execute the action behavior corresponding to the target reply data to the conversation object.
14. The method according to any one of claims 1 to 13, wherein said session attribute information comprises data of at least one of the following attributes: a dialogue intention of the dialogue text, a state attribute of the non-player character, a relationship attribute of the dialogue object and the non-player character, an environment attribute of the game scene, and a memory attribute of the non-player character.
15. The method of claim 14, wherein if the dialog attribute information includes: memory attributes of the non-player character, the memory attributes comprising: historical conversation content of the non-player character and the conversation object, and/or events occurring in the game world that are associated with the non-player character.
16. An interactive control apparatus for a non-player character, comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a conversation text of a conversation object in a game scene, which carries out conversation with a non-player character, and the conversation attribute information of the non-player character;
the second acquisition module is used for acquiring reply data of the dialog text matched with the dialog attribute information as target reply data according to the dialog text and the dialog attribute information;
and the control module is used for controlling the non-player character to execute the interactive operation corresponding to the target reply data.
17. An electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing program instructions executable by the processor, the processor and the storage medium communicating via the bus when the electronic device is running, the processor executing the program instructions to perform the steps of the method for interactive control of a non-player character according to any one of claims 1 to 15.
18. A computer-readable storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for interactive control of non-player characters according to any one of claims 1 to 15.
CN202111466589.0A 2021-12-03 2021-12-03 Interactive control method, device, equipment and storage medium for non-player character Pending CN114225428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111466589.0A CN114225428A (en) 2021-12-03 2021-12-03 Interactive control method, device, equipment and storage medium for non-player character

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111466589.0A CN114225428A (en) 2021-12-03 2021-12-03 Interactive control method, device, equipment and storage medium for non-player character

Publications (1)

Publication Number Publication Date
CN114225428A true CN114225428A (en) 2022-03-25

Family

ID=80752893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111466589.0A Pending CN114225428A (en) 2021-12-03 2021-12-03 Interactive control method, device, equipment and storage medium for non-player character

Country Status (1)

Country Link
CN (1) CN114225428A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115018960A (en) * 2022-06-02 2022-09-06 北京新唐思创教育科技有限公司 Role interaction method, device, equipment and storage medium
CN115245682A (en) * 2022-07-15 2022-10-28 深圳市大梦龙途文化传播有限公司 Game interaction method, device, system and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115018960A (en) * 2022-06-02 2022-09-06 北京新唐思创教育科技有限公司 Role interaction method, device, equipment and storage medium
CN115245682A (en) * 2022-07-15 2022-10-28 深圳市大梦龙途文化传播有限公司 Game interaction method, device, system and computer readable storage medium

Similar Documents

Publication Publication Date Title
Fencott et al. Game invaders: The theory and understanding of computer games
CN114225428A (en) Interactive control method, device, equipment and storage medium for non-player character
US20240269556A1 (en) Method for interaction in game, device, and non-transitory computer-readable storage medium
Kankainen et al. Games as blends: Understanding hybrid games
Bódi Videogames and agency
Yang et al. Mastering the dungeon: Grounded language learning by mechanical turker descent
Bainbridge Online multiplayer games
Cremin Molecular Mario: the becoming-animal of video game compositions
Ware et al. Intentionality and conflict in The Best Laid Plans interactive narrative virtual environment
CN115463424A (en) Display control method and device of virtual role and electronic equipment
Carpenter Replaying colonialism: Indigenous national sovereignty and its limits in strategic videogames
US12070690B2 (en) System for providing item generation service for generating artificial intelligence-based dynamic game environment
Karpouzis et al. AI in (and for) Games
CN113617036A (en) Game dialogue processing method, device, equipment and storage medium
KR101619526B1 (en) Apparatus and method of managing master and disciple relationship in on-line game
CN110314379B (en) Learning method of action output deep training model and related equipment
Tychsen et al. Personalizing the player experience in MMORPGs
Franco et al. An interactive storytelling model for non-player characters on electronic rpgs
Sithungu et al. Adaptive Game AI-Based Dynamic Difficulty Scaling via the Symbiotic Game Agent
Schrier et al. Creating morality through play: digital games, moral perspective-taking, and empathy
Osborn et al. Towards general rpg playing
JP7519518B1 (en) Program and system
Wu Video Games Classification with Game Experience and Hierarchy of Needs
Poor Human–Machine Communities: How Online Computer Games Model the Future
Φραγκιάς Video game character learning with artificial intelligent algorithms

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination