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
CN113440839A CN202110812441.1A CN202110812441A CN113440839A CN 113440839 A CN113440839 A CN 113440839A CN 202110812441 A CN202110812441 A CN 202110812441A CN 113440839 A CN113440839 A CN 113440839A
Authority
CN
China
Prior art keywords
game
event
npc
target
virtual object
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 Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110812441.1A priority Critical patent/CN113440839A/en
Publication of CN113440839A publication Critical patent/CN113440839A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/40Processing input control signals of video game devices, e.g. signals generated by the player or derived from the environment
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/45Controlling the progress of the video game
    • A63F13/49Saving the game status; Pausing or ending the game
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/30Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by output arrangements for receiving control signals generated by the game device

Landscapes

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

Abstract

The application provides a method, a device, equipment and a storage medium for controlling a non-player game role, and relates to the technical field of games. A game including a game scene and virtual objects located in the game scene and a plurality of Non-Player characters (NPCs), the method comprising: 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. Compared with the prior art, the problem that each NPC frequently acquires surrounding state information data, so that the performance consumption of the game is too high is solved.

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: the upper manager 301 may transmit and receive data between the sender 302 and the receiver 303, respectively, as a transfer station and a listener for data transmission between the sender 302 and the receiver 303, and perform unified data management independently of the two parties, and decouple both the sender 302 and the receiver 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 receiving module 201, a determining module 202 and a sending module 203, wherein:
a receiving 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 determining module 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 determining module 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 determining module 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 triggering event 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 associated event 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: a processor 501, a storage medium 502, and a bus 503.
The processor 501 is used for storing a program, and the processor 501 calls the program stored in the storage 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)

1. A method of controlling a non-player game character, the game comprising a game scene and a plurality of NPCs located in the game scene, the method comprising:
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.
2. The method of claim 1, wherein 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.
3. The method of claim 1, wherein 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.
4. The method of claim 1, wherein determining a target NPC from the game scene based on the game event comprises:
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.
5. The method of claim 4, wherein the event type comprises: 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.
6. The method of claim 4, wherein the event type comprises: 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.
7. The method of any one of claims 1-6, wherein the virtual object is a virtual item, a virtual character, or an NPC.
8. 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.
9. A control device for a non-player game character, the device comprising: 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 over the bus when the control of the non-player game character is run, the processor executing the machine-readable instructions to perform the method of any of claims 1-7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, performs the method of any of the preceding claims 1-7.
CN202110812441.1A 2021-07-19 2021-07-19 Method, device, equipment and storage medium for controlling non-player game role Pending CN113440839A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110812441.1A CN113440839A (en) 2021-07-19 2021-07-19 Method, device, equipment and storage medium for controlling non-player game role

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110812441.1A CN113440839A (en) 2021-07-19 2021-07-19 Method, device, equipment and storage medium for controlling non-player game role

Publications (1)

Publication Number Publication Date
CN113440839A true CN113440839A (en) 2021-09-28

Family

ID=77816594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110812441.1A Pending CN113440839A (en) 2021-07-19 2021-07-19 Method, device, equipment and storage medium for controlling non-player game role

Country Status (1)

Country Link
CN (1) CN113440839A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114307150A (en) * 2022-01-07 2022-04-12 腾讯科技(深圳)有限公司 Interaction method, device, equipment, medium and program product between virtual objects
WO2024066993A1 (en) * 2022-09-26 2024-04-04 腾讯科技(深圳)有限公司 Non-player character control method and apparatus, storage medium, and electronic device

Citations (5)

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

Patent Citations (5)

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

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114307150A (en) * 2022-01-07 2022-04-12 腾讯科技(深圳)有限公司 Interaction method, device, equipment, medium and program product between virtual objects
CN114307150B (en) * 2022-01-07 2023-07-14 腾讯科技(深圳)有限公司 Method, device, equipment, medium and program product for interaction between virtual objects
WO2024066993A1 (en) * 2022-09-26 2024-04-04 腾讯科技(深圳)有限公司 Non-player character control method and apparatus, storage medium, and electronic device

Similar Documents

Publication Publication Date Title
CN111905370B (en) Method and device for controlling virtual character in game, electronic equipment and storage medium
CN113440839A (en) Method, device, equipment and storage medium for controlling non-player game role
CN108057249B (en) Service data processing method and device
US20180018178A1 (en) Mobile game data processing method and apparatus
US9358468B2 (en) Pattern detection of avatars in a virtual environment
US9898700B2 (en) Method, apparatus, and artificial intelligence server for determining artificial intelligence behavior
CN104965695B (en) The method and apparatus of analog subscriber real-time operation
CN112418580A (en) Risk control method, computer equipment and readable storage medium
CN108379839A (en) Response method, device and the terminal of control
US20220280870A1 (en) Method, apparatus, device, and storage medium, and program product for displaying voting result
CN106572099A (en) Cross-server method and system for network game
CN106709229B (en) The method and device of NPC object priority response in a kind of game system
CN108600680A (en) Method for processing video frequency, terminal and computer readable storage medium
CN113350802A (en) Voice communication method, device, terminal and storage medium in game
CN114288639A (en) Picture display method, providing method, device, equipment and storage medium
CN106445710A (en) Method for determining interactive type object and equipment thereof
CN109925712A (en) A kind of virtual objects controlled system
CN110947182B (en) Event handling method, event handling device, game terminal and medium
CN112138409A (en) Game result prediction method, device and storage medium
CN114189731B (en) Feedback method, device, equipment and storage medium after giving virtual gift
CN109304035A (en) Acquisition methods, device, terminal device and the storage medium of game duration
CN112619157B (en) Game fight interaction method and device, electronic equipment, readable medium and product
CN111494955B (en) Character interaction method, device, server and medium based on game
CN105245558B (en) Application program running method, system and server supporting virtual online
KR20140032541A (en) Method of and system for transferring to game ai in the event of communication disconnect during on-line mobile game

Legal Events

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