Entity determination method and device in virtual environment, equipment and medium
By using natural language commands in a virtual environment combined with environmental perception information, determining the target entity and controlling the activities of non-player characters, the problem of difficulty in controlling complex activities in the existing technology is solved, and precise control and interaction of non-player characters is achieved. Sex improvement.
Patent Information
- Application Number
- CN202411096365.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-09
AI Technical Summary
The prior art is difficult to accurately control non-player characters in virtual environments to perform complex activities in virtual environments, especially because simple instructions cannot accurately direct characters to move to designated locations.
By using natural language commands in the virtual environment and combining the information perceived by the master virtual character and non-player characters from the virtual environment, the target entity is determined, thereby controlling the activity of non-player characters in the virtual environment.
It realizes flexible control over non-player characters, can accurately execute complex instructions, and improves the immersion and interactivity of the game.
Smart Images

Figure CN119075314A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of human-computer interaction, and in particular, to a method, apparatus, device, and medium for determining an entity in a virtual environment. Background Art
[0002] In the field of game design and development, AI (Artificial Intelligence) controlling NPC (Non-Player Character) has become a key technology to enhance game immersion and interactivity.
[0003] In related technologies, players can control the actions of NPCs by issuing simple commands, such as "attack" and "follow". AI can control the activities of non-player characters based on simple commands issued by users.
[0004] However, simple commands cannot accurately direct non-player characters to perform complex activities. For example, when a user wants to direct a non-player character to move to a specified location, the user can only repeatedly issue simple commands such as "forward", "backward", "left", and "right" to direct the non-player character to move little by little to get closer to the specified location, and cannot accurately control the non-player character to reach the specified location. Summary of the invention
[0005] The embodiment of the present application provides a method, device, equipment and medium for determining an entity in a virtual environment. The technical solution is as follows:
[0006] In one aspect, a method for determining an entity in a virtual environment is provided, the method comprising:
[0007] displaying at least one of a host virtual character and a non-player character in a virtual environment;
[0008] receiving a natural language command, the natural language command being used to control the non-player character;
[0009] Controlling the non-player character to move in the virtual environment according to the target entity indicated by the natural language command;
[0010] The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
[0011] In another aspect, a method for determining an entity in a virtual environment is provided, the method comprising:
[0012] Acquire an entity set, wherein the entity set includes entity information of at least one entity in the virtual environment;
[0013] Acquire environmental perception information, where the environmental perception information controls information perceived by at least one of the virtual character and the non-player character from the virtual environment;
[0014] The target entity is determined from the entity set according to the target entity information of the target entity and the environment perception information.
[0015] In another aspect, a device for determining an entity in a virtual environment is provided, the device comprising:
[0016] A display module, for displaying at least one of a main control virtual character and a non-player character in a virtual environment;
[0017] A receiving module, configured to receive a natural language command, wherein the natural language command is used to control the non-player character;
[0018] A control module, for controlling the non-player character to move in the virtual environment according to the target entity indicated by the natural language command;
[0019] The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
[0020] The environmental perception information includes at least one of the following:
[0021] Visual information perceived within the visual field of the master virtual character;
[0022] Auditory information perceived within the auditory range of the master virtual character;
[0023] The information perceived by the perception skills or the perception virtual props possessed by the master virtual character;
[0024] Visual information perceived within the field of vision of the non-player-controlled character;
[0025] Auditory information perceived within the hearing range of the non-player-controlled character;
[0026] The information perceived by the perception skills or virtual props possessed by the non-player controlled character.
[0027] In an optional embodiment, the virtual environment includes multiple candidate entities matching the natural language command, and the target entity is an entity screened from the multiple candidate entities based on environmental perception information of the main virtual character or the non-player-controlled character.
[0028] In an optional embodiment, the device further includes:
[0029] A first query module, configured to query and obtain the target entity from the entity set of the virtual environment according to the target entity information indicated by the natural language command and the environment perception information;
[0030] The control module is used to control the non-player controlled character to perform an activity associated with the target entity according to the intention of the natural language command.
[0031] In an optional embodiment, the first query module is used to parse the natural language command to obtain the target entity information; the target entity information includes at least one of the following: entity type, entity name, entity location, entity feature;
[0032] The first query module is used to calculate the similarity between the target entity information and each entity information in the entity set;
[0033] The first query module is used to determine the target entity from the entity set according to the similarity and the environmental perception information.
[0034] In an optional embodiment, the similarity includes text similarity; the entity set includes entity information of the first entity;
[0035] The first query module is used to perform word segmentation processing on the target entity information to obtain at least one target entity tag;
[0036] The first query module is used to convert the at least one target entity label into at least one target embedding vector;
[0037] The first query module is used to obtain entity information of the first entity, where the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained by converting a text label of the first entity;
[0038] The first query module is used to calculate the text parent similarity between the at least one target embedding vector and the text embedding vector respectively, and obtain at least one text parent similarity corresponding to the at least one target embedding vector respectively;
[0039] The first query module is used to determine the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0040] In an optional embodiment, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0041] The first query module is used to calculate the text sub-similarity between the first target embedding vector and the at least one text embedding vector respectively to obtain at least one text sub-similarity;
[0042] The first query module is used to determine the highest value of the at least one text sub-similarity as the text parent similarity corresponding to the first target embedding vector.
[0043] In an optional embodiment, the similarity includes image similarity; the entity set includes entity information of the first entity;
[0044] The first query module is used to perform word segmentation processing on the target entity information to obtain at least one target entity tag;
[0045] The first query module is used to convert the at least one target entity label into at least one target embedding vector;
[0046] The first query module is used to obtain entity information of the first entity, where the entity information includes an image embedding vector, where the image embedding vector is an embedding vector extracted based on the image of the first entity;
[0047] The first query module is used to respectively calculate the image parent similarity between the at least one target embedding vector and the text embedding vector, and obtain at least one image parent similarity corresponding to the at least one target embedding vector;
[0048] The first query module is used to determine the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0049] In an optional embodiment, the entity information of the first entity includes at least one image embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0050] The first query module is used to calculate the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity;
[0051] The first query module is used to determine the highest value of the at least one image sub-similarity as the image parent similarity corresponding to the first target embedding vector.
[0052] In an optional embodiment, the device further includes:
[0053] A first preprocessing module, configured to obtain at least one perspective image of the first entity;
[0054] A first preprocessing module, configured to obtain at least one text label of the first entity;
[0055] The first preprocessing module is used to call the multimodal model to extract the visual features of the first entity based on the at least one perspective image and the at least one text label of the first entity to obtain the image embedding vector of the first entity.
[0056] In an optional embodiment, the entity set includes a first entity, and the apparatus further includes:
[0057] The first query module is used to determine the average value of the text similarity and the image similarity as the similarity between the first entity and the target entity when the first entity and the target entity have corresponding text similarity and image similarity.
[0058] In an optional embodiment, the first query module is used to determine a search range according to the target entity information and the environment perception information;
[0059] The first query module is used to filter the target entity from the entities sensed within the search range according to the similarity.
[0060] In an optional embodiment, the first query module is used to determine the entity with the highest similarity in the search range as the target entity;
[0061] The first query module is used to determine the entity with the highest similarity in the search range and the closest distance to the master virtual character as the target entity when the number of the entities with the highest similarity in the search range is at least two.
[0062] In another aspect, a device for determining an entity in a virtual environment is provided, the device comprising:
[0063] An acquisition module, configured to acquire an entity set, wherein the entity set includes entity information of at least one entity in the virtual environment;
[0064] The acquisition module is used to acquire environmental perception information, wherein the environmental perception information mainly controls information perceived by at least one of the virtual character and the non-player character from the virtual environment;
[0065] The second query module is used to determine the target entity from the entity set according to the target entity information of the target entity and the environment perception information.
[0066] The environmental perception information includes at least one of the following:
[0067] Visual information perceived within the visual field of the master virtual character;
[0068] Auditory information perceived within the auditory range of the master virtual character;
[0069] The information perceived by the perception skills or the perception virtual props possessed by the master virtual character;
[0070] Visual information perceived within the field of vision of the non-player-controlled character;
[0071] Auditory information perceived within the hearing range of the non-player-controlled character;
[0072] The information perceived by the perception skills or virtual props possessed by the non-player controlled character.
[0073] In an optional embodiment, the virtual environment includes multiple candidate entities matching the natural language command, and the target entity is an entity screened from the multiple candidate entities based on environmental perception information of the main virtual character or the non-player-controlled character.
[0074] In an optional embodiment, the second query module is used to calculate the similarity between the target entity information of the target entity and each entity information in the entity set;
[0075] The second query module is used to determine the target entity from the entity set according to the similarity and the environmental perception information.
[0076] In an optional embodiment, the similarity includes text similarity; the entity set includes entity information of the first entity;
[0077] The second query module is used to perform word segmentation processing on the target entity information to obtain at least one target entity tag;
[0078] The second query module is used to convert the at least one target entity label into at least one target embedding vector;
[0079] The second query module is used to obtain entity information of the first entity, where the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained by converting a text label of the first entity;
[0080] The second query module is used to calculate the text parent similarity between the at least one target embedding vector and the text embedding vector respectively, and obtain at least one text parent similarity corresponding to the at least one target embedding vector respectively;
[0081] The second query module is used to determine the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0082] In an optional embodiment, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0083] The second query module is used to calculate the text sub-similarity between the first target embedding vector and the at least one text embedding vector respectively to obtain at least one text sub-similarity;
[0084] The second query module is used to determine the highest value of the at least one text sub-similarity as the text parent similarity corresponding to the first target embedding vector.
[0085] In an optional embodiment, the similarity includes image similarity; the entity set includes entity information of the first entity;
[0086] The second query module is used to perform word segmentation processing on the target entity information to obtain at least one target entity tag;
[0087] The second query module is used to convert the at least one target entity label into at least one target embedding vector;
[0088] The second query module is used to obtain entity information of the first entity, where the entity information includes an image embedding vector, where the image embedding vector is an embedding vector extracted based on the image of the first entity;
[0089] The second query module is used to calculate the image parent similarity between the at least one target embedding vector and the text embedding vector respectively, and obtain at least one image parent similarity corresponding to the at least one target embedding vector respectively;
[0090] The second query module is used to determine the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0091] In an optional embodiment, the entity information of the first entity includes at least one image embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0092] The second query module is used to calculate the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity;
[0093] The second query module is used to determine the highest value of the at least one image sub-similarity as the image parent similarity corresponding to the first target embedding vector.
[0094] In an optional embodiment, the device further includes:
[0095] A second preprocessing module, configured to obtain at least one perspective image of the first entity;
[0096] The second preprocessing module is used to obtain at least one text label of the first entity;
[0097] The second preprocessing module is used to call the multimodal model to extract the visual features of the first entity based on the at least one perspective image and the at least one text label of the first entity to obtain the image embedding vector of the first entity.
[0098] In an optional embodiment, the entity set includes a first entity;
[0099] The second query module is used to determine the average value of the text similarity and the image similarity as the similarity between the first entity and the target entity when the first entity and the target entity have corresponding text similarity and image similarity.
[0100] In an optional embodiment, the second query module is used to determine a search range according to the target entity information and the environment perception information;
[0101] The second query module is used to filter the target entity from the entities sensed within the search range according to the similarity.
[0102] In an optional embodiment, the second query module is used to determine the entity with the highest similarity in the search range as the target entity;
[0103] The second query module is used to determine the entity with the highest similarity in the search range and the closest distance to the master virtual character as the target entity when the number of the entities with the highest similarity in the search range is at least two.
[0104] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the entity determination method in a virtual environment as described above.
[0105] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the entity determination method in a virtual environment as described above.
[0106] On the other hand, an embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the entity determination method in a virtual environment provided in the above optional implementation.
[0107] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0108] Based on the information perceived by the main virtual character and / or the non-player character from the virtual environment, the target entity indicated in the natural language command is identified. For example, if the natural language command is "move to the back of the truck", then based on the field of view of the main virtual character when issuing the natural language command, the truck that the main virtual character can see within the field of view is determined as the "truck" referred to in the natural language command, and then the non-player character is controlled to move accurately to the back of the truck. Alternatively, if the natural language command is "is there a stream nearby", then based on the stream sound effect heard by the non-player character from the virtual environment, the non-player character is controlled to explore in the direction of the source of the stream sound effect, and based on the visual picture of the non-player character, it is identified whether the non-player character has found the stream, and feedback of the natural language command is generated based on the exploration results. By adopting this method, the target entity indicated in the natural language command can be accurately determined from the many entities in the virtual environment based on the environmental perception information. For the received natural language commands with vague descriptions, the target entity indicated by the natural language command can be inferred based on the information perceived by the main virtual character from the virtual environment when the command is issued, and the non-player virtual character can be controlled to execute the behavioral activities related to the target entity indicated in the natural language command, thereby realizing flexible control of the non-player character using natural language. BRIEF DESCRIPTION OF THE DRAWINGS
[0109] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0110] Figure 1is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;
[0111] Figure 2 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0112] Figure 3 is a schematic diagram of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0113] Figure 4 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0114] Figure 5 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0115] Figure 6 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0116] Figure 7 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0117] Figure 8 is a schematic diagram of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0118] Fig. 9 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0119] Fig.10 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0120] Fig.11 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0121] Fig.12 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0122] Fig.13 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0123] Fig.14 is a schematic diagram of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0124] Fig.15 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0125] Fig.16 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0126] Fig.17 is a schematic diagram of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0127] Fig.18 is a method flow chart of a method for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0128] Fig.19 is a device block diagram of a device for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0129] Fig. 20 is a device block diagram of a device for determining an entity in a virtual environment provided by another exemplary embodiment of the present application;
[0130] Fig.21 is a block diagram of a terminal provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0131] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0132] First, the nouns involved in the embodiments of the present application are briefly introduced:
[0133] Virtual environment: is a virtual environment displayed (or provided) when an application is running on a terminal. The virtual environment can be a simulation of the real world, a semi-simulation and semi-fictitious environment, or a purely fictitious environment. The virtual environment can be any one of a two-dimensional virtual environment, a 2.5-dimensional virtual environment, and a three-dimensional virtual environment, which is not limited in the embodiments of the present application.
[0134] Virtual character: A virtual character refers to an active object in a virtual environment. The active object may be a virtual person, a virtual animal, an animated character, etc., such as a person displayed in a virtual environment. Optionally, the virtual character is a three-dimensional model created based on animation skeleton technology. Each virtual character has its own shape and volume in the three-dimensional virtual world and occupies a part of the space in the three-dimensional virtual world.
[0135] User Interface (UI) controls: refers to any visual controls or elements that can be seen on the user interface of an application, such as images, input boxes, text boxes, buttons, labels, etc. Some UI controls respond to user operations.
[0136] 3D (three-dimensional) model: In computer graphics and video game design, a 3D model is a three-dimensional object defined by three-dimensional geometric data. This data can be created manually or generated by a 3D scanner. A complete 3D model allows the user to view the object from any angle and may contain additional information such as texture, color, and surface material properties. In video games, this type of model is often used to create the image of the player or NPC (non-player character).
[0137] First-person shooting game (First-person Shooting, FPS): refers to a shooting game that users can play from a first-person perspective. The screen of the virtual environment in the game is a screen that observes the virtual environment from the perspective of the virtual character controlled by the user. In the game, virtual characters of at least two camps play a single-game battle mode in the virtual environment. The virtual characters achieve the purpose of survival in the virtual environment by avoiding attacks launched by other virtual characters and dangers in the virtual environment (such as gas circles, swamps, etc.). When the life value of the virtual character in the virtual environment is zero, the life of the virtual character in the virtual environment ends, and the virtual character that survives in the virtual environment is the winner. Optionally, the competitive mode of the battle (game) can include a single-player battle mode, a two-person team battle mode, or a multi-person group battle mode. The battle mode in the embodiment of the present application is not limited.
[0138] Figure 1 A structural block diagram of a computer system provided by an exemplary embodiment of the present application is given. The computer system includes: a terminal 110 and a server 120.
[0139] The terminal 110 is installed and runs a client 111 that supports a virtual environment, and the client 111 is a client of an application. When the terminal runs the client 111, the user interface of the client 111 is displayed on the screen of the terminal 110. The application can be any one of a battle royale shooting game, a virtual reality (VR) application, an augmented reality (AR) program, a three-dimensional map program, a virtual reality game, an augmented reality game, a first-person shooting game (FPS), a third-person shooting game (TPS), a multiplayer online tactical competitive game (MOBA), and a simulation game (SLG).
[0140] In this embodiment, the client is a MOBA game. Terminal 110 is a terminal used by a first user 112. In the game, the first user 112 uses terminal 110 to control a first virtual character in a virtual environment to perform activities. The first virtual character can be referred to as the main virtual character of the first user 112 in the game. The activities of the first virtual character include, but are not limited to, at least one of adjusting body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, and throwing.
[0141] Figure 1 Only one terminal is shown, but in different embodiments, there are multiple other terminals that can access the server 120. Optionally, there are one or more terminals corresponding to the developer, and a development and editing platform for the client supporting the virtual environment is installed on the terminal. The developer can edit and update the client on the terminal, and transmit the updated client installation package to the server 120 via a wired or wireless network. The terminal 110 can download the client installation package from the server 120 to update the client.
[0142] The terminal 110 and other terminals are connected to the server 120 via a wireless network or a wired network.
[0143] The server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 120 is used to provide background services for clients that support virtual environments. Optionally, the server 120 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, the server 120 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, the server 120 and the terminal adopt a distributed computing architecture for collaborative computing.
[0144] In an illustrative example, the server 120 includes a processor, a user account database, a battle service module, and a user-oriented input / output interface (I / O interface). The processor is used to load instructions stored in the server 120 and process data in the user account database and the battle service module; the user account database is used to store data of user accounts used by the terminal 110 and other terminals, such as the user account's avatar, the user account's nickname, the user account's combat power index, and the service area where the user account is located; the battle service module is used to provide multiple battle rooms for users to fight, such as 1V1 battle, 3V3 battle, 5V5 battle, etc.; the user-oriented I / O interface is used to establish communication and exchange data with the terminal 110 through a wireless network or a wired network.
[0145] The embodiments of the present application provide a solution for users to control non-player characters in a virtual environment using voice commands in the form of natural language. In this solution, in addition to the main virtual character controlled by the user, the user usually has one or more NPCs as teammates. The user can use a relatively casual human conversation method rather than a mechanical command to command the NPC to give the first entity in the virtual environment the feedback he or she expects, thereby commanding the NPC to work with the main virtual character to complete the task. Figure 1 , the user controls the main virtual character 10 to play the game, and the main virtual character 10 has an NPC teammate 20. There is a car 30 in the field of vision of the main virtual character 10. The user speaks a voice command in natural language: "No. 2, you go to ambush behind the car 30", and then the NPC teammate 20 will move to the back of the car 30 to ambush. It should be noted that Figure 1 There may be multiple cars in the scene shown, and the NPC teammate 20 will accurately understand that the car the user is talking about is the car 30 located within the user's field of vision. That is, the NPC teammate 20 has a relatively intelligent natural language understanding ability.
[0146] Combined with reference Figure 1 The program includes at least one of the following five stages:
[0147] Phase 1: Preprocessing of spatial data;
[0148] The server pre-processes the first entity in the virtual environment and constructs spatial data of the virtual environment.
[0149] The spatial data of the virtual environment includes a matching tag of the first entity and a spatial position of the first entity. In some examples, the spatial data also includes a perspective image of the first entity. The first entity is any object that appears in the virtual environment, such as Figure 1Cars, walls, boxes, etc.
[0150] Matching tags for the first entity: first, obtain attribute information of the first entity in the virtual environment, such as at least one of the name, size, and other information of the first entity; and obtain a perspective image of the first entity, the perspective image including images obtained by observing the first entity from at least two perspectives. Observing the first entity from multiple perspectives can ensure that the perspective image carries comprehensive appearance information of the first entity.
[0151] The server calls the multimodal model to perform prediction on the attribute information and view image of the first entity, and obtains the object label of the first entity. The object label is used to describe the first entity in at least one dimension; for example, the first entity is described in dimensions such as material, transparency, color, and shape. The large language model is called to perform label optimization on the object label to obtain matching labels for scene objects; the large language model has the ability to generate text, and rewrites the object label input into the large language model in a manner that conforms to the spoken expression of natural language, thereby achieving label optimization of the object label and obtaining matching labels for scene objects.
[0152] For the spatial position of the first entity: the spatial position includes at least one of the following of the first entity: coordinate position (Location), such as coordinate information of a center point or a preset point of the first entity in the virtual environment; orientation (Rotation), such as the direction in which the front of the first entity faces in the virtual environment; a bounding box (Bounding Box), used to indicate the size of the first entity in the virtual environment; cover points, used to indicate recommended virtual character position points when the virtual character approaches the first entity, so that the first entity can mask the virtual character.
[0153] For the perspective image of the first entity, the perspective image is obtained in the process of predicting the matching label of the first entity, and the perspective image includes an image obtained by observing the first entity from at least two perspectives.
[0154] Phase 2: Speech recognition and intent recognition;
[0155] When the user controls the main virtual character, the terminal receives the natural language command input by the user in the form of voice; the server performs voice recognition and intent recognition on the natural language command to analyze the user's input instruction;
[0156] Speech recognition is to perform text conversion on the natural language instructions input by the user through voice, obtain the instruction text corresponding to the natural language instructions, and convert the speech information into text information. Call the encoding network to perform feature encoding on the instruction text to obtain the feature representation of the natural language instructions in the latent space; call the text segmentation network to perform segmentation on the feature representation to obtain multiple clauses in the instruction text, and then perform intent recognition on each of the multiple clauses. In the case that the natural language instructions input by the user through voice are long sentences, the segmentation of the instruction text corresponding to the natural language instructions can be achieved to meet the needs of analyzing the user's input instructions in the long sentence scenario.
[0157] The following introduces the intent recognition of each clause; the user's input instruction is obtained through intent recognition, and the user's input instruction includes the entity, semantic type, subject type and intent type in the clause.
[0158] Phase 3: Query of spatial data;
[0159] Taking the user's input as input, and the spatial data of the virtual environment and the runtime information corresponding to the main virtual character as reference, the AI model is used to determine the target entity in the virtual space and the control instructions for the NPC;
[0160] For example, the text input command is first parsed to parse out the entity in the text command. Then, the spatial data of the virtual environment is used as the query scope, and the real-time position and orientation of the main virtual character are used as the query reference conditions to query the target entity position corresponding to the input command in the virtual environment. This allows the NPC to be subsequently controlled to move to the vicinity of the target entity position, or to perform the action indicated by the input command on the target entity position.
[0161] Stage 4: NPC voice feedback;
[0162] NPC will give voice feedback to the user. The types of voice feedback include: at least one of instant feedback, command execution feedback, and dynamic feedback. Among them, instant feedback means that after the user issues a natural language command to the NPC, the NPC immediately gives voice feedback on the natural language command, such as "received", "start execution", "OK", etc.; execution command feedback means that after the NPC executes the control command indicated by the intention of the natural language command, the NPC gives voice feedback on the execution result of the control command, such as "successful execution", "failed to execute successfully", etc.; dynamic feedback means that when the user does not issue a natural language command to the NPC, the NPC gives voice feedback based on real-time environmental perception.
[0163] The above-mentioned voice feedback is obtained by converting text content into speech. The text content is inferred by a large language model combined with the above-mentioned spatial data and dynamic runtime information. Using a large language model to dynamically generate the text content of voice feedback can, on the one hand, break through the monotonous, mechanical, and easily repetitive voice feedback of fixed templated voice feedback; on the other hand, it does not need to save too many pre-made template voices in advance, which can avoid the problem of too large a total data volume on the client.
[0164] Stage 5: NPC behavior control;
[0165] The above natural language commands usually also include control instructions, which are instructions that can be used for the NPC's behavior tree to execute; the control instruction indicates that the NPC needs to perform a subsequent action, which can be a single action or a sequence of actions. In the case where the control instruction is a multi-action sequence instruction, the multi-action sequence instruction is used to instruct the NPC to perform an action sequence, and the data structure storing the multi-action sequence instruction is in the form of a list, and the instructions to be executed in the sequence instruction are cached. When the NPC's behavior tree executes the current instruction, the cache is called back, and the instructions to be executed in the cache are continued to be sent for execution.
[0166] Hot word update function:
[0167] For phase 2, this solution also introduces a hot word system to improve the accuracy of speech recognition.
[0168] The hot word system is used to provide scene hot words related to the scenes involved in the natural language instructions during the speech recognition process, so that when a natural language instruction input by voice is received, it can preferentially search for words from the hot word library as the instruction analysis result based on the currently running virtual environment, so that the match between the instruction analysis result and the virtual environment is higher.
[0169] The virtual environment includes at least one of a plurality of virtual environments such as a virtual battle scene, a virtual transaction scene, a virtual office scene, and a virtual kitchen scene. Frequently used words in a plurality of virtual environments, specific entities existing in a virtual environment, etc. (such as virtual buildings and virtual characters that only exist in a particular scene type) are pre-analyzed as scene hot words, and a scene hot word library consisting of a plurality of scene hot words is obtained, and the plurality of scene hot words correspond to virtual environments respectively. In addition, different scene language models are pre-trained for different virtual environments, such as a scene language model in a battle scene that pays more attention to words related to battle, and a scene language model in a transaction scene that pays more attention to words related to transaction; the scene language model can perform a more targeted analysis of natural language instructions received in a virtual environment.
[0170] For example: when a user controls a non-player character, a natural language instruction is received. Based on the game state, object position and current task completion status, the first virtual environment in which the target virtual character (at least one of the main virtual character and the non-player character) is currently located is determined to be a virtual battle scene, and a battle scene language model corresponding to the virtual battle scene is obtained. In addition, based on the field of view of the target virtual character, the first scene hot words in the virtual battle scene are obtained, including: "truck", "virtual grass", "virtual house", "enter", "open truck", "defense", "desert", "attack", "oak tree", "stable", etc. Under the constraints of the first scene hot words, the natural language instruction is decoded and processed by a pre-trained natural language analysis model (including acoustic network, language network, preset dictionary, etc.), and the instruction analysis result is output to accurately control the non-player character. The instruction analysis result is illustrated as follows.
[0171] (1) The command analysis result is "No. 1, you go to the front Defense The command analysis result can be used to specifically control No. 1 to move forward and make a defensive posture, preventing the enemy virtual character from attacking the main control virtual character first; if there is no constraint of the hot words in the first scene, the natural language command is easily recognized as "No. 1, go to the front and make a sound", thereby affecting the player's virtual combat plan.
[0172] (2) The command analysis result is "No. 2, you go desert The command analysis result can be used to specifically control No. 2 to move to the desert to check whether there are enemy virtual characters or virtual treasure chests. If there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as "No. 2, you go to the desert to check whether there are virtual characters or virtual treasure chests. Mountains "Explore it", which causes No. 2 to move to the wrong position, and the human-computer interaction efficiency is low.
[0173] (3) The command analysis result is "No. 1, No. 2, give me attack ", the command analysis result can be used to specifically control No. 1 and No. 2 to carry out virtual attacks on nearby attackable virtual characters; if there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as "No. 1 No. 2, give me supply ", causing No. 1 and No. 2 to make incorrect behaviors that do not meet the players' expectations, which can neither protect the main virtual character nor easily allow the enemy virtual character to win the virtual game.
[0174] (4) The command analysis result is “No. 1, go find a nearby oak tree”. This command analysis result can be used to specifically control No. 1 to find an oak tree in the nearby area so that he can complete the game task or find an oak tree that can avoid attacks. If there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as “No. 1, go find a nearby oak tree”. Project Book", causing No. 1 to search nearby for entities that do not meet the player's expectations and fail to meet the player's virtual combat needs.
[0175] (5) The command analysis result is "No. 1, No. 2, go over there stable OK", the command analysis result can be used to specifically control No. 1 and No. 2 to search for nearby stables and move to the location of the stables; if there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as "No. 1 No. 2, go over there , right away OK", which makes No. 1 and No. 2 mistakenly believe that the main virtual character currently hopes to complete the virtual game by itself, and therefore cannot provide good game assistance to the main virtual character.
[0176] (6) The command analysis result is “No. 2, pick up the props in front”. This command analysis result can specifically control No. 2 to search for props in front and pick up the props. If there is no constraint of the hot words in the first scene, it is easy to recognize the natural language command as “No. 2, pick up the props in front”. Crab ", which makes it impossible for No. 2 to accurately find the entity that the main virtual character in front wants to pick up. It is possible that the player will be prompted with "Cannot find the crab", or the player may pick up the wrong entity "crab", interfering with the player's virtual combat process.
[0177] Ambient sound function:
[0178] In addition, the solution also provides a spatial audio enhancement solution for the ambient sound effects of the entire virtual environment.
[0179] The audio played by the terminal includes environmental audio and NPC audio. Environmental audio is the audio generated based on the scene characteristics of the virtual environment where the main virtual object is currently located, so that the user can feel immersive; NPC audio is the audio generated based on the characteristics of the NPC, so that the user can intuitively feel the character's emotions and physical state through the sound heard.
[0180] Environmental audio: Identify the scene elements in the virtual environment where the master virtual object is located, generate appropriate element sound effects in real time based on the scene elements / select appropriate element sound effects from the sound effect library, and synthesize the element sound effects to obtain environmental audio. For example, if the virtual environment is a forest at night, the scene elements include trees, owls, insects, etc., and the environmental audio includes the rustling of leaves, the calls of owls, the chirping of insects, etc.
[0181] NPC audio: Determine the NPCs included in the virtual environment, and generate corresponding character voices based on the NPC's character type, current emotion, and current behavior. For example, if the NPC is a middle-aged man running, the generated character voice is a deep male voice with the sound of panting when running.
[0182] When the terminal plays the ambient audio and / or NPC audio to the user, the terminal performs audio enhancement processing on the ambient audio and / or NPC audio to improve the realism of the audio.
[0183] In combination with the above description of the implementation environment, the entity determination method in the virtual environment provided in the embodiment of the present application is described.
[0184] Exemplarily, the method is executed by an application program, and when the application program is an application program for a stand-alone game, the method is executed by a terminal.
[0185] When the application is a multi-person online application, the method is executed by a client of the application installed on the terminal, or is executed collaboratively by the terminal and the server.
[0186] Among them, when the method is executed collaboratively by a terminal and a server, the terminal is used to display images, receive natural language commands, and report natural language commands to the server; the server is used to perform target entity recognition according to natural language commands, generate control instructions for non-player characters, and send control instructions to the terminal; the terminal controls the activities of non-player characters in the virtual environment according to the control instructions, and renders and displays corresponding images.
[0187] Alternatively, when the method is executed collaboratively by a terminal and a server, the terminal is only used to display images and receive trigger operations and natural language commands; the terminal reports the received trigger operations and natural language commands to the server, and the server identifies the target entity and generates control instructions; the server renders an image of a non-player character moving in a virtual environment according to the control instructions, and sends the image to the terminal; the terminal receives and displays the image.
[0188] Figure 2 A flowchart of a method for determining an entity in a virtual environment provided by an exemplary embodiment of the present application is shown. Figure 1 The method comprises:
[0189] Step 210 , display at least one of a main control virtual character and a non-player character in a virtual environment.
[0190] Exemplarily, the method may be executed by a client installed on the terminal, the client being a client of an application, and the application being an application supporting a virtual environment, for example, the application may be an application for a shooting game.
[0191] It should be noted that the calculations in the embodiments of the present application can be completely performed by the client. For example, the game application is a stand-alone game application, and all calculations are completed by the client. It can also be completely performed by the server. For example, in a cloud game scenario, all calculations of the application are completed by the server, and the client is only responsible for displaying and collecting the user's operation behavior. It can also be completed by the client and the server in collaboration. For example, the client is responsible for part of the calculation and the server is responsible for another part of the calculation.
[0192] Optionally, the terminal displays a game interface, which includes a virtual environment screen, in which a main control virtual character and non-player characters are displayed. The virtual environment screen is a screen obtained by observing the virtual environment from the perspective of the main control virtual character.
[0193] The main control virtual character is a virtual character directly controlled by the terminal. The terminal can directly control the behavior of the main control virtual character according to the received control instructions based on the preset control logic. For example, when receiving the forward instruction, the main control virtual character is controlled to move forward; when receiving the jump instruction, the main control virtual character is controlled to jump upward.
[0194] For example, the terminal displays control controls corresponding to the main virtual character (e.g., moving controls, shooting controls, throwing controls, jumping controls, etc.), and the user controls the main virtual character to move in the virtual environment by triggering the control controls. Alternatively, the terminal is connected to an input device (e.g., a mouse, keyboard, camera, sensor, etc.), and the user issues control instructions through the input device, and controls the main virtual character to move in the virtual environment according to the control instructions.
[0195] The non-player character is a virtual character controlled by a game application, which is controlled by a server or an artificial intelligence program in a client. The non-player character can be commanded by a user, who commands the activities of the non-player character through natural language commands. In the embodiment of the present application, the game application can control the behavior of the non-player character according to the received natural language command. The game application can understand the intention of the natural language command, generate control instructions according to the intention, and control the non-player character to execute the intention indicated by the natural language command.
[0196] It should be noted that "command" and "control" are different modes of manipulation. Player command of non-player characters means that the player uses natural language commands to express his intentions to non-player characters (for example, control intentions or behavioral expectations). The AI will understand the intentions in the natural language commands and generate control instructions for the intentions according to the autonomous behavioral capabilities of the non-player characters. The control instructions are used to control the non-player characters to perform the activities indicated by the intentions.
[0197] When the player controls the main virtual character, the player directly gives control operations. Each control operation corresponds to a control instruction, and the main virtual character directly performs activities according to the control instructions.
[0198] In an optional embodiment, the main virtual character is a virtual character controlled by the control instruction generated by the triggering UI control; the non-player character is a virtual character controlled by the AI according to the natural language command. When no natural language command is received, the AI can control the non-player character to move in the virtual environment; when a natural language command is received, the AI can control the non-player character to move in the virtual environment according to the intention of the natural language command.
[0199] Exemplarily, the main virtual character has an association relationship with the non-player character. For example, the non-player character is a teammate of the main virtual character, or the non-player character is a pet of the main virtual character, or the non-player character is a servant of the main virtual character, or the non-player character is an intelligent robot controlled by the main virtual character, or the non-player character is an avatar of the main virtual character.
[0200] In an optional embodiment, the game application may provide multiple types of non-player virtual characters, and different types of non-player virtual characters may have different personalities, different behavioral habits, or different autonomous behavioral capabilities.
[0201] For example, a game application may provide a sniper non-player character, whose shooting accuracy is as high as 99%. Alternatively, a game application may provide a gathering enthusiast non-player character, who, once discovering virtual resources to be gathered in a virtual environment, will prioritize gathering resources and ignore the player's natural language commands. Alternatively, a game application may provide a directionally challenged non-player character, who must always follow the main virtual character. Once the main virtual character leaves the directionally challenged non-player character's field of view, the directionally challenged non-player character will lose its target and stand still, unable to move.
[0202] For example, in a team-based game, a player needs to team up with at least one other player to play the game. When a player lacks teammates, the game application can provide a non-player character as the player's teammate to play the game with the player. During the game, the player can command the activities of the non-player virtual character by issuing voice commands (natural language commands) so that the non-player virtual character cooperates with the main control virtual character to complete the game.
[0203] For example, during a game, a player can bring a pet and use the pet to explore the virtual environment. The player can use voice commands or text commands to command the pet to move in the virtual environment to explore unknown areas in the virtual environment, making it easier for the main virtual character to make strategic decisions and deployments.
[0204] Alternatively, in a MOBA game, the main virtual character teams up with the virtual characters controlled by the other four players to play against each other. When one of the teammates is offline and cannot control his virtual character, for example, the player of the first virtual character is offline and cannot control the first virtual character, the main virtual character can use voice commands to command the first virtual character during the offline period of the teammates, so that the first virtual character assists other teammates in participating in the team battle, or commands the first virtual character to take accurate actions to respond to changes in the battle situation.
[0205] Step 220, receiving a natural language command, where the natural language command is used to control a non-player character.
[0206] Natural language commands are command instructions conveyed using human natural language. The terminal receives the natural language commands issued by the player and controls the non-player character according to the intention corresponding to the natural language commands. For example, the terminal receives the voice audio of the player, converts the voice audio into text, and obtains the natural language command. Alternatively, the terminal receives the text of the natural language command input by the player.
[0207] Players can use spoken or written language to issue natural language commands. The game application will use the large language model to understand the natural language commands, extract the intentions expressed in the natural language commands, generate control instructions based on the intentions, and control the activities of non-player characters.
[0208] For example, a natural language command may be “Come to me”, and the game application may parse out that the intention of the natural language command is “control the non-player virtual character to move to the location of the controlling virtual character”, then the game application obtains the location of the controlling virtual character, generates a navigation route for the non-player virtual character to move to the location of the controlling virtual character, and controls the non-player virtual character to move to the location of the controlling virtual character along the navigation route.
[0209] For another example, a natural language command may be “go pick up a treasure chest”, then the game application may parse out that the intention of the natural language command is “control the non-player virtual character to move to the location of the treasure chest and pick up the treasure chest”, then the game application may obtain the location of the treasure chest, control the non-player virtual character to move to the location of the treasure chest, and perform the operation of picking up the treasure chest after arriving at the location of the treasure chest.
[0210] Optionally, the natural language command is used to control the non-player character to perform an activity related to a target entity. For example, the target entity may be a destination for the non-player character to move to, an object that the non-player character needs to observe, a target that the non-player character needs to attack, or an object that the non-player character needs to interact with.
[0211] The target entity is a virtual object that exists in the virtual environment. The target entity is the entity described in the natural language command. The entity can refer to a virtual object that is fixed in the virtual environment. For example, the target entity can be a virtual building, a virtual terrain, a virtual vehicle, a virtual plant, a virtual prop, a virtual item, etc. The entity can also refer to a virtual object in the virtual environment that can interact with the virtual character. For example, the target entity can be an interaction point in the virtual environment (for example, a door, a window, a cabinet, a cellar, etc.), a virtual prop, a virtual character, a virtual light source, etc.
[0212] For example, a natural language command may be "Please help me open the door", then the target entity may be "door", and the non-player character needs to perform a door-related activity "open the door". Alternatively, a natural language command may be "Is the kitchen safe", then the target entity may be "kitchen", and the non-player character needs to perform a kitchen-related activity "check if there are enemy avatars or other dangerous situations in the kitchen".
[0213] Optionally, the natural language command includes target entity information of the target entity. The target entity information may be a description text of the target entity. For example, the target entity information may include at least one of the following contents: the name, type, location, and features of the target entity. The game application may find the target entity from among the many entities in the virtual environment based on the target entity information in the natural language.
[0214] Step 230 , controlling the non-player character to move in the virtual environment according to the target entity indicated by the natural language command.
[0215] The game application parses the natural language command, extracts the target entity information therein, determines the target entity from the entity set of the virtual environment based on the target entity information, and then controls the non-player character to perform activities related to the target entity according to the intention of the natural language command.
[0216] The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
[0217] Since the target entity information in natural language commands is usually vague, for example, a natural language command may be "move to the red truck", where the target entity information is "red truck", and there may be many red trucks in the virtual environment. It is impossible to accurately determine the target entity in the virtual environment based solely on the target entity information in the natural language command.
[0218] Therefore, the embodiment of the present application provides a method for determining the target entity by combining the target entity information and the environmental perception information. For the previous example, the "red truck" expressed by the player in the natural language command should be a red truck that the player can see. Therefore, combined with the field of view of the main control virtual character, the red truck within the field of view of the main control system character can be screened out from the multiple red trucks in the virtual environment. The red truck is the target entity indicated by the player in the natural language command.
[0219] Since natural language commands are issued by players based on their perception of the virtual environment, in order to accurately identify the target entity indicated in the natural language command, the game application will combine the environmental perception information when the player issues the natural language command to identify the target entity in the natural language command. Based on the player's perception of the virtual environment, the entity that the player can perceive in the virtual environment and is closest to the target entity information is inferred as the target entity.
[0220] Exemplarily, the virtual environment includes multiple candidate entities that match the natural language command, and the target entity is an entity selected from the multiple candidate entities based on the environmental perception information of the main virtual character or the non-player character. For example, the game application first selects multiple candidate entities that match the target entity information in the natural language command from the entity set, and then selects the entity that can be perceived by the main virtual character or the non-player character from the multiple candidate entities as the target entity based on the environmental perception information.
[0221] Exemplarily, the environmental perception information includes at least one of the following:
[0222] Visual information perceived within the field of vision of the controlling virtual character;
[0223] Auditory information perceived within the hearing range of the controlling virtual character;
[0224] ·The perception skills possessed by the main virtual character or the information perceived by the perception virtual props;
[0225] Visual information perceived within the field of view of non-player characters;
[0226] Auditory information perceived within the hearing range of non-player characters;
[0227] Information perceived by a non-player character’s perception skills or virtual props.
[0228] For example, the environmental perception information of the main virtual character may include: the pictures or entities that the main virtual character can see when observing the virtual environment, the environmental sound effects that the main virtual character can hear, the source direction of the environmental sound effects, the type and volume of the environmental sound effects, the perception information obtained by the main virtual character through the use of perception skills (for example, visual information, auditory information, sound wave information, light reflection information, etc.), and the perception information obtained by the main virtual character through the use of perception virtual props (for example, the sensor signal of the sensor, the positioning signal of the positioning props, etc.).
[0229] The environmental perception information of the non-player character may include: the images or entities that the non-player character can see when observing the virtual environment, the environmental sounds that the non-player character can hear, the source direction of the environmental sounds, the type and volume of the environmental sounds, the perception information obtained by the non-player character through the use of perception skills (for example, visual information, auditory information, sound wave information, light reflection information, etc.), and the perception information obtained by the non-player character through the use of perception virtual props (for example, sensor signals of sensors, positioning signals of positioning props, etc.).
[0230] For example, Figure 3 As shown, when the natural language command is "Come to the stairs in front of me", the game application can determine that the target entity is the stairs 301 located in front of the main control virtual character in combination with the field of view of the main control virtual character.
[0231] It should be noted that the environmental perception information may include the information perceived by the controlling virtual character and the non-player character in real time when receiving the natural language command, and may also include the information perceived by the controlling virtual character and the non-player character in history before receiving the natural language command. That is, the target entity may be the entity currently seen by the player, or it may be the entity that the player has seen in the past. Therefore, the game application needs to combine the real-time environmental perception information and the historical environmental perception information of the controlling virtual character and / or the non-player character to identify the target entity.
[0232] For example, when the natural language command is "Let's go back to the hotel we just passed by", the game application needs to query the hotels that the main virtual character has passed by based on the historical environmental perception information of the main virtual character.
[0233] In summary, the method provided in this embodiment identifies the target entity indicated in the natural language command based on the information perceived by the main virtual character and / or the non-player character from the virtual environment. For example, if the natural language command is "move to the back of the truck", then according to the field of view of the main virtual character when issuing the natural language command, the truck that the main virtual character can see within the field of view is determined as the "truck" referred to in the natural language command, and then the non-player character is controlled to move accurately to the back of the truck. Alternatively, if the natural language command is "is there a stream nearby", then according to the stream sound effect heard by the non-player character from the virtual environment, the non-player character is controlled to explore in the direction of the source of the stream sound effect, and based on the visual picture of the non-player character, it is identified whether the non-player character has found the stream, and feedback of the natural language command is generated based on the exploration result. By adopting this method, the target entity indicated in the natural language command can be accurately determined from the many entities in the virtual environment based on the environmental perception information. For the received natural language commands with vague descriptions, the target entity indicated by the natural language command can be inferred based on the information perceived by the main virtual character from the virtual environment when the command is issued, and the non-player virtual character can be controlled to execute the behavioral activities related to the target entity indicated in the natural language command, thereby realizing flexible control of the non-player character using natural language.
[0234] Figure 4 A flowchart of a method for determining an entity in a virtual environment provided by an exemplary embodiment of the present application is shown. Figure 1 The method comprises:
[0235] Step 240: Acquire an entity set, where the entity set includes entity information of at least one entity in the virtual environment.
[0236] Exemplarily, the identification of the target entity may be performed by a client or a server.
[0237] For example, the client reports the received natural language command to the server. The server parses the natural language command and obtains the target entity information. Then, the execution Figure 4 The method shown determines the target entity indicated by the target entity information from the entity set of the virtual environment according to the environment perception information.
[0238] Step 250, obtaining environmental perception information, where the environmental perception information includes: information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
[0239] Step 260 , determining a target entity from the entity set according to the target entity information and the environment perception information of the target entity.
[0240] Exemplarily, the method for the server to determine the target entity from the entity set is as follows: Figure 2 The embodiments shown are the same except that Figure 2 The illustrated embodiment is executed by a client, Figure 4 The illustrated embodiment is executed by a server, and the specific method will not be described in detail here.
[0241] Exemplarily, the server can determine a list of candidate entities that match the target entity information from the entity set based on the target entity information of the target entity; determine the perception range of the main virtual character and / or the non-player character based on the environmental perception information, and use the perception range as the search range; and determine the entity in the candidate entity list that is within the search range as the target entity.
[0242] Alternatively, the server determines the perception range of the main virtual character and / or the non-player character based on the environmental perception information, uses the perception range as the search range, and determines the entities within the search range as candidate entities; the candidate entities are matched with the target entity information of the target entity in turn for similarity, and the candidate entity with the highest similarity is determined as the target entity.
[0243] In summary, the method provided in this embodiment identifies the target entity indicated in the natural language command based on the information perceived by the main virtual character and / or the non-player character from the virtual environment. For example, if the natural language command is "move to the back of the truck", then according to the field of view of the main virtual character when issuing the natural language command, the truck that the main virtual character can see within the field of view is determined as the "truck" referred to in the natural language command, and then the non-player character is controlled to move accurately to the back of the truck. Alternatively, if the natural language command is "is there a stream nearby", then according to the stream sound effect heard by the non-player character from the virtual environment, the non-player character is controlled to explore in the direction of the source of the stream sound effect, and based on the visual picture of the non-player character, it is identified whether the non-player character has found the stream, and feedback of the natural language command is generated based on the exploration result. By adopting this method, the target entity indicated in the natural language command can be accurately determined from the many entities in the virtual environment based on the environmental perception information. For the received natural language commands with vague descriptions, the target entity indicated by the natural language command can be inferred based on the information perceived by the main virtual character from the virtual environment when the command is issued, and the non-player virtual character can be controlled to execute the behavioral activities related to the target entity indicated in the natural language command, thereby realizing flexible control of the non-player character using natural language.
[0244] Exemplarily, an exemplary embodiment of determining a target entity from multiple entities in a virtual environment is given.
[0245] Figure 5A flowchart of a method for determining an entity in a virtual environment provided by an exemplary embodiment of the present application is shown. Figure 1 Based on the terminal in Figure 2 In the illustrated embodiment, step 230 may include step 231 and step 232 .
[0246] Step 210 , display at least one of a main control virtual character and a non-player character in a virtual environment.
[0247] Optionally, the terminal may receive control operations to control activities of a master virtual character, and receive natural language commands to control activities of non-player virtual characters.
[0248] For example, in a shooting game, an AI teammate (non-player character) can be assigned to the player. The player can issue arbitrary natural language commands to the AI teammate to instruct the AI teammate to scout, fight, or cooperate with him to complete tactical cooperation tasks.
[0249] Step 220, receiving a natural language command, where the natural language command is used to control a non-player character.
[0250] For example, a game application displays a game interface, which includes an AI communication control. In response to an operation that triggers the AI communication control, voice audio recording begins. In response to triggering the AI communication control again, voice audio recording stops and voice audio is obtained. The voice audio is converted into text to obtain natural language commands.
[0251] Step 231 , according to the target entity information indicated by the natural language command and the environment perception information, query and obtain the target entity from the entity set of the virtual environment.
[0252] In an optional embodiment, the client queries and obtains the target entity from the entity set of the virtual environment according to the target entity information and the environment perception information indicated by the natural language command. In another optional embodiment, the client reports the natural language command to the server, and the server queries and obtains the target entity from the entity set of the virtual environment according to the target entity information and the environment perception information indicated by the natural language command.
[0253] Optionally, the game application infers the target entity based on the target entity information, the environment perception information and the pre-processed virtual environment data, wherein the pre-processed virtual environment data includes a set of entities in the virtual environment.
[0254] The entity set includes entity information of each entity in the virtual environment. The entity information includes at least one of the following: name, type, location, feature, text label, embedding vector of text label, image, embedding vector of image.
[0255] The text label may be at least one word obtained after segmenting a feature (for example, a descriptive text of an entity appearance), and the embedding model is called to obtain an embedding vector corresponding to each text label.
[0256] The image may include an image obtained by observing a three-dimensional model of the entity from at least one direction, for example, the image may include three views of the entity. The embedding vector of the image is the embedding vector of the visual feature label. The visual feature label is obtained by calling the multimodal model to perform feature recognition based on the image and text label of the entity.
[0257] For example, Figure 6 As shown, to control the non-player character to move to any position in the virtual environment, it is necessary to search for all entities in the virtual environment based on natural language commands. Therefore, it is necessary to pre-process the virtual environment data first to generate a searchable entity set. Optionally, the entities in the entity set can include two categories: area / building 403, and other entity objects 404. The entity information of the area / building can be manually calibrated. Since the area / building 403 is usually large in scope and there may be subspaces inside, such as rooms in a building, it is necessary to manually calibrate the position, orientation, etc. of the area, building and its subspace. For other entity objects 404, their position, orientation, bounding box, cover point and other entity information can be automatically exported by the game engine. These entity information exist in the game engine assets themselves and can be directly recorded.
[0258] Exemplarily, the entity set includes a first type of entity and a second type of entity, the first type of entity includes at least one of an area and a building, and the second type of entity includes a physical object. The text labels of the first type of entity are obtained by manual labeling. For example, the text label of a room of a building is manually labeled as: an area, a building, a floor, and a room. The text labels of the second type of entity are automatically generated by calling a large language model.
[0259] The method for generating text labels for the second type of entity may include: obtaining at least one image of the entity, inputting the at least one image into a large language model, and obtaining a description text of the entity; segmenting the description text to obtain at least one text label of the entity, each text label including a word obtained after the segmentation process; performing a vectorization operation on the text label to obtain an embedding vector corresponding to the text label.
[0260] For example, Figure 7 As shown in the figure, the text label generation process for an oil barrel includes: shooting Figure 8The oil barrel 501 shown is 9 images from different perspectives. Then the large language model is called to output the description text 405 of the oil barrel "a metal oil barrel" according to the 9 images. The description text is segmented 406 to obtain at least one text label. For example, "a metal oil barrel" will be segmented into: "metal", "oil barrel", representing all the characteristics of the oil barrel. The segmentation can be processed using the large language model, and the embedding model 407 is called to perform vectorization operations on each word in the segmentation result, generate an Embedding vector, and record the Embedding vector indexes corresponding to all the text labels of the oil barrel.
[0261] The embedding vector is the high-dimensional vector data of the text label. By pre-generating the embedding vector of the text label, there is no need to repeatedly generate vectors for the text label of each entity when matching the target entity from the entity set based on the target entity information, which can improve the matching efficiency of the target entity information and the entity information.
[0262] It should be noted that this method does not use the description text directly as the text label, but uses the word segmentation result of the description text as the text label. This is because the description text is usually of different lengths. For longer description texts, their embedding vectors are less effective in actual search and similarity comparison. For example, when searching for "a small blue truck with rusty body" using "truck", "a small blue truck with rusty body" is likely to be ranked after "a car" in the recall results. In fact, for the searched "truck", no matter how complex its additional description is, "truck" should be searched first. Therefore, when performing similarity search, the comparison should be one feature word at a time, not the description text.
[0263] In addition, in order to further extract the visual features of the entity, the method provided in the embodiment of the present application can also further extract the hidden visual features in the image of the entity based on the text label and image of the entity. Taking the first entity as an example, Fig. 9 As shown, the method includes: obtaining at least one perspective image of the first entity 408; obtaining at least one text label of the first entity 409; calling a multimodal model 410, extracting visual features of the first entity based on at least one perspective image and at least one text label of the first entity, and obtaining an image embedding vector 411 of the first entity.
[0264] Since text labels are manually annotated, or generated by a large language model based on human language characteristics; and text labels extracted based on human language habits may ignore some features of the entity. For example, when manually annotating a text label for an oil drum, only more eye-catching text labels such as "metal" and "rusty" may be annotated, while detailed features such as "rusty", "blue", "yellow", and "paint peeling in the lower right corner" are ignored. Therefore, the method provided in the embodiment of the present application also uses a multimodal model based on the text label and entity image of the entity, so that the multimodal model extracts more visual features from it; performs image similarity matching with the target entity based on the visual features to improve the recognition accuracy of the target entity.
[0265] The training method of the multimodal model can be: inputting sample entity images and sample labels into a pre-trained multimodal model, fine-tuning the pre-trained multimodal model according to the loss of the predicted labels and sample labels output by the pre-trained multimodal model, and obtaining a multimodal model that can output visual feature labels based on the input text labels and images, and the visual feature labels include more detailed description texts proposed from the image. For example, the text description of "a metal oil barrel" can only be associated with the two text labels "metal" and "oil barrel", while the Clip (multimodal) model can also identify the hidden visual information in the image from the image of the oil barrel, such as "rusty", "blue", and "yellow" visual feature labels, which are features that do not appear in the text labels. Therefore, combining the Clip model for visual feature search can further improve the accuracy of entity search.
[0266] In an optional embodiment, after obtaining the entity set, the target entity can be matched from the entity set according to the target entity information in the natural language command. Fig.10 As shown, the game application parses the input natural language command 401 to obtain target entity information; performs target entity query 402 based on the preprocessed virtual environment data and the real-time position and orientation of the main virtual character; finds the target entity that is within the field of view of the main virtual character and matches the target entity information from the preprocessed virtual environment data, and then determines the position of the target entity, so as to determine the target movement position of the non-player character.
[0267] In an optional embodiment, if Fig.11 As shown, step 231 may include steps 2311 to 2313. The method may be executed by a terminal or a server.
[0268] Step 2311, parse the natural language command to obtain target entity information; the target entity information includes at least one of the following: entity type, entity name, entity location, entity feature.
[0269] Optionally, the game application calls the large language model to parse the natural language command to obtain target entity information of the target entity, and calls the embedding model to vectorize the target entity information to obtain a target embedding vector of the target entity information.
[0270] For example, if the natural language command is "Come to the blue truck in front", the target entity information that can be parsed by the large language model includes: the direction information "front" and the entity name "blue truck".
[0271] For example, named entity recognition technology in the field of natural language processing can also be used to extract target entity information from natural language commands. Named entity recognition technology is used to identify entities with specific meanings in texts, such as names of people, places, locative words, adjectives, etc.
[0272] For example, Fig.12 As shown, the natural language command 412 is "go to the first floor of the motel and find a paper box behind the red sofa". Using named entity recognition technology, we can identify: the architectural noun "the first floor of the motel"; the object nouns "sofa" and "paper box"; the locative word "behind"; the adjective "red". After logical construction, a hierarchical scene query call form 413 with search type, content, locative word, and constraint information can be formed. Among them, the search type is used to narrow the data retrieval scope based on similarity matching, the search content is a specific entity description, and the adjective will be merged into the description text for query together, and the locative word is used to form a constraint on the search scope. The floor constraint is determined by the player's location. In indoor scenes, the upper and lower ranges need to be narrowed to avoid finding invisible entities across floors.
[0273] Step 2312, calculating the similarity between the target entity information and each entity information in the entity set.
[0274] Exemplarily, the entity set includes entity information of at least one entity, and the entity information of each entity may include at least one of a text embedding vector of a text label and an embedding vector of a visual feature. Then the target entity information may calculate similarity with the text embedding vector and the image embedding vector respectively, and the entity with higher similarity is determined as the target entity.
[0275] The following are methods for similarity matching with text embedding vectors and similarity matching with image embedding vectors.
[0276] 1. Similarity includes the text similarity between the target entity information and the text embedding vector.
[0277] Taking the first entity in the entity set as an example, the game application (client or server) segments the target entity information to obtain at least one target entity tag; converts the at least one target entity tag into at least one target embedding vector; obtains the entity information of the first entity, the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained based on the text tag conversion of the first entity; calculates the text parent similarity between at least one target embedding vector and the text embedding vector respectively, and obtains at least one text parent similarity corresponding to at least one target embedding vector; and determines the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0278] For example, the number of target entity tags is two, target entity tag 1 and target entity tag 2, and the number of entities in the entity set is also two, entity 1 and entity 2. Entity 1 corresponds to text embedding vector 1, and entity 2 corresponds to text embedding vector 2. Then similarity 1 between target entity tag 1 and text embedding vector 1 is calculated, and similarity 2 between target entity tag 2 and text embedding vector 1 is calculated, and the sum of similarity 1 and similarity 2 is determined as the text similarity between the target entity information and entity 1. Similarity 3 between target entity tag 1 and text embedding vector 2 is calculated, and similarity 4 between target entity tag 2 and text embedding vector 2 is calculated, and the sum of similarity 3 and similarity 4 is determined as the text similarity between the target entity information and entity 2.
[0279] Exemplarily, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector; the game application calculates the text sub-similarity between the first target embedding vector and the at least one text embedding vector respectively to obtain at least one text sub-similarity; the highest value of the at least one text sub-similarity is determined as the text parent similarity corresponding to the first target embedding vector.
[0280] For example, the number of target entity tags is 1: target entity tag 1. The number of entities in the entity set is also 1: entity 1. Entity 1 corresponds to text embedding vector 1 and text embedding vector 3. Then the similarity 1 between target entity tag 1 and text embedding vector 1 is calculated, and the similarity 5 between target entity tag 1 and text embedding vector 3 is calculated, and the larger value of similarity 1 and similarity 5 is determined as the similarity between the target entity information (target entity tag 1) and entity 1.
[0281] For example, for the input target entity information "blue car", the target entity information is first segmented into target entity labels "blue" and "car", which means that the queried target entity has two features. Then each feature is calculated with each entity in the entity set for similarity, and each feature takes the maximum similarity. Finally, the sum of the similarity scores corresponding to all query features is taken, which represents the text similarity between the target entity information and the queried entity.
[0282] like Fig.13 As shown, the target entity information includes two target entity labels "blue" and "car", and the two target entity labels are converted into two target embedding vectors. Then the entity information in the entity set is obtained. For example, the entity set includes entity 1 and entity 2. The text labels of entity 1 include "metal", "old", "car", "truck", "blue", and "broken", and the text labels of entity 2 include "metal", "scratches", "car", "broken", "money transporter", and "black".
[0283] Calculate the text similarity between the target entity information and entity 1: first calculate the similarity between the target entity label "blue" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "blue" and the text label "blue" of entity 1 is 1 (1 is the maximum value); then calculate the similarity between the target entity label "car" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "car" and the text label "car" of entity 1 is 1. Then sum the two similarities of the target entity labels "car" and "blue" to obtain the final similarity between the target entity information and entity 1, which is 2.
[0284] Similarly, calculate the text similarity between the target entity information and entity 2: first calculate the similarity between the target entity label "blue" and each text label of entity 2, and take the maximum value. For example, the similarity between the target entity label "blue" and the text label "black" of entity 1 is 0.91; then calculate the similarity between the target entity label "car" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "car" and the text label "car" of entity 2 is 1 (1 is the maximum value). Then sum the two similarities of the target entity labels "car" and "blue" to obtain the final similarity between the target entity information and entity 2, which is 1.91.
[0285] It can be seen that the similarity between the target entity information and entity 1 is 2, which is higher than the similarity between the target entity information and entity 2, which is 1.91.
[0286] 2. The similarity includes the image similarity between the target entity information and the image embedding vector.
[0287] Taking the first entity in the entity set as an example, the game application (client or server) segments the target entity information to obtain at least one target entity tag; converts the at least one target entity tag into at least one target embedding vector; obtains the entity information of the first entity, the entity information includes an image embedding vector, and the image embedding vector is an embedding vector obtained based on the image extraction of the first entity; calculates the image parent similarity of at least one target embedding vector and the text embedding vector respectively, and obtains at least one image parent similarity corresponding to the at least one target embedding vector; and determines the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0288] For example, the number of target entity tags is two, target entity tag 1 and target entity tag 2, and the number of entities in the entity set is also two, entity 1 and entity 2. Entity 1 corresponds to image embedding vector 1, and entity 2 corresponds to image embedding vector 2. Then similarity 1 between target entity tag 1 and image embedding vector 1 is calculated, and similarity 2 between target entity tag 2 and image embedding vector 1 is calculated, and the sum of similarity 1 and similarity 2 is determined as the image similarity between the target entity information and entity 1. Similarity 3 between target entity tag 1 and image embedding vector 2 is calculated, and similarity 4 between target entity tag 2 and image embedding vector 2 is calculated, and the sum of similarity 3 and similarity 4 is determined as the image similarity between the target entity information and entity 2.
[0289] Exemplarily, the entity information of the first entity includes at least one image embedding vector; at least one target embedding vector includes a first target embedding vector; the game application calculates the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity; and the highest value of the at least one image sub-similarity is determined as the image parent similarity corresponding to the first target embedding vector.
[0290] For example, the number of target entity tags is 1: target entity tag 1. The number of entities in the entity set is also 1: entity 1. Entity 1 corresponds to image embedding vector 1 and image embedding vector 3. Then the similarity 1 between target entity tag 1 and image embedding vector 1 is calculated, and the similarity 5 between target entity tag 1 and image embedding vector 3 is calculated, and the larger value of similarity 1 and similarity 5 is determined as the similarity between the target entity information (target entity tag 1) and entity 1.
[0291] In an optional embodiment, the target image embedding vector may be used for calculating the image similarity, that is, the target image embedding vector is used instead of the target embedding vector in the above method. The target image embedding vector may be obtained by: segmenting the target entity information to obtain at least one target entity tag; inputting at least one target entity tag into a multimodal model to obtain a target image embedding vector.
[0292] like Fig.14 As shown in the figure, based on the target entity information "red door", through image similarity search, many features that do not exist in the text tags can be found. For example, the "red" feature does not exist in many text tags of "red door" entities, but through image similarity search, entities with red door features can still be searched and images of these entities can be returned. For example, Fig.14 (1) in the figure is a wooden door, and the image similarity is 0.4898; Fig.14 (2) in the figure is a door made of wood, and the image similarity is 0.4895; Fig.14 (3) in is a metal door, and the image similarity is 0.4539; Fig.14 (4) in the figure is a rusty metal door, and the image similarity is 0.4494; Fig.14 (5) in the figure is a rusty metal door, and the image similarity is 0.4605; Fig.14 (6) is a door frame made of wood, with a crossbeam on the top of the door, a column on each side of the door, and a crossbeam on the top of the column. The image similarity is 0.4581; Fig.14 (7) in the figure is a rusty metal door with a rectangular window in the middle. The image similarity is 0.4439. Fig.14 (8) is a rusty metal door, and the image similarity is 0.4439.
[0293] 3. Similarity includes text similarity and image similarity.
[0294] When the first entity and the target entity have corresponding text similarity and image similarity, the game application determines an average value of the text similarity and the image similarity as the similarity between the first entity and the target entity.
[0295] Alternatively, when the first entity and the target entity have corresponding text similarity and image similarity, the larger value of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
[0296] Alternatively, when the first entity and the target entity have corresponding text similarity and image similarity, the sum of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
[0297] Alternatively, the weighting coefficients of the text similarity and the image similarity are preset. When the first entity and the target entity have corresponding text similarity and image similarity, the weighted average of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity. In addition, different weighting coefficients can be configured for different types of entities. For example, when there are entities in the virtual environment that are easily confused in appearance but have large differences in text expression (such as microwave ovens and safes), players may confuse the two and misidentify them. When calculating the similarity of such entities, the weight of the image similarity is configured higher, which makes it easier to accurately judge the user's true intentions.
[0298] Step 2313, determine the target entity from the entity set based on the similarity and environmental perception information.
[0299] In an optional embodiment, if Fig.15 As shown, the game application first performs a similarity search 414 based on the target entity information, obtains at least one candidate entity with a high similarity, and sorts them according to the similarity; then, based on the position, position, direction and other information of the main virtual character and / or the non-player character, the game application performs perceptual filtering and sorting 415, and finally obtains the target entity.
[0300] In an optional embodiment, the game application determines a search range based on environmental perception information; and filters the entities perceived within the search range based on similarity to obtain the target entity.
[0301] Wherein, determining the search range according to the environmental perception information may include at least one of the following:
[0302] According to the position and orientation of the main control virtual character, the visual field of the main control virtual character is determined as the search range;
[0303] According to the position of the main control virtual character, the hearing range of the main control virtual character is determined as the search range;
[0304] Determine the detection range of the perception virtual props used by the main control virtual character as the search range;
[0305] According to the position and orientation of the non-player character, the field of view of the non-player character is determined as the search range;
[0306] According to the position of the non-player character, the hearing range of the non-player character is determined as the search range;
[0307] Determine the detection range of the perception virtual props used by the non-player character as the search range;
[0308] According to the position of the main virtual character, the direction of the main virtual character, the position of the non-player character, and the direction of the non-player character, the overlapping part of the visual range of the main virtual character and the non-player character is determined as the search range;
[0309] According to the position of the main control virtual character and the position of the non-player character, the overlapping part of the hearing range of the main control virtual character and the non-player character is determined as the search range.
[0310] In another optional embodiment, the game application determines the search range according to the target entity information and the environmental perception information; and obtains the target entity by filtering the entities perceived within the search range according to the similarity.
[0311] For example, in the case where the target entity information includes the location information of the target entity; according to the location information of the target entity, and at least one of the visual range, hearing range, and virtual item search range of the controlling virtual character and / or the non-player character indicated by the environmental perception information, the search range is determined, and the search range is the estimated range of the target entity that can be perceived by the target virtual character and / or the non-player character. Exemplarily, the game application determines the perception range according to the environmental perception information, and the perception range includes at least one of the following: the visual range of the controlling virtual character, the hearing range of the controlling virtual character, the visual range of the non-player character, the hearing range of the non-player character, and the detection range of the perceived virtual item; the area within the perception range that matches the location information is determined as the search range.
[0312] Alternatively, the game application determines x entities with the highest similarity from the entity set according to the similarity to form a candidate entity list; determines the search range according to the target entity information and the environmental perception information, and determines the entity in the search range among the x entities as the target entity. x is a positive integer.
[0313] Exemplarily, the game application determines the entity with the highest similarity in the search range as the target entity.
[0314] It should be noted that when there are multiple entities with equal similarity within the search range, the multiple entities can be sorted according to the distance between the entity and the master virtual character. For example, when there are at least two entities with the highest similarity in the search range, the entity with the highest similarity in the search range and the closest distance to the master virtual character is determined as the target entity.
[0315] Exemplarily, when the natural language command includes a fuzzy position description of the target entity, the game application can perform text matching based on the entity position recorded in the entity set and the position described in the natural language command, and query to obtain the target entity whose position is more consistent with the natural language command. When the target entity information includes the location information of the target entity, the game application can call the large language model to generate a real-time relative position description of each entity based on the position of each entity recorded in the entity set, the current position of the main virtual character and / or the non-player character. The real-time relative position description is used to describe the relative position relationship between the entity and the main virtual character / non-player character. The text similarity calculated by the game application includes the similarity between the position information and the real-time relative position description.
[0316] For example, Fig.16 As shown, the search range is determined according to the position and direction of the main control virtual character 416. For example, the target entity information indicates that the target entity is located in front of the main control virtual character, and the following can be constructed: Fig.16 The search range shown is a fan-shaped area of a certain visual field in front of the main virtual character; entities that are not within the fan-shaped range are filtered out. Then, the entities are sorted according to the similarity. When there are two entities with the highest and equal similarity scores within the search range, that is, the similarity scores of entity 2 and entity 3 are both 2 points, entity 2, which is closer to the main virtual character, is selected as the target entity.
[0317] In an optional embodiment, the game application determines the entity with the highest similarity within the search range and above the threshold as the target entity. Exemplarily, the number of the search range is at least one. For example, the search range includes at least one of the following: the visual range of the main virtual character, the auditory range of the main virtual character, the search range of the perceived virtual props of the main virtual character, the visual range of the non-player character, the auditory range of the non-player character, and the search range of the perceived virtual props of the non-player character.
[0318] Exemplarily, the game application may sequentially traverse at least one of the above-mentioned search ranges, or the game application may sequentially traverse at least one search range determined according to the natural language command. For example, if the natural language command is "Can you see the truck in front? Move to the truck", the game application may first traverse the visual range of the main virtual character, and then traverse the visual range of the non-player character, and match the entity with the highest similarity and above the threshold.
[0319] Exemplarily, when there are at least two search ranges, the traversal order of the at least two search ranges may be preset, or the traversal order of the at least two search ranges may be determined according to the intention indicated in the natural language command. For example, when the intention is to search for an item, the visual range is traversed first. When the intention is to search for a combat scene, the auditory range is traversed first.
[0320] If there are multiple levels of nested instructions in the natural language command, the first target entity will be searched first, and then the next target entity will be searched based on the position of the previous target entity. In the case where the natural language command includes a second target entity determined based on the position of the first target entity, the first target entity is queried from the entity set of the virtual environment based on the first target entity information and environmental perception information of the first target entity indicated by the natural language command; then the second target entity is queried from the entity set of the virtual environment based on the second target entity information, the first target entity and environmental perception information of the second target entity.
[0321] The multi-level nested instruction refers to a natural language command including at least two entities, at least one of the at least two entities is used as a reference entity, and the reference entity is used to determine the target entity. That is, the reference entity is used to limit the target entity.
[0322] For example, the natural language command describes the positional relationship between the reference entity and the target entity. For example, if the natural language command is "move to the blue car behind the red car", the red car is the reference entity, the blue car is the target entity, and the target entity is located behind the reference entity.
[0323] Alternatively, the natural language command describes the similarity between the reference entity and the target entity. For example, if the natural language command is "Find out if there are any other red treasure chests nearby", then the reference entity is the red treasure chest that the controlling virtual character can currently see, and the target entity is a nearby red treasure chest that has not been discovered by the controlling virtual character. The target entity and the reference entity have the same appearance.
[0324] Exemplarily, the target entity information includes reference entity information of a reference entity, and the reference entity is used to refer to determine the target entity; the game application queries and obtains the reference entity from the entity set based on the reference entity information and environmental perception information; and queries and obtains the target entity from the entity set based on the reference entity, the target entity information and environmental perception information.
[0325] For example, the target entity information includes: reference entity information, the positional relationship between the reference entity and the target entity, and the feature text of the target entity; the game application calculates the similarity between the feature text and each entity information in the entity set; determines the search range based on the environmental perception information; and obtains the target entity by filtering the entities in the entity set that are within the search range based on the similarity and positional relationship.
[0326] Optionally, the target entity information may include reference entity information of n reference entities, and the i-th reference entity among the n reference entities is used to determine / limit the i+1-th reference entity, where n is an integer greater than 1 and i is a positive integer less than n. Then, the game application queries and obtains the i-th reference entity from the entity set based on the reference entity information and environmental perception information of the i-th reference entity; queries and obtains the i+1-th reference entity from the entity set based on the reference entity information and environmental perception information of the i-th reference entity and the i+1-th reference entity, until the n-th reference entity is queried; queries and obtains the target entity from the entity set based on the n-th reference entity, the target entity information and environmental perception information.
[0327] For example, Fig.17 As shown, when the natural language command is "go to the broken car on the left of the red truck in front", the game application will find the nearest red truck 503 based on the position and orientation of the main control virtual character, and then find the nearest car wreck 504 on the left of the red truck 503.
[0328] Step 232 , according to the intention of the natural language command, control the non-player character to perform an activity associated with the target entity.
[0329] Exemplarily, a large language model is called to identify the intent of a natural language command, a control instruction or a control instruction sequence is generated according to the intent, and a non-player character is controlled to complete an activity based on a target entity according to the control instruction or the control instruction sequence.
[0330] In summary, the method provided in this embodiment proposes a game scene perception and query method based on deep learning, which can initiate query positioning within the spatial range of the game scene in the form of natural language. Combining the pre-built static game scene data with the real-time game data, a method for controlling non-player characters is provided. For example, if the player inputs: "surround the house in front", "hide behind this stone", the method can parse the entity position of the "house" and "stone" based on the player's current position, and move the non-player character to a reasonable position next to the entity. In addition, the method can also adapt to complex and ambiguous instructions, such as: "go to the red truck inside the house", "go upstairs", etc.
[0331] The method provided in this embodiment is applied to the voice command of non-player characters in shooting games, and can complete the scheduling function of thousands of target positions in the game scene. It can adapt to any text instructions input by the player, parse the action mode of the non-player character, and the target position to be reached, where the action mode corresponds to the fixed instructions of the traditional solution, and the position to be reached is the fine control of the non-player character, and finally realize accurate and complex control of the non-player character.
[0332] The method provided in this embodiment can greatly enhance the gaming experience of players controlling non-player characters. Players can issue arbitrary instructions and command teammates to complete the dispatch of thousands of target positions in the game scene, with a high degree of freedom. At the same time, compared with the solutions of related technologies, which require the design of complex comparative game logic to complete the control of non-player characters, this solution can save a lot of game design and development costs.
[0333] An exemplary embodiment of the present application provides a method for controlling a virtual character. The method comprises:
[0334] Displaying at least one of a main control virtual character and an NPC in a virtual environment;
[0335] Exemplarily, the main virtual character is a virtual character that the user directly controls in the virtual environment. There are also one or more non-player characters (NPC) in the virtual environment; the NPC and the main virtual character belong to the same virtual camp and are teammates of the main virtual character. The NPC follows the main virtual character in the virtual environment. In addition, the NPC can also be a follower character, a pet character, etc. controlled by the main virtual character. In addition, the NPC can also be a neutral character, and only cooperates with the main virtual character when certain conditions are met.
[0336] Obtain natural language commands;
[0337] Exemplarily, the natural language command includes the natural semantics of commanding the NPC; the NPC is commanded in the virtual scene through the natural language command, and the natural language command can be directly input by the user or extracted from the voice information input by the user. The present application does not limit the method of obtaining the natural language command.
[0338] The natural language command includes at least one of a behavior intention and a scene entity; the behavior intention is used to indicate the type of virtual activity performed by the NPC, such as indicating what type of virtual activity is performed in the virtual environment; the scene entity includes a first scene object, such as indicating what scene object in the virtual environment the virtual activity is performed on. The behavior intention and scene entity included in the natural language command are partial words in the natural language command.
[0339] In one example, the natural language command controls the NPC in terms of what type of virtual activity to perform and for what scene object in the virtual environment to perform the virtual activity; it is a complex instruction to control the NPC.
[0340] Controlling NPCs to perform virtual activities in response to natural language commands;
[0341] Exemplarily, controlling the NPC to perform virtual activities is determined based on the environmental perception information of the main virtual character and / or NPC. In some examples, the main virtual character and / or NPC obtains environmental perception information within the search range of perception methods such as vision, hearing, and movement trajectory. Exemplarily, the virtual activity is close to the current perception of the virtual environment by the main virtual character and / or NPC, and the NPC is controlled with reference to the current perception of the virtual character and / or NPC of the virtual environment. Exemplarily, the NPC has autonomous behavior capabilities, and the user only directs the NPC. The user gives commands, and the NPC understands and executes the commands based on its own autonomous behavior capabilities.
[0342] To sum up, the method provided in this embodiment determines the virtual activities that need to be performed by facing complex instructions for controlling the NPC in terms of what type of virtual activities to perform and for what scene objects in the virtual environment to perform the virtual activities, with reference to the environmental perception information of the master virtual character and / or the NPC; and ensures that the NPC and the master virtual character perform virtual activities in collaboration with each other by using the environmental perception information of the master virtual character and / or the NPC as a reference.
[0343] Fig.18 A flowchart of a method for controlling a virtual character provided by an exemplary embodiment of the present application is shown. The method comprises:
[0344] Step 201: Acquire a spatial data set;
[0345] The spatial dataset of the virtual environment includes visual labels of scene objects, and the visual labels are used to describe the visual characteristics of the scene objects in at least one dimension, such as describing the scene objects in dimensions such as material, transparency, color, and shape.
[0346] Step 202: displaying at least one of a main control virtual character and an NPC in a virtual environment;
[0347] Exemplarily, the main control virtual character is a virtual character that the user directly controls in the virtual environment. There are also one or more NPCs in the virtual environment; the NPCs and the main control virtual character belong to the same virtual camp and are teammates of the main control virtual character.
[0348] Step 203: Acquire a natural language command in voice form;
[0349] The natural language command includes natural semantics for commanding the NPC, and the command information includes behavioral intention and scene entity; the behavioral intention is used to indicate the type of virtual activity performed by the NPC, and the scene entity is used to indicate the target entity of the virtual activity;
[0350] Step 204: converting the natural language command in voice form into the natural language command in text form;
[0351] Exemplarily, speech-to-text (Automatic Speech Recognition, ASR) processing is performed on the natural language command in the form of speech to determine the natural language command in the form of text. Speech-to-text processing generally includes calling components such as acoustic models and language models to recognize the pronunciation, vocabulary, grammatical structure and other information of the natural language command in the form of speech, and convert it into a natural language command in the form of text.
[0352] Step 205: performing intent recognition on the natural language command to obtain a first classification label;
[0353] Exemplarily, the first intention indication corresponding to the first classification label includes a command intention for a non-player character on an intention dimension; for example, at least one of the following: indicating which of a plurality of non-player characters the non-player character commanded by the command text is, indicating whether the virtual activity performed by the non-player character is related to initiating a virtual attack, and indicating what kind of virtual activity the non-player character performs.
[0354] Step 206: Perform entity recognition on the natural language command to obtain a target entity;
[0355] The target entity is determined from the virtual environment in combination with the environmental perception information, which includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment. The target entity may be the entity currently seen by the player, or may be an entity that the player has seen in the past.
[0356] Step 207: In response to the natural language command, the NPC is controlled to perform a virtual activity according to the first intention corresponding to the first classification label, or the NPC is controlled to perform a virtual activity associated with the target entity, or the NPC is controlled to perform a virtual activity associated with the target entity according to the first intention corresponding to the first classification label;
[0357] Exemplarily, the NPC is controlled to perform a virtual activity according to the first classification tag and / or the instruction of the target entity.
[0358] Step 208: reporting the NPC's feedback information;
[0359] Exemplarily, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character and make a broadcast. For example, when the environmental perception information of the non-player character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information that triggers the broadcast condition; or, when the non-player character or the main control virtual character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character.
[0360] The preprocessing stage of step 201 can be implemented as follows:
[0361] Sub-step 1: Obtaining attribute text of scene objects in the virtual scene;
[0362] Exemplarily, attribute text is used to introduce the inherent attributes of scene objects in a virtual scene; on the one hand, attribute text realizes the description of scene objects in a textual mode, and while describing scene objects, it provides semantic information for the prediction of the visual labels of scene objects. On the other hand, attribute text is the description of scene objects in a virtual scene. In the face of a large number of scene objects in a virtual scene and the existence of reused object models, it can more accurately describe the inherent attributes of scene objects in a virtual scene.
[0363] In an optional implementation, the attribute text includes at least one of a name of the scene object in the virtual scene and a size of the scene object in the virtual scene.
[0364] Sub-step 2: obtaining an appearance image of a scene object in a virtual scene;
[0365] Exemplarily, the appearance image is used to describe the style of the scene object; the appearance image carries the appearance style of the scene object such as color, texture, shape, etc., and the relative position relationship between each sub-part in the picture mode, and can fully describe the scene object from the picture mode (or visual mode). In an optional implementation, the appearance image of the scene object includes images obtained by observing the scene object from at least two perspectives.
[0366] Sub-step 3: Call the multimodal model to perform prediction on the attribute text and appearance image of the scene object to obtain the visual label of the scene object;
[0367] Exemplarily, the multimodal model has the ability to perform model prediction on text information and image information of different modalities. In this embodiment, the input parameters of the multimodal model are the attribute text and appearance image of the scene object; the multimodal model predicts the visual label of the scene object from the two modalities of text modality and image modality, and the visual label is used to describe the visual features of the scene object in at least one dimension.
[0368] Optionally, the multimodal model includes a visual question answering model; the question statement carries attribute text of the scene objects; on the one hand, the question statement is used to guide the visual question answering model to convert the appearance image into the visual label of the scene object; on the other hand, while guiding the conversion of the visual label of the scene object, the question statement provides supplementary information of the scene object in text form.
[0369] Get the expected information of scene objects;
[0370] Exemplarily, the expected information is used to indicate the description dimension of the scene object expected in the visual tag, and / or the expected format of the visual tag; in one example, the expected information is used to indicate that the description dimension of the scene object expected in the visual tag includes but is not limited to at least one of the type description, material, transparency, color, surface features, and shape of the scene object. In another example, the expected information is used to indicate that the expected format of the visual tag is at least one of the following: Comma Separated Values (CSV), JavaScript Object Notation (JSON), and eXtensible Markup Language (XML).
[0371] Construct a question statement of the appearance image based on the expected information and attribute text;
[0372] Exemplarily, the first subpart of the question sentence is supplementary introduction information of the scene object, carrying attribute text of the scene object; the second subpart of the question sentence is an answer guidance sentence for the visual question answering model, carrying expected information.
[0373] Optionally, the spatial data set includes matching labels of scene objects in the virtual scene; correspondingly: performing pseudo-spoken rewriting on the visual labels of the scene objects to obtain matching labels that conform to spoken expressions of natural language.
[0374] Exemplarily, as described above, visual labels are used to describe the visual features of scene objects in at least one dimension, and the appearance image of the scene objects presents rich visual features of the scene objects. In the spoken expression of natural language, however, the description of scene objects cannot cover the visual features of scene objects in all dimensions. The purpose of performing a pseudo-colloquial rewrite on the visual labels of scene objects is to obtain a matching label that is closer to the spoken expression; it can be understood that performing a pseudo-colloquial rewrite can be to delete part of the content in the visual label, or to change the visual label to a label with the same semantics but different textual expression.
[0375] In an optional implementation, the pseudo-colloquial rewriting is performed by calling a natural language model; the visual labels of the scene objects are input into the natural language model, and matching labels that conform to the spoken expressions of the natural language are predicted. The pseudo-colloquial rewriting of the visual labels is implemented based on calling the natural language model. Exemplarily, the natural language model carries prior knowledge of the spoken expressions of the natural language. For example, the natural language model is implemented as a large language model (Large Language Model, LLM).
[0376] Optionally, the spatial dataset also includes spatial information of scene objects, and accordingly, also includes:
[0377] The spatial position of the scene object in the virtual scene is obtained, and the spatial position of the scene object is determined as auxiliary information of the visual label of the scene object.
[0378] Exemplarily, the spatial position of the scene object in the virtual scene is used to indicate the deployment of the scene object in the virtual scene, and the spatial information is used to indicate the position, size and other information of the scene object in the virtual scene after the scene object is deployed in the virtual scene.
[0379] Further, obtaining at least one of the coordinate position, orientation information, bounding box information, and cover point information of the scene object in the virtual scene;
[0380] Among them, the coordinate position (Location) is used to indicate the position of the scene object in the virtual scene, such as the coordinate information of the center point or preset point of the scene object in the virtual scene; the orientation (Rotation) is used to indicate the direction facing the scene object in the virtual scene, such as the direction facing the front of the scene object in the virtual scene; the bounding box (BoundingBox) is used to indicate the size of the scene object in the virtual scene; the cover points (Cover points) are used to indicate the recommended virtual character position points when the virtual character approaches the scene object, so that the scene object can mask the virtual character.
[0381] The intention recognition phase of step 205 can be implemented as follows:
[0382] Sub-step 4: calling at least one hierarchical prediction network to perform intent recognition on the natural language command, and obtaining a first classification label of the natural language command intent to command the NPC;
[0383] Exemplarily, the hierarchical prediction network has the ability to predict the classification label corresponding to the command text. Exemplarily, the hierarchical prediction network includes at least two layers of sub-networks, the upper network and the lower network are cascaded, and the lower network further performs the prediction of the classification label according to the prediction result output by the upper network. At least two layers of sub-networks are constructed based on the tree structure of multiple classification labels. The hierarchical prediction network constructs at least two layers of sub-networks corresponding to the hierarchical structure for the tree structure of the classification labels, and splits the prediction task of a wide variety of classification labels into prediction sub-tasks performed by at least two layers of sub-networks, so as to reduce the complexity of classification prediction of each layer of sub-network.
[0384] In an optional implementation, each hierarchical prediction network in at least one hierarchical prediction network is used to predict the command intention of the command text for a non-player character on an intention dimension; the intention dimension includes: at least one of the subject dimension, the semantic dimension, and the behavior dimension. Exemplarily, in at least one hierarchical prediction network, the i-th layer subnetwork in each hierarchical prediction network is used to predict the first-level behavior label of the command text on an intention dimension, and the i+1-th layer subnetwork in the hierarchical prediction network is used to predict the second-level behavior label corresponding to the command text in the first-level behavior label, i is a positive integer; the high-level behavior label (such as the first-level behavior label) predicted by the high-level subnetwork (such as the i-th layer subnetwork) in the hierarchical prediction network includes multiple sublabels, or subordinate lower-level labels; the corresponding low-level subnetwork (such as the i+1-th layer subnetwork) needs to be called to further perform classification prediction (such as predicting the second-level behavior label). The prediction task of a wide variety of classification labels is split into prediction subtasks performed by at least two layers of subnetworks to reduce the complexity of classification prediction of each layer of subnetwork.
[0385] Furthermore, the intent dimension includes a subject dimension, the hierarchical prediction network includes a hierarchical subject prediction network, and the subject prediction network has the ability to predict the subject type in a natural language command; the subject type is used to indicate the identity of the NPC commanded by the natural language command; exemplarily, the subject prediction network is used to predict which of a plurality of non-player characters the non-player character commanded by the command text is, and the number of non-player characters commanded by the command text can be one or more.
[0386] That is, the game application inputs the natural language command into the subject prediction network to obtain the subject type output by the network, and the subject type is used to determine the subject of the action execution indicated in the natural language command. Optionally, the game application can also determine the NPC directed by the natural language command, that is, the subject of the action execution, based on the subject type output by the subject prediction network and the environmental perception information. For example, the NPC of the subject type closest to the main virtual character is determined as the subject of the action execution according to the environmental perception information; or, the NPC of the subject type within the field of view of the main virtual character is determined as the subject of the action execution according to the environmental perception information; or, the NPC of the subject type that is the visual focus of the main virtual character is determined as the subject of the action execution according to the environmental perception information.
[0387] And / or, the intent dimension includes a semantic dimension, the hierarchical prediction network includes a hierarchical semantic prediction network, the semantic prediction network has the ability to predict the semantic type in a natural language command; the semantic type is used to indicate the NPC's control method for initiating a virtual attack; exemplarily, the subject prediction network is used to predict whether the virtual activity performed by a non-player character commanded by the command text is related to initiating a virtual attack.
[0388] And / or, the intention dimension includes a behavior dimension, the hierarchical prediction network includes a hierarchical behavior prediction network, the behavior prediction network has the ability to predict the behavior intention type in the natural language command; the behavior intention type is used to indicate the behavior mode of the NPC for performing the virtual activity. Exemplarily, the behavior prediction network is used to predict what virtual activity the non-player character performs.
[0389] Accordingly, in step 207, in response to the natural language command, the NPC is controlled to perform a virtual activity according to the first intention corresponding to the first classification label;
[0390] Exemplarily, the first intention corresponding to the first classification tag indicates a command intention for a non-player character in an intention dimension, such as at least one of the following: indicating which non-player character is commanded by the command text among a plurality of non-player characters, indicating whether the virtual activity performed by the non-player character is related to launching a virtual attack, and indicating what virtual activity the non-player character performs. According to the instruction of the first classification tag, the NPC is controlled to perform the virtual activity.
[0391] The target entity identification process of step 206 can be implemented as follows:
[0392] Sub-step 5: querying and obtaining the target entity from the entity set of the virtual environment according to the target entity information of the target entity indicated by the natural language command and the environment perception information;
[0393] The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by the main virtual character and / or the non-player character from the virtual environment.
[0394] Since the target entity information in natural language commands is usually vague, for example, a natural language command may be "move to the red truck", where the target entity information is "red truck", and there may be many red trucks in the virtual environment. It is impossible to accurately determine the target entity in the virtual environment based solely on the target entity information in the natural language command.
[0395] Therefore, the embodiment of the present application provides a method for determining the target entity by combining the target entity information and the environmental perception information. For the previous example, the "red truck" expressed by the player in the natural language command should be a red truck that the player can see. Therefore, combined with the field of view of the main control virtual character, the red truck within the field of view of the main control system character can be screened out from the multiple red trucks in the virtual environment. The red truck is the target entity indicated by the player in the natural language command.
[0396] Since natural language commands are issued by players based on their perception of the virtual environment, in order to accurately identify the target entity indicated in the natural language command, the game application will combine the environmental perception information when the player issues the natural language command to identify the target entity in the natural language command. Based on the player's perception of the virtual environment, the entity that the player can perceive in the virtual environment and is closest to the target entity information is inferred as the target entity.
[0397] Exemplarily, the virtual environment includes multiple candidate entities that match the natural language command, and the target entity is an entity selected from the multiple candidate entities based on the environmental perception information of the main virtual character or the non-player character. For example, the game application first selects multiple candidate entities that match the target entity information in the natural language command from the entity set, and then selects the entity that can be perceived by the main virtual character or the non-player character from the multiple candidate entities as the target entity based on the environmental perception information.
[0398] For example, the environmental perception information of the main virtual character may include: the pictures or entities that the main virtual character can see when observing the virtual environment, the environmental sound effects that the main virtual character can hear, the source direction of the environmental sound effects, the type and volume of the environmental sound effects, the perception information obtained by the main virtual character through the use of perception skills (for example, visual information, auditory information, sound wave information, light reflection information, etc.), and the perception information obtained by the main virtual character through the use of perception virtual props (for example, the sensor signal of the sensor, the positioning signal of the positioning props, etc.).
[0399] The environmental perception information of the non-player character may include: the images or entities that the non-player character can see when observing the virtual environment, the environmental sounds that the non-player character can hear, the source direction of the environmental sounds, the type and volume of the environmental sounds, the perception information obtained by the non-player character through the use of perception skills (for example, visual information, auditory information, sound wave information, light reflection information, etc.), and the perception information obtained by the non-player character through the use of perception virtual props (for example, sensor signals of sensors, positioning signals of positioning props, etc.).
[0400] It should be noted that the environmental perception information may include the information perceived by the controlling virtual character and the non-player character in real time when receiving the natural language command, and may also include the information perceived by the controlling virtual character and the non-player character in history before receiving the natural language command. That is, the target entity may be the entity currently seen by the player, or it may be the entity that the player has seen in the past. Therefore, the game application needs to combine the real-time environmental perception information and the historical environmental perception information of the controlling virtual character and / or the non-player character to identify the target entity.
[0401] For example, when the natural language command is "Let's go back to the hotel we just passed by", the game application needs to query the hotels that the main virtual character has passed by based on the historical environmental perception information of the main virtual character.
[0402] In an optional embodiment, the client queries and obtains the target entity from the entity set of the virtual environment according to the target entity information and the environment perception information indicated by the natural language command. In another optional embodiment, the client reports the natural language command to the server, and the server queries and obtains the target entity from the entity set of the virtual environment according to the target entity information and the environment perception information indicated by the natural language command.
[0403] Optionally, the game application infers the target entity based on the target entity information, the environment perception information and the pre-processed virtual environment data, wherein the pre-processed virtual environment data includes a set of entities in the virtual environment.
[0404] The entity set includes entity information of each entity in the virtual environment. The entity information includes at least one of the following: name, type, location, feature, text label, embedding vector of text label, image, embedding vector of image.
[0405] The text label may be at least one word obtained after segmenting a feature (for example, a descriptive text of an entity appearance), and the embedding model is called to obtain an embedding vector corresponding to each text label.
[0406] The image may include an image obtained by observing a three-dimensional model of the entity from at least one direction, for example, the image may include three views of the entity. The embedding vector of the image is the embedding vector of the visual feature label. The visual feature label is obtained by calling the multimodal model to perform feature recognition based on the image and text label of the entity.
[0407] Exemplarily, the entity set includes a first type of entity and a second type of entity, the first type of entity includes at least one of an area and a building, and the second type of entity includes a physical object. The text labels of the first type of entity are obtained by manual labeling. For example, the text label of a room of a building is manually labeled as: an area, a building, a floor, and a room. The text labels of the second type of entity are automatically generated by calling a large language model.
[0408] The method for generating text labels for the second type of entity may include: obtaining at least one image of the entity, inputting the at least one image into a large language model, and obtaining a description text of the entity; segmenting the description text to obtain at least one text label of the entity, each text label including a word obtained after the segmentation process; performing a vectorization operation on the text label to obtain an embedding vector corresponding to the text label.
[0409] The embedding vector is the high-dimensional vector data of the text label. By pre-generating the embedding vector of the text label, there is no need to repeatedly generate vectors for the text label of each entity when matching the target entity from the entity set based on the target entity information, which can improve the matching efficiency of the target entity information and the entity information.
[0410] It should be noted that this method does not use the description text directly as the text label, but uses the word segmentation result of the description text as the text label. This is because the description text is usually of different lengths. For longer description texts, their embedding vectors are less effective in actual search and similarity comparison. For example, when searching for "a small blue truck with rusty body" using "truck", "a small blue truck with rusty body" is likely to be ranked after "a car" in the recall results. In fact, for the searched "truck", no matter how complex its additional description is, "truck" should be searched first. Therefore, when performing similarity search, the comparison should be one feature word at a time, not the description text.
[0411] In addition, in order to further extract the visual features of the entity, the method provided in the embodiment of the present application can also further extract the hidden visual features in the image of the entity based on the text label and image of the entity. Taking the first entity as an example, the method includes: obtaining at least one perspective image of the first entity; obtaining at least one text label of the first entity; calling the multimodal model to extract the visual features of the first entity based on at least one perspective image and at least one text label of the first entity, and obtain the image embedding vector of the first entity.
[0412] Since text labels are manually annotated, or generated by a large language model based on human language characteristics; and text labels extracted based on human language habits may ignore some features of the entity. For example, when manually annotating a text label for an oil drum, only more eye-catching text labels such as "metal" and "rusty" may be annotated, while detailed features such as "rusty", "blue", "yellow", and "paint peeling in the lower right corner" are ignored. Therefore, the method provided in the embodiment of the present application also uses a multimodal model based on the text label and entity image of the entity, so that the multimodal model extracts more visual features from it; performs image similarity matching with the target entity based on the visual features to improve the recognition accuracy of the target entity.
[0413] The training method of the multimodal model can be: inputting sample entity images and sample labels into a pre-trained multimodal model, fine-tuning the pre-trained multimodal model according to the loss of the predicted labels and sample labels output by the pre-trained multimodal model, and obtaining a multimodal model that can output visual feature labels based on the input text labels and images, and the visual feature labels include more detailed description texts proposed from the image. For example, the text description of "a metal oil barrel" can only be associated with the two text labels "metal" and "oil barrel", while the Clip (multimodal) model can also identify the hidden visual information in the image from the image of the oil barrel, such as "rusty", "blue", and "yellow" visual feature labels, which are features that do not appear in the text labels. Therefore, combining the Clip model for visual feature search can further improve the accuracy of entity search.
[0414] In an optional embodiment, the game application may query the target entity using the following method.
[0415] (1) Parse the natural language command to obtain target entity information; the target entity information includes at least one of the following: entity type, entity name, entity location, and entity feature.
[0416] Optionally, the game application calls the large language model to parse the natural language command to obtain target entity information of the target entity, and calls the embedding model to vectorize the target entity information to obtain a target embedding vector of the target entity information.
[0417] For example, if the natural language command is "Come to the blue truck in front", the target entity information that can be parsed by the large language model includes: the direction information "front" and the entity name "blue truck".
[0418] For example, named entity recognition technology in the field of natural language processing can also be used to extract target entity information from natural language commands. Named entity recognition technology is used to identify entities with specific meanings in texts, such as names of people, places, locative words, adjectives, etc.
[0419] For example, if the natural language command is "Go to the first floor of the motel and find a paper box behind the red sofa", the named entity recognition technology can identify: the architectural noun "the first floor of the motel"; the object nouns "sofa" and "paper box"; the locative word "behind"; the adjective "red". After logical construction, a hierarchical scene query call form with search type, content, locative word, and constraint information can be formed. Among them, the search type is used to narrow the data retrieval scope based on similarity matching, the search content is a specific entity description, and the adjective will be merged into the description text for query together, and the locative word is used to form a constraint on the search scope. The floor constraint is determined by the player's location. In indoor scenes, the upper and lower ranges need to be narrowed to avoid finding invisible entities across floors.
[0420] (2) Calculate the similarity between the target entity information and each entity information in the entity set.
[0421] Exemplarily, the entity set includes entity information of at least one entity, and the entity information of each entity may include at least one of a text embedding vector of a text label and an embedding vector of a visual feature. Then the target entity information may calculate similarity with the text embedding vector and the image embedding vector respectively, and the entity with higher similarity is determined as the target entity.
[0422] The following are methods for similarity matching with text embedding vectors and similarity matching with image embedding vectors.
[0423] 1) Similarity includes the text similarity between the target entity information and the text embedding vector.
[0424] Taking the first entity in the entity set as an example, the game application (client or server) segments the target entity information to obtain at least one target entity tag; converts the at least one target entity tag into at least one target embedding vector; obtains the entity information of the first entity, the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained based on the text tag conversion of the first entity; calculates the text parent similarity between at least one target embedding vector and the text embedding vector respectively, and obtains at least one text parent similarity corresponding to at least one target embedding vector; and determines the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0425] For example, the number of target entity tags is two, target entity tag 1 and target entity tag 2, and the number of entities in the entity set is also two, entity 1 and entity 2. Entity 1 corresponds to text embedding vector 1, and entity 2 corresponds to text embedding vector 2. Then similarity 1 between target entity tag 1 and text embedding vector 1 is calculated, and similarity 2 between target entity tag 2 and text embedding vector 1 is calculated, and the sum of similarity 1 and similarity 2 is determined as the text similarity between the target entity information and entity 1. Similarity 3 between target entity tag 1 and text embedding vector 2 is calculated, and similarity 4 between target entity tag 2 and text embedding vector 2 is calculated, and the sum of similarity 3 and similarity 4 is determined as the text similarity between the target entity information and entity 2.
[0426] Exemplarily, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector; the game application calculates the text sub-similarity between the first target embedding vector and the at least one text embedding vector respectively to obtain at least one text sub-similarity; the highest value of the at least one text sub-similarity is determined as the text parent similarity corresponding to the first target embedding vector.
[0427] For example, the number of target entity tags is 1: target entity tag 1. The number of entities in the entity set is also 1: entity 1. Entity 1 corresponds to text embedding vector 1 and text embedding vector 3. Then the similarity 1 between target entity tag 1 and text embedding vector 1 is calculated, and the similarity 5 between target entity tag 1 and text embedding vector 3 is calculated, and the larger value of similarity 1 and similarity 5 is determined as the similarity between the target entity information (target entity tag 1) and entity 1.
[0428] For example, for the input target entity information "blue car", the target entity information is first segmented into target entity labels "blue" and "car", which means that the queried target entity has two features. Then each feature is calculated with each entity in the entity set for similarity, and each feature takes the maximum similarity. Finally, the sum of the similarity scores corresponding to all query features is taken, which represents the text similarity between the target entity information and the queried entity.
[0429] For example, the target entity information includes two target entity tags "blue" and "car", and the two target entity tags are converted into two target embedding vectors. Then the entity information in the entity set is obtained. For example, the entity set includes entity 1 and entity 2. The text tags of entity 1 include "metal", "old", "car", "truck", "blue", and "damaged", and the text tags of entity 2 include "metal", "scratches", "car", "damaged", "money transporter", and "black".
[0430] Calculate the text similarity between the target entity information and entity 1: first calculate the similarity between the target entity label "blue" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "blue" and the text label "blue" of entity 1 is 1 (1 is the maximum value); then calculate the similarity between the target entity label "car" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "car" and the text label "car" of entity 1 is 1. Then sum the two similarities of the target entity labels "car" and "blue" to obtain the final similarity between the target entity information and entity 1, which is 2.
[0431] Similarly, calculate the text similarity between the target entity information and entity 2: first calculate the similarity between the target entity label "blue" and each text label of entity 2, and take the maximum value. For example, the similarity between the target entity label "blue" and the text label "black" of entity 1 is 0.91; then calculate the similarity between the target entity label "car" and each text label of entity 1, and take the maximum value. For example, the similarity between the target entity label "car" and the text label "car" of entity 2 is 1 (1 is the maximum value). Then sum the two similarities of the target entity labels "car" and "blue" to obtain the final similarity between the target entity information and entity 2, which is 1.91.
[0432] It can be seen that the similarity between the target entity information and entity 1 is 2, which is higher than the similarity between the target entity information and entity 2, which is 1.91.
[0433] 2) Similarity includes the image similarity between the target entity information and the image embedding vector.
[0434] Taking the first entity in the entity set as an example, the game application (client or server) segments the target entity information to obtain at least one target entity tag; converts the at least one target entity tag into at least one target embedding vector; obtains the entity information of the first entity, the entity information includes an image embedding vector, and the image embedding vector is an embedding vector obtained based on the image extraction of the first entity; calculates the image parent similarity of at least one target embedding vector and the text embedding vector respectively, and obtains at least one image parent similarity corresponding to the at least one target embedding vector; and determines the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0435] For example, the number of target entity tags is two, target entity tag 1 and target entity tag 2, and the number of entities in the entity set is also two, entity 1 and entity 2. Entity 1 corresponds to image embedding vector 1, and entity 2 corresponds to image embedding vector 2. Then similarity 1 between target entity tag 1 and image embedding vector 1 is calculated, and similarity 2 between target entity tag 2 and image embedding vector 1 is calculated, and the sum of similarity 1 and similarity 2 is determined as the image similarity between the target entity information and entity 1. Similarity 3 between target entity tag 1 and image embedding vector 2 is calculated, and similarity 4 between target entity tag 2 and image embedding vector 2 is calculated, and the sum of similarity 3 and similarity 4 is determined as the image similarity between the target entity information and entity 2.
[0436] Exemplarily, the entity information of the first entity includes at least one image embedding vector; at least one target embedding vector includes a first target embedding vector; the game application calculates the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity; and the highest value of the at least one image sub-similarity is determined as the image parent similarity corresponding to the first target embedding vector.
[0437] For example, the number of target entity tags is 1: target entity tag 1. The number of entities in the entity set is also 1: entity 1. Entity 1 corresponds to image embedding vector 1 and image embedding vector 3. Then the similarity 1 between target entity tag 1 and image embedding vector 1 is calculated, and the similarity 5 between target entity tag 1 and image embedding vector 3 is calculated, and the larger value of similarity 1 and similarity 5 is determined as the similarity between the target entity information (target entity tag 1) and entity 1.
[0438] In an optional embodiment, the target image embedding vector may be used for calculating the image similarity, that is, the target image embedding vector is used instead of the target embedding vector in the above method. The target image embedding vector may be obtained by: segmenting the target entity information to obtain at least one target entity tag; inputting at least one target entity tag into a multimodal model to obtain a target image embedding vector.
[0439] 3) Similarity includes text similarity and image similarity.
[0440] When the first entity and the target entity have corresponding text similarity and image similarity, the game application determines an average value of the text similarity and the image similarity as the similarity between the first entity and the target entity.
[0441] Alternatively, when the first entity and the target entity have corresponding text similarity and image similarity, the larger value of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
[0442] Alternatively, when the first entity and the target entity have corresponding text similarity and image similarity, the sum of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
[0443] (3) Determine the target entity from the entity set based on similarity and environmental perception information.
[0444] In an optional embodiment, the game application first performs a similarity search based on the target entity information to obtain at least one candidate entity with a high similarity, and sorts them according to the similarity; then, based on the position, location, orientation and other information of the main virtual character and / or the non-player character, the game application performs perceptual filtering and sorting, and finally screens out the target entity.
[0445] Exemplarily, the game application determines a target search range based on target entity information and environmental perception information; and obtains the target entity by filtering entities perceived within the target search range based on similarity.
[0446] Alternatively, the game application determines x entities with the highest similarity from the entity set according to the similarity to form a candidate entity list; determines a target search range according to the target entity information and the environmental perception information, and determines the entity in the target search range among the x entities as the target entity. x is a positive integer.
[0447] Exemplarily, the game application determines the entity with the highest similarity in the search range as the target entity.
[0448] It should be noted that, when there are multiple entities with equal similarity within the target search range, the multiple entities can be sorted according to the distance between the entity and the master virtual character. For example, when there are at least two entities with the highest similarity in the search range, the entity with the highest similarity in the search range and the closest distance to the master virtual character is determined as the target entity.
[0449] In an optional embodiment, the game application determines the entity with the highest similarity within the search range and above the threshold as the target entity. Exemplarily, the number of the search range is at least one. For example, the search range includes at least one of the following: the visual range of the main virtual character, the auditory range of the main virtual character, the search range of the perceived virtual props of the main virtual character, the visual range of the non-player character, the auditory range of the non-player character, and the search range of the perceived virtual props of the non-player character.
[0450] Exemplarily, the game application may sequentially traverse at least one of the above-mentioned search ranges, or the game application may sequentially traverse at least one search range determined according to the natural language command. For example, if the natural language command is "Can you see the truck in front? Move to the truck", the game application may first traverse the visual range of the main virtual character, and then traverse the visual range of the non-player character, and match the entity with the highest similarity and above the threshold.
[0451] Exemplarily, when there are at least two search ranges, the traversal order of the at least two search ranges may be preset, or the traversal order of the at least two search ranges may be determined according to the intention indicated in the natural language command. For example, when the intention is to search for an item, the visual range is traversed first. When the intention is to search for a combat scene, the auditory range is traversed first.
[0452] If there are multiple levels of nested instructions in the natural language command, the first target entity will be searched first, and then the next target entity will be searched based on the position of the previous target entity. In the case where the natural language command includes a second target entity determined based on the position of the first target entity, the first target entity is queried from the entity set of the virtual environment based on the first target entity information and environmental perception information of the first target entity indicated by the natural language command; then the second target entity is queried from the entity set of the virtual environment based on the second target entity information, the first target entity and environmental perception information of the second target entity.
[0453] In response to natural language commands, the NPC is controlled to perform a virtual activity associated with a target entity.
[0454] Exemplarily, a large language model is called to identify the behavioral intent of natural language commands, and a control instruction or a control instruction sequence is generated according to the behavioral intent. According to the control instruction or the control instruction sequence, a non-player character is controlled to complete an activity based on a target entity.
[0455] The broadcasting of the NPC feedback information in step 208 may be implemented as follows:
[0456] Sub-step 6: reporting feedback information of the non-player character, wherein the feedback text corresponding to the feedback information is a non-fixed text generated based on the environmental perception information of the non-player character;
[0457] Exemplarily, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character and make a broadcast. For example, when the environmental perception information of the non-player character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information that triggers the broadcast condition; or, when the non-player character or the main control virtual character triggers the broadcast condition, the game application can generate corresponding feedback information in real time according to the environmental perception information of the non-player character.
[0458] For example, the feedback text is obtained by inferring the large language model based on the static entity data of the virtual environment and the dynamic environment perception information of the non-player characters. The large language model will generate different feedback texts according to the different perception situations of the non-player characters.
[0459] For example, the feedback text can also be obtained by inference based on the static entity data of the virtual environment and the dynamic environment perception information of the non-player character by the language model, and the feedback text can be in line with the personality characteristics of the non-player character. For example, when the non-player character is a strong uncle, the feedback text can adopt a heroic tone; when the non-player character is a reporter, the feedback text can adopt a news report tone.
[0460] It should be noted that due to the randomness of the results generated by the large language model, in the same scene, when the environmental perception information of the non-player character is the same, the generated feedback text may also be different.
[0461] The environmental perception information may include information perceived by the non-player character in real time, or may include information perceived by the non-player character historically.
[0462] Exemplarily, the feedback information is inferred by the game application based on the environmental perception information of the non-player character and the static entity data of the virtual environment. The feedback information can be a voice broadcast or a text broadcast. The static entity data includes data of relatively unchanged entities in the virtual environment, for example, model information of various buildings, terrains, and vehicles in the virtual environment.
[0463] Exemplarily, the feedback information may include at least one of the following: instant feedback, execution feedback, and dynamic feedback. Instant feedback and execution feedback are both feedback information generated for natural language commands, and dynamic feedback is feedback information spontaneously generated by non-player characters.
[0464] 1. Instant feedback is feedback information generated immediately when a natural language command is received. Instant feedback can include reply broadcast and instant broadcast. Reply broadcast is used to resume the inquiry in the natural language command; instant broadcast is used to feedback the reception of the natural language command.
[0465] For example, the client can command the non-player character to move in the virtual environment according to the intention of the natural language command. Then, when the client receives the natural language command, it can generate instant feedback corresponding to the natural language command, and the instant feedback is used to indicate that the natural language command has been received, or the instant feedback is used to instantly reply to the natural language command.
[0466] In an optional embodiment, the feedback information includes a reply report. The reply report includes a reply to the query natural language command generated in response to the query natural language command raised by the player. For example, when the query natural language command includes querying the location of the target entity, the corresponding reply report should include the query result of the location of the target entity.
[0467] When the behavioral intention of the received natural language command is an inquiry, the terminal broadcasts a reply message of the non-player character; the reply message includes reply content for the natural language command generated according to the environmental perception information of the non-player character about the virtual environment.
[0468] The natural language command is used to inquire about information from the non-player character. The natural language command may be referred to as an inquiry natural language command. The inquiry natural language command is a natural language command intended to be an inquiry. The inquiry natural language command contains at least one question.
[0469] Natural language commands are command instructions conveyed using human natural language. The terminal receives the natural language commands issued by the player and commands the non-player characters according to the intention corresponding to the natural language commands. For example, the terminal receives the voice audio of the player, converts the voice audio into text, and obtains the natural language command. Alternatively, the terminal receives the text of the natural language command input by the player.
[0470] Players can use spoken or written language to issue natural language commands. The game application will use the large language model to understand the natural language commands, extract the intentions expressed in the natural language commands, generate control instructions based on the intentions, and direct the activities of non-player characters.
[0471] For example, a natural language command may be "Come to me", and the game application may parse out that the intention of the natural language command is "control the non-player character to move to the location of the controlling virtual character". The game application then obtains the location of the controlling virtual character, generates a navigation route for the non-player character to move to the location of the controlling virtual character, and controls the non-player character to move to the location of the controlling virtual character along the navigation route.
[0472] For another example, a natural language command may be "go pick up a treasure chest", then the game application may parse out that the intention of the natural language command is "control the non-player character to move to the location of the treasure chest and pick up the treasure chest", then the game application may obtain the location of the treasure chest, control the non-player character to move to the location of the treasure chest, and perform the operation of picking up the treasure chest after arriving at the location of the treasure chest.
[0473] For example, when the natural language command includes an intelligence inquiry about the target entity, a first reply report is broadcast based on the non-player character's perception of the target entity; the first reply report includes the intelligence perception result of the non-player character about the target entity.
[0474] Alternatively, when the natural language command includes an inquiry about the location of the target entity, a second reply broadcast is broadcast based on the non-player character's perception of the target entity, and the second reply broadcast includes a description of the location of the target entity.
[0475] Exemplarily, a large language model is called to parse the received natural language command to obtain the intention of the natural language command. When the intention is of an inquiry type, the natural language command can be determined to be an inquiry natural language command. When the natural language command is an inquiry natural language command, the large language model can infer according to the intention of the natural language command, based on static entity data and environmental perception information, to obtain a reply text. That is, the large language model is called to parse the received natural language command, and the intention of the natural language command is output as an inquiry, as well as the reply text of the natural language command. The game application calls the text-to-speech service according to the processing logic of the inquiry intention, and converts the reply text into a reply broadcast, which is an audio broadcast, and sends the reply audio to the client for broadcast.
[0476] For example, when the large language model recognizes that the intention of the natural language command is to ask a question, since the user may ask hundreds of questions and it is impossible to store the answer to each question locally on the client, the game application will call the text-to-speech service to generate a reply broadcast in real time based on the reply text returned by the large language model, so that the game application can instantly generate a corresponding reply broadcast to respond to the player's question.
[0477] Exemplarily, a game application (client or server) calls a large language model to parse natural language commands, and obtains reply text based on static environmental data and environmental perception information of the virtual environment; and generates human voice audio based on the reply text to obtain a reply broadcast.
[0478] For example, the client reports the received natural language query command to the server, the server calls the large language model to parse the natural language query command, and infers the reply text based on the static environmental data and environmental perception information of the virtual environment; generates human voice audio based on the reply text to obtain a reply broadcast; the server sends the reply broadcast to the client; and the client broadcasts the reply broadcast.
[0479] 2. Execution feedback is the feedback generated when a task is executed according to the intent indicated by the natural language command after receiving the natural language command. Execution feedback can also be called execution broadcast.
[0480] For example, when a natural language command is used to instruct a non-player character to perform a target task, the client can generate execution feedback during the non-player character's execution of the target task, and the execution feedback is used to indicate the execution status of the target task; or, the client can generate execution feedback after the non-player character completes the target task, and the execution feedback is used to indicate the execution result of the target task.
[0481] In an optional embodiment, the feedback information includes a feedback report (also referred to as execution feedback). The feedback report includes a report on the task execution status and task execution result generated in response to the task natural language command proposed by the player. For example, when the task natural language command includes moving to the target entity, the corresponding feedback report may include: moving to the target entity, or having reached the target entity.
[0482] When the behavioral intention of the received natural language command is to execute a task, the terminal broadcasts a feedback report; the feedback report includes an execution status after the natural language command is executed according to the environmental perception information of the virtual environment by the non-player character.
[0483] The natural language command is used to instruct the non-player character to perform a task. The natural language command may be referred to as a task natural language command. The task natural language command includes a description text of the task, for example, the description text of the task may include at least one of the following: the task name, the action that the non-player character needs to perform, the method used to perform the task, the task target, and the location of the task target.
[0484] For example, when the intention of the task natural language command includes searching for a target entity, a first feedback announcement is broadcast, and the first feedback announcement includes the search result of the non-player character for the target entity.
[0485] Alternatively, when the intention of the task natural language command includes using a virtual prop, a second feedback announcement is announced, and the second feedback announcement is used to indicate that the virtual prop is ready.
[0486] Alternatively, when the intention of the task natural language command includes the use of virtual props, a third feedback announcement is broadcast, and the third feedback announcement is used to indicate the result of the use of the virtual props.
[0487] Alternatively, when the intention of the task natural language command includes controlling the movement of the non-player character, a fourth feedback announcement is announced, and the fourth feedback announcement is used to indicate the movement result of the movement.
[0488] Alternatively, when the intention of the task natural language command includes performing an interaction with a target entity, a fifth feedback announcement is broadcast, and the fifth feedback announcement is used to indicate at least one of a search result of the non-player character for the target entity and an interaction result between the non-player character and the target entity.
[0489] Alternatively, when the intention of the task natural language command includes item interaction, a sixth feedback broadcast is broadcast, and the sixth feedback broadcast is used to indicate the item interaction result of the non-player character performing the item interaction.
[0490] Exemplarily, a large language model is called to parse the received natural language command to obtain the intention of the natural language command. When the intention is a task, the natural language command can be determined to be a task natural language command. When the natural language command is a task natural language command, the large language model can be inferred according to the intention of the natural language command, based on static entity data and environmental perception information, to obtain a task instruction sequence, and the task instruction sequence is used to control the non-player character to perform the task. When the game application receives the task instruction sequence, it controls the non-player character activity to perform the task according to the task instructions in the task instruction sequence. During the control of the non-player character according to the task instruction, the corresponding execution status can be obtained for feedback broadcast according to the feedback broadcast logic corresponding to different task instructions.
[0491] For example, since the instructions that can be executed by non-player characters in the virtual environment are finite and traversable, the client can locally store feedback broadcasts corresponding to various character instructions. When the non-player characters execute corresponding instructions, the client can read the local feedback broadcasts for voice broadcasting.
[0492] Alternatively, when there is variable content in the feedback broadcast corresponding to a task instruction, for example, the target entity in the feedback broadcast is variable, or the position information in the feedback broadcast is variable; the client can also generate a broadcast voice with variable content based on the target entity or position information returned by the large language model, and splice it with the broadcast voice with immutable content stored locally to obtain the final feedback broadcast.
[0493] For example, when the task natural language command is "find a nearby treasure chest", calling the large language model to parse the task natural language command can get the intention of the task, the task goal is to find the target entity, and the target entity is a treasure chest; based on the static entity data and environmental perception information, reasoning can be obtained that there is a treasure chest in the left front of the main control virtual character. In the case that the target entity can be found, the feedback broadcast corresponding to the task goal is "found aaa at xxx", where xxx is the location of the target entity and aaa is the name of the target entity. The game application can call the online text-to-speech technology to generate the location voice according to the location information "left front" in the reasoning result; according to the name of the target entity "treasure chest", call the online text-to-speech technology to generate the name voice, and then splice the location voice and name voice into the feedback broadcast to get the final feedback broadcast.
[0494] Exemplarily, a game application (client or server) calls a large language model to parse natural language commands for a task, and infers task execution instructions based on static environmental data and environmental perception information of the virtual environment; controls a non-player character to perform the task according to the task execution instructions; generates feedback text according to the execution status of the non-player character performing the task; and generates human voice audio based on the feedback text to obtain a feedback broadcast.
[0495] For example, the client reports a task natural language command to the server; the server parses the task natural language command and infers the task execution instructions based on the static environment data and environment perception information of the virtual environment; the non-player character is controlled to perform the task according to the task execution instructions; feedback text is generated according to the execution status of the non-player character performing the task; human voice audio is generated based on the feedback text to obtain a feedback broadcast; the server sends the feedback broadcast to the client; the client receives and broadcasts the feedback broadcast.
[0496] 3. Dynamic feedback is the feedback information generated spontaneously based on the environmental perception information of non-player characters. Dynamic feedback can also be called dynamic broadcast.
[0497] For example, the client can spontaneously generate dynamic feedback based on the perception of the virtual environment without receiving natural language commands, and the dynamic feedback is used to indicate abnormal situations found by the non-player character in the virtual environment. For example, abnormal situations may include: finding hostile virtual characters, finding changes in the status of friendly virtual characters, finding dangerous situations, finding traces of combat or looting, etc.
[0498] In an optional embodiment, the feedback information includes dynamic reporting (also referred to as "dynamic feedback"). The dynamic reporting includes reporting of abnormal situations perceived by non-player characters. For example, when a non-player character perceives being attacked, a report is made that the character is being attacked; when a non-player character perceives a dangerous situation ahead, a report is made that there is danger ahead.
[0499] The terminal broadcasts a dynamic report when the environmental perception information of the non-player character about the virtual environment meets the dynamic report conditions.
[0500] Dynamic reporting is a report generated by the game application based on the environmental perception information of non-player characters when it determines that there is an abnormal situation that needs to be reported. The dynamic report includes reminder information of the abnormal situation. For example, the abnormal situation may include at least one of the following: discovering a hostile virtual character, discovering a change in the status of a friendly virtual character, and discovering a new trace.
[0501] For example, in the case where the non-player character perceives a hostile virtual character, a first dynamic broadcast is broadcast; the first dynamic broadcast includes the position of the hostile virtual character perceived by the non-player character.
[0502] Alternatively, when the non-player character senses a dangerous situation, a second dynamic broadcast is broadcast; the second dynamic broadcast is used to prompt the dangerous situation.
[0503] Alternatively, when the non-player character senses a change in the state of the friendly virtual character, a third dynamic broadcast is broadcast; the third dynamic broadcast is used to prompt that the state of the friendly virtual character has changed.
[0504] Alternatively, when the non-player character finds new traces in the virtual environment, a fourth dynamic broadcast is broadcast; the fourth dynamic broadcast is used to prompt the new traces. The new traces may be combat traces and / or looting traces.
[0505] For example, since the number of dynamic announcements that can be triggered by non-player characters in the virtual environment is limited and traversable, the client can store dynamic announcement voices locally, and the client can read the dynamic announcement voices from the local computer for announcement when the corresponding dynamic announcement voices are triggered. Similarly, some dynamic announcement voices can contain variable content, and the client can generate variable content in real time through text-to-speech technology, and splice it with the dynamic announcement template to obtain the final dynamic announcement.
[0506] In an optional embodiment, when generating feedback information, it may be necessary to query the location of the target entity in the virtual environment, or determine the target entity indicated in the natural language command from the virtual environment. In this case, an entity query method is required to query the target entity.
[0507] Before executing the target entity query, it is necessary to pre-build the static entity data of the virtual environment. Static entity data construction can serve both the reasoning of the large language model and the real-time feedback text generation on the game application side after the reasoning results are returned.
[0508] In an optional embodiment, entities in the virtual environment are traversed, entity information of each entity is exported from the game engine, and static entity data is obtained.
[0509] For example, for in-game scenes, editor tools have been developed to perform StaticMesh traversal of the entire scene, special Actor traversal (such as interactive doors, which do not belong to the StaticMesh category), vegetation traversal, and export the entity's position, orientation, and bounding box size as static entity data for subsequent labeling and reasoning by the large language model.
[0510] Among them, StaticMesh is a static geometry resource type in the Unreal Engine 4 (UE4) game engine, which is used to represent immutable 3D models, such as buildings, props, etc. Actor is a basic object class in the Unreal Engine 4 (UE4) game engine, representing an entity in the game world, such as a character, object, light source, etc. Actor can contain multiple components to achieve different functions.
[0511] Exemplarily, static entity data can also include spatial data, which is obtained by manual labeling. Spatial data is more complex than static entities because there are multiple floors in the space and multiple layers of nesting within the floors (such as the motel area includes the second floor, and the second floor area includes the guest rooms). For this type of data, manual calibration is used to construct it. Add Volume to the scene in the editor, divide the area required for the entire map and label it accordingly. Volume is a special Actor class in the Unreal Engine4 (UE4) game engine, which represents a three-dimensional area with specific functions, such as a trigger area, audio area, etc.
[0512] Exemplarily, if there are three-dimensional space areas that need to be identified in the virtual environment, these three-dimensional space areas can be identified by creating space entities. That is, the entity set includes space entities, and the static entity data corresponding to the space entities includes text labels for describing spatial relationships; the space entities are used to identify the three-dimensional space areas in the virtual environment; the game application creates space entities in the virtual environment, and the space entities are used to surround the three-dimensional space areas to be identified; the text labels of the space entities are obtained, and the text labels include description text of the spatial relationship of the three-dimensional space areas; wherein the description text of the spatial relationship includes at least one of the following: the scene to which the three-dimensional space area belongs, the building to which the three-dimensional space area belongs, the floor of the three-dimensional space area in the building to which it belongs, the spatial orientation of the three-dimensional space area on the floor to which it belongs, and the spatial name of the three-dimensional space area.
[0513] For example, if there is a second floor area of a recycling station tower in the virtual environment, a spatial entity is created in the second floor area. The spatial entity is used to surround the second floor area, determine the spatial position of the second floor area, and set a description text of the spatial relationship "Farm Map-Recycling Station Tower-Second Floor Area" for the spatial entity.
[0514] After obtaining the static entity data, you can query entities or spaces based on the static entity data during the game.
[0515] For example, when a player issues a natural language command, the natural language command will be accompanied by the constructed static entity data and the real-time captured runtime data (including the environmental perception information of non-player characters and / or the main virtual character) to make an inference request to the large language model. In addition, when the NPC needs to provide dynamic feedback based on the runtime data, an entity query is also performed to generate feedback text based on the current state.
[0516] When a natural language command includes a target entity, the game application will query the target entity based on the position and orientation of the current controlling virtual character, the position and orientation of teammates or enemies, and based on the target entity information of the target entity described in the natural language command and the environmental perception information of the controlling virtual character and / or the non-player character, filter out a target entity that matches the target entity information from at least one candidate entity within the perception range of the controlling virtual character and / or the non-player character.
[0517] Optionally, the natural language command is used to instruct the non-player character to perform an activity related to the target entity. For example, the target entity may be a destination for the non-player character to move to, an object that the non-player character needs to observe, a target that the non-player character needs to attack, or an object that the non-player character needs to interact with.
[0518] The target entity is a virtual object that exists in a three-dimensional virtual environment. The target entity is the entity described in a natural language command. An entity may refer to a virtual object that is fixed in a three-dimensional virtual environment. For example, a target entity may be a virtual building, a virtual terrain, a virtual vehicle, a virtual plant, a virtual prop, a virtual item, etc. An entity may also refer to a virtual object that can interact with a virtual character in a three-dimensional virtual environment. For example, a target entity may be an interaction point in a three-dimensional virtual environment (e.g., a door, a window, a cabinet, a cellar, etc.), a virtual prop, a virtual character, a virtual light source, etc.
[0519] For example, a natural language command may be "Please help me open the door", then the target entity may be "door", and the non-player character needs to perform a door-related activity "open the door". Alternatively, a natural language command may be "Is the kitchen safe", then the target entity may be "kitchen", and the non-player character needs to perform a kitchen-related activity "check if there are enemy avatars or other dangerous situations in the kitchen".
[0520] Optionally, the natural language command includes target entity information of the target entity. The target entity information may be a description text of the target entity. For example, the target entity information may include at least one of the following contents: the name, type, location, and features of the target entity. The game application may find the target entity from among the many entities in the three-dimensional virtual environment based on the target entity information in the natural language.
[0521] The game application parses the natural language command, extracts the target entity information therein, determines the target entity from the entity set of the three-dimensional virtual environment based on the target entity information, and then controls the non-player character to perform activities related to the target entity according to the intention of the natural language command.
[0522] The target entity is determined from the three-dimensional virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the three-dimensional virtual environment.
[0523] Since the target entity information in natural language commands is usually vague, for example, a natural language command may be "move to the red truck", where the target entity information is "red truck", and there may be many red trucks in the three-dimensional virtual environment. It is impossible to accurately determine the target entity in the three-dimensional virtual environment based solely on the target entity information in the natural language command.
[0524] Therefore, the embodiment of the present application provides a method for determining the target entity by combining the target entity information and the environmental perception information. For the previous example, the "red truck" expressed by the player in the natural language command should be a red truck that the player can see. Therefore, combined with the field of view of the main control virtual character, the red truck within the field of view of the main control system character can be screened out from multiple red trucks in the three-dimensional virtual environment. The red truck is the target entity indicated by the player in the natural language command.
[0525] Since natural language commands are issued by players based on their perception of the 3D virtual environment, in order to accurately identify the target entity indicated in the natural language command, the game application will combine the environmental perception information when the player issues the natural language command to identify the target entity in the natural language command. Based on the player's perception of the 3D virtual environment, the entity that the player can perceive in the 3D virtual environment and that is closest to the target entity information is inferred as the target entity.
[0526] Exemplarily, the three-dimensional virtual environment includes multiple candidate entities that match the natural language command, and the target entity is an entity selected from the multiple candidate entities based on the environmental perception information of the main virtual character or the non-player character. For example, the game application first selects multiple candidate entities that match the target entity information in the natural language command from the entity set, and then selects the entity that can be perceived by the main virtual character or the non-player character from the multiple candidate entities as the target entity based on the environmental perception information.
[0527] For example, according to the position and orientation of the main virtual character, the perception range of the main virtual character is determined, and the perception range is determined as the search range of the target entity. For example, the perception range is a fan-shaped area of a certain visual field size in front of the main virtual character; entities that are not within the fan-shaped range are filtered out. Then, the target entity information and the entity information of the candidate entities are sorted according to the similarity, and the entities with higher similarity are selected as the target entities. When there are two entities with the highest and equal similarity scores within the perception range, for example, the similarity scores of entity 2 and entity 3 are both 2 points, then entity 2, which is closer to the main virtual character, is selected as the target entity.
[0528] When feedback information needs to be generated based on the position information of the target entity, the game application can perform a spatial query to generate a position description based on the positional relationship between the master virtual character and the target entity.
[0529] The main application scenario of spatial query is to obtain the location of the main virtual character, non-player characters, hostile virtual characters, gunshots, etc. For example, a report containing spatial information such as "enemies found on the second floor of the motel" can be made.
[0530] The spatial query logic defines the concepts of parent area and child area. The parent area refers to a large area in a 3D virtual environment that covers multiple buildings or multiple isolated spaces, such as a motel with front and back yards and multiple rooms and basements. The child area refers to an independent space in the parent area, which can be a closed space or a special function space, such as a motel guest room or kitchen.
[0531] In order to make the location description returned by the spatial query closer to human expression, when the main virtual character and the queried location are in different parent areas, the query result returns complete text information (for example, the main virtual character is outside the motel and the queried location is on the second floor of the motel, then "the enemy is on the second floor of the motel" is returned). When the main virtual character and the queried location are in the same parent area but different child areas, the query result only returns the child area information (for example, the main virtual character is on the first floor of the motel and the queried location is on the second floor, then "the enemy is on the second floor" is returned). When the main virtual character and the queried location are in the same parent area and the same child area, the query result only returns the direction relative to the main perspective player (for example, the main virtual character and the queried location are both on the second floor of the motel, then "the enemy is in the right front position" is returned).
[0532] Exemplarily, when the controlling virtual character and the target entity are located in different parent spaces, the position description includes the parent space and the child space where the target entity is located. When the controlling virtual character and the target entity are located in different child spaces of the same parent space, the position description includes the child space where the target entity is located. When the controlling virtual character and the target entity are located in the same child space of the same parent space, the position description includes the relative position of the target entity and the controlling virtual character; wherein a parent space includes at least one child space.
[0533] For the broadcast of the NPC feedback information in step 208, the feedback information is implemented as spatial human voice audio processed by spatial sound effects, wherein the spatial sound effect processing process can be implemented as follows:
[0534] Sub-step 7: Obtaining human voice audio corresponding to the feedback text;
[0535] In the embodiment of the present application, the process of generating the feedback text is as shown in the above-mentioned sub-step 6, which will not be repeated here.
[0536] In some embodiments, the process of obtaining corresponding human voice audio based on feedback text can be implemented as follows: obtaining feedback text and character feature information corresponding to a non-player character; and generating human voice audio matching the character feature information according to the feedback text.
[0537] Illustratively, the character feature information is used to describe the attributes of the non-player character, that is, the character feature information is information used to describe the current state and characteristics of the non-player character. In some embodiments, the attributes of the non-player character include at least one of the basic attributes of the non-player character and the situational performance attributes. Among them, the basic attributes are attributes pre-configured for the non-player character, that is, the attributes of the non-player character that do not change due to the three-dimensional virtual environment or the current situation, such as the age information of the non-player character, the male / female information of the non-player character, the martial arts information of the non-player character, etc. The situational performance attributes are attributes determined in real time by the non-player character in the situation of the three-dimensional virtual environment, that is, attributes associated with the current situation, such as the emotional information and behavioral information of the non-player character in the current situation.
[0538] Optionally, the character feature information includes at least one of basic character information, character emotion information, and character behavior information. The basic character information is used to indicate the basic situation of the non-player character, and the basic character information is information about the basic attributes of the non-player character, such as the age information of the non-player character, the male / female information of the non-player character, and the martial arts information of the non-player character; the character emotion information is used to indicate the emotional state of the non-player character in the dialogue scenario corresponding to the feedback text, and the character emotion information is the situational performance attribute of the non-player character, such as the character emotion information indicates that the non-player character is in an excited state, an angry state, a sad state, etc.; the character behavior information is used to indicate the actions performed by the non-player character in the dialogue scenario, and the character behavior information is the situational performance attribute of the non-player character, such as being in a running state, an attacking state, an injured treatment state, etc.
[0539] In some embodiments, the generation of human voice audio is achieved through a pre-trained speech generation model, and the speech generation model is used to generate speech that matches the character feature information of the non-player character. In an illustrative example, the feedback text and the character feature information are input into the pre-trained speech generation model to obtain human voice audio as the human voice audio.
[0540] Optionally, the above-mentioned speech generation model can be implemented by a neural network model such as a convolutional neural network, a feedforward neural network, a residual network, a Transformer, a multimodal large language model (Multimodal Large Language Model, MLLM), etc., which is not specifically limited here.
[0541] In some embodiments, the speech generation model includes a text encoder, a role encoder and a decoder. The text encoder is used to perform text encoding on the input feedback text, that is, the feedback text is input into the text encoder to obtain a text encoding representation. The role encoder is used to perform feature encoding on the input role feature information, that is, the role feature information is input into the role encoder to obtain a role encoding representation.
[0542] Illustratively, after obtaining the text coding representation and the role coding representation, the text coding representation and the role coding representation are fused to obtain the coding representation input to the decoder, that is, the text coding representation and the role coding representation are fused to obtain a joint coding representation, and the joint coding representation is input into the decoder to generate human voice audio.
[0543] In some embodiments, the character encoder includes at least one of a first sub-encoder, a second sub-encoder, and a third sub-encoder. The first sub-encoder is used to perform feature encoding based on the basic attributes of the non-player character, that is, when the character feature information includes the character basic information, the character basic information is input into the first sub-encoder to obtain a first character encoding representation; the second sub-encoder is used to perform feature encoding based on the emotional state of the non-player character, that is, when the character feature information includes the character emotional information, the character emotional information is input into the second sub-encoder to obtain a second character encoding representation; the third sub-encoder is used to perform feature encoding based on the behavior state of the non-player character, that is, when the character feature information includes the character behavioral information, the character behavioral information is input into the third sub-encoder to obtain a third character encoding representation.
[0544] Sub-step 8: based on the relative position relationship between the non-player character and the main control virtual character in the three-dimensional virtual environment, obtaining sound effect parameters corresponding to the non-player character;
[0545] Illustratively, the relative position relationship between the non-player character and the controlling virtual character in the three-dimensional virtual environment is used to indicate the relative relationship between a first position corresponding to the non-player character and a second position corresponding to the controlling virtual character in the three-dimensional virtual environment.
[0546] Optionally, the above-mentioned relative orientation relationship includes at least one of position distance, position direction, and spatial surrounding situation between the non-player character and the main virtual character, wherein the position distance is used to indicate the distance relationship between the non-player character and the main virtual character, the position direction is used to indicate the angular relationship between the first position of the non-player character and the orientation direction of the main virtual character, and the spatial surrounding situation is used to indicate the surround situation of the main virtual character by the spatial elements forming the virtual space in the three-dimensional virtual environment, and the propagation effect of the space on the audio when the non-player character emits audio in the virtual space.
[0547] In some embodiments, the determination of the relative position relationship between the non-player character and the main virtual character can be implemented as follows: obtaining first position information of the non-player character in the three-dimensional virtual environment, obtaining second position information of the main virtual character in the three-dimensional virtual environment, and determining the relative position relationship between the non-player character and the main virtual character based on the first position information and the second position information.
[0548] In some embodiments, the first position information of the non-player character and the second position information of the controlling virtual character are position information determined based on the same preset coordinate system. Optionally, the preset coordinate system can be implemented as a world coordinate system corresponding to the three-dimensional virtual environment, or the preset coordinate system can be implemented as a coordinate system established with the controlling virtual character as the origin.
[0549] In some embodiments, when the sound effect parameters corresponding to the non-player characters are pre-generated and stored in a database, the sound effect parameters corresponding to the non-player characters are obtained from the database. In other embodiments, the sound effect parameters corresponding to the non-player characters may also be generated in real time, that is, the sound effect parameters corresponding to the non-player characters are generated based on the relative position relationship.
[0550] Optionally, the sound effect parameters corresponding to the non-player character may include at least one of the following types:
[0551] The first type is distance type
[0552] Illustratively, the distance-type sound effect parameter is used to indicate that the sound effect of the human voice audio is adjusted based on the distance between the non-player character and the main virtual character. In some embodiments, the distance-type sound effect parameter can adjust the audio volume of the human voice audio to simulate the effect of distance on the sound volume; and / or, the distance-type sound effect parameter can adjust the audio delay of the human voice audio to simulate the effect of distance on the sound propagation time.
[0553] Second, direction type
[0554] Illustratively, the direction-type sound effect parameter is used to indicate the adjustment of the sound effect of the human voice audio based on the direction of the non-player character relative to the main virtual character. In some embodiments, the direction-type sound effect parameter can adjust the audio volume of the human voice audio to simulate whether the main virtual character is facing the scene audio element; and / or, the direction-type sound effect parameter can adjust the volume parameters of the human voice audio in different channels to simulate the direction of the audio emitted by the scene sound source element.
[0555] The third type is space effects
[0556] Illustratively, the sound effect parameters of the spatial special effect type are used to indicate that the virtual space formed based on the spatial elements adjusts the sound effects in the virtual space, that is, the sound effect parameters of the spatial special effect type are used to indicate the effect of the virtual space on the sound performance of the audio emitted by the non-player characters. In some embodiments, the sound effect parameters of the spatial special effect type can add echo sound effects and reverberation sound effects to simulate the effect of sound in the space.
[0557] Optionally, the sound effect parameters of the spatial special effect type include at least one of a reverberation time parameter, a pre-delay parameter, a wetness (Wet / DryMix) parameter, a space width parameter, and a distance effect parameter. Among them, the reverberation time parameter is used to indicate the speed at which the audio decays in the virtual space; the pre-delay parameter is used to indicate the time difference between the audio directly reaching the main virtual character and the audio reaching the main virtual character after the first reflection; the wetness parameter is used to indicate the ratio between the audio directly transmitted and the audio transmitted through reflection; the space width parameter is used to indicate the degree of diffusion of the audio on the horizontal plane in the virtual space; and the distance effect parameter is used to indicate the attenuation of the audio with the propagation distance during the propagation process.
[0558] The fourth type is custom type
[0559] Schematically, the custom type of sound effect parameters are user-defined parameters for sound effect adjustment. Optionally, the user can customize the overall volume of the scene audio, whether to add background music, customize the volume of different types of audio, etc.
[0560] In some embodiments, the client provides a customization interface for sound effect parameters to the user, and the user configures the customized sound effect parameters through the customization interface.
[0561] In some embodiments, a parameter prediction model for personalized learning of the custom sound effect parameters is configured in the custom sound effect parameter server for the user. Schematically, the custom sound effect parameters of multiple candidate accounts are obtained, the multiple custom sound effect parameters are input into the parameter prediction model to be trained, the parameter prediction model to be trained is iteratively trained to obtain the parameter prediction model, and the sound effect parameters generated by the system (for example, the sound effect parameters of the above-mentioned distance type, direction type, and spatial special effect type) are optimized through the parameter prediction model.
[0562] Sub-step 9: adjusting the vocal audio based on the sound effect parameters, generating and broadcasting the spatial vocal audio corresponding to the non-player character;
[0563] Among them, the spatial human voice audio is used to express the perceptual effect of the audio produced by the main virtual character on the non-player character under the relative position relationship.
[0564] In an embodiment of the present application, the human voice audio is adjusted according to the sound effect parameters corresponding to the non-player character, thereby generating the spatial human voice audio corresponding to the non-player character. That is, the spatial human voice audio is the audio data corresponding to the non-player character obtained after the human voice audio is adjusted by the sound effect parameters. In some embodiments, the spatial human voice audio includes the audio after the sound effect parameters are adjusted, as well as at least one of the audio duration information, the audio playback start timestamp, the audio playback end timestamp, the audio playback condition information, and the element identification information corresponding to the audio.
[0565] Optionally, when the sound effect parameters indicate that the volume of the non-player character's vocal audio is to be adjusted, the volume of the non-player character's vocal audio on at least one channel is adjusted based on the sound effect parameters. Optionally, when the sound effect parameters indicate that the playback delay of the non-player character's vocal audio is to be adjusted, the audio playback start time corresponding to the non-player character's vocal audio is adjusted based on the sound effect parameters. Optionally, when the sound effect parameters indicate that the speed of the non-player character's vocal audio is to be adjusted, the playback speed of the non-player character's vocal audio is adjusted based on the sound effect parameters. Optionally, when the sound effect parameters indicate the pitch of the non-player character's vocal audio, the frequency in the spectrum of the non-player character's vocal audio is adjusted based on the sound effect parameters. When the sound effect parameters indicate the timbre of the non-player character's vocal audio, a filter corresponding to the non-player character is determined based on the sound effect parameters, and the timbre corresponding to the vocal audio is adjusted through the filter.
[0566] Illustratively, the client plays the spatial human voice audio to realize the broadcasting of non-player character feedback information.
[0567] The speech-to-text conversion stage of step 204 can be implemented as follows:
[0568] Sub-step 10: obtaining a plurality of first scene hot words corresponding to the first virtual scene where the target virtual character is located;
[0569] The target virtual character includes at least one of an NPC and a master virtual character.
[0570] In a illustrative manner, the main virtual character is the virtual character commanded by the player, and the NPC is the virtual character that assists the main virtual character in a virtual game. Usually, a virtual game includes a main virtual character and at least one NPC. There are certain differences between the main virtual character and the NPC.
[0571] Optionally, the main virtual character is the virtual character mainly controlled by the player, and the NPC is the virtual character chosen by the player to command, such as the main virtual character is the virtual character manually controlled by the player during the game, and the player's manual operations on the terminal interface are used to control the main virtual character; the NPC is the virtual character commanded by the player in voice form, and the player occasionally issues natural language commands in voice form to command the NPC.
[0572] In some embodiments, the first virtual scene is determined based on the target virtual character, and the target virtual character is at least one of an NPC and a master virtual character, which means that the process of determining the first virtual scene is implemented as at least one of the following.
[0573] (1) If the main virtual character is selected as the target virtual character, the virtual scene where the main virtual character is located is used as the first virtual scene;
[0574] (2) If an NPC is selected as the target virtual character, the virtual scene where the NPC is located is used as the first virtual scene; if there are multiple NPCs, the virtual scene including the most NPCs can be used as the first virtual scene. Alternatively, the NPC closest to the main virtual character can be selected as the target virtual character, and the virtual scene where the NPC is located can be used as the first virtual scene. Alternatively, the NPC with the largest character attribute value (such as at least one of the attribute values such as virtual health, virtual mana, and virtual defense) can be selected as the target virtual character, and the virtual scene where the NPC is located can be used as the first virtual scene.
[0575] (3) If the main virtual character and the NPC are selected as the target virtual characters, the virtual scene in which the main virtual character and the NPC are located can be used as the first virtual scene, etc.
[0576] In some embodiments, the target virtual character is determined based on the player's selection; or, the target virtual character is set by system default.
[0577] In some embodiments, a plurality of first scene hot words are determined based on the first virtual scene.
[0578] Among them, the plurality of first scene hot words are scene-related words of the first virtual scene, that is, there is an association relationship between the first scene hot words and the first virtual scene, and the first scene hot words are words that describe the first virtual scene.
[0579] Optionally, the first scene hot words include the scene status of the first virtual scene, such as: the first virtual scene is a virtual restaurant, and the first scene hot words include business status, rest status, closed status, etc.
[0580] Optionally, the first scene hot words include element names of entities in the first virtual scene, such as: the first virtual scene is a virtual restaurant, and the first scene hot words include virtual tables, virtual chairs, virtual kitchen utensils, virtual plates, etc.
[0581] Optionally, the first scene hot words include interactive vocabulary for interacting with entities in the first virtual scene, such as: the first virtual scene is a virtual battlefield, and the first scene hot words include attack, attack virtual character, defense, building barriers, etc.
[0582] In some embodiments, after receiving a natural language command, multiple first scene hot words are collected based on the first virtual scene; or, after receiving a natural language command, multiple first scene hot words corresponding to the first virtual scene are filtered from multiple scene hot words pre-acquired based on the first virtual scene, etc.
[0583] In an optional embodiment, the perception range of the target virtual character in the first virtual scene is obtained.
[0584] Among them, the perception range is the three-dimensional space range in which the target virtual character perceives the existence of other scene elements.
[0585] Optionally, when the target virtual character is the master virtual character, the perception range of the master virtual character in the first virtual scene is obtained; when the target virtual character is an NPC, the perception range of the NPC in the first virtual scene is obtained; or, when the target virtual character is the master virtual character and the NPC, the perception range of the master virtual character in the first virtual scene is obtained and the perception range of the NPC in the first virtual scene is obtained.
[0586] In some embodiments, the perception range includes at least one of the following.
[0587] (1) The visual perception range (field of view) of the target virtual character.
[0588] In schematic form, the visual perception range refers to the spatial range that an observer can visually perceive or understand, and is usually used to describe the size of the area that an organism or technical device can visually cover or perceive. The visual perception range of the target virtual character is the three-dimensional spatial range perceived by the target virtual character as an observer through observation.
[0589] Optionally, based on the position and visual observation ability of the target virtual character in the first virtual scene, the visual perception range of the target virtual character is acquired.
[0590] (2) The auditory perception range of the target virtual character (auditory range).
[0591] In schematic form, the auditory perception range refers to the spatial range that a listener can perceive or understand, and is usually used to describe the range of sounds that an organism or technical device can cover or perceive. The auditory perception range of the target virtual character is the three-dimensional spatial range that the target virtual character can perceive through its auditory perception ability, with the target virtual character as the listener.
[0592] Optionally, based on the position and auditory perception ability of the target virtual character in the first virtual scene, the auditory perception range of the target virtual character is acquired.
[0593] (3) The olfactory perception range of the target virtual character (olfactory range).
[0594] In schematic form, the olfactory perception range refers to the spatial range of the odor perceived or recognized by the sense of smell. The olfactory perception range of the target virtual character is the three-dimensional spatial range that the target virtual character can perceive by the sense of smell.
[0595] Optionally, based on the position and olfactory perception ability of the target virtual character in the first virtual scene, the olfactory perception range of the target virtual character is acquired.
[0596] (4) The detection range of the perception skills possessed by the target virtual character or the perception virtual props.
[0597] Illustratively, the perception skill is the ability of the target virtual character to perceive the first virtual scene, and the perception skill includes at least one of a perception acquisition form and a perception enhancement form.
[0598] Optionally, the perception acquisition form is used to indicate the process of acquiring a perception skill that is not possessed. After the perception skill is possessed through the perception acquisition form, the target virtual character can perform targeted scene perception of the first virtual scene through the perception skill. Optionally, the perception enhancement form is used to indicate the process of enhancing a certain perception ability by possessing the perception skill when the target virtual character possesses the perception ability.
[0599] Illustratively, the perception virtual props are virtual props used to perceive the first virtual scene, and the perception virtual props include at least one of a perception acquisition form and a perception enhancement form.
[0600] Optionally, different perception skills or perception virtual props each correspond to a detection range, representing a range that can be perceived when the perception skill or perception virtual prop is applied, and the detection range represents the perception range.
[0601] In some embodiments, the perception range is a spherical range, an annular range, an irregular three-dimensional space range, etc., and the shape of the perception range is not limited here.
[0602] In an optional embodiment, a plurality of first scene hot words are acquired based on environmental perception information within the perception range.
[0603] Schematically, the environmental perception information is used to represent the environmental information perceived and acquired by the target virtual character within the perception range. Optionally, the environmental perception information includes entities determined by emitting rays, and may also include regional structure information determined by analyzing the geometric structure and layout information of the virtual environment.
[0604] Illustratively, after determining the perception range corresponding to the target virtual character, multiple first scene hot words representing the state of the target virtual character are obtained based on the range of the perception range in the first virtual scene and the environmental perception information determined based on perception of the target virtual character within the perception range.
[0605] In an optional embodiment, the environmental perception information includes entities; and entities within the perception range in the first virtual scene are determined.
[0606] Schematically, the perception range is a part of the three-dimensional space range in the first virtual scene; the first virtual scene includes a large number of entities, and the entities are elements that constitute the virtual scene, such as virtual ground, virtual buildings, virtual trees, virtual characters, virtual stones, etc.
[0607] In some embodiments, when the perception range is determined, an entity within the perception range is determined from a plurality of entities corresponding to the first virtual scene.
[0608] In some embodiments, the entity name of the entity is used as the first scene hot word; or, the action name of the interactive action corresponding to the entity is used as the first scene hot word.
[0609] Sub-step 11: converting the natural language command in voice form into text form based on multiple first scenario hot words;
[0610] Indicatively, the first scene hot words are words that are highly associated with the first virtual scene. Therefore, if you want to command the NPC through natural language commands to better cooperate with the activities of the main virtual character, you can use the first scene hot words as constraints on the basis of the first virtual scene. In this way, in the process of converting the natural language commands into text form, the text content of the command analysis results is more consistent with the first virtual scene, avoiding command analysis results that are incompatible with the first virtual scene.
[0611] In an optional embodiment, when a natural language command is analyzed by a natural language analysis model, a plurality of speech units corresponding to the natural language command are acquired through an acoustic network.
[0612] Among them, phonetic units are the basic building blocks of vocabulary pronunciation.
[0613] In some embodiments, a command feature representation corresponding to a natural language command is extracted; and the command feature representation is analyzed through an acoustic network.
[0614] Schematically, taking the command feature representation as an example, the goal of the acoustic network is to map a continuous sequence of acoustic features to a sequence of speech units, such as phonemes or segments. It learns to predict possible sequences of speech units (phonemes or segments) given acoustic features.
[0615] Optionally, the acoustic network outputs one or more possible speech unit sequences, wherein the speech unit sequence includes multiple speech units. Different speech unit sequences may contain different speech units, or may just have different orders of speech units. The multiple speech unit sequences represent the arrangement of speech units that the language network considers to be most likely when understanding the input natural language command.
[0616] The natural language analysis model includes an acoustic network, a preset dictionary, and language sub-networks corresponding to at least two virtual scenes.
[0617] Schematically, the virtual environment includes at least two virtual scenes. For example, the virtual environment is a large virtual world, which includes a virtual kitchen 1, a virtual kitchen 2, a virtual office, etc. The virtual kitchen 1, the virtual kitchen 2, the virtual office, etc. can each be regarded as a virtual scene.
[0618] In an optional embodiment, based on a first virtual scene in which the target virtual character is located, a first language sub-network corresponding to the first virtual scene is determined from at least two language sub-networks.
[0619] Schematically, multiple virtual scenes correspond to a language subnetwork respectively, and different language subnetworks are used to analyze the corresponding virtual scenes in a targeted manner. For example, virtual scene A corresponds to language subnetwork 1, and virtual scene B corresponds to language subnetwork 2; when analysis is required based on virtual scene A, language subnetwork 1 is used for language analysis; when analysis is required based on virtual scene B, language subnetwork 2 is used for language analysis, and so on.
[0620] Illustratively, the first virtual scene is a virtual scene among at least two virtual scenes. In addition to determining the first scene hot words based on the first virtual scene in which the target virtual character is located, a first language subnetwork corresponding to the first virtual scene is determined from at least two language subnetworks based on the first virtual scene. The first language subnetwork is a subnetwork layer that performs semantic analysis on natural language commands based on the first virtual scene.
[0621] In an optional embodiment, the first language sub-network analyzes the sequence matching relationship between multiple speech units and selected words in a preset dictionary to convert the natural language command in speech form into text form.
[0622] Optionally, different language sub-networks are language sub-networks pre-trained based on corresponding virtual scenes, wherein the first language sub-network is a language sub-network trained based on the first virtual scene.
[0623] In some embodiments, matching relationships between multiple speech units and selected words in a preset dictionary are analyzed to obtain multiple candidate word sequences.
[0624] The selected words include at least a plurality of first-scenario hot words and common words.
[0625] Schematically, the process of analyzing the matching relationship represents the process of analyzing the matching between the selected vocabulary and the speech unit. Schematically, each selected vocabulary corresponds to at least one speech unit, and the conversion probability of the speech unit to the selected vocabulary is determined by analyzing the multiple speech units and the selected vocabulary. The conversion probability represents the probability of matching between the selected vocabulary and the speech unit. The larger the conversion probability, the closer the speech unit is to the selected vocabulary, that is, the greater the possibility that the speech unit may express the selected vocabulary, and the stronger the matching relationship between the selected vocabulary and the speech unit.
[0626] Optionally, a plurality of speech units form at least one speech unit sequence, and based on a matching analysis process between the speech units and the selected vocabulary, at least one candidate vocabulary sequence corresponding to the at least one speech unit sequence is determined, and a plurality of candidate vocabulary sequences are obtained.
[0627] In some embodiments, the sequence semantics of multiple candidate vocabulary sequences are analyzed by the first language sub-network, and at least one candidate vocabulary sequence is obtained from the multiple candidate vocabulary sequences as a text form for natural language command conversion.
[0628] Schematically, sequence semantics is used to represent the semantic information expressed by the candidate vocabulary sequence, which can not only reflect the semantic changes of at least one word in the candidate vocabulary sequence, but also reflect the sentence semantics of the entire candidate vocabulary sequence.
[0629] Schematically, the natural language command in text form is called the command analysis result; multiple candidate vocabulary sequences are evaluated separately by the first language sub-network, so as to take at least one candidate vocabulary sequence that is more in line with the current semantic situation as the command analysis result, that is, the natural language command in speech form is converted into text form.
[0630] It is worth noting that the above are merely illustrative examples and are not limited to the embodiments of the present application.
[0631] The following is an embodiment of the device of the present application. For details not described in detail in the embodiment of the device, reference may be made to the above method embodiment.
[0632] Fig.19 1 is a block diagram of an entity determination device in a virtual environment provided by an exemplary embodiment of the present application. The device is used to implement a terminal. The device includes:
[0633] A display module 1003, used to display at least one of the main virtual character and the non-player character in the virtual environment;
[0634] A receiving module 1001 is used to receive a natural language command, where the natural language command is used to control the non-player character;
[0635] A control module 1002, configured to control the non-player character to move in the virtual environment according to the target entity indicated by the natural language command;
[0636] The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
[0637] In an optional embodiment, the environmental perception information includes at least one of the following:
[0638] Visual information perceived within the visual field of the master virtual character;
[0639] Auditory information perceived within the auditory range of the master virtual character;
[0640] The information perceived by the perception skills or the perception virtual props possessed by the master virtual character;
[0641] Visual information perceived within the field of view of the non-player character;
[0642] Auditory information perceived within the hearing range of the non-player character;
[0643] The non-player character's perception skills or information perceived by the perception virtual props.
[0644] In an optional embodiment, the virtual environment includes a plurality of candidate entities matching the natural language command, and the target entity is an entity screened from the plurality of candidate entities based on environmental perception information of the master virtual character or the non-player character.
[0645] In an optional embodiment, the device further includes:
[0646] A first query module 1005 is used to query and obtain the target entity from the entity set of the virtual environment according to the target entity information indicated by the natural language command and the environment perception information;
[0647] The control module 1002 is used to control the non-player character to perform an activity associated with the target entity according to the intention of the natural language command.
[0648] In an optional embodiment, the first query module 1005 is used to parse the natural language command to obtain the target entity information; the target entity information includes at least one of the following: entity type, entity name, entity location, entity feature;
[0649] The first query module 1005 is used to calculate the similarity between the target entity information and each entity information in the entity set;
[0650] The first query module 1005 is used to determine the target entity from the entity set according to the similarity and the environment perception information.
[0651] In an optional embodiment, the similarity includes text similarity; the entity set includes entity information of the first entity;
[0652] The first query module 1005 is used to segment the target entity information to obtain at least one target entity tag;
[0653] The first query module 1005 is used to convert the at least one target entity label into at least one target embedding vector;
[0654] The first query module 1005 is used to obtain entity information of the first entity, where the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained by converting a text label of the first entity;
[0655] The first query module 1005 is used to respectively calculate the text parent similarity between the at least one target embedding vector and the text embedding vector, and obtain at least one text parent similarity corresponding to the at least one target embedding vector;
[0656] The first query module 1005 is used to determine the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0657] In an optional embodiment, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0658] The first query module 1005 is used to calculate the text sub-similarity between the first target embedding vector and the at least one text embedding vector respectively to obtain at least one text sub-similarity;
[0659] The first query module 1005 is used to determine the highest value of the at least one text sub-similarity as the text parent similarity corresponding to the first target embedding vector.
[0660] In an optional embodiment, the similarity includes image similarity; the entity set includes entity information of the first entity;
[0661] The first query module 1005 is used to segment the target entity information to obtain at least one target entity tag;
[0662] The first query module 1005 is used to convert the at least one target entity label into at least one target embedding vector;
[0663] The first query module 1005 is used to obtain entity information of the first entity, where the entity information includes an image embedding vector, where the image embedding vector is an embedding vector extracted based on the image of the first entity;
[0664] The first query module 1005 is used to respectively calculate the image parent similarity between the at least one target embedding vector and the text embedding vector, and obtain at least one image parent similarity corresponding to the at least one target embedding vector;
[0665] The first query module 1005 is configured to determine the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0666] In an optional embodiment, the entity information of the first entity includes at least one image embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0667] The first query module 1005 is used to calculate the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity;
[0668] The first query module 1005 is used to determine the highest value of the at least one image sub-similarity as the image parent similarity corresponding to the first target embedding vector.
[0669] In an optional embodiment, the device further includes:
[0670] A first pre-processing module 1004 is configured to obtain at least one perspective image of the first entity; and
[0671] A first preprocessing module 1004, configured to obtain at least one text label of the first entity;
[0672] The first preprocessing module 1004 is used to call the multimodal model to extract the visual features of the first entity based on the at least one perspective image and the at least one text label of the first entity to obtain the image embedding vector of the first entity.
[0673] In an optional embodiment, the entity set includes a first entity, and the apparatus further includes:
[0674] The first query module 1005 is configured to determine, when the first entity and the target entity have corresponding text similarity and image similarity, an average value of the text similarity and the image similarity as the similarity between the first entity and the target entity.
[0675] In an optional embodiment, the first query module 1005 is used to determine a search range according to the target entity information and the environment perception information;
[0676] The first query module 1005 is used to filter the target entity from the entities sensed within the search range according to the similarity.
[0677] In an optional embodiment, the first query module 1005 is used to determine the entity with the highest similarity in the search range as the target entity;
[0678] The first query module 1005 is used to determine the entity with the highest similarity in the search range and the closest distance to the master virtual character as the target entity when the number of entities with the highest similarity in the search range is at least two.
[0679] Fig. 20 1 is a block diagram of an entity determination device in a virtual environment provided by an exemplary embodiment of the present application. The device is used to implement a server. The device includes:
[0680] An acquisition module 1006 is used to acquire an entity set, where the entity set includes entity information of at least one entity in the virtual environment;
[0681] The acquisition module 1006 is used to acquire environmental perception information, wherein the environmental perception information controls information perceived by at least one of the virtual character and the non-player character from the virtual environment;
[0682] The second query module 1008 is used to determine the target entity from the entity set according to the entity information of the target entity and the environment perception information.
[0683] In an optional embodiment, the environmental perception information includes at least one of the following:
[0684] Visual information perceived within the visual field of the master virtual character;
[0685] Auditory information perceived within the auditory range of the master virtual character;
[0686] The information perceived by the perception skills or the perception virtual props possessed by the master virtual character;
[0687] Visual information perceived within the field of view of the non-player character;
[0688] Auditory information perceived within the hearing range of the non-player character;
[0689] The non-player character's perception skills or information perceived by the perception virtual props.
[0690] In an optional embodiment, the virtual environment includes a plurality of candidate entities matching the natural language command, and the target entity is an entity screened from the plurality of candidate entities based on environmental perception information of the master virtual character or the non-player character.
[0691] In an optional embodiment, the second query module 1008 is used to calculate the similarity between the target entity information of the target entity and each entity information in the entity set;
[0692] The second query module 1008 is used to determine the target entity from the entity set according to the similarity and the environmental perception information.
[0693] In an optional embodiment, the similarity includes text similarity; the entity set includes entity information of the first entity;
[0694] The second query module 1008 is used to segment the target entity information to obtain at least one target entity tag;
[0695] The second query module 1008 is used to convert the at least one target entity label into at least one target embedding vector;
[0696] The second query module 1008 is used to obtain entity information of the first entity, where the entity information includes a text embedding vector, and the text embedding vector is an embedding vector obtained by converting a text label of the first entity;
[0697] The second query module 1008 is used to respectively calculate the text parent similarity between the at least one target embedding vector and the text embedding vector, and obtain at least one text parent similarity corresponding to the at least one target embedding vector;
[0698] The second query module 1008 is used to determine the sum of the at least one text parent similarity as the text similarity between the target entity information and the entity information of the first entity.
[0699] In an optional embodiment, the entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0700] The second query module 1008 is used to respectively calculate the text sub-similarity between the first target embedding vector and the at least one text embedding vector to obtain at least one text sub-similarity;
[0701] The second query module 1008 is used to determine the highest value of the at least one text sub-similarity as the text parent similarity corresponding to the first target embedding vector.
[0702] In an optional embodiment, the similarity includes image similarity; the entity set includes entity information of the first entity;
[0703] The second query module 1008 is used to segment the target entity information to obtain at least one target entity tag;
[0704] The second query module 1008 is used to convert the at least one target entity label into at least one target embedding vector;
[0705] The second query module 1008 is used to obtain entity information of the first entity, where the entity information includes an image embedding vector, where the image embedding vector is an embedding vector extracted based on the image of the first entity;
[0706] The second query module 1008 is used to respectively calculate the image parent similarity between the at least one target embedding vector and the text embedding vector, and obtain at least one image parent similarity corresponding to the at least one target embedding vector;
[0707] The second query module 1008 is configured to determine the sum of the at least one image parent similarity as the image similarity between the target entity information and the entity information of the first entity.
[0708] In an optional embodiment, the entity information of the first entity includes at least one image embedding vector; the at least one target embedding vector includes a first target embedding vector;
[0709] The second query module 1008 is used to calculate the image sub-similarity between the first target embedding vector and the at least one image embedding vector respectively to obtain at least one image sub-similarity;
[0710] The second query module 1008 is used to determine the highest value of the at least one image sub-similarity as the image parent similarity corresponding to the first target embedding vector.
[0711] In an optional embodiment, the device further includes:
[0712] A second preprocessing module 1007 is configured to obtain at least one viewing angle image of the first entity; and
[0713] The second preprocessing module 1007 is used to obtain at least one text label of the first entity;
[0714] The second preprocessing module 1007 is used to call the multimodal model to extract the visual features of the first entity based on the at least one perspective image and the at least one text label of the first entity, so as to obtain the image embedding vector of the first entity.
[0715] In an optional embodiment, the entity set includes a first entity;
[0716] The second query module 1008 is configured to determine, when the first entity and the target entity have corresponding text similarity and image similarity, an average value of the text similarity and the image similarity as the similarity between the first entity and the target entity.
[0717] In an optional embodiment, the second query module 1008 is used to determine a search range according to the target entity information and the environment perception information;
[0718] The second query module 1008 is used to filter the target entity from the entities sensed within the search range according to the similarity.
[0719] In an optional embodiment, the second query module 1008 is used to determine the entity with the highest similarity in the search range as the target entity;
[0720] The second query module 1008 is configured to determine the entity with the highest similarity in the search range and the closest distance to the master virtual character as the target entity when the number of entities with the highest similarity in the search range is at least two.
[0721] It should be noted that the entity determination device in the virtual environment provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the entity determination device in the virtual environment provided in the above embodiment and the entity determination method embodiment in the virtual environment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0722] The present application also provides a terminal, which includes a processor and a memory, wherein at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the entity determination method in the virtual environment provided by the above-mentioned various method embodiments.
[0723] Fig.21 The structure block diagram of a terminal 900 provided by an exemplary embodiment of the present application is shown. The terminal 900 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer or a desktop computer. The terminal 900 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0724] Typically, the terminal 900 includes a processor 901 and a memory 902 .
[0725] The processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 901 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 901 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0726] The memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 902 is used to store at least one instruction, which is used to be executed by the processor 901 to implement the information prompt method of the turn-based chess game provided in the method embodiment of the present application.
[0727] In some embodiments, the terminal 900 may also optionally include: a peripheral device interface 903 and at least one peripheral device. The processor 901, the memory 902 and the peripheral device interface 903 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 903 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, a position assembly 908 and a power supply 909.
[0728] The peripheral device interface 903 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, the memory 902, and the peripheral device interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0729] The radio frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 904 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 904 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 904 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 904 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0730] The display screen 905 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to collect touch signals on the surface or above the surface of the display screen 905. The touch signal can be input to the processor 901 as a control signal for processing. At this time, the display screen 905 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 905 can be one, and the front panel of the terminal 900 is set; in other embodiments, the display screen 905 can be at least two, which are respectively set on different surfaces of the terminal 900 or are folded; in some other embodiments, the display screen 905 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 900. Even, the display screen 905 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 905 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like.
[0731] The camera assembly 906 is used to capture images or videos. Optionally, the camera assembly 906 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 906 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0732] The audio circuit 907 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 901 for processing, or input them into the radio frequency circuit 904 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 900. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 901 or the radio frequency circuit 904 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 907 may also include a headphone jack.
[0733] The location component 908 is used to locate the current geographical location of the terminal 900 to implement navigation or LBS (Location Based Service). The location component 908 can be a location component based on the GPS (Global Positioning System), Beidou system or Galileo system.
[0734] The power supply 909 is used to power various components in the terminal 900. The power supply 909 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 909 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0735] In some embodiments, the terminal 900 further includes one or more sensors 910 . The one or more sensors 910 include, but are not limited to: an acceleration sensor 911 , a gyroscope sensor 912 , a pressure sensor 913 , an optical sensor 915 , and a proximity sensor 916 .
[0736] The acceleration sensor 911 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal 900. For example, the acceleration sensor 911 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 901 can control the display screen 905 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 can also be used to collect motion data of games or users.
[0737] The gyro sensor 912 can detect the body direction and rotation angle of the terminal 900, and the gyro sensor 912 can cooperate with the acceleration sensor 911 to collect the user's 3D actions on the terminal 900. The processor 901 can implement the following functions based on the data collected by the gyro sensor 912: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0738] The pressure sensor 913 can be set on the side frame of the terminal 900 and / or the lower layer of the display screen 905. When the pressure sensor 913 is set on the side frame of the terminal 900, it can detect the user's holding signal of the terminal 900, and the processor 901 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is set on the lower layer of the display screen 905, the processor 901 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 905. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0739] The optical sensor 915 is used to collect the ambient light intensity. In one embodiment, the processor 901 can control the display brightness of the display screen 905 according to the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is reduced. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera component 906 according to the ambient light intensity collected by the optical sensor 915.
[0740] The proximity sensor 916, also called a distance sensor, is usually arranged on the front panel of the terminal 900. The proximity sensor 916 is used to collect the distance between the user and the front of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually decreasing, the processor 901 controls the display screen 905 to switch from the screen-on state to the screen-off state; when the proximity sensor 916 detects that the distance between the user and the front of the terminal 900 is gradually increasing, the processor 901 controls the display screen 905 to switch from the screen-off state to the screen-on state.
[0741] Those skilled in the art will understand that Fig.21 The structure shown in the figure does not constitute a limitation on the terminal 900, and the terminal 900 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0742] The memory also includes one or more programs, which are stored in the memory and include a method for performing an entity determination method in a virtual environment provided in an embodiment of the present application.
[0743] The present application provides a computer-readable storage medium, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by the processor to implement the entity determination method in the virtual environment provided by the above-mentioned various method embodiments.
[0744] The present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the entity determination method in the virtual environment provided in the above optional implementation.
[0745] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0746] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0747] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining entities in a virtual environment, It is characterized in that The method comprises: displaying at least one of a host virtual character and a non-player character in a virtual environment; receiving a natural language command, wherein the natural language command is used to command the non-player character; Controlling the non-player character to move in the virtual environment according to the target entity indicated by the natural language command; The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
2. The method according to claim 1, It is characterized in that The environmental perception information includes at least one of the following: Visual information perceived within the visual field of the master virtual character; Auditory information perceived within the auditory range of the master virtual character; The information perceived by the perception skills or the perception virtual props possessed by the master virtual character; Visual information perceived within the field of view of the non-player character; Auditory information perceived within the hearing range of the non-player character; The non-player character's perception skills or information perceived by the perception virtual props.
3. The method according to claim 1, It is characterized in that The virtual environment includes a plurality of candidate entities that match the natural language command, and the target entity is an entity screened from the plurality of candidate entities based on environmental perception information of the master virtual character or the non-player character.
4. The method according to any one of claims 1 to 3, It is characterized in that The controlling the non-player character to move in the virtual environment according to the physical object indicated by the natural language command comprises: According to the target entity information indicated by the natural language command and the environment perception information, query and obtain the target entity from the entity set of the virtual environment; According to the intention of the natural language command, the non-player character is controlled to perform an activity associated with the target entity.
5. The method according to claim 4, It is characterized in that The step of querying and obtaining the target entity from an entity set of the virtual environment according to the target entity information indicated by the natural language command and the environment perception information includes: Parsing the natural language command to obtain the target entity information; the target entity information includes at least one of the following: entity type, entity name, entity location, entity feature; Calculating the similarity between the target entity information and each entity information in the entity set; The target entity is determined from the entity set according to the similarity and the environmental perception information.
6. The method according to claim 5, It is characterized in that The similarity includes text similarity; the entity set includes entity information of the first entity; The calculating the similarity between the target entity information and each entity information in the entity set includes: Segmenting the target entity information to obtain at least one target entity tag; converting the at least one target entity label into at least one target embedding vector; Acquire entity information of the first entity, where the entity information includes a text embedding vector, where the text embedding vector is an embedding vector obtained by converting a text label of the first entity; Calculating the text parent similarity between the at least one target embedding vector and the text embedding vector respectively, and obtaining at least one text parent similarity corresponding to the at least one target embedding vector respectively; The sum of the at least one text parent similarity is determined as the text similarity between the target entity information and the entity information of the first entity.
7. The method according to claim 6, It is characterized in that The entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector; The calculating the text parent similarity between the at least one target embedding vector and the text embedding vector comprises: respectively calculating text sub-similarity between the first target embedding vector and the at least one text embedding vector to obtain at least one text sub-similarity; The highest value of the at least one text sub-similarity is determined as the text parent similarity corresponding to the first target embedding vector.
8. The method according to claim 5, It is characterized in that The similarity includes image similarity; the entity set includes entity information of a first entity; The calculating the similarity between the target entity information and each entity information in the entity set includes: Segmenting the target entity information to obtain at least one target entity tag; converting the at least one target entity label into at least one target embedding vector; Acquire entity information of the first entity, the entity information including an image embedding vector, the image embedding vector being an embedding vector extracted based on the image of the first entity; Calculating the image parent similarity of the at least one target embedding vector and the text embedding vector respectively, and obtaining at least one image parent similarity corresponding to the at least one target embedding vector respectively; The sum of the at least one image parent similarity is determined as the image similarity between the target entity information and the entity information of the first entity.
9. The method according to claim 6, It is characterized in that The entity information of the first entity includes at least one image embedding vector; the at least one object embedding vector includes a first object embedding vector; The calculating the image parent similarity between the at least one target embedding vector and the image embedding vector comprises: respectively calculating image sub-similarity between the first target embedding vector and the at least one image embedding vector to obtain at least one image sub-similarity; The highest value of the at least one image sub-similarity is determined as the image parent similarity corresponding to the first target embedding vector.
10. The method according to claim 8, It is characterized in that The method further comprises: Acquire at least one perspective image of the first entity; and acquire at least one text label of the first entity; the text label is used to introduce the inherent attributes of the first entity in the virtual environment; The multimodal model is called to extract visual features of the first entity based on the at least one perspective image and the at least one text label of the first entity to obtain the image embedding vector of the first entity.
11. The method according to any one of claims 5 to 9, It is characterized in that The entity set includes a first entity, and the method further includes: In the case that the first entity and the target entity have corresponding text similarity and image similarity, an average value of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
12. The method according to any one of claims 4 to 9, It is characterized in that The determining the target entity from the entity set according to the similarity and the environmental perception information includes: Determine a search range according to the target entity information and the environmental perception information; The target entity is obtained by screening the entities sensed within the search range according to the similarity.
13. The method according to claim 12, It is characterized in that The step of obtaining the target entity by screening the entities sensed within the search range according to the similarity includes one of the following: Determine the entity with the highest similarity in the search range as the target entity; When the number of entities with the highest similarity in the search range is at least two, the entity with the highest similarity in the search range and the closest distance to the master virtual character is determined as the target entity.
14. A method for determining an entity in a virtual environment, It is characterized in that The method comprises: Acquire an entity set, wherein the entity set includes entity information of at least one entity in the virtual environment; Acquire environmental perception information, where the environmental perception information controls information perceived by at least one of the virtual character and the non-player character from the virtual environment; The target entity is determined from the entity set according to the target entity information of the target entity and the environment perception information.
15. The method according to claim 14, It is characterized in that The environmental perception information includes at least one of the following: Visual information perceived within the visual field of the master virtual character; Auditory information perceived within the auditory range of the master virtual character; The information perceived by the perception skills or the perception virtual props possessed by the master virtual character; Visual information perceived within the field of view of the non-player character; Auditory information perceived within the hearing range of the non-player character; The non-player character's perception skills or information perceived by the perception virtual props.
16. The method according to claim 14, It is characterized in that The virtual environment includes a plurality of candidate entities that match the natural language command, and the target entity is an entity screened from the plurality of candidate entities based on environmental perception information of the master virtual character or the non-player character.
17. The method according to any one of claims 14 to 16, It is characterized in that The step of determining the target entity from the entity set according to the target entity information and the environment perception information of the target entity includes: Calculate the similarity between the target entity information of the target entity and each entity information in the entity set; The target entity is determined from the entity set according to the similarity and the environmental perception information.
18. The method according to claim 17, It is characterized in that The similarity includes text similarity; the entity set includes entity information of the first entity; The calculating the similarity between the target entity information and each entity information in the entity set includes: Segmenting the target entity information to obtain at least one target entity tag; converting the at least one target entity label into at least one target embedding vector; Acquire entity information of the first entity, where the entity information includes a text embedding vector, where the text embedding vector is an embedding vector obtained by converting a text label of the first entity; Calculating the text parent similarity between the at least one target embedding vector and the text embedding vector respectively, and obtaining at least one text parent similarity corresponding to the at least one target embedding vector respectively; The sum of the at least one text parent similarity is determined as the text similarity between the target entity information and the entity information of the first entity.
19. The method according to claim 18, It is characterized in that The entity information of the first entity includes at least one text embedding vector; the at least one target embedding vector includes a first target embedding vector; The calculating the text parent similarity between the at least one target embedding vector and the text embedding vector comprises: respectively calculating text sub-similarity between the first target embedding vector and the at least one text embedding vector to obtain at least one text sub-similarity; The highest value of the at least one text sub-similarity is determined as the text parent similarity corresponding to the first target embedding vector.
20. The method according to claim 17, It is characterized in that The similarity includes image similarity; the entity set includes entity information of a first entity; The calculating the similarity between the target entity information and each entity information in the entity set includes: Segmenting the target entity information to obtain at least one target entity tag; converting the at least one target entity label into at least one target embedding vector; Acquire entity information of the first entity, the entity information including an image embedding vector, the image embedding vector being an embedding vector extracted based on the image of the first entity; Calculating the image parent similarity of the at least one target embedding vector and the text embedding vector respectively, and obtaining at least one image parent similarity corresponding to the at least one target embedding vector respectively; The sum of the at least one image parent similarity is determined as the image similarity between the target entity information and the entity information of the first entity.
21. The method according to claim 20, It is characterized in that The entity information of the first entity includes at least one image embedding vector; the at least one object embedding vector includes a first object embedding vector; The calculating the image parent similarity between the at least one target embedding vector and the image embedding vector comprises: respectively calculating image sub-similarity between the first target embedding vector and the at least one image embedding vector to obtain at least one image sub-similarity; The highest value of the at least one image sub-similarity is determined as the image parent similarity corresponding to the first target embedding vector.
22. The method according to claim 20, It is characterized in that The method further comprises: Acquire at least one perspective image of the first entity; and, Obtaining at least one text label of the first entity; The multimodal model is called to extract visual features of the first entity based on the at least one perspective image and the at least one text label of the first entity to obtain the image embedding vector of the first entity.
23. The method according to claim 17, It is characterized in that The entity set includes a first entity, and the method further includes: In the case that the first entity and the target entity have corresponding text similarity and image similarity, an average value of the text similarity and the image similarity is determined as the similarity between the first entity and the target entity.
24. The method according to claim 17, It is characterized in that Determining the target entity from the entity set according to the similarity and the environment perception information includes: Determine a search range according to the target entity information and the environmental perception information; The target entity is obtained by screening the entities sensed within the search range according to the similarity.
25. The method according to claim 24, It is characterized in that The step of obtaining the target entity by screening the entities sensed within the search range according to the similarity includes one of the following: Determine the entity with the highest similarity in the search range as the target entity; When the number of entities with the highest similarity in the search range is at least two, the entity with the highest similarity in the search range and the closest distance to the master virtual character is determined as the target entity.
26. An entity determination device in a virtual environment, It is characterized in that The device comprises: A display module, for displaying at least one of a main control virtual character and a non-player character in a virtual environment; A receiving module, configured to receive a natural language command, wherein the natural language command is used to control the non-player character; A control module, for controlling the non-player character to move in the virtual environment according to the target entity indicated by the natural language command; The target entity is determined from the virtual environment in combination with environmental perception information, and the environmental perception information includes information perceived by at least one of the main virtual character and the non-player character from the virtual environment.
27. An entity determination device in a virtual environment, It is characterized in that The device comprises: An acquisition module, configured to acquire an entity set, wherein the entity set includes entity information of at least one entity in the virtual environment; The acquisition module is used to acquire environmental perception information, wherein the environmental perception information mainly controls information perceived by at least one of the virtual character and the non-player character from the virtual environment; The second query module is used to determine the target entity from the entity set according to the target entity information of the target entity and the environment perception information.
28. A computer device, It is characterized in that The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the entity determination method in a virtual environment as described in any one of claims 1 to 25.
29. A computer-readable storage medium, It is characterized in that The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the entity determination method in a virtual environment as described in any one of claims 1 to 25.
30. A computer program product or a computer program, It is characterized in that The computer program product or computer program includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the entity determination method in a virtual environment as described in any one of claims 1 to 25.
Citation Information
Patent Citations
Natural language query interface achievement method oriented to big data
CN107885786A
Human-computer interaction method and device, electronic equipment and storage medium
CN114461775A
Robot object recognition method and device and storage medium
CN116188971A
Non-player character interaction processing method and device, electronic equipment and storage medium
CN116966574A
Virtual object control method and device, equipment and storage medium
CN116983639A
