Non-Player Character Control Method, Apparatus, Program, and Electronic Device

By determining the voice intensity of a player's voice and using threshold values to control NPC actions, the method addresses the challenge of NPCs inaccurately detecting and interacting with players in 3D game scenes, enhancing interaction accuracy and player experience.

JP2025516276AInactive Publication Date: 2025-05-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
JP2024564612
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-09-26
Filing Date
2023-09-06
Publication Date
2025-05-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In 3D game scenes, non-player characters (NPCs) struggle to accurately detect and interact with players hiding behind obstacles, leading to inaccurate control of action operations.

Method used

A method for controlling NPCs that involves determining the voice intensity of a player's voice heard by the NPC, based on the voice intensity and propagation distance, and controlling the NPC to execute action operations when the voice intensity meets specific threshold values.

Benefits of technology

This approach allows NPCs to accurately execute action operations by comparing the voice intensity with predetermined thresholds, improving interaction accuracy and player experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025516276000001_ABST
    Figure 2025516276000001_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus for controlling a non-player character, a storage medium, and an electronic device. Here, the method includes: obtaining a first voice intensity of a first voice and a first propagation distance of the first voice, where the first voice intensity is a predetermined voice intensity corresponding to a first motion state of a first player character at a first position; determining a voice intensity of the first voice heard by the non-player character (NPC) based on the first voice intensity and a first target distance when the first target distance between the NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC; and controlling the NPC to execute an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is greater than or equal to a first voice intensity threshold. The present invention solves the technical problem that in the related art, the non-player character cannot be accurately controlled to execute an action operation.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] This application claims priority to a Chinese patent application filed with the China Patent Office on September 26, 2022, bearing application number 202211174826.0 and entitled "Method and device for controlling non-player characters, storage medium, and electronic device," the entire contents of which are incorporated herein by reference.

[0002] The present invention relates to the technical field of computers, and more particularly to a method and device for controlling non-player characters, a storage medium, and an electronic device. [Background technology]

[0003] In a virtual game scene, multiple different types of non-player characters (NPCs) can usually be set. In order to increase the fun of the game, the NPCs can be made to perform specified actions according to their environmental sensing capabilities, thereby realizing the interaction between the NPCs and the player.

[0004] In the related art, the environmental sensing ability of an NPC mainly relies on visual sensing, and the visual sensing ability of an NPC is usually simulated based on information such as the distance, angle, etc. between the NPC and the player. For example, in a 3D game scene, when the player is located within a specified distance and a specified angle range in front of the NPC, the NPC can see the player and interact with the player.

[0005] However, in the related art, the influence on the vision of NPCs in a 3D game scene is not considered. For example, when a player is hiding behind an obstacle such as a rock, the NPC cannot see the player. In this case, when the player walks, runs, or sprints at full speed within the blind spot of the NPC's vision, the NPC may not be able to sense the player, and furthermore, the NPC cannot be controlled to interact with the player, thereby potentially causing the technical problem that the non-player character cannot be accurately controlled to execute action operations.

[0006] Currently, no effective solution has been proposed for the above problems.

Summary of the Invention

Problems to be Solved by the Invention

[0007] Embodiments of the present invention provide a method and apparatus for controlling a non-player character, a storage medium, and an electronic device, thereby solving at least the technical problem that the non-player character cannot be accurately controlled to execute action operations.

Means for Solving the Problems

[0008] According to one aspect of an embodiment of the present invention, there is provided a method for controlling a non-player character, including the steps of obtaining a first voice intensity of a first voice and a first propagation distance of the first voice, where the first voice is a voice emitted by a first player character at a first position, the first voice intensity is a predetermined voice intensity corresponding to a first motion state of the first player character at the first position, and the first propagation distance is a propagation distance determined based on the first voice intensity; determining the voice intensity of the first voice heard by the non-player character (NPC) based on the first voice intensity and a first target distance when the first target distance between the NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC; and controlling the NPC to execute an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is equal to or greater than a first voice intensity threshold value.

[0009] Optionally, when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold value, the step of controlling the NPC to execute an action operation corresponding to the first voice includes the step of controlling the NPC to execute a first action operation when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold value and less than a second voice intensity threshold value, where the first action operation is an action operation executed when the NPC perceives the voice.

[0010] Optionally, when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold value, the step of controlling the NPC to execute an action operation corresponding to the first voice further includes the step of controlling the NPC to execute a second action operation when the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold value, where the second action operation is an action operation executed when the NPC discovers the first player character.

[0011] Optionally, the step of controlling the NPC to perform an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold includes: when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, controlling the NPC to move to the first position; or when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, controlling the NPC to search for the first player character during the process of moving to the first position.

[0012] Optionally, the step of controlling the NPC to perform an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold further includes: when the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, controlling the NPC to move in a direction away from the first player character, or controlling the NPC to move in the direction of the first player character; or when the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, controlling the NPC to perform an interaction operation with the first player character.

[0013] Optionally, the step of determining the voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance includes: determining the excess voice intensity when the first voice propagates to the location of the NPC based on the first voice intensity and the first target distance; obtaining the voice intensity of the environmental noise at the location of the NPC; and determining the voice intensity of the first voice heard by the NPC based on the excess voice intensity and the voice intensity of the environmental noise.

[0014] Optionally, the step of obtaining the audio intensity of the environmental noise at the location of the NPC includes: determining a target grid at the location of the NPC in the target game scene, where the target game scene is pre-divided into a set of grids, the set of grids includes the target grid, and the audio intensity of the environmental noise corresponding to each grid in the set of grids is pre-set. The audio intensity corresponding to each grid is the audio intensity obtained by determining based on the type of the virtual terrain in each grid, the step of determining that the audio intensity of the environmental noise at the location of the NPC is equal to the audio intensity of the environmental noise corresponding to the pre-set target grid.

[0015] Optionally, the method includes an operation of obtaining the audio intensity of the initial noise corresponding to each grid in a set of grids, where the audio intensity of the initial noise has a predetermined correspondence with the type of the virtual terrain in the current grid, and an operation of obtaining the audio intensity of the propagation noise received by the current grid, where the audio intensity of the propagation noise includes the excess audio intensity when the initial noise corresponding to each grid other than the current grid in the set of grids propagates to the current grid. And an operation of determining the audio intensity of the environmental noise corresponding to the current grid based on the audio intensity of the initial noise and the audio intensity of the propagation noise, to obtain the audio intensity of the environmental noise corresponding to each grid. When performing the above operations, the step where each grid is the current grid is further included.

[0016] Optionally, the step of determining the voice intensity of the environmental noise corresponding to the current grid based on the voice intensity of the initial noise and the voice intensity of the propagation noise includes determining that the voice intensity of the environmental noise corresponding to the current grid is equal to the maximum voice intensity of the voice intensity of the initial noise and the voice intensity of the propagation noise, or determining that the voice intensity of the environmental noise corresponding to the current grid is equal to the sum of the voice intensity of the initial noise and the voice intensity of the propagation noise, or determining that the voice intensity of the environmental noise corresponding to the current grid is equal to the value obtained by weighted summing the voice intensity of the initial noise and the voice intensity of the propagation noise.

[0017] Optionally, the step of determining the voice intensity of the first voice heard by the NPC based on the excess voice intensity and the voice intensity of the environmental noise includes, when the excess voice intensity is greater than the voice intensity of the environmental noise, determining that the voice intensity of the first voice heard by the NPC is equal to the difference between the excess voice intensity and the voice intensity of the environmental noise, and / or when the excess voice intensity is less than or equal to the voice intensity of the environmental noise, determining that the voice intensity of the first voice heard by the NPC is equal to the voice intensity of the environmental noise or is 0.

[0018] Optionally, the method includes a step of setting a predetermined auditory radius based on the character type of the NPC, where when the character type of the NPC is a character type sensitive to hearing, the predetermined auditory radius is set to a first value, and when the character type of the NPC is not a character type sensitive to hearing, the predetermined auditory radius is set to a second value, and the first value is greater than the second value, or a step of setting a predetermined auditory radius based on the current state of the NPC, where when the current state of the NPC is a state of not receiving attack damage, the predetermined auditory radius is set to a first value, and when the current state of the NPC is a state of receiving attack damage, the predetermined auditory radius is set to a second value, and the first value is greater than the second value, or a step of setting a predetermined auditory radius based on the activation state (also referred to as "skill casting") of the NPC's target skill, where the target skill is used to increase the auditory range of the NPC in the activated state, when the activation state of the target skill is an activated state, the predetermined auditory radius is set to a first value, and when the activation state of the target skill is an unactivated state, the predetermined auditory radius is set to a second value, and the first value is greater than the second value.

[0019] Optionally, in the process of controlling the NPC to execute the action operation corresponding to the first voice, the method includes the steps of obtaining the second voice intensity of the second voice and the second propagation distance of the second voice, where the second voice is the voice emitted by the second player character at the second position, the second voice intensity is a predetermined voice intensity corresponding to the second motion state of the second player character at the second position, and the second propagation distance is the propagation distance determined based on the second voice intensity; determining the voice intensity of the second voice heard by the NPC based on the second voice intensity and the second target distance when the second target distance between the NPC and the second player character is less than the second propagation distance and less than a predetermined hearing radius of the NPC; and controlling the NPC to stop executing the action operation corresponding to the first voice and controlling the NPC to execute the action operation corresponding to the second voice when the voice intensity of the second voice heard by the NPC is greater than or equal to the first voice intensity threshold and greater than the voice intensity of the first voice heard by the NPC.

[0020] According to another aspect of an embodiment of the present invention, there is further provided a control device for a non-player character, including a first acquisition unit used to obtain the first voice intensity of the first voice and the first propagation distance of the first voice, where the first voice is the voice emitted by the first player character at the first position, the first voice intensity is a predetermined voice intensity corresponding to the first motion state of the first player character at the first position, and the first propagation distance is the propagation distance determined based on the first voice intensity; a first processing unit used to determine the voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance when the first target distance between the non-player character NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC; and a second processing unit used to control the NPC to execute the action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold.

[0021] According to still another aspect of an embodiment of the present invention, there is further provided a computer-readable storage medium. A computer program is stored in the computer-readable storage medium, where the computer program is configured to execute the method for controlling the non-player character when it runs.

[0022] According to still another aspect of an embodiment of the present invention, there is further provided a computer program product, including a computer program / instructions, where the steps of the method are realized when the computer program / instructions are executed by a processor.

[0023] According to still another aspect of an embodiment of the present invention, there is further provided an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to execute the method for controlling the non-player character by the computer program.

Advantages of the Invention

[0024] According to the embodiment provided by the present application, when it is determined that the non-player character (NPC) can hear the first voice emitted by the first player character based on the first target distance between the NPC and the first player character and a predetermined hearing radius of the NPC, by comparing the voice intensity of the first voice heard by the NPC with a first voice intensity threshold, the NPC is controlled to execute an action operation corresponding to the first voice. In other words, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, the NPC can accurately execute corresponding action operations, avoiding the technical problem that the NPC cannot be accurately controlled to execute action operations, and realizing the technical effect of improving the accuracy of controlling the NPC to execute action operations.

[0025] The drawings described herein are provided for a further understanding of the present invention and form a part of this application. The exemplary embodiments of the present invention and the description thereof are used to interpret the present invention and do not constitute an improper limitation to the present invention.

Brief Description of the Drawings

[0026]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Figure 9

Figure 10

Figure 11

Figure 12

Figure 13

Figure 14

Figure 15

Figure 16

Figure 17

Mode for Carrying Out the Invention

[0027] In order for those skilled in the art to better understand the solution means of the present invention, the technical solution means in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. As is clear, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative labor belong to the protection scope of the present invention.

[0028] First, the terms used in or related to the embodiments of the present invention are explained as follows. As can be understood, the following explanation is one interpretation of the terms, but not the only interpretation.

[0029] AI: An alias for an NPC having anthropomorphic actions in a game. Hearing range: The range within which an AI object can hear voices, generally a spherical area. Hearing perception threshold: The intensity value of a voice that triggers the perception of an AI object. When hearing a voice louder than this value, the AI object can enter a state of perception. Hearing discovery threshold: The intensity value of a voice that causes an AI object to discover a player. When hearing a voice louder than this value, the AI object can discover the player and interact with the player.

[0030] It should be noted that terms such as "first" and "second" in the specification, claims, and the above drawings of the present invention are used to distinguish similar objects and are not used to describe a specific order or sequence. The data used in this way can be exchanged in an appropriate situation. Therefore, the embodiments of the present invention described here can be implemented in an order other than the order illustrated or described here. Also, the terms "comprising", "having", and any variations thereof are intended to cover non-exclusively including. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to those steps or units explicitly illustrated, and may include other steps or units not explicitly illustrated or specific to these processes, methods, products, or devices.

[0031] According to one aspect of an embodiment of the present invention, a method for controlling a non-player character is provided. As one selectable embodiment, the method for controlling the non-player character can be applied to the application scenario shown in FIG. 1, but is not limited thereto. In the application scenario shown in FIG. 1, the terminal device 102 can communicate with the server 106 via the network 104, but is not limited thereto. The server 106 can perform operations on the database 108, such as, for example, data writing operations or data reading operations, but is not limited thereto. The terminal device 102 can include, but is not limited to, a human-computer interaction screen, a processor, and a memory. The human-computer interaction screen can be used to display the motion state of the first player character at the first position on the terminal device 102, the interaction behavior between the NPC and the first player character, etc., but is not limited thereto. The processor can be used to execute corresponding operations in response to the human-computer interaction operation, or generate corresponding instructions and send the generated instructions to the server 106, but is not limited thereto. The memory is used to store related processing data, such as the first voice intensity of the first voice, the first propagation distance of the first voice, and the predetermined hearing radius of the NPC, etc.

[0032] As an alternative form, the following steps of the method for controlling non-player characters can be executed on server 106. Step S102: Obtain the first voice intensity of the first voice and the first propagation distance of the first voice. Here, the first voice is the voice emitted by the first player character at the first position, the first voice intensity is a predetermined voice intensity corresponding to the first motion state of the first player character at the first position, and the first propagation distance is the propagation distance determined based on the first voice intensity. When the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold, control is performed such that the NPC executes an action operation corresponding to the first voice. Step S104: When the first target distance between the non-player character NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC, determine the voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance. Step S106: When the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold, control is performed such that the NPC executes an action operation corresponding to the first voice.

[0033] By adopting the above method, when it is determined that the NPC can hear the first voice emitted by the first player character based on the first target distance between the non-player character NPC and the first player character and the predetermined hearing radius of the NPC, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, control is performed such that the NPC executes an action operation corresponding to the first voice. In other words, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, the NPC can accurately execute the corresponding action operation, avoiding the technical problem that the NPC cannot be accurately controlled to execute the action operation, and realizing the technical effect of improving the accuracy of controlling the NPC to execute the action operation.

[0034] To solve the technical problem that the above NPC cannot be accurately controlled to execute an action operation, an embodiment of the present invention provides a method for controlling a non-player character. FIG. 2 is a flowchart of a method for controlling a non-player character according to an embodiment of the present invention, and the process includes the following steps.

[0035] Step S202: Obtain the first voice intensity of the first voice and the first propagation distance of the first voice. Here, the first voice is the voice emitted by the first player character at the first position, the first voice intensity is a predetermined voice intensity corresponding to the first motion state of the first player character at the first position, and the first propagation distance is the propagation distance determined based on the first voice intensity.

[0036] Exemplarily, the first voice intensity and the first propagation distance of the first voice can be obtained from the specified parameter values, but the present application is not limited thereto. For example, the first voice intensity can be obtained from the specified parameter values based on the first position where the first player character is located and the first motion state at the first position, or in combination with other information. Further, the first propagation distance can be determined based on the first voice intensity. Here, the first propagation distance may be a virtual distance in the virtual scene.

[0037] As shown in FIG. 3, assuming that the first player character emits the first voice at the first position, the first voice intensity of the first voice can be determined based on the first motion state of the first player character at the first position.

[0038] As one selectable example, as shown in FIG. 4, when the motion state of the first player character at the first position is "walking", based on the motion state of the first player character, it is simulated that the intensity of the voice emitted by the first player character in the game scene is 25 dB. When the motion state of the first player character at the first position is "sneaking", based on the motion state of the first player character, it is simulated that the intensity of the voice emitted by the first player character in the game scene is 10 dB. When the motion state of the first player character at the first position is "sprinting at full speed", based on the motion state of the first player character, it is simulated that the intensity of the voice emitted by the first player character in the game scene is 40 dB. When the motion state of the first player character at the first position is "flying", based on the motion state of the first player character, it is simulated that the intensity of the voice emitted by the first player character in the game scene is 20 dB.

[0039] As another selectable example, in addition to being related to the first motion state of the first player character at the first position, the first voice intensity may further be a predetermined voice intensity corresponding to the type of the virtual terrain where the first position is located and the first motion state of the first player character at the first position. Here, for the voice emitted by the player in the game scene, based on the action state of the player, the voice intensity of different voices emitted by the player in the game scene can be simulated, but it is not limited thereto. For example, as shown in FIG. 4, when the first player is located in different types of virtual terrains and in different motion states, the intensity of the voice emitted is different.

[0040] For example, (1) when the first player character sneaks through the grass, based on the virtual terrain of "grass" at the first position where the first player character is located and the motion state of "sneaking", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 10 DB. Based on the virtual terrain of "ground" at the first position where the first player character is located and the motion state of "sneaking", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 15 DB.

[0041] When the first player character runs through the grass at full speed, based on the virtual terrain of "grass" at the first position where the first player character is located and the motion state of "running through at full speed", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 40 DB. Based on the virtual terrain of "mountainous area" at the first position where the first player character is located and the motion state of "running through at full speed", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 50 DB.

[0042] When the first player character walks normally on the ground, based on the virtual terrain of "ground" at the first position where the first player character is located and the motion state of "walking", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 25 DB. Based on the virtual terrain of "grass" at the first position where the first player character is located and the motion state of "walking", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 30 DB.

[0043] When the first player character flies in the air, based on the virtual terrain of "air" at the first position of the location of the first player character and the motion state of "flying", it is possible to simulate that the intensity of the sound emitted by the first player character in the game scene is 20 DB.

[0044] As can be seen in combination with the above analysis, the method for determining the first sound intensity of the first sound can query a pre-created relationship mapping table based on the type of the virtual terrain at the first position and / or the first motion state to obtain the numerical value of the first sound intensity, but is not limited thereto.

[0045] Step S204: When the first target distance between the non-player character NPC and the first player character is less than the first propagation distance and less than the predetermined hearing radius of the NPC, determine the sound intensity of the first sound heard by the NPC based on the first sound intensity and the first target distance.

[0046] For easy understanding, the hearing abilities corresponding to different types of NPCs are different. Therefore, in the process of determining the sound intensity of the first sound heard by the NPC, in addition to considering the first target distance between the NPC and the first player character, it is also necessary to consider the hearing perception ability of the NPC itself, for example, the predetermined hearing radius of the NPC.

[0047] For example, as shown in FIG. 5, assuming that the propagation distance of the first voice emitted by the first player character (which can also be understood as the first propagation distance of the first voice) is d, and the target distance between the first player character and NPC1 is d1, then d1 > d. Since NPC1 is relatively far away from the first player character, NPC1 cannot hear the first voice. On the other hand, since the target distance between the first player character and NPC2 is d2, d2 < d, and d2 < r, NPC2 can hear the first voice, and it is determined that the voice intensity of the first voice is relatively strong. Here, r is the predetermined hearing radius of NPC2, and r determines the hearing range of NPC2. Further, based on the first voice intensity of the first voice and the first target distance, the voice intensity of the first voice heard by NPC2 is determined.

[0048] Also, whether NPC1 and NPC2 can hear the first voice can also be determined by the following implementation process. When the first player character emits the first voice, first, based on the propagation distance d of the first voice, the NPCs within the range of the propagation distance d can be determined. As shown in FIG. 5, including NPC1 and NPC2, next, based on whether the sound source of the first voice is located within the predetermined hearing radius of the NPC, it can be determined that only NPC2 can hear the first voice. For NPC1, although it is within the range of the propagation distance d of the first voice, since the sound source of the first voice is located outside the predetermined hearing radius of NPC1, NPC1 cannot hear the first voice.

[0049] It should be noted that the propagation distance d of the first voice, the predetermined hearing radius r of NPC2, the target distances between NPC1, NPC2 and the first player character, etc. are just one example and do not limit it.

[0050] Step S206: When the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold, control the NPC to execute the action operation corresponding to the first voice.

[0051] When the voice intensity of the first voice heard by the NPC is determined by executing step S204, the voice intensity of the first voice heard by the NPC is compared with the first voice intensity threshold. For example, the voice intensity of the first voice heard by the NPC is compared with the auditory perception threshold of the NPC.

[0052] As is obvious, as an easy-to-understand point, the action operation corresponding to the first voice can be executed only when the NPC perceives the first voice. For example, as shown in FIG. 5, when NPC2 can hear the first voice and the voice intensity of the first voice heard by NPC2 is greater than the auditory perception threshold (the first voice intensity threshold), the conversation operation shown in FIG. 3 is executed. On the other hand, since NPC1 cannot hear the first voice, for example, it will continue its daily state such as sleeping and patrolling.

[0053] It should be noted that the above steps S202 to S206 are all executed on the server side, which improves the data synchronization efficiency and data processing efficiency between different clients, and avoids problems such as client misbehavior and large data synchronization delays.

[0054] According to the above embodiment of the present application, when it is determined that the NPC can hear the first voice emitted by the first player character based on the first target distance between the non-player character NPC and the first player character and the predetermined auditory radius of the NPC, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, the NPC is controlled to execute the action operation corresponding to the first voice. In other words, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, the NPC can accurately execute the corresponding action operation, avoiding the technical problem that the NPC cannot be accurately controlled to execute the action operation, and realizing the technical effect of improving the accuracy of controlling the NPC to execute the action operation.

[0055] To ensure the authenticity of the NPC's auditory perception and enable the NPC to have anthropomorphic auditory perception capabilities, in the embodiments of the present application, by setting the rules for each item according to different parameters, the NPC is controlled to execute the action operation corresponding to the first voice. For example, there are a predetermined auditory radius of the NPC, a first voice intensity threshold, etc. In addition, in the embodiments of the present application, a second voice intensity threshold is further provided.

[0056] As one selectable example, when the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold, the above step of controlling the NPC to execute the action operation corresponding to the first voice is When the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold and less than the second voice intensity threshold, it is a step of controlling the NPC to execute the first action operation, where the first action operation is the action operation executed when the NPC perceives the voice.

[0057] In the embodiments of the present application, when the NPC can hear the first voice, in order to accurately control the NPC to execute the action operation corresponding to the first voice, based on the fact that the NPC perceives the first voice but has not discovered the first player character, and the fact that the NPC perceives the first voice and has discovered the first player character, the executed action operations are divided. Below, in combination with specific examples, first, when the NPC perceives the first voice but has not discovered the first player character, the first action operation executed will be described in detail.

[0058] As one selectable example, when the NPC perceives the first voice but has not discovered the first player character, the above step of controlling the NPC to execute the action operation corresponding to the first voice is When the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold and less than the second voice intensity threshold, it is a step of controlling the NPC to move to the first position, or When the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, it includes a step of controlling the NPC to search for the first player character in the process of moving to the first position.

[0059] For example, as shown in Fig. 6(a), when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, the NPC perceives the first voice, arouses vigilance against the first voice, and executes a perception action. For example, it moves in the direction of the first position S1 where the first player character is located.

[0060] Obviously, the fact that the voice intensity of the first voice heard by the NPC is less than the second voice intensity threshold means that the NPC has only heard the first voice and has not discovered the first player character. Therefore, in addition to only moving in the direction of the first position S1, the first action operation executed by the NPC may be to search for the first player character while moving.

[0061] Specifically, as shown in Fig. 6(b), when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, the NPC moves in the direction of the first position S1 where the first player character is located and searches for the first player character during the movement.

[0062] As another selectable example, when the NPC perceives the first voice and discovers the first player character, the above step of controlling the NPC to execute the action operation corresponding to the first voice When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, it includes a step of controlling the NPC to execute a second action operation, where the second action operation is an action operation executed when the NPC discovers the first player character.

[0063] Here, the second voice intensity threshold may be the auditory discovery threshold at which the NPC discovers the first player character, but is not limited thereto. That is, when the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, the NPC discovers the first player character and executes a second action operation corresponding to the first voice. Specifically, When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, control the NPC to move in a direction away from the first player character, or control the NPC to move in the direction of the first player character, or When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, include a step of controlling the NPC to execute an interaction operation with the first player character.

[0064] When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, the NPC can directly discover the first player character and trigger a discovery action (which can also be understood as the second action operation) corresponding to the NPC. For example, based on the relationship between the NPC and the first player character, control the NPC to move away from or approach the first player character, or control the NPC to execute an interaction operation with the first player character, etc. The above discovery action will be described below in conjunction with specific examples.

[0065] (1) As shown in FIG. 7(a), when the NPC discovers the first player character, assuming that the NPC and the first player character are in different camps or the NPC can damage the first player character, control the NPC to move away from the first player character.

[0066] (2) As shown in FIG. 7(b), when the NPC discovers the first player character, assuming that the NPC and the first player character are in the same camp or the NPC does not damage the first player character, the NPC is controlled to approach the first player character.

[0067] (3) As shown in FIG. 7(c), when the NPC discovers the first player character, the NPC is controlled to perform an interaction operation with the first player character. For example, by executing a dialogue or sending prompt information to the first player character, the first player character is informed of the position or status of the NPC.

[0068] Controlling the NPC to perform the action operation corresponding to the first voice according to the above rules further includes that, in addition to the above first action operation and second action operation, when the voice intensity of the above first voice heard by the NPC is less than the first voice intensity threshold and less than the second voice intensity threshold, since the NPC does not perceive the first voice, for example, the NPC can continuously perform daily actions such as patrolling, resting, or sleeping. Specifically, reference can be made to the schematic diagram shown in FIG. 7(d).

[0069] As can be seen from the analysis of the above embodiments, by controlling the NPC to perform the first action operation, the second action operation, or the daily action operation corresponding to the first voice based on a plurality of parameters such as the voice intensity of the first voice heard by the NPC, the first voice intensity threshold, and the second voice intensity threshold, the problem in the related art that when the NPC is in a blind spot of vision, the voice cannot be anthropomorphically heard by using the visual perception ability of the NPC is avoided, and the player's game experience is improved.

[0070] As an optional example, the step of determining the voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance is Determining an excess audio intensity when the first audio propagates to the location of the NPC based on the first audio intensity and the first target distance; Obtaining an audio intensity of environmental noise at the location of the NPC; Determining an audio intensity of the first audio heard by the NPC based on the excess audio intensity and the audio intensity of the environmental noise.

[0071] To ensure the authenticity of sound source simulation, when sound propagates in a medium, it is necessary to fully consider that the intensity of the sound continues to attenuate as the distance increases, and the attenuation situation of the sound is related to factors such as the attenuation formula, distance, and characteristics of the medium. For example, as shown in FIG. 8(a), the audio intensity of the first audio emitted from the location of the sound source gradually attenuates to 0 as the propagation distance increases.

[0072] Exemplarily, in the embodiments of the present application, assuming that the specific process of audio attenuation is simulated according to the linear attenuation formula, for example, y = a / x, where y is the excess audio intensity of the first audio received by the NPC, x is the first target distance between the first player character and the NPC, and a is the first audio intensity of the first audio emitted by the first player character at the first position. As can be seen from the formula, as the first target distance between the first player character and the NPC gradually increases, the excess audio intensity of the first audio received by the NPC gradually decreases. Specifically, reference can be made to the schematic diagram shown in FIG. 8(b).

[0073] For example, as shown in FIG. 8(c), when the player character emits the first voice according to the above linear attenuation formula, the excess voice intensity of the first voice received by NPC1 (character level is Lv.7) relatively close to the player character is greater than the excess voice intensity of the first voice received by NPC2 (character level is Lv.6) relatively far from the player character. For example, NPC1 can hear the first voice emitted by the player character and may interact with the player character. On the other hand, NPC2 is still in a daily state, for example, performing daily actions such as resting or sleeping.

[0074] By using the above linear attenuation formula, the process in which the voice intensity changes with the propagation distance in the voice propagation process is fully considered, and the situations such as the generation and propagation of voices in the 3D virtual game scene are reproduced relatively realistically.

[0075] Obviously, for the sake of easy understanding, the above linear attenuation formula is only one example and is not limited thereto. For example, other non-linear attenuation formulas may also be used.

[0076] When determining the voice intensity of the first voice heard by the NPC, in addition to considering the attenuation process of the first voice, it is also necessary to consider the influence of the voice intensity of the environmental noise on the auditory perception ability of the NPC. When determining the voice intensity of the environmental noise at the location of the NPC, based on the excess voice intensity of the first voice received at the location of the NPC and the voice intensity of the environmental noise, the voice intensity of the first voice heard by the NPC is determined.

[0077] As an optional implementation method, the above step of determining the voice intensity of the first voice heard by the NPC based on the excess voice intensity and the voice intensity of the environmental noise is When the excess voice intensity is greater than the voice intensity of the environmental noise, determining that the voice intensity of the first voice heard by the NPC is equal to the difference between the excess voice intensity and the voice intensity of the environmental noise, and / or Including the step of determining that the voice intensity of the first voice heard by the NPC is equal to or 0 the voice intensity of the ambient noise when the excess voice intensity is less than or equal to the voice intensity of the ambient noise.

[0078] The first voice uttered by the player character is the voice that the NPC wants to receive. On the other hand, since the ambient noise generated by the surrounding environment is the voice that interferes with the NPC's hearing of the first voice uttered by the player character, when the excess voice intensity is greater than the voice intensity of the ambient noise, the difference between the excess voice intensity and the voice intensity of the ambient noise is determined as the voice intensity of the first voice heard by the NPC.

[0079] As a point to be explained, when the first player character utters the first voice and the NPC receives the first voice, based on the XYZ coordinates of the position where the NPC is located, the target grid shown in FIG. 9 corresponding to the position where the NPC is located can be quickly identified. Next, by querying the voice intensity of the ambient noise corresponding to each grid, the voice intensity of the ambient noise in the target grid can be easily obtained, improving the efficiency of obtaining the voice intensity of the ambient noise at the position where the NPC is located.

[0080] When the excess voice intensity is less than the voice intensity of the ambient noise at the position where the NPC is located, since the first voice received by the NPC is masked by the ambient noise at the position where the NPC is located, the voice intensity of the first voice heard by the NPC is equal to the voice intensity of the ambient noise at the position where the NPC is located.

[0081] When the excess voice intensity is equal to the voice intensity of the ambient noise at the position where the NPC is located, as can be seen from the calculation method of the difference between the excess voice intensity and the voice intensity of the ambient noise, the voice intensity of the first voice heard by the NPC is 0, that is, the NPC is actually not hearing the voice.

[0082] By adopting the above method, based on the excess voice intensity when the first voice propagates to the location of the NPC and the voice intensity of the environmental noise at the location of the NPC, the voice intensity of the first voice heard by the NPC can be accurately determined, improving the accuracy of the voice intensity of the first voice heard by the NPC, and at the same time, it is also beneficial for accurately controlling the NPC to execute the action operation corresponding to the first voice.

[0083] As one selectable example, the above step of obtaining the voice intensity of the environmental noise at the location of the NPC includes a step of determining the target grid where the NPC is located in the target game scene, where the target game scene is pre-divided into a set of grids, the set of grids includes the target grid, and the voice intensity of the environmental noise corresponding to each grid in the set of grids is pre-set, and the voice intensity of the environmental noise corresponding to each grid is the voice intensity obtained by determining based on the type of virtual terrain in each grid, and a step of determining that the voice intensity of the environmental noise at the location of the NPC is equal to the voice intensity of the environmental noise corresponding to the pre-set target grid.

[0084] Before obtaining the voice intensity of the environmental noise at the location of the NPC, it is necessary to grid and divide the entire game scene. For example, based on the actual game screen, the entire game scene is divided into 2D square grids or 3D cube grids. In the embodiments of the present application, it is assumed that the entire 3D game screen is divided into a set of 0.5m * 0.5m * 0.5m cube grids shown in FIG. 9.

[0085] Using the game scene after being grid-divided as above, the specific implementation steps for determining the voice intensity of the environmental noise at the location of the NPC include the following steps.

[0086] S1: Set the voice intensity of the environmental noise of each grid in the target game scene.

[0087] As is obvious and for easy understanding, in the actual life scene, the voice intensity of the environmental noise when in the forest is greater than that when in the grassland. On the other hand, the voice intensity of the environmental noise when around the waterfall is greater than that when in the forest. That is, the type of the virtual terrain in each grid directly affects the voice intensity of the environmental noise in that grid.

[0088] Therefore, in the embodiments of the present application, a simulation system from a set of virtual terrains to the voice intensity of environmental noise is constructed. That is, based on the type of the virtual terrain in each grid, the voice intensity of the environmental noise corresponding to each grid can be determined.

[0089] As shown in FIG. 10, when the virtual terrain where the NPC is located is a forest, the corresponding voice intensity of the environmental noise is preset to 10 DB. When the virtual terrain where the NPC is located is grassland, the corresponding voice intensity of the environmental noise is preset to 0 DB. When the virtual terrain where the NPC is located is a waterfall, the corresponding voice intensity of the environmental noise is preset to 20 DB.

[0090] In the embodiments of the present application, by pre-calculating the voice intensity of the environmental noise of each grid in this game scene, the query time of the voice intensity of the environmental noise is shortened, the efficiency of determining the voice intensity of the environmental noise corresponding to each grid is improved, and the data processing efficiency of the server is increased.

[0091] S2: Determine the target grid where the NPC is located in the target game scene.

[0092] For example, when the position where the NPC is located is completely within one grid, directly determine that grid as the target grid where the NPC is located. When the position where the NPC is located is within two or more grids, determine the grid with the largest ratio of the NPC's position among the multiple grids as the target grid.

[0093] S3: Determine the voice intensity of the environmental noise corresponding to the preset target grid as the voice intensity of the environmental noise at the location of the NPC.

[0094] As described above, noise, as one type of sound, can also propagate in a medium and there is also a situation of attenuation. Regarding the voice intensity of the environmental noise corresponding to each grid, in addition to being affected by the virtual terrain of the grid itself, it is further affected by the virtual terrain in the surrounding grids. Therefore, in the embodiments of the present application, a simulation form of linear attenuation is also adopted to determine the voice intensity of the environmental noise corresponding to each grid.

[0095] As one selectable example, when considering the virtual terrain in the surrounding grids, the implementation method for determining the voice intensity of the environmental noise corresponding to each grid is as follows.

[0096] For each grid in a set of grids, An operation of obtaining the voice intensity of the initial noise corresponding to the current grid, where the voice intensity of the initial noise has a predetermined correspondence with the type of the virtual terrain in the current grid, the operation, and An operation of obtaining the voice intensity of the propagated noise received by the current grid, where the voice intensity of the propagated noise includes the excess voice intensity when the initial noise corresponding to each grid other than the current grid in a set of grids propagates to the current grid, the operation, and An operation of determining the voice intensity of the environmental noise corresponding to the current grid based on the voice intensity of the initial noise and the voice intensity of the propagated noise, and Execute to obtain the voice intensity of the environmental noise corresponding to each grid. Here, when executing the above operations, each grid is the current grid.

[0097] As shown in FIG. 11, assuming that there are a total of two grids in a set of grids and assuming that Grid 1# is the current grid, the specific steps for determining the voice intensity of the environmental noise corresponding to the current grid are as follows.

[0098] S11: First, simulate the audio intensity of the initial noise corresponding to each grid based on the virtual terrain in each grid.

[0099] For example, the audio intensity of the initial noise of Grid 1# is 10, and the audio intensity of the initial noise of Grid 2# is 20.

[0100] S12: Calculate the noise influence value on the surrounding grids during the propagation process of the initial noise corresponding to each grid.

[0101] Here, the noise influence value may be the excess audio intensity when the initial noise corresponding to each grid other than the current grid in a set of grids propagates to the current grid, but is not limited thereto. For example, the excess audio intensity when the initial noise corresponding to Grid 1# propagates to Grid 2# is 5, and the excess audio intensity when the initial noise corresponding to Grid 2# propagates to Grid 1# is 15. That is, it means that the audio intensity of the propagated noise received by Grid 1# from Grid 2# is 15, and the audio intensity of the propagated noise received by Grid 2# from Grid 1# is 5. Here, in each of the above steps, the measurement unit of the audio intensity may be decibel (dB), but is not limited thereto.

[0102] It should be noted that during the process of the initial noise corresponding to Grid 1# propagating to Grid 2# or the initial noise corresponding to Grid 2# propagating to Grid 1#, there is attenuation of the audio intensity in both cases.

[0103] S13: Determine the audio intensity of the environmental noise corresponding to Grid 1# based on the audio intensity of the initial noise corresponding to Grid 1# and the audio intensity of the propagated noise received by Grid 1#.

[0104] When determining grid 2# as the current grid by adopting the same method as the above steps S11 to S13, the audio intensity of the environmental noise corresponding to grid 2# can also be determined based on the audio intensity of the initial noise and the audio intensity of the propagation noise received by grid 2#.

[0105] As one selectable example, the above step of determining the audio intensity of the environmental noise corresponding to the current grid based on the audio intensity of the initial noise and the audio intensity of the propagation noise is determining that the audio intensity of the environmental noise corresponding to the current grid is equal to the maximum audio intensity among the audio intensity of the initial noise and the audio intensity of the propagation noise, or determining that the audio intensity of the environmental noise corresponding to the current grid is equal to the sum of the audio intensity of the initial noise and the audio intensity of the propagation noise, or determining that the audio intensity of the environmental noise corresponding to the current grid is equal to the value obtained by weighted summing the audio intensity of the initial noise and the audio intensity of the propagation noise.

[0106] Hereinafter, in combination with specific examples, the specific implementation method of the audio intensity of the environmental noise corresponding to the above current grid will be described.

[0107] (1) Regarding the case of determining that the audio intensity of the environmental noise corresponding to the current grid is equal to the maximum audio intensity among the audio intensity of the initial noise and the audio intensity of the propagation noise, it is as follows.

[0108] As shown in FIG. 11, when grid 1# is the current grid, assuming that the audio intensity of the initial noise of grid 1# is 10 and the audio intensity of the propagation noise received by grid 1# is 15, the maximum value among 10 and 15 is taken as the final audio intensity of the environmental noise of grid 1#, that is, the audio intensity of the environmental noise corresponding to grid 1# is 15.

[0109] When Grid 2# is the current grid, assuming that the voice intensity of the initial noise of Grid 2# is 20 and the voice intensity of the propagation noise received by Grid 2# is 5, the maximum value of 20 and 5 is set as the voice intensity of the final environmental noise of Grid 2#, that is, the voice intensity of the environmental noise corresponding to Grid 2# is 20.

[0110] (2) Regarding the case where it is determined that the voice intensity of the environmental noise corresponding to the current grid is equal to the sum of the voice intensity of the initial noise and the voice intensity of the propagation noise, it is as follows.

[0111] As shown in FIG. 12, assuming that a set of grids includes a total of 9 grids, and the voice intensities of the initial noises corresponding to Grids 1# to 9# are V1, V2... V9 respectively, an example will be described with the current grid being Grid 5#.

[0112] Since Grids 1# to 4# and 6# to 9# are included around Grid 5#, assuming that the excess voice intensities when the initial noises corresponding to each of Grids 1# to 4# are propagated to Grid 5# are V’1 to V’4 respectively, and the excess voice intensities when the initial noises corresponding to each of Grids 6# to 9# are propagated to Grid 5# are V’6 to V’9 respectively. In this case, the voice intensity of the environmental noise corresponding to Grid 5# is V = V5 + V’1... V’4 + V’6 + V’9.

[0113] As a point to be explained, adopting the above linear attenuation simulation format, when the initial noises corresponding to the above Grids 1# to 4# and 6# to 9# are propagated to Grid 5#, the voice intensity of each initial noise may attenuate to 0. That is, some of the values in the voice intensities V’1 to V’4, V’6 to V’9 of the propagation noise received by Grid 5# may be 0.

[0114] (3) Regarding the case where it is determined that the voice intensity of the environmental noise corresponding to the current grid is equal to the value obtained by weighted summing the voice intensity of the initial noise and the voice intensity of the propagation noise, it is as follows.

[0115] Still taking FIG. 12 as an example, different weights are set for the voice intensity of the propagation noise received by grid 5# based on the type of initial noise corresponding to grids 1# to 4#, 6# to 9#, or the magnitude of the distance between grids 1# to 4#, 6# to 9# and grid 5#. For example, the weight occupied by the voice intensity of the propagation noise of the surrounding grids relatively close to grid 5# is relatively large, and the weight occupied by the voice intensity of the propagation noise of the surrounding grids relatively far from grid 5# is relatively small.

[0116] The voice intensity V5 of the initial noise of grid 5# and the voice intensities V'1 to V'4, V'6 to V'9 of the propagation noise are weighted and summed, and the voice intensity of the environmental noise corresponding to grid 5# obtained is V = W1V5 + W2V'1... W5V'4 + W6V'6... W9V'9.

[0117] Based on the premise of considering the virtual terrain of the location of the NPC by the above method, by introducing the voice intensity of the initial noise corresponding to the target grid where the NPC is located and the voice intensity of the propagation noise received by the target grid, the attenuation of the environmental noise and the influence of the environmental noise of the surrounding grids on the voice intensity of the environmental noise corresponding to the target grid are fully considered, and the authenticity of the environmental noise is improved.

[0118] As one selectable example, the above method is a step of setting a predetermined auditory radius based on the character type of the NPC, where when the character type of the NPC is a character type sensitive to hearing, the predetermined auditory radius is set to a first value, and when the character type of the NPC is not a character type sensitive to hearing, the predetermined auditory radius is set to a second value, and the first value is greater than the second value, or A step of setting a predetermined hearing radius based on the current state of the NPC, where when the current state of the NPC is a state of not receiving attack damage, the predetermined hearing radius is set to a first value, and when the current state of the NPC is a state of receiving attack damage, the predetermined hearing radius is set to a second value, and the first value is greater than the second value, or A step of setting a predetermined hearing radius based on the activation state of the NPC's target skill, where the target skill is used to increase the hearing range of the NPC in the activated state, and when the activation state of the target skill is an activated state, the predetermined hearing radius is set to a first value, and when the activation state of the target skill is an unactivated state, the predetermined hearing radius is set to a second value, and the first value is greater than the second value, further including the step.

[0119] As can be understood in conjunction with the description of the above embodiments, the predetermined hearing radius of the NPC indicates the hearing perception ability of the NPC itself and can also be understood as the hearing range within which the NPC can receive voices. Therefore, in the process of determining whether the NPC can hear the first voice emitted by the first player character, the setting of the predetermined hearing radius plays a very important role. Hereinafter, an example will be combined to explain how to set the predetermined hearing radius of the NPC.

[0120] First type: Assume that based on the character type of the NPC, the NPC is divided into two different types: those with sensitive hearing and those with insensitive hearing.

[0121] When the distance from the first player character is the same, the voice intensity of the first voice heard by the NPC with sensitive hearing is greater than the voice intensity of the first voice heard by the NPC with insensitive hearing. Or, the NPC with sensitive hearing can hear the first voice emitted by the first player character, while the NPC with insensitive hearing cannot hear the first voice. That is, the predetermined hearing radius of the NPC with sensitive hearing is greater than the predetermined hearing radius of the NPC with insensitive hearing.

[0122] As shown in Fig. 13(a), when setting the predetermined hearing radius of an NPC sensitive to hearing to a first value r1 and the predetermined hearing radius of an NPC not sensitive to hearing to a second value r2, r1 > r2.

[0123] Second type: Assume that based on the state characteristics of the NPC, the NPCs are divided into two different types: those that have been attacked and those that have not been attacked.

[0124] Obviously, for the sake of easy understanding, when the distance from the first player character is the same, the voice intensity of the first voice heard by the attacked NPC is less than the voice intensity of the first voice heard by the NPC that has not been attacked. Or, an NPC that has not been attacked can hear the first voice emitted by the first player character, while an attacked NPC cannot hear the first voice. That is, the predetermined hearing radius of an NPC that has not been attacked is larger than the predetermined hearing radius of an attacked NPC.

[0125] As shown in Fig. 13(b), when setting the predetermined hearing radius of an NPC that has not been attacked to a first value r3 and the predetermined hearing radius of an attacked NPC to a second value r4, r3 > r4.

[0126] Third type: Assume that based on the skill activation state of the NPC, the NPCs are divided into two different types: those with the skill not activated and those with the skill activated.

[0127] When the distance from the first player character is the same, the voice intensity of the first voice heard by an NPC with the skill not activated is greater than the voice intensity of the first voice heard by an NPC with the skill activated. Or, an NPC with the skill not activated can hear the first voice emitted by the first player character, while an NPC with the skill activated cannot hear the first voice. That is, the predetermined hearing radius of an NPC with the skill not activated is larger than the predetermined hearing radius of an NPC with the skill activated.

[0128] As shown in FIG. 13(c), when setting the predetermined hearing radius of an NPC with the skill not activated to a first value r5 and the predetermined hearing radius of an NPC with the skill activated to a second value r6, r5 > r6.

[0129] By the above method, based on the character type of the NPC, the current state of the NPC, and the activation state of the target skill of the NPC, after setting different types, the predetermined hearing radius of the NPCs in different states improves the flexibility of the setting of the predetermined hearing radius and improves the authenticity of the predetermined hearing radius.

[0130] As one selectable example, based on parameters such as the predetermined hearing radius of the NPC, the first voice intensity threshold, and the second voice intensity threshold, the NPC can be controlled to execute a first action operation and a second action operation corresponding to the first voice. In addition, the switching of the action operations of the NPC can also be controlled by the first voice intensity threshold and the second voice intensity threshold. Specifically, In the process of controlling the NPC to execute the action operation corresponding to the first voice, a step of obtaining the second voice intensity of the second voice and the second propagation distance of the second voice, where the second voice is the voice emitted by the second player character at the second position, the second voice intensity is the predetermined voice intensity corresponding to the second motion state of the second player character at the second position, and the second propagation distance is the propagation distance determined based on the second voice intensity, and When the second target distance between the NPC and the second player character is less than the second propagation distance and less than the predetermined hearing radius of the NPC, a step of determining the voice intensity of the second voice heard by the NPC based on the second voice intensity and the second target distance, and When the voice intensity of the second voice heard by the NPC is greater than or equal to the first voice intensity threshold and greater than the voice intensity of the first voice heard by the NPC, a step of controlling the NPC to stop executing the action operation corresponding to the first voice and controlling the NPC to execute the action operation corresponding to the second voice.

[0131] Here, the method for obtaining the second voice intensity and the second propagation distance is similar to that of the first voice intensity and the first propagation distance, and the above description can be referred to.

[0132] As shown in FIG. 14(a), assume that the NPC is performing an action operation corresponding to the voice emitted by the first player character P1, for example, approaching the first player character P1. The second player character P2 located at the second position S2 emits a second voice, and based on the voice intensity corresponding to the second motion state of the second player character P2 at the second position S2, the second voice intensity V2 corresponding to the second motion state of P2 at S2 is obtained. Since the specific process can refer to the description of the first voice intensity corresponding to the first motion state of the first player character at the first position in the above embodiment, detailed description is omitted here.

[0133] Here, the second motion state of the second player character P2 at the second position S2 includes, but is not limited to, sneaking, full-speed running, walking, flying, etc. shown in FIG. 4.

[0134] When the second target distance between the NPC and the second player character is less than the second propagation distance and less than the predetermined hearing radius of the NPC, it is determined that the NPC can hear the second voice emitted by the second player character. At this time, based on the second voice intensity V2 and the second target distance, the voice intensity of the second voice heard by the NPC is determined.

[0135] If the voice intensity of the second voice heard by the NPC is greater than or equal to the first voice intensity threshold and greater than the voice intensity of the first voice heard by the NPC, it means that the NPC has already perceived the second voice, and the second voice heard by the NPC interferes with the first voice heard by the NPC in advance. In this case, the NPC stops approaching the first player character P1 and executes an action operation corresponding to the second voice. For example, as shown in FIG. 14(b), it moves away from the second player character P1.

[0136] In this way, when the NPC hears the first voice and the second voice uttered by the first player character and the second player character, respectively, the voice intensities of the first voice and the second voice are calculated. When it is determined that the voice intensity of the second voice heard by the NPC is greater than the voice intensity of the first voice heard by the NPC, the action operation executed by the NPC is switched, improving the flexibility of the action operation executed by the NPC, enriching the gameplay, and enhancing the user experience.

[0137] To understand the above non-player character control method more clearly, it will be further described below in conjunction with the overall flowchart shown in FIG. 15. Specifically, it includes the following steps.

[0138] S1502: Calculate the voice intensity of the environmental noise.

[0139] For example, according to the schematic diagrams shown in FIGS. 9 to 12, the target game scene is pre-divided into a set of grids, and the voice intensity of the environmental noise corresponding to each grid is determined based on the type of virtual terrain in each grid of the set of grids. Since the determination of the voice intensity of the environmental noise of each grid can refer to the description of the above embodiments, detailed description is omitted here.

[0140] S1504: Simulate the voice intensity of the first voice uttered by the player character.

[0141] Assuming that the player character utters the first voice at the first position in the game scene, the voice intensity of the first voice of the player character can be simulated based on the motion state of the player character at the first position.

[0142] Here, the relationship between the voice intensity of the first voice and the type of virtual terrain where the first position is located and / or the motion state of the player character can be determined by querying a pre-created relationship mapping table, but it is not limited thereto.

[0143] S1506: Screen the NPCs based on the propagation distance of the first voice and the predetermined hearing radius of the NPCs.

[0144] As an optional example, screen the NPCs according to the propagation distance d of the first voice shown in FIG. 5 and the predetermined hearing radius of the NPCs. The specific implementation process is as follows.

[0145] As shown in FIG. 5, assuming that the propagation distance of the first voice emitted by the first player character (which can also be understood as the first propagation distance of the first voice) is d and the target distance between the first player character and NPC1 is d1, since d1>d and NPC1 is relatively far away from the first player character, NPC1 cannot hear the first voice. On the other hand, since the target distance between the first player character and NPC2 is d2, d2<d and d2<r, it is determined that NPC2 can hear the first voice. Here, r is the predetermined hearing radius of NPC2, and r determines the hearing range of NPC2.

[0146] In addition, whether NPC1 and NPC2 can hear the first voice can also be determined by the following implementation process. When the first player character emits the first voice, first, based on the propagation distance d of the first voice, the NPCs within the range of the propagation distance d can be determined. As shown in FIG. 5, including NPC1 and NPC2, then, based on whether the sound source of the first voice is within the predetermined hearing radius of the NPC, it can be determined that only NPC2 can hear the first voice. For NPC1, although it is within the range of the propagation distance d of the first voice, since the sound source of the first voice is outside the predetermined hearing radius of NPC1, NPC1 cannot hear the first voice.

[0147] The target distance between the NPC screened by the above method and the first player character is less than the propagation distance of the first voice and less than the predetermined hearing radius of the NPC.

[0148] Furthermore, by adopting the above method to screen NPCs, it is only necessary to perform subsequent calculations for some NPCs that meet the requirements. Here, the subsequent calculations include, but are not limited to, the calculation of the excess voice intensity of the first voice received by the NPC, the calculation of the voice intensity of the first voice actually heard by the NPC, etc.

[0149] For example, assuming that the total number of NPCs in the virtual scene is 100, according to the above screening method, only two NPCs are determined to meet the requirements. In this case, since it is only necessary to calculate the excess voice intensity of the first voice received by the two NPCs and the voice intensity of the first voice actually heard, the amount of calculation is reduced, and the technical effect of improving the efficiency of the NPC to execute action operations is realized.

[0150] S1508: Calculate the excess voice intensity of the first voice received by the NPC when the first voice propagates to the first position.

[0151] To ensure the authenticity of the sound source simulation, when the voice propagates in the medium, it is necessary to fully consider that the intensity of the voice continues to attenuate with the increase of the distance, and the attenuation situation of the voice is related to factors such as the attenuation formula, distance, and characteristics of the medium. For example, as shown in FIG. 8(a), the voice intensity of the first voice emitted from the location of the sound source gradually attenuates to 0 with the increase of the propagation distance.

[0152] Here, in the embodiments of the present application, the specific process of voice attenuation can be simulated according to the linear attenuation formula, but it is not limited thereto. For example, y = a / x, where y is the excess voice intensity of the first voice received by the NPC, x is the first target distance between the first player character and the NPC, and a is the first voice intensity of the first voice emitted by the first player character at the first position.

[0153] S1510: Query the voice intensity of the environmental noise.

[0154] First, grid the entire game scene and divide it into a set of grids. Then, preset the audio intensity of the environmental noise corresponding to each grid in the set of grids. Finally, determine the audio intensity obtained by the NPC based on the type of virtual terrain in each grid.

[0155] As a selectable example, directly determine the audio intensity of the environmental noise at the location of the NPC as the audio intensity of the environmental noise corresponding to the preset target grid, or determine the audio intensity of the environmental noise corresponding to the target grid based on the initial noise corresponding to the queried target grid and the excess audio intensity after the initial noise emitted from the surrounding grids propagates to the target grid. For the specific process, reference can be made to the description of the above embodiments.

[0156] S1512: Calculate the audio intensity of the first voice actually heard by the NPC.

[0157] Exemplarily, when the excess audio intensity when the first voice propagates to the location of the NPC is greater than the audio intensity of the environmental noise, determine that the audio intensity of the first voice heard by the NPC is equal to the difference between the excess audio intensity and the audio intensity of the environmental noise, or When the excess audio intensity is less than or equal to the audio intensity of the environmental noise, determine that the audio intensity of the first voice heard by the NPC is equal to or 0 of the audio intensity of the environmental noise.

[0158] S1514: Compare the relationship between the audio intensity of the first voice heard by the NPC and the auditory perception threshold and the auditory discovery threshold, and perform corresponding action operations as in step S1516.

[0159] For example, when the audio intensity of the first voice heard by the NPC is greater than or equal to the auditory perception threshold (the first voice intensity threshold), perform the first action operation in the above embodiments, for example, search for the player.

[0160] When the voice intensity of the first voice heard by the NPC is equal to or greater than the auditory detection threshold (second voice intensity threshold), the NPC is controlled to execute a second action operation, for example, to talk or interact with the player.

[0161] S1516: Control the NPC to execute an action operation corresponding to the first voice.

[0162] According to the above embodiment of the present application, when it is determined that the NPC can hear the first voice emitted by the first player character based on the first target distance between the non-player character (NPC) and the first player character and the predetermined auditory radius of the NPC, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, the NPC is controlled to execute an action operation corresponding to the first voice. In other words, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold, the NPC can accurately execute the corresponding action operation, avoid the technical problem that the NPC cannot be accurately controlled to execute the action operation, and realize the technical effect of improving the accuracy of controlling the NPC to execute the action operation.

[0163] It should be noted that for the above method embodiments, for the sake of simplicity of description, they are all expressed as a combination of a series of operations. However, those skilled in the art should understand that according to the present invention, some steps may be performed in other orders or simultaneously, so the present invention is not limited to the order of the operations described. Next, those skilled in the art should also understand that the embodiments described in the specification all belong to preferred embodiments, and such operations and modules are not necessarily essential to the present invention.

[0164] According to another aspect of the embodiment of the present invention, a control device for a non-player character shown in FIG. 16 is further provided. The device includes A first acquisition unit 1602 used to acquire a first voice intensity of a first voice and a first propagation distance of the first voice, where the first voice is a voice emitted by a first player character at a first position, the first voice intensity is a predetermined voice intensity corresponding to a first motion state of the first player character at the first position, and the first propagation distance is a propagation distance determined based on the first voice intensity. The first acquisition unit 1602, A first processing unit 1604 used to determine a voice intensity of the first voice heard by an NPC based on the first voice intensity and a first target distance when the first target distance between the non-player character NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC. A second processing unit 1606 used to control the NPC to execute an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is greater than or equal to a first voice intensity threshold.

[0165] Optionally, the second processing unit 1606 A first processing module used to control the NPC to execute a first action operation when the voice intensity of the first voice heard by the NPC is greater than or equal to a first voice intensity threshold and less than a second voice intensity threshold, where the first action operation is an action operation executed when the NPC perceives the voice.

[0166] Optionally, the first processing module A first processing sub-module used to control the NPC to execute a second action operation when the voice intensity of the first voice heard by the NPC is greater than or equal to the second voice intensity threshold, where the second action operation is an action operation executed when the NPC discovers the first player character.

[0167] Optionally, the second processing unit 1606 When the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, control is performed so that the NPC moves to the first position, or Including a second processing module used to control the NPC to search for the first player character in the process of moving to the first position when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold.

[0168] Optionally, the second processing module When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, control is performed so that the NPC moves in a direction away from the first player character, or control is performed so that the NPC moves in the direction of the first player character, or When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, it further includes a second processing sub-module used to control the NPC to perform an interaction operation with the first player character.

[0169] Optionally, the first processing unit 1604 A third processing module used to determine the excess voice intensity when the first voice propagates to the position where the NPC is located based on the first voice intensity and the first target distance, A first acquisition module used to acquire the voice intensity of the environmental noise at the position where the NPC is located, Including a fourth processing module used to determine the voice intensity of the first voice heard by the NPC based on the excess voice intensity and the voice intensity of the environmental noise.

[0170] Optionally, the first acquisition module A third processing sub-module used to determine the target grid of the location of an NPC in a target game scene, where the target game scene is pre-divided into a set of grids, the set of grids includes the target grid, and the voice intensity of the environmental noise corresponding to each grid in the set of grids is pre-set. The voice intensity of the environmental noise corresponding to each grid is the voice intensity obtained by determining based on the type of virtual terrain in each grid, the third processing sub-module, A fourth processing sub-module used to determine that the voice intensity of the environmental noise at the location of the NPC is equal to the voice intensity of the environmental noise corresponding to a pre-set target grid, and includes.

[0171] Optionally, the first acquisition module For each grid in a set of grids An operation to obtain the voice intensity of the initial noise corresponding to the current grid, where the voice intensity of the initial noise has a predetermined correspondence with the type of virtual terrain in the current grid, the operation, An operation to obtain the voice intensity of the propagation noise received by the current grid, where the voice intensity of the propagation noise includes the excess voice intensity when the initial noise corresponding to each grid other than the current grid in a set of grids propagates to the current grid, the operation, Based on the voice intensity of the initial noise and the voice intensity of the propagation noise, an operation to determine the voice intensity of the environmental noise corresponding to the current grid, and is used to obtain the voice intensity of the environmental noise corresponding to each grid. When performing the above operations, each grid is the current grid, and further includes a fifth processing sub-module.

[0172] Optionally, the above device Determine that the voice intensity of the environmental noise corresponding to the current grid is equal to the maximum voice intensity of the voice intensity of the initial noise and the voice intensity of the propagation noise, or Determine that the voice intensity of the environmental noise corresponding to the current grid is equal to the sum of the voice intensity of the initial noise and the voice intensity of the propagation noise, or It further includes a sixth processing sub-module used to determine that the voice intensity of the environmental noise corresponding to the current grid is equal to a value obtained by weighted summing the voice intensity of the initial noise and the voice intensity of the propagation noise.

[0173] Optionally, the fourth processing module When the excess voice intensity is greater than the voice intensity of the environmental noise, determine that the voice intensity of the first voice heard by the NPC is equal to the difference between the excess voice intensity and the voice intensity of the environmental noise, and / or It includes a seventh processing sub-module used to determine that the voice intensity of the first voice heard by the NPC is equal to the voice intensity of the environmental noise or 0 when the excess voice intensity is less than or equal to the voice intensity of the environmental noise.

[0174] Optionally, the device further includes a third processing unit The third processing unit is used to set a predetermined hearing radius based on the character type of the NPC. Here, when the character type of the NPC is a character type sensitive to hearing, the predetermined hearing radius is set to a first value; when the character type of the NPC is not a character type sensitive to hearing, the predetermined hearing radius is set to a second value, and the first value is greater than the second value, or It is used to set a predetermined hearing radius based on the current state of the NPC. Here, when the current state of the NPC is a state of not receiving attack damage, the predetermined hearing radius is set to a first value; when the current state of the NPC is a state of receiving attack damage, the predetermined hearing radius is set to a second value, and the first value is greater than the second value, or It is used to set a predetermined auditory radius based on the activation state of the NPC's target skill. Here, the target skill is used to increase the NPC's auditory range when activated. When the activation state of the target skill is the activated state, the predetermined auditory radius is set to the first value. When the activation state of the target skill is the unactivated state, the predetermined auditory radius is set to the second value, and the first value is greater than the second value.

[0175] Optionally, the above device A second acquisition unit used to acquire the second voice intensity of the second voice and the second propagation distance of the second voice in the process of controlling the NPC to execute an action operation corresponding to the first voice. Here, the second voice is the voice emitted by the second player character at the second position. The second voice intensity is a predetermined voice intensity corresponding to the second motion state of the second player character at the second position. The second propagation distance is the propagation distance determined based on the second voice intensity. A fourth processing unit used to determine the voice intensity of the second voice heard by the NPC based on the second voice intensity and the second target distance when the second target distance between the NPC and the second player character is less than the second propagation distance and less than the predetermined auditory radius of the NPC. A fifth processing unit used to control the NPC to stop executing the action operation corresponding to the first voice and control the NPC to execute the action operation corresponding to the second voice when the voice intensity of the second voice heard by the NPC is greater than or equal to the first voice intensity threshold and greater than the voice intensity of the first voice heard by the NPC.

[0176] By applying the above device, when it is determined that an NPC can hear a first voice emitted by a first player character based on a first target distance between the non-player character (NPC) and the first player character and a predetermined hearing radius of the NPC, the voice intensity of the first voice heard by the NPC is compared with a first voice intensity threshold value, so as to control the NPC to execute an action operation corresponding to the first voice. In other words, by comparing the voice intensity of the first voice heard by the NPC with the first voice intensity threshold value, the NPC can accurately execute a corresponding action operation, avoiding the technical problem that the NPC cannot be accurately controlled to execute an action operation, and realizing the technical effect of improving the accuracy of controlling the NPC to execute an action operation.

[0177] It should be noted that since the embodiments of the control device for the non-player character here can refer to the embodiments of the control method for the non-player character above, the detailed description here is omitted.

[0178] According to still another aspect of the embodiments of the present application, there is further provided an electronic device used to implement the above control method for the non-player character. The electronic device may be the terminal device shown in FIG. 17. This embodiment will be described by taking the example that the electronic device is a background device. As shown in FIG. 17, the electronic device includes a memory 1702 and a processor 1704. A computer program is stored in the memory 1702, and the processor 1704 is configured to execute the steps in any of the above method embodiments by the computer program.

[0179] Optionally, in this embodiment, the electronic device may be located at at least one network device among a plurality of network devices of a computer network.

[0180] Optionally, in this embodiment, the processor is configured by a computer program to Step S1 of obtaining the first voice intensity of the first voice and the first propagation distance of the first voice, where the first voice is the voice emitted by the first player character at the first position, the first voice intensity is a predetermined voice intensity corresponding to the first motion state of the first player character at the first position, and the first propagation distance is the propagation distance determined based on the first voice intensity. Step S1 Step S2 of determining the voice intensity of the first voice heard by the non-player character (NPC) based on the first voice intensity and the first target distance when the first target distance between the NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC Step S3 of controlling the NPC to execute an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold may be set to be executed

[0181] Optionally, as can be understood by those skilled in the art, the structure shown in FIG. 17 is merely exemplary, and the electronic device or electronic equipment may be a target terminal such as a smartphone (e.g., Android mobile phone, iOS mobile phone, etc.), tablet computer, palmtop computer, and mobile Internet device (MID), PAD, etc. FIG. 17 does not limit the structure of the above electronic device and electronic equipment. For example, the electronic device and electronic equipment may include more or fewer components (e.g., network interface, etc.) than shown in FIG. 17, or may have a different arrangement from that shown in FIG. 17

[0182] Here, the memory 1702 can be used to store software programs and modules, such as the non-player character control method and the program instructions / modules corresponding to the device in the embodiments of the present application. The processor 1704 can execute various functional applications and data processing by operating the software programs and modules stored in the memory 1702, that is, to implement the above non-player character control method. The memory 1702 may include a high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some examples, the memory 1702 may further include a memory installed remotely with respect to the processor 1704, and these remote memories can be connected to the terminal through a network. Examples of the above network include, but are not limited to, the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof. Here, the memory 1702 can specifically be used to store, but is not limited to, the first audio intensity of the first audio, the first target distance between the NPC and the first player character, and the predetermined hearing radius of the NPC, etc. As an example, as shown in FIG. 17, the memory 1702 can include, but is not limited to, the first acquisition unit 1602, the first processing unit 1604, and the second processing unit 1606 in the non-player character control device. Further, it can further include other module units in the non-player character control device, but is not limited thereto, and detailed description in this example is omitted.

[0183] Optionally, the above transmission device 1706 is used to receive or transmit data via one network. Specific examples of the above network may include a wired network and a wireless network. In one example, the transmission device 1706 includes a network interface controller (NIC), which can communicate with the Internet or a local area network by being connectable to other network devices and routers by a network cable. In one example, the transmission device 1706 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0184] In addition, the above electronic device further includes a display 1708 used to display the azimuth prompt information of the above target voice, and a connection bus 1710 used to connect each module member in the above electronic device.

[0185] In other embodiments, the above target terminal or server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the plurality of nodes in the form of network communication. Here, a peer-to-peer (P2P) network can be configured between the nodes, and any form of computer device, such as an electronic device such as a server and a terminal, can become a node in the blockchain system by joining the peer-to-peer network.

[0186] According to one aspect of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions 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 by executing the computer instructions by the processor, the computer device executes a control method for a non-player character provided in various selectable implementation manners such as the check processing of the server. Here, when the computer program operates, it is set to execute the steps in any of the method embodiments.

[0187] Optionally, in this embodiment, the computer-readable storage medium is Step S1 of obtaining the first voice intensity of the first voice and the first propagation distance of the first voice, where the first voice is the voice emitted by the first player character at the first position, the first voice intensity is a predetermined voice intensity corresponding to the first motion state of the first player character at the first position, and the first propagation distance is the propagation distance determined based on the first voice intensity. Step S1, Step S2 of determining the voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance when the first target distance between the non-player character NPC and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC, Step S3 of controlling the NPC to execute an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is greater than or equal to the first voice intensity threshold may be set to store a computer program for executing.

[0188] Optionally, in this embodiment, as can be understood by those skilled in the art, all or part of the steps in the various methods of the above embodiments can be completed by issuing instructions to the relevant hardware of the target terminal by a program, and the program may be stored in a computer-readable storage medium. The storage medium may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0189] The numbers of the embodiments of the present application described above are only used for description and do not indicate the superiority or inferiority of the embodiments.

[0190] The integrated unit in the above embodiment is realized in the form of a software functional unit, and when it is sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention can be essentially, or a part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, includes a plurality of instructions, and is used to cause all or part of the steps of the method of each embodiment of the present invention to be executed on one or more computer devices (which may be personal computers, servers, or network devices, etc.).

[0191] In the above embodiments of the present invention, each embodiment is described with emphasis respectively. For parts not described in detail in a certain embodiment, the relevant descriptions of other embodiments can be referred to.

[0192] In some embodiments of the present application, it should be understood that the disclosed client can be implemented in other ways. Here, the device embodiments described above are merely exemplary. For example, the division of units is only a division of one kind of logic function, and when actually implemented, other division methods may be adopted. For example, a plurality of units or components may be combined, or integrated into another system, or some features may be ignored or not executed. On the other hand, the couplings, direct couplings, or communication connections shown or referred to between each other may be indirect couplings or communication connections through some interfaces, units, or modules, and may be electrical or other forms.

[0193] The units described as separate members may or may not be physically separated. The members shown as units may or may not be physical units, that is, they may be located in one place or distributed among a plurality of network units. According to actual needs, some or all of the units can be selected to achieve the purpose of the solution means of this embodiment.

[0194] Also, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may physically exist alone, and two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of a software functional unit.

[0195] The above are only preferred embodiments of the present invention. It should be noted that those skilled in the art can further make a plurality of improvements and modifications without departing from the principle of the present invention, and these improvements and modifications should also be regarded as within the protection scope of the present invention.

Claims

1. A method for controlling a non-player character, comprising: obtaining a first voice intensity of a first voice and a first propagation distance of the first voice, wherein the first voice is a voice emitted by a first player character at a first position, the first voice intensity is a predetermined voice intensity corresponding to a first motion state of the first player character at the first position, and the first propagation distance is a propagation distance determined based on the first voice intensity; when a first target distance between the non-player character (NPC) and the first player character is less than the first propagation distance and less than a predetermined hearing radius of the NPC, determining a voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance; and when the voice intensity of the first voice heard by the NPC is equal to or greater than a first voice intensity threshold, controlling the NPC to execute an action operation corresponding to the first voice. A method for controlling a non-player character, characterized by comprising the above steps.

2. When the voice intensity of the first voice heard by the NPC is equal to or greater than a first voice intensity threshold, the step of controlling the NPC to execute an action operation corresponding to the first voice comprises: when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than a second voice intensity threshold, controlling the NPC to execute a first action operation, wherein the first action operation is an action operation executed when the NPC perceives the voice. The method according to claim 1, characterized by comprising the above steps.

3. When the voice intensity of the first voice heard by the NPC is equal to or greater than a first voice intensity threshold, the step of controlling the NPC to execute an action operation corresponding to the first voice comprises: when the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, controlling the NPC to execute a second action operation, wherein the second action operation is an action operation executed when the NPC discovers the first player character. The method according to claim 2, further characterized by comprising the above steps.

4. When the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold, the step of controlling the NPC to execute an action operation corresponding to the first voice is as follows: When the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, the step of controlling the NPC to move to the first position, or The method according to claim 1, characterized in that when the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold and less than the second voice intensity threshold, the step includes controlling the NPC to search for the first player character during the process of moving to the first position.

5. When the voice intensity of the first voice heard by the NPC is equal to or greater than the first voice intensity threshold, the step of controlling the NPC to execute an action operation corresponding to the first voice is as follows: When the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, the step of controlling the NPC to move in a direction away from the first player character, or controlling the NPC to move in the direction of the first player character, or The method according to claim 4, further characterized in that when the voice intensity of the first voice heard by the NPC is equal to or greater than the second voice intensity threshold, the step includes controlling the NPC to execute an interaction operation with the first player character.

6. The step of determining the voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance is as follows: Based on the first voice intensity and the first target distance, the step of determining the excess voice intensity when the first voice propagates to the position where the NPC is located, and The step of obtaining the voice intensity of the environmental noise at the position where the NPC is located, and Based on the excess voice intensity and the voice intensity of the environmental noise, the step of determining the voice intensity of the first voice heard by the NPC. The method according to any one of claims 1 to 5 is characterized by including the above steps.

7. The above step of obtaining the voice intensity of the environmental noise at the position where the NPC is located is A step of determining a target grid of the location of the NPC in a target game scene, wherein the target game scene is pre-divided into a set of grids, the set of grids includes the target grid, and the audio intensity of environmental noise corresponding to each grid in the set of grids is pre-set, and the audio intensity of environmental noise corresponding to each grid is the audio intensity obtained by determining based on the type of virtual terrain in each grid. A step of determining that the audio intensity of environmental noise at the location of the NPC is equal to the audio intensity of environmental noise corresponding to the pre-set target grid. The method according to claim 6 is characterized by including this step.

8. The method is For each grid in the set of grids An operation of obtaining the audio intensity of initial noise corresponding to the current grid, wherein the audio intensity of the initial noise has a predetermined correspondence with the type of virtual terrain in the current grid. An operation of obtaining the audio intensity of propagation noise received by the current grid, wherein the audio intensity of the propagation noise includes the excess audio intensity when the initial noise corresponding to each grid other than the current grid in the set of grids propagates to the current grid. An operation of determining the audio intensity of environmental noise corresponding to the current grid based on the audio intensity of the initial noise and the audio intensity of the propagation noise. A step of executing the above operations to obtain the audio intensity of environmental noise corresponding to each grid, wherein when the operations are executed, each grid is the current grid. The method according to claim 7 is characterized by further including this step.

9. Determining the audio intensity of environmental noise corresponding to the current grid based on the audio intensity of the initial noise and the audio intensity of the propagation noise means Determining that the audio intensity of environmental noise corresponding to the current grid is equal to the maximum audio intensity among the audio intensity of the initial noise and the audio intensity of the propagation noise, or Determining that the audio intensity of environmental noise corresponding to the current grid is equal to the sum of the audio intensity of the initial noise and the audio intensity of the propagation noise, or The method according to claim 8, comprising the step of determining that the voice intensity of the environmental noise corresponding to the current grid is equal to a value obtained by weighted summation of the voice intensity of the initial noise and the voice intensity of the propagation noise.

10. The step of determining the voice intensity of the first voice heard by the NPC based on the excess voice intensity and the voice intensity of the environmental noise is when the excess voice intensity is greater than the voice intensity of the environmental noise, determining that the voice intensity of the first voice heard by the NPC is equal to the difference between the excess voice intensity and the voice intensity of the environmental noise, and / or when the excess voice intensity is less than or equal to the voice intensity of the environmental noise, determining that the voice intensity of the first voice heard by the NPC is equal to or 0 of the voice intensity of the environmental noise, the method according to any one of claims 6 to 9.

11. The method is a step of setting the predetermined hearing radius based on the character type of the NPC, wherein when the character type of the NPC is a character type sensitive to hearing, the predetermined hearing radius is set to a first value, and when the character type of the NPC is not a character type sensitive to hearing, the predetermined hearing radius is set to a second value, and the first value is greater than the second value, or a step of setting the predetermined hearing radius based on the current state of the NPC, wherein when the current state of the NPC is a state not receiving attack damage, the predetermined hearing radius is set to the first value, and when the current state of the NPC is a state receiving attack damage, the predetermined hearing radius is set to the second value, and the first value is greater than the second value, or a step of setting the predetermined hearing radius based on the activation state of the target skill of the NPC, wherein the target skill is used to increase the hearing range of the NPC in an activated state, and when the activation state of the target skill is an activated state, the predetermined hearing radius is set to the first value, and when the activation state of the target skill is an unactivated state, the predetermined hearing radius is set to the second value, and the first value is greater than the second value, the method according to any one of claims 1 to 10, further comprising the step.

12. The method is In the process of controlling the NPC to execute an action operation corresponding to the first voice, a step of obtaining a second voice intensity of a second voice and a second propagation distance of the second voice, where the second voice is a voice emitted by a second player character at a second position, the second voice intensity is a predetermined voice intensity corresponding to a second motion state of the second player character at the second position, and the second propagation distance is a propagation distance determined based on the second voice intensity, the step; A step of determining a voice intensity of the second voice heard by the NPC based on the second voice intensity and the second target distance when a second target distance between the NPC and the second player character is less than the second propagation distance and less than a predetermined auditory radius of the NPC; The method according to any one of claims 1 to 11, further comprising a step of controlling the NPC to stop executing the action operation corresponding to the first voice and controlling the NPC to execute the action operation corresponding to the second voice when the voice intensity of the second voice heard by the NPC is equal to or greater than the first voice intensity threshold and greater than the voice intensity of the first voice heard by the NPC.

13. A control device for a non-player character, A first acquisition unit used for acquiring a first voice intensity of a first voice and a first propagation distance of the first voice, where the first voice is a voice emitted by a first player character at a first position, the first voice intensity is a predetermined voice intensity corresponding to a first motion state of the first player character at the first position, and the first propagation distance is a propagation distance determined based on the first voice intensity, the first acquisition unit; A first processing unit used for determining a voice intensity of the first voice heard by the NPC based on the first voice intensity and the first target distance when a first target distance between the non-player character (NPC) and the first player character is less than the first propagation distance and less than a predetermined auditory radius of the NPC; A non-player character control device, comprising: a second processing unit used to control the NPC to execute an action operation corresponding to the first voice when the voice intensity of the first voice heard by the NPC is equal to or greater than a first voice intensity threshold value.

14. A computer-readable storage medium, comprising a stored program, wherein when the program is operated by a terminal device or a computer, the method according to any one of claims 1 to 12 can be executed.

15. A computer program product comprising a computer program / instructions, wherein when the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 12 are realized.

16. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 12 by the computer program.

Citation Information

Patent Citations

  • Method and device for controlling non-player game character in game

    CN111760294A

  • Sound processing method and device, computer equipment and storage medium

    CN113398590A

  • Non-player game role control method and device, equipment and storage medium

    CN113440839A

  • Non-player virtual character control method and device, storage medium and electronic equipment

    CN113559517A