Movatterモバイル変換


[0]ホーム

URL:


CN113440839A - Method, device, equipment and storage medium for controlling non-player game role - Google Patents

Method, device, equipment and storage medium for controlling non-player game role
Download PDF

Info

Publication number
CN113440839A
CN113440839ACN202110812441.1ACN202110812441ACN113440839ACN 113440839 ACN113440839 ACN 113440839ACN 202110812441 ACN202110812441 ACN 202110812441ACN 113440839 ACN113440839 ACN 113440839A
Authority
CN
China
Prior art keywords
game
event
npc
target
scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110812441.1A
Other languages
Chinese (zh)
Inventor
孙静
蒋晨凤
浦东旭
王佳伟
白海霞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co LtdfiledCriticalNetease Hangzhou Network Co Ltd
Priority to CN202110812441.1ApriorityCriticalpatent/CN113440839A/en
Publication of CN113440839ApublicationCriticalpatent/CN113440839A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请提供一种非玩家游戏角色的控制方法、装置、设备及存储介质,涉及游戏技术领域。游戏包括游戏场景和位于所述游戏场景中的虚拟对象以及多个非玩家游戏角色(Non‑Player Character,NPC),该方法包括:接收所述游戏场景中虚拟对象发送的游戏事件,所述游戏事件为所述虚拟对象执行目标游戏行为所触发的事件;根据所述游戏事件,从所述游戏场景中的多个NPC中确定目标NPC;将所述游戏事件发送至所述目标NPC,以使所述目标NPC执行所述游戏事件对应的行为。相对于现有技术,避免了每个NPC都在频繁获取周边的状态信息数据,从而造成游戏的性能消耗过高的问题。

Figure 202110812441

The present application provides a control method, device, device and storage medium for a non-player game character, and relates to the technical field of games. The game includes a game scene, virtual objects located in the game scene, and a plurality of non-player game characters (Non-Player Character, NPC). The method includes: receiving a game event sent by a virtual object in the game scene, and the game The event is an event triggered by the virtual object executing the target game behavior; according to the game event, the target NPC is determined from a plurality of NPCs in the game scene; the game event is sent to the target NPC, so that the The target NPC executes the behavior corresponding to the game event. Compared with the prior art, it avoids the problem that each NPC frequently obtains the surrounding state information data, thereby causing high performance consumption of the game.

Figure 202110812441

Description

Method, device, equipment and storage medium for controlling non-player game role
Technical Field
The present application relates to the field of game technologies, and in particular, to a method, an apparatus, a device, and a storage medium for controlling a non-player game character.
Background
For a game, a game NPC (Non-Player Character) is an essential element, and in order to make the NPC more vivid, game developers generally give AI (artificial intelligence) to the NPC, and collectively refer to behavior logic of the game NPC as a game AI, and the excellent game AI can bring a better game experience to players. In the game, the behavior logic of the NPC can be one of the game actors with the game playing property, which can provide information to the player through different processing expressions of events, including voice, actions and the like, through which the player can presume the progress stage, the self-risk degree and some important guidance contents of the current game, or some hidden contents and the like, so that a large number of NPCs in the game are important components of the play core and information transmission.
In the prior art, generally, the NPCs are required to actively monitor information data in a surrounding game scene, acquire state information in the surrounding game scene, perform decision-making judgment on the state information data acquired by each NPC according to a decision tree, and determine corresponding performance of each NPC.
However, since each NPC frequently acquires surrounding status information data, the performance consumption of the game is too high.
Disclosure of Invention
The present application aims to provide a method, an apparatus, a device and a storage medium for controlling a non-player character, so as to solve the problem that in the prior art, each NPC frequently acquires surrounding status information data, thereby resulting in too high performance consumption of a game.
In order to achieve the above purpose, the technical solutions adopted in the embodiments of the present application are as follows:
in a first aspect, an embodiment of the present application provides a method for controlling a non-player game character, where the game includes a game scene and a virtual object located in the game scene, and a plurality of non-player game characters (NPCs), the method including:
receiving a game event sent by a virtual object in the game scene, wherein the game event is an event triggered by the virtual object executing a target game behavior;
determining a target NPC from a plurality of NPCs in the game scene according to the game event;
and sending the game event to the target NPC so that the target NPC executes the action corresponding to the game event.
Optionally, the method further comprises:
when a behavior termination instruction of the target NPC is detected, the NPC is re-determined from the game scene according to the game event;
and sending the game event to the re-determined NPC so that the re-determined NPC executes the action corresponding to the game event.
Optionally, the method further comprises:
and when an event termination instruction of the virtual object is detected, sending a termination instruction to the target NPC, wherein the termination instruction is used for enabling the target NPC to terminate the execution of the action corresponding to the game event.
Optionally, the determining a target NPC from the game scene according to the game event includes:
and determining the target NPC from the game scene by adopting the screening condition corresponding to the event type according to the event type of the game event.
Optionally, the event type includes: determining the target NPC from the game scene by adopting a screening condition corresponding to the event type according to the event type of the game event, wherein the distance triggering event comprises the following steps:
and according to the distance information in the game event, determining the NPC closest to the virtual object as the target NPC from the preset range of the virtual object in the game scene.
Optionally, the event type includes: associating events, wherein determining the target NPC from the game scene by adopting screening conditions corresponding to the event types according to the event types of the game events comprises the following steps:
determining the NPC corresponding to the identification information as the target NPC from the game scene according to the identification information of the associated NPC in the game event; wherein the associated NPC is a preconfigured NPC associated with the virtual object.
Optionally, the virtual object is a virtual article, a virtual character, or an NPC.
In a second aspect, another embodiment of the present application provides an apparatus for controlling a non-player character, the game including a game scene and a plurality of NPCs and virtual objects located in the game scene, the apparatus comprising: the device comprises a receiving module, a determining module and a sending module, wherein:
the receiving module is configured to receive a game event sent by a virtual object in the game scene, where the game event is an event triggered by the virtual object executing a target game behavior;
the determining module is used for determining a target NPC from a plurality of NPCs in the game scene according to the game event;
the sending module is configured to send the game event to the target NPC, so that the target NPC executes a behavior corresponding to the game event.
Optionally, the determining module is specifically configured to, when a behavior termination instruction of the target NPC is detected, re-determine the NPC from the game scene according to the game event;
the sending module is specifically configured to send the game event to the re-determined NPC, so that the re-determined NPC executes a behavior corresponding to the game event.
Optionally, the sending module is specifically configured to send a termination instruction to the target NPC when the event termination instruction of the virtual object is detected, where the termination instruction is used to enable the target NPC to terminate execution of a behavior corresponding to the game event.
Optionally, the determining module is specifically configured to determine the target NPC from the game scene by using a filtering condition corresponding to the event type according to the event type of the game event.
Optionally, the event type includes: and the determining module is specifically configured to determine, according to the distance information in the game event, an NPC closest to the virtual object as the target NPC from a preset range of the virtual object in the game scene.
Optionally, the event type includes: the determining module is specifically configured to determine, according to identification information of an associated NPC in the game event, an NPC corresponding to the identification information as the target NPC from the game scene; wherein the associated NPC is a preconfigured NPC associated with the virtual object.
Optionally, the virtual object is a virtual article, a virtual character, or an NPC.
In a third aspect, another embodiment of the present application provides a control apparatus for a non-player game character, including: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating via the bus when a control device of a non-player game character is operating, the processor executing the machine-readable instructions to perform the steps of the method according to any one of the first aspects.
In a fourth aspect, another embodiment of the present application provides a storage medium having a computer program stored thereon, where the computer program is executed by a processor to perform the steps of the method according to any one of the above first aspects.
The beneficial effect of this application is: by adopting the control method of the non-player game character provided by the application, the game event is the event triggered by the virtual character in the received game scene when the game action is executed, then the target NPC is directly determined in the NPCs in the game scene according to the game event, and sends the game event to the target NPC, so that the target NPC can directly execute the corresponding action of the game event according to the received game event, in such a manner, the NPC does not need to continuously acquire state data in the surrounding range, and then determine events and corresponding expressions of the NPCs according to the state data, but directly after the virtual character triggers a game event, the target NPC is determined from a plurality of NPCs in the game scene based on the game event, in such a manner that since the NPC need not actively continuously acquire status data, but directly receives game events, thereby greatly reducing the consumption of performance and improving the game performance.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
FIG. 1 is a flow chart illustrating a method for controlling a non-player character according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an interaction provided by an embodiment of the present application;
FIG. 3 is a schematic interface diagram of a game scenario provided in an embodiment of the present application;
FIG. 4 is a flow chart illustrating a method for controlling a non-player character according to another embodiment of the present application;
FIG. 5 is a flow chart illustrating a method for controlling a non-player character according to another embodiment of the present application;
FIG. 6 is a schematic structural diagram of a control device for a non-player character according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a control device of a non-player game character according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments.
The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
Additionally, the flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and steps without logical context may be performed in reverse order or simultaneously. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
It should be noted that in the embodiments of the present application, the term "comprising" is used to indicate the presence of the features stated hereinafter, but does not exclude the addition of further features.
It is worth noting that prior art generally needs each NPC in a game scene to actively and continuously acquire surrounding state information data by taking itself as a center before the application is filed, which causes that each NPC needs to frequently acquire surrounding information, so that performance is continuously consumed no matter whether a game event occurs in the game scene, and the pressure on CPU performance is huge, and each NPC reads surrounding state information data, reads the read data into its own behavior tree, and determines a behavior decision according with its own state according to different judgments of the behavior tree, but this method has a deep traversal depth and consumes a lot of performance. In a real application scene, the performance consumption of the manner of determining the behavior decision of each NPC is large, and the problem of influencing the game experience of the player is caused.
In the method for controlling the non-player game character, each game event is an event triggered by a virtual character in a game scene when the game behavior is executed, and then an upper manager directly determines a target NPC in a plurality of NPCs in the game scene according to the received game event and sends the game event to the target NPC, so that the target NPC can directly execute a behavior corresponding to the game event according to the received game event, without continuously acquiring state data in a preset range by the NPC, and then determines the game event and corresponding behavior expression of each NPC according to the state data, but directly determines the target NPC from the NPCs in the game scene according to the game event after the game event is triggered by the virtual character, and without continuously acquiring the state data actively by each NPC in the game scene, but directly receives the game event forwarded by the upper manager, the consumption of performance is greatly reduced and the game performance is improved.
The following explains a control method for a non-player game character provided in the embodiments of the present application with reference to a plurality of specific application examples. Fig. 1 is a schematic flowchart of a method for controlling a non-player game character according to an embodiment of the present application, where a game includes a game scene, a virtual object located in the game scene, and a plurality of non-player game characters (NPCs), and as shown in fig. 1, the method includes:
s101: and receiving a game event sent by a virtual object in the game scene.
The game event is an event triggered by the virtual object executing the target game behavior; in the embodiment of the present application, an upper manager is used to perform the method, and the upper manager may be, for example, a server, and the upper manager may receive each game event sent by each virtual object in the game scene.
In embodiments of the present application, the virtual object may be, for example, a virtual article, a virtual character, or an NPC; for example, when the virtual object is a controlled virtual character corresponding to a player, the game event may be, for example, a game event in which the player operates the controlled virtual character in the game scene using an interfering object virtual item, and the game event is sent to the controlled virtual character using the interfering object virtual item; for example, when the virtual object is a virtual object, and the game event may be, for example, when a player operates a controlled virtual character in a game scene, the controlled virtual character touches a virtual object in the game scene, and then the controlled virtual character touches the virtual object, which is the game event sent by the virtual object, and the virtual object may be, for example, a virtual alarm, a virtual inductor, or the like; for example, when the virtual object is an NPC, the game event may be, for example, a game event that the NPC sees a controlled virtual character when the NPC executes its own task, for example, when a certain area in a game scene in which the NPC is responsible is patrolled, the event that the controlled virtual character is seen is the game event sent by the NPC; it should be understood that the above embodiments are only exemplary, and the content that may be included in a specific game event may be flexibly adjusted according to the user's needs, and is not limited to the above embodiments.
S102: a target NPC is determined from a plurality of NPCs in a game scene based on a game event.
Different game events may have different rules for determining the target NPC, the target NPC may be determined in a plurality of NPCs in the game scene according to the different game events in the determination process, and the target NPCs corresponding to the different game events may be different and may be the same.
S103: and sending the game event to the target NPC so that the target NPC executes the action corresponding to the game event.
In an embodiment of the present application, for example, a preset behavior tree may be set in the game server, where the preset behavior tree may include, for example, a plurality of game events and preset behaviors corresponding to the game events, and after the target NPC receives a game event, the preset behavior corresponding to the current game event may be determined according to the current game event, so that the target NPC executes the preset behavior corresponding to the game event in the game scene according to the determined preset behavior, because the behavior tree in the present application deletes a plurality of state nodes of the behavior tree for analyzing surrounding information, performance consumption caused by node traversal operation is reduced to a great extent, on one hand, readability of the preset behavior tree is greatly improved, on the other hand, overall operation efficiency is improved, so that the corresponding preset behavior may be determined directly according to the game event, and the game event does not need to be determined according to state information first, and then the preset behavior is determined according to the game event, so that the traversal depth of the preset behavior tree is greatly reduced, the traversal speed is improved, and the consumption of game performance is further reduced.
According to the setting mode, each NPC in a game scene does not need to actively monitor the surrounding state, namely, a part of the NPC which screens the state of the NPC according to surrounding information is removed, the specific situation of each type of state is split, the state data is changed into a game event, namely, the NPC directly obtains the game event forwarded by an upper layer server, namely, the upper layer server directly sends the game event to a target NPC, the NPC actively monitors the surrounding state data and adjusts the state data to passively receive the game event, the situation that the game event in the game cannot be controlled due to the fact that the state is the main mode is effectively removed, and the performance of a Central Processing Unit (CPU) can be improved by more than 33%; and the game events are directly used as direct data and core data for processing, so that the plan can also configure priority, different expressions, different propagation ranges or different trigger opportunities and the like for each game event, the controllability of game event processing is greatly increased, and each behavior feedback can be controllably expressed to the player, thereby improving the game experience of the player.
Fig. 2 is an interaction schematic diagram provided in an embodiment of the present application, and as shown in fig. 2, an interaction process includes: theupper manager 301 may transmit and receive data between thesender 302 and thereceiver 303, respectively, as a transfer station and a listener for data transmission between thesender 302 and thereceiver 303, and perform unified data management independently of the two parties, and decouple both thesender 302 and thereceiver 303.
In addition, the method converts Artificial Intelligence (AI) triggering from brain-free cyclic search peripheral state information of each NPC into on-demand triggering, each NPC directly receives the game event sent by an upper manager, and arranges basic data of triggering, receiving and expressing of the game event and the like into a configuration table, so that the high configurability of the plan is realized, and the high controllability of the game event can be realized by the plan regardless of the propagation mode of the game event, the screening condition of a propagation object and the expressing mode of a target NPC after the game event is received; for example, different game events can be combined and classified, so that the priorities of behaviors corresponding to the game events can be sequenced in the subsequent process, all the general attributes and rules under the same game event can be arranged, and the realization of diversified design of each game event can be conveniently planned on the basis of the standard of the game event in the later process.
In addition, in the method of taking the game event as a main body, a planning staff can check the current game event processed by each NPC at any time in the planning process and process the progress of the game event, so that the planning staff can better control and adjust the attribute data of each game event.
In addition, according to the setting mode in the application, after the CPU performance is improved by more than 33%, because NPCs can not generate a large amount of performance consumption due to continuous detection of surrounding state data, each NPC in a game scene can be used as an NPC which can interact with a controlled virtual character or a virtual object, so that NPCs which can not interact cannot exist in a game, a player is not required to judge whether each NPC in the current game scene can interact, the understanding cost of the player in the game process is reduced, the game playing method is clearer, and the game experience of the player is further improved.
By adopting the control method of the non-player game character provided by the application, the game event is the event triggered by the virtual character in the received game scene when the game action is executed, then the target NPC is directly determined in the NPCs in the game scene according to the game event, and sends the game event to the target NPC, so that the target NPC can directly execute the corresponding action of the game event according to the received game event, in such a way, the NPC is not required to continuously acquire state data in the surrounding range, and then the event and the corresponding performance of each NPC are determined according to the state data, but directly determines the target NPC from the NPCs in the game scene according to the game event after the game event is triggered by the virtual character, in this way, because the NPC does not need to actively and continuously acquire state data, but directly receives game events, thereby greatly reducing the consumption of performance and improving the game performance.
In some possible embodiments, for example, the S102 may determine the target NPC from the game scene by using the filtering condition corresponding to the event type according to the event type of the game event, that is, different event types may correspond to different filtering conditions, and specifically, the target NPC is determined according to different event types when the target NPC is determined; in other possible embodiments, for example, the target NPC may be determined according to a screening condition corresponding to a virtual object type of a sender of the game event, where different virtual object types may correspond to different screening conditions, for example, when a virtual police and a virtual civilian in the game trigger the same game event, conditions corresponding to the screening target NPC are not necessarily the same; it should be understood that the above embodiments are only exemplary, and the specific manner of screening the target NPC may be flexibly adjusted according to the user's needs, and is not limited to the embodiments described above.
For example, in some possible embodiments, the event types may include, for example: a distance triggering event, where the distance triggering event may be, for example, an event with distance propagation limitation, such as a sound event or a visual field event, and the like, where the event is determined whether each NPC can receive the event according to a distance between the event initiator virtual object and each NPC, for example, an NPC closest to the event initiator virtual object can receive the time, or an NPC within a preset range from the event initiator virtual object can receive the event, so that the event is determined as a distance triggering event, it should be understood that event content included in a specific distance triggering event may be flexibly adjusted according to user requirements, and is not limited to what is given in the above embodiments, so as to determine a target NPC, for example, an NPC closest to the event initiator virtual object may be used as an example, in this case, S102 may be based on distance information in a game event, and determining the NPC closest to the virtual object as the target NPC from the preset range of the virtual object of the current event initiator in the game scene.
Fig. 3 is an interface schematic diagram of a game scene provided in an embodiment of the present application, which is illustrated by taking a distance triggering event as a sound event, where an event initiator virtual object in a current game scene is a sound source virtual object, and as shown in fig. 3, the interface schematic diagram includes 6 area points, 5 connection points, 1 sound source and 4 receivers in the current game scene, where transmission of the sound event may be, for example, directly transmitted to the receivers by the sound source or transmitted to the receivers by at least one connection point associated with the sound source, for example, a connection point within a preset range of the sound source is a connection point associated with the sound source, but a propagation distance of the sound event transmitted to the receivers by the connection point may have an attenuation, for example, the connection point itself may generate a distance initial attenuation of 3 units when the sound event propagates, and the attenuation may also be caused by a distance between the connection point and the sound source, Other attenuation occurs due to obstructions, etc., i.e., different points of connection may differ for propagation distances from the same sound event. For example, in some possible embodiments, an NPC that is less than or equal to 10 linear distance from the sound source or the connection point is an NPC that can receive a sound event.
As shown in fig. 3, when the area 1 includes a sound source and one receiver, and the distance between the sound source in the area 1 and the receiver in the area 1 is 3, which is smaller than 10, it indicates that the receiver NPC in the area 1 can receive the sound event currently; the receiver NPC does not exist in zone 2, so no judgment is needed; in addition to the initial attenuation, there are other attenuations of 4 units at the connection point in the area 3, and at this time, the NPC whose linear distance from the connection point in the area 3 is less than or equal to 3 can receive the sound event, and since there is only one receiver in the area 3 and the distance between the receiver and the connection point is 2, less than 3, it indicates that the NPC of the receiver in the current area 3 can receive the sound event; the connection point in the area 4 has no attenuation except the initial attenuation, and at this time, NPCs having a linear distance from the connection point in the area 4 of less than or equal to 7 can receive the sound event, and since the distance between the receiver in the area 4 and the connection point is 6 and less than 7, the NPC of the receiver in the current area 4 can receive the sound event; the connection point in the area 5 has 4 unit attenuations besides the initial attenuation, at this time, the NPC which is less than or equal to 3 from the straight line distance between the connection points in the area 3 can receive the sound event, and because only one receiver exists in the area 5, and the distance between the receiver and the connection point is 4 and is greater than 3, the NPC of the receiver in the current area 5 cannot receive the sound event; the receiver NPC does not exist in zone 6, so no judgment is needed; it should be understood that the above embodiments are only exemplary, and the initial attenuation, other attenuations of specific connection points, and the setting of the threshold value of the linear distance may be flexibly adjusted according to the user's needs, and are not limited to the above embodiments.
In other possible embodiments, the event type may also be an associated event, for example, where the associated event may be configured in advance, and at this time, the method of determining the target NPC is to determine, as the target NPC, an NPC having an association relationship with the event initiator virtual object, and then S102 may include: determining the NPC corresponding to the identification information as a target NPC from a game scene according to the identification information of the associated NPC in the game event; the associated NPC is a preconfigured NPC associated with a virtual object, for example, a game scene including a virtual guard and a virtual monitor is taken as an example to explain, if the NPC responsible for monitoring sees that a game event 1 occurs in an area a in the current virtual monitor, the game event 1 is sent to an upper manager, the upper manager directly determines identification information of the NPC responsible for the area a in the game scene according to a preset association relationship, sends the game event 1 to the virtual guard responsible for the area a in the game scene, and receives the virtual guard of the game event a, which is a target NPC.
In some possible embodiments, the number of target NPCs corresponding to an event in a game is not necessarily 1, for example, when some distance propagation events are sound propagation events, NPCs within 10 meters of a straight line distance from a virtual object emitting the sound event in a game scene may receive the sound event, but the behaviors performed by different target NPCs after receiving the sound event are not necessarily the same; or for some visual field events, multiple virtual objects may see the visual field event at the same time and send the visual field event to the upper manager, wherein for the same visual field event, the corresponding target NPCs of different virtual objects under the visual field event may be the same or different; or for some associated events, one associated event may correspond to multiple target NPCs, and it should be understood that the foregoing embodiment is merely an exemplary illustration, and the specific manner in which each event determines a target NPC and the number of target NPCs may be flexibly adjusted according to the user requirement, and is not limited to the foregoing embodiment.
In the process of determining the target NPC, the upper manager may filter, according to the conditions such as the range information required by the game event, the identity information of the target NPC, the execution timing information, and the idle information, the NPC that all the conditions satisfy as the target NPC corresponding to the game event, and take the target NPC as the receiver of the game event.
Optionally, on the basis of the above embodiments, embodiments of the present application may further provide a method for controlling a non-player character, and an implementation process of the method is described below with reference to the accompanying drawings. Fig. 4 is a flowchart illustrating a method for controlling a non-player character according to another embodiment of the present application, where as shown in fig. 4, the method may further include:
s104: and when the action termination instruction of the target NPC is detected, the NPC is re-determined from the game scene according to the game event.
In some possible embodiments, for example, in the process of executing the preset behavior corresponding to the game event, if the target NPC receives a game event with a higher priority again, or the target NPC dies in the process of executing the preset behavior corresponding to the game event, a behavior termination instruction may be generated, where the behavior termination instruction indicates that the current target NPC cannot continue to execute the game event, it should be understood that the manner in which the target NPC may trigger the termination instruction is merely an exemplary illustration, and the manner in which the termination instruction is specifically triggered may be flexibly adjusted according to the user requirement, and is not limited to the manner in the embodiment.
After the upper manager detects the behavior termination instruction of the target NPC, the upper manager continuously re-screens the NPC which meets all the conditions as the NPC corresponding to the game event as a receiver of the game event according to the conditions such as the range information required by the game event, the identity information of the target NPC, the execution opportunity information, whether the game event is idle or not and the like.
S105: and sending the game event to the re-determined NPC so that the re-determined NPC executes the action corresponding to the game event.
Optionally, on the basis of the above embodiments, embodiments of the present application may further provide a method for controlling a non-player character, and an implementation process of the method is described below with reference to the accompanying drawings. Fig. 5 is a flowchart illustrating a method for controlling a non-player character according to another embodiment of the present application, and as shown in fig. 5, the method may further include:
s106: and when an event termination instruction of the virtual object is detected, sending a termination instruction to the target NPC, wherein the termination instruction is used for enabling the target NPC to terminate the execution of the action corresponding to the game event.
The upper manager serves as a transfer station between the virtual object and the target NPC, and when receiving a termination instruction sent by any one of the virtual object and the target NPC, the upper manager controls the target NPC to terminate the current behavior.
In other possible embodiments, after the game event is processed, the upper manager may also compare the receipt correspondingly sent by the virtual object and the target NPC, and after the comparison determines that the current game event is successfully executed, it determines that the current game event is processed, that is, the upper manager may simultaneously monitor information between the virtual object of the event sender and the target NPC of the event receiver, and perform unified data management on each game event independently of the two parties, and decouple the two parties.
By adopting the control method of the non-player game character provided by the application, as the game event is the game event triggered by the virtual character in the received game scene when the game action is executed, then the target NPC is directly determined in the NPCs in the game scene according to the game event, and sends the game event to the target NPC, so that the target NPC can directly execute the corresponding action of the game event according to the received game event, in such a way, the NPC is not required to continuously acquire state data in the surrounding range, and then the event and the corresponding performance of each NPC are determined according to the state data, but directly determines the target NPC from the plurality of NPCs in the game scene according to the game event after the NPC triggers the game event, in this way, since the NPC does not need to actively and continuously acquire the state data, but directly receives game events, thereby greatly reducing the consumption of performance and improving the game performance; in addition, data such as trigger conditions, receiving performance and the like corresponding to the game events are arranged in a configuration table in advance, so that the planning height can be configured and controlled; moreover, the method provided by the application can greatly improve the performance of the CPU, so that each NPC in the game scene can be an interactive NPC, namely, the non-interactive NPC does not exist in the game scene any more, thereby reducing the understanding cost of the player, enabling the playing method of the game to be clearer and improving the game experience of the player.
The following explains the control device for a non-player game character provided in the present application with reference to the drawings, where the control device for a non-player game character can execute the control method for a non-player game character in any one of fig. 1 to 5, and specific implementation and beneficial effects thereof are referred to above and will not be described again below.
Fig. 6 is a schematic structural diagram of a control apparatus for a non-player character according to an embodiment of the present application, where a game includes a game scene, a virtual object located in the game scene, and a plurality of NPCs, as shown in fig. 6, the apparatus includes: a receivingmodule 201, a determiningmodule 202 and a sending module 203, wherein:
areceiving module 201, configured to receive a game event sent by a virtual object in a game scene, where the game event is an event triggered by the virtual object executing a target game behavior;
a determiningmodule 202, configured to determine a target NPC from a plurality of NPCs in a game scene according to a game event;
and the sending module 203 is configured to send the game event to the target NPC, so that the target NPC executes a behavior corresponding to the game event.
Optionally, the determiningmodule 201 is specifically configured to, when a behavior termination instruction of the target NPC is detected, re-determine the NPC from the game scene according to the game event;
the sending module 203 is specifically configured to send the game event to the redetermined NPC, so that the redetermined NPC executes an action corresponding to the game event.
Optionally, the sending module 203 is specifically configured to send a termination instruction to the target NPC when an event termination instruction of the virtual object is detected, where the termination instruction is used to enable the target NPC to terminate execution of a behavior corresponding to the game event.
Optionally, the determiningmodule 201 is specifically configured to determine the target NPC from the game scene by using a filtering condition corresponding to the event type according to the event type of the game event.
Optionally, the event types include: the distance triggeringevent determining module 201 is specifically configured to determine, according to the distance information in the game event, an NPC closest to the virtual object as a target NPC from a preset range of the virtual object in the game scene.
Optionally, the event types include: the associatedevent determining module 201 is specifically configured to determine, according to the identification information of the associated NPC in the game event, that the NPC corresponding to the identification information is a target NPC from the game scene; the associated NPC is a preset NPC associated with the virtual object.
Optionally, the virtual object is a virtual article, a virtual character, or an NPC.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 7 is a schematic structural diagram of a control device of a non-player game character according to an embodiment of the present application, where the control device of the non-player game character may be integrated in a terminal device or a chip of the terminal device.
The control device of the non-player game character includes: aprocessor 501, astorage medium 502, and abus 503.
Theprocessor 501 is used for storing a program, and theprocessor 501 calls the program stored in thestorage medium 502 to execute the method embodiment corresponding to fig. 1-5. The specific implementation and technical effects are similar, and are not described herein again.
Optionally, the present application also provides a program product, such as a storage medium, on which a computer program is stored, including a program, which, when executed by a processor, performs embodiments corresponding to the above-described method.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to perform some steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (10)

Translated fromChinese
1.一种非玩家游戏角色的控制方法,其特征在于,所述游戏包括游戏场景和位于所述游戏场景中的虚拟对象以及多个NPC,所述方法包括:1. A control method for a non-player game character, wherein the game comprises a game scene, a virtual object located in the game scene and a plurality of NPCs, the method comprising:接收所述游戏场景中虚拟对象发送的游戏事件,所述游戏事件为所述虚拟对象执行目标游戏行为所触发的事件;receiving a game event sent by a virtual object in the game scene, where the game event is an event triggered by the virtual object performing a target game behavior;根据所述游戏事件,从所述游戏场景中的多个NPC中确定目标NPC;determining a target NPC from a plurality of NPCs in the game scene according to the game event;将所述游戏事件发送至所述目标NPC,以使所述目标NPC执行所述游戏事件对应的行为。The game event is sent to the target NPC, so that the target NPC executes the behavior corresponding to the game event.2.如权利要求1所述的方法,其特征在于,所述方法还包括:2. The method of claim 1, wherein the method further comprises:在检测到所述目标NPC的行为终止指令时,根据所述游戏事件,从所述游戏场景中重新确定NPC;When detecting the behavior termination instruction of the target NPC, re-determining the NPC from the game scene according to the game event;将所述游戏事件发送至所述重新确定的NPC,以使所述重新确定的NPC执行所述游戏事件对应的行为。The game event is sent to the re-determined NPC, so that the re-determined NPC executes the behavior corresponding to the game event.3.如权利要求1所述的方法,其特征在于,所述方法还包括:3. The method of claim 1, wherein the method further comprises:在检测到所述虚拟对象的事件终止指令时,向所述目标NPC发送终止指令,所述终止指令用于使得所述目标NPC终止执行所述游戏事件对应的行为。When an event termination instruction of the virtual object is detected, a termination instruction is sent to the target NPC, where the termination instruction is used to cause the target NPC to terminate execution of the behavior corresponding to the game event.4.如权利要求1所述的方法,其特征在于,所述根据所述游戏事件,从所述游戏场景中确定目标NPC,包括:4. The method of claim 1, wherein determining a target NPC from the game scene according to the game event comprises:根据所述游戏事件的事件类型,采用所述事件类型对应的筛选条件,从所述游戏场景中确定所述目标NPC。According to the event type of the game event, the target NPC is determined from the game scene using the filter condition corresponding to the event type.5.如权利要求4所述的方法,其特征在于,所述事件类型包括:距离触发事件,所述根据所述游戏事件的事件类型,采用所述事件类型对应的筛选条件,从所述游戏场景中确定所述目标NPC,包括:5. The method according to claim 4, wherein the event type comprises: a distance trigger event, and according to the event type of the game event, using a filter condition corresponding to the event type, from the game event Determine the target NPC in the scene, including:根据所述游戏事件中的距离信息,从所述游戏场景中所述虚拟对象的预设范围内,确定与所述虚拟对象距离最近的NPC为所述目标NPC。According to the distance information in the game event, within a preset range of the virtual object in the game scene, the NPC closest to the virtual object is determined as the target NPC.6.如权利要求4所述的方法,其特征在于,所述事件类型包括:关联事件,所述根据所述游戏事件的事件类型,采用所述事件类型对应的筛选条件,从所述游戏场景中确定所述目标NPC,包括:6. The method according to claim 4, wherein the event type comprises: an associated event, and according to the event type of the game event, using a filter condition corresponding to the event type, from the game scene Determine the target NPC in:根据所述游戏事件中关联NPC的标识信息,从所述游戏场景中确定所述标识信息对应的NPC为所述目标NPC;其中,所述关联NPC为预先配置的与所述虚拟对象关联的NPC。According to the identification information of the associated NPC in the game event, it is determined from the game scene that the NPC corresponding to the identification information is the target NPC; wherein the associated NPC is a pre-configured NPC associated with the virtual object .7.如权利要求1-6中任一所述的方法,其特征在于,所述虚拟对象为虚拟物品、虚拟角色或NPC。7. The method according to any one of claims 1-6, wherein the virtual object is a virtual item, a virtual character or an NPC.8.一种非玩家游戏角色的控制装置,其特征在于,所述游戏包括游戏场景和位于所述游戏场景中的虚拟对象以及多个NPC,所述装置包括:接收模块、确定模块和发送模块,其中:8. A control device for a non-player game character, wherein the game includes a game scene, virtual objects located in the game scene, and a plurality of NPCs, the device comprising: a receiving module, a determining module, and a sending module ,in:所述接收模块,用于接收所述游戏场景中虚拟对象发送的游戏事件,所述游戏事件为所述虚拟对象执行目标游戏行为所触发的事件;The receiving module is configured to receive a game event sent by a virtual object in the game scene, where the game event is an event triggered by the virtual object performing a target game behavior;所述确定模块,用于根据所述游戏事件,从所述游戏场景中的多个NPC中确定目标NPC;The determining module is configured to determine a target NPC from a plurality of NPCs in the game scene according to the game event;所述发送模块,用于将所述游戏事件发送至所述目标NPC,以使所述目标NPC执行所述游戏事件对应的行为。The sending module is configured to send the game event to the target NPC, so that the target NPC executes the behavior corresponding to the game event.9.一种非玩家游戏角色的控制设备,其特征在于,所述设备包括:处理器、存储介质和总线,所述存储介质存储有所述处理器可执行的机器可读指令,当所述非玩家游戏角色的控制运行时,所述处理器与所述存储介质之间通过总线通信,所述处理器执行所述机器可读指令,以执行上述权利要求1-7任一项所述的方法。9. A control device for a non-player game character, characterized in that the device comprises: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, when the During the control operation of the non-player game character, the processor communicates with the storage medium through a bus, and the processor executes the machine-readable instruction to execute the method described in any one of the preceding claims 1-7. method.10.一种存储介质,其特征在于,所述存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行上述权利要求1-7任一项所述的方法。10 . A storage medium, wherein a computer program is stored on the storage medium, and the computer program executes the method according to any one of claims 1 to 7 when the computer program is run by a processor.
CN202110812441.1A2021-07-192021-07-19Method, device, equipment and storage medium for controlling non-player game rolePendingCN113440839A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110812441.1ACN113440839A (en)2021-07-192021-07-19Method, device, equipment and storage medium for controlling non-player game role

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110812441.1ACN113440839A (en)2021-07-192021-07-19Method, device, equipment and storage medium for controlling non-player game role

Publications (1)

Publication NumberPublication Date
CN113440839Atrue CN113440839A (en)2021-09-28

Family

ID=77816594

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110812441.1APendingCN113440839A (en)2021-07-192021-07-19Method, device, equipment and storage medium for controlling non-player game role

Country Status (1)

CountryLink
CN (1)CN113440839A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114053710A (en)*2021-11-262022-02-18完美世界(北京)软件科技发展有限公司Display and hiding method and device for non-player character and computer equipment
CN114053715A (en)*2021-11-182022-02-18完美世界(北京)软件科技发展有限公司Feedback control method and device for NPC (game non-player character) and storage medium
CN114130032A (en)*2021-12-062022-03-04珠海金山数字网络科技有限公司 Data update method and device
CN114307150A (en)*2022-01-072022-04-12腾讯科技(深圳)有限公司Interaction method, device, equipment, medium and program product between virtual objects
CN114404982A (en)*2021-12-292022-04-29北京像素软件科技股份有限公司Reference behavior structure editing method and behavior control method for non-player character
CN115245682A (en)*2022-07-152022-10-28深圳市大梦龙途文化传播有限公司Game interaction method, device, system and computer readable storage medium
CN116351059A (en)*2023-03-172023-06-30网易(杭州)网络有限公司 Non-player character control method, device, computer device and storage medium
WO2024066993A1 (en)*2022-09-262024-04-04腾讯科技(深圳)有限公司Non-player character control method and apparatus, storage medium, and electronic device
WO2025039683A1 (en)*2023-08-222025-02-27腾讯科技(深圳)有限公司Object construction method and related device
WO2025086942A1 (en)*2023-10-262025-05-01网易(杭州)网络有限公司Control method and apparatus for virtual character, editing method and apparatus for virtual character, and electronic device
WO2025112922A1 (en)*2023-11-272025-06-05北京字跳网络技术有限公司Interaction method, interaction apparatus and computer-readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007075314A (en)*2005-09-142007-03-29Sony Computer Entertainment IncGame control program, method and game apparatus
US20080227543A1 (en)*2007-03-142008-09-18Namco Bandai Games Inc.Calculation control method, storage medium, and game device
CN103116685A (en)*2011-11-172013-05-22苏州蜗牛数字科技股份有限公司Interaction method of game player and non-player character (NPC) in network games
CN103577704A (en)*2013-11-132014-02-12北京像素软件科技股份有限公司Event handling method and device through NPC in game system
CN112337090A (en)*2020-11-062021-02-09完美世界(重庆)互动科技有限公司Event message broadcasting method and device, storage medium and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2007075314A (en)*2005-09-142007-03-29Sony Computer Entertainment IncGame control program, method and game apparatus
US20080227543A1 (en)*2007-03-142008-09-18Namco Bandai Games Inc.Calculation control method, storage medium, and game device
CN103116685A (en)*2011-11-172013-05-22苏州蜗牛数字科技股份有限公司Interaction method of game player and non-player character (NPC) in network games
CN103577704A (en)*2013-11-132014-02-12北京像素软件科技股份有限公司Event handling method and device through NPC in game system
CN112337090A (en)*2020-11-062021-02-09完美世界(重庆)互动科技有限公司Event message broadcasting method and device, storage medium and electronic device

Cited By (13)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114053715A (en)*2021-11-182022-02-18完美世界(北京)软件科技发展有限公司Feedback control method and device for NPC (game non-player character) and storage medium
CN114053710A (en)*2021-11-262022-02-18完美世界(北京)软件科技发展有限公司Display and hiding method and device for non-player character and computer equipment
CN114130032B (en)*2021-12-062025-08-05珠海金山数字网络科技有限公司Data updating method and device
CN114130032A (en)*2021-12-062022-03-04珠海金山数字网络科技有限公司 Data update method and device
CN114404982A (en)*2021-12-292022-04-29北京像素软件科技股份有限公司Reference behavior structure editing method and behavior control method for non-player character
CN114307150A (en)*2022-01-072022-04-12腾讯科技(深圳)有限公司Interaction method, device, equipment, medium and program product between virtual objects
CN114307150B (en)*2022-01-072023-07-14腾讯科技(深圳)有限公司Method, device, equipment, medium and program product for interaction between virtual objects
CN115245682A (en)*2022-07-152022-10-28深圳市大梦龙途文化传播有限公司Game interaction method, device, system and computer readable storage medium
WO2024066993A1 (en)*2022-09-262024-04-04腾讯科技(深圳)有限公司Non-player character control method and apparatus, storage medium, and electronic device
CN116351059A (en)*2023-03-172023-06-30网易(杭州)网络有限公司 Non-player character control method, device, computer device and storage medium
WO2025039683A1 (en)*2023-08-222025-02-27腾讯科技(深圳)有限公司Object construction method and related device
WO2025086942A1 (en)*2023-10-262025-05-01网易(杭州)网络有限公司Control method and apparatus for virtual character, editing method and apparatus for virtual character, and electronic device
WO2025112922A1 (en)*2023-11-272025-06-05北京字跳网络技术有限公司Interaction method, interaction apparatus and computer-readable storage medium

Similar Documents

PublicationPublication DateTitle
CN113440839A (en)Method, device, equipment and storage medium for controlling non-player game role
US10445103B2 (en)Mobile game data processing method and apparatus
US9358468B2 (en)Pattern detection of avatars in a virtual environment
US20190270021A1 (en)User interaction monitoring
JP2019037549A (en) GAME PROGRAM, GAME PROCESSING METHOD, AND GAME DEVICE
CN107135146B (en)The display methods and device of information
US20150005062A1 (en)Providing situational priority to player communications in a multi-player environment
KR20220133279A (en) Voting result display method and apparatus, device, storage medium and program product
CN111632385B (en) Game control method, device, computer equipment and storage medium
CN106709229B (en)The method and device of NPC object priority response in a kind of game system
CN113350802A (en)Voice communication method, device, terminal and storage medium in game
JP7178421B2 (en) Information processing method, device, program, and recording medium
CN105975066A (en)Control method and device based on virtual reality equipment
CN116363286A (en)Game processing method, game processing device, storage medium and program product
CN108600680A (en)Method for processing video frequency, terminal and computer readable storage medium
CN108600071A (en)A kind of sharing method and mobile terminal of virtual portrait
CN114632328B (en) A method, device, terminal and storage medium for displaying special effects in a game
CN114189731B (en)Feedback method, device, equipment and storage medium after giving virtual gift
CN105245558B (en)Application program running method, system and server supporting virtual online
CN116474359A (en)Abnormal team detection method, device, terminal and computer readable storage medium
US20240424393A1 (en)Virtual world-based character interaction method and apparatus, device, and medium
US20250010211A1 (en)Method and apparatus for displaying historical messages in virtual battles
CN113769407B (en)Control instruction generation method and device, storage medium and electronic device
CN115501612B (en) Method, device, storage medium and processor for detecting cheats in games
US9692803B2 (en)Computer device, system and methods for controlling an exchange of objects between devices

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20210928

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp