Game character control method, device and storage medium
By determining the target character group for the target level events in the game and configuring action parameters, the problem of behavior conflicts under the AI logic of multiple game characters is solved, and the rationality of game experience and character behavior is improved.
Patent Information
- Application Number
- CN202111452396.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-11-30
AI Technical Summary
In the prior art, multiple game characters are prone to behavioral conflicts under the control of their respective AI logic, especially in group behavior scenarios, resulting in poor game experience.
By determining the target role group in the level events of the target level and determining the action parameters of each target role based on the group configuration policy, ensure the reasonable configuration of role behavior and avoid behavior conflicts. The specific method includes filtering out the following characters or enemy character groups in level events, configuring their action parameters, such as follow coordinates and offensive parameters, ensuring natural distribution and avoiding conflicts.
It effectively avoids behavioral conflicts between characters, improves the game experience in group behavior scenarios, ensures the rationality and naturalness of character actions, and enhances the game's expressiveness and user experience.
Smart Images

Figure CN114100137B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a game character control method, device and storage medium. Background Art
[0002] For non-player controlled characters in the game, appropriate AI (Artificial Intelligence) behaviors are required to interact with players to advance the game process. In the prior art, different non-player controlled characters are coordinated through their own AI logics. However, when there is group behavior among multiple characters, different AI logics are reflected in the character behavior control, which may cause behavior conflicts. Summary of the invention
[0003] The embodiments of the present application provide a game character control method, device and storage medium to solve the technical problem in the prior art that behavior conflicts occur among multiple game characters under the control of their respective AI logics.
[0004] In a first aspect, an embodiment of the present invention provides a game character control method, comprising:
[0005] Based on a level event of a target level, determining a target character group corresponding to the level event from among the game characters corresponding to the target level, wherein the level event is a group behavior event;
[0006] Determining the action parameters of each target character in the target character group based on the group configuration strategy corresponding to the level event;
[0007] Based on the action parameters of each target character, each target character is controlled to execute the level event.
[0008] Optionally, the determining, based on the level event of the target level, a target character group corresponding to the level event from among the game characters corresponding to the target level includes:
[0009] When the level event is a follow event for the main control character, a first number of follower characters that follow the main control character are determined in the follower character list corresponding to the target level as the target character group, wherein the follower characters are non-player controlled characters;
[0010] The determining the action parameter of each target character in the target character group based on the group configuration strategy corresponding to the level event includes:
[0011] Based on the group configuration strategy corresponding to the following event, the following coordinates of each target character when following the main control character are determined.
[0012] Optionally, the determining, based on the group configuration strategy corresponding to the following event, the following coordinates of each target character when following the master character, includes:
[0013] Determine the current position coordinates of the master character;
[0014] Based on a preset outer diameter of the ring and a preset inner diameter of the ring, determine a target ring with the current position coordinate as the center, and emit N rays outward from the center, where N is an integer greater than or equal to the first number;
[0015] The following coordinates of each target character relative to the main control character are determined within the circular area of the target ring, wherein each target character is located within the circular area and on one of the N rays, and different target characters correspond to different rays.
[0016] Optionally, the determining, based on the level event of the target level, a target character group corresponding to the level event from among the game characters corresponding to the target level includes:
[0017] When the level event is a coordinated attack event, determining a second number of enemy characters in the enemy character list corresponding to the target level as the target character group;
[0018] The determining the action parameter of each target character in the target character group based on the group configuration strategy corresponding to the level event includes:
[0019] Based on the group configuration strategy of the coordinated attack event, the attack area of the target character group and the attack parameters of each target character are determined.
[0020] Optionally, the method further comprises:
[0021] When a change in the current game character is detected, the enemy character list is refreshed, and a third number of enemy characters are re-determined from the refreshed enemy character list as the target character group.
[0022] Optionally, the method further comprises:
[0023] When the coordinated attack event is a linked attack event, when it is detected that the number of characters corresponding to the target character group is less than the second number, the target character group is screened again or the linked attack event is interrupted.
[0024] Optionally, the target level corresponds to a level behavior tree for group configuration, and based on the level event of the target level, determining a target character group corresponding to the level event from game characters corresponding to the target level, and based on the group configuration strategy corresponding to the level event, determining an action parameter of each target character in the target character group includes:
[0025] Determining the target character group based on a group screening node set in a level behavior tree of the target level, and determining an action parameter of each target character based on a group control node in the level behavior tree;
[0026] The group screening node is configured based on the role screening strategy corresponding to the level event, and the group control node is configured based on the group configuration strategy corresponding to the level event.
[0027] Optionally, each game character corresponds to a character behavior tree, and the character behavior tree corresponding to each game character is associated with the level behavior tree, and the method further includes:
[0028] Controlling the level behavior tree to send corresponding action parameters to the character behavior tree of each target character, so that the character behavior tree of each target character performs parameter configuration based on the corresponding action parameters;
[0029] The controlling each target character to execute the level event based on the action parameter of each target character includes:
[0030] Execute the configured character behavior tree corresponding to each target character, and control each target character to execute the level event.
[0031] Optionally, the level behavior tree is associated with the character behavior tree via a communication node, and when each target character in the target character group can be used as a master control character, the method further includes:
[0032] When a switching operation for a main control character is detected, re-determining a target main control character and a non-player control character corresponding to the switching operation from the target character group through the level behavior tree;
[0033] Based on the target main control character and the non-player controlled character, updating the communication node;
[0034] The controlling the level behavior tree to send corresponding action parameters to the character behavior tree of each target character includes:
[0035] Based on the updated communication node, the action parameters of the target master-controlled character and the non-player-controlled character are sent to the corresponding character behavior tree.
[0036] In a second aspect, an embodiment of the present invention provides a game character control device, comprising:
[0037] A group determination module, for determining a target character group corresponding to the level event from among the game characters corresponding to the target level based on the level event of the target level, wherein the level event is a group behavior event;
[0038] An action parameter determination module, used to determine the action parameter of each target character in the target character group based on the group configuration strategy corresponding to the level event;
[0039] The control module is used to control each target character to execute the level event based on the action parameters of each target character.
[0040] In a third aspect, an embodiment of the present invention provides a game character control device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute operation instructions corresponding to the game character control method provided in the first aspect.
[0041] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps corresponding to the game character control method provided in the first aspect.
[0042] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0043] In the embodiment of the present application, the level event of the target level is a group behavior event. When entering the level event, the target role group corresponding to the level event is determined from the game characters of the target level; based on the group configuration strategy corresponding to the level event, the action parameters of each target role in the target role group are determined; based on the action parameters of each target role, each target role is controlled to execute the level event. In the scheme of the present application, when performing a level event of group behavior, the target role group is uniformly configured through the group configuration strategy, and the action parameters corresponding to each role can be reasonably configured from the perspective of the group. If there are multiple game characters following the main control character, the game characters that follow can be naturally distributed around the main control character, and there will be no position overlap and no obvious sense of formation; when executing a group attack, avoid behavioral conflicts between the characters executing the attack, and adjust the battle rhythm. It can be seen that the scheme of the present application can make each target character execute the corresponding action parameters without conflict in the group behavior process, enrich the expressiveness of each target character in the target role group when realizing the group behavior event, and improve the user's game experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 This is a flowchart of a game character control method in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a target circle determined with the master role as the center in an embodiment of the present application;
[0047] Figure 3 This is a structural diagram of a game character control device in an embodiment of the present application;
[0048] Figure 4 This is a structural diagram of a game character control device in an embodiment of the present application;
[0049] Figure 5 This is a structural diagram of a game character control device used as a server in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The embodiments of the present application provide a game character control method, device and storage medium to solve the technical problem in the prior art that behavior conflicts occur among multiple game characters under the control of their respective AI logics.
[0051] The technical solution of the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:
[0052] Based on the level event of the target level, a target character group corresponding to the level event is determined among the game characters corresponding to the target level, wherein the level event is a group behavior event; based on the group configuration strategy corresponding to the level event, the action parameters of each target character in the target character group are determined; based on the action parameters of each target character, each target character is controlled to execute the level event.
[0053] The solution of the present application, when performing level events of group behavior, uniformly configures the target character group through the group configuration strategy, and can reasonably configure the action parameters corresponding to each character from the perspective of the group, so that when each target character executes the corresponding action parameters, there will be no conflict in the group behavior process, thereby improving the user's gaming experience.
[0054] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0055] First of all, the term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0056] The embodiment of this specification provides a game character control method, such as Figure 1 As shown, the method comprises the following steps:
[0057] Step S101: Based on a level event of a target level, a target character group corresponding to the level event is determined from game characters corresponding to the target level, wherein the level event is a group behavior event;
[0058] Step S102: determining the action parameters of each target character in the target character group based on the group configuration strategy corresponding to the level event;
[0059] Step S103: Based on the action parameters of each target character, control each target character to execute the level event.
[0060] The solutions in the embodiments of this specification can be applied to terminal devices installed with game software, such as smart phones and tablet computers, and can also be applied to servers corresponding to the game software. They can also be applied to systems composed of terminal devices and servers, and are not limited here.
[0061] In step S101, for a game, multiple levels may be set, in which group behaviors (such as coordinated attack) between multiple game characters exist in some levels, while in some levels, only individual behaviors of a single character exist (such as one-on-one combat) without group behaviors. In the embodiment of this specification, the target level may be a level with group behaviors, and the level event may be a task event corresponding to the group behaviors.
[0062] After entering the target level, if a level event of a group behavior is triggered, it is necessary to filter out the target character group that performs the group behavior from the game characters corresponding to the target level. Among them, the game characters may include player characters and non-player characters, and the target character group may include only player characters, only non-player characters, or both player characters and non-player characters. The type of game characters in the target character group and the number of game characters may be determined according to the configuration information corresponding to the level event. For example, if the level event corresponds to a group behavior performed by three player characters, then three player characters may be filtered out from the player characters existing in the target level as the target character group.
[0063] In order to avoid behavior conflicts (such as collisions, crowding, etc.) between the target character groups when performing group behaviors, the action parameters of each target character in the target character group can be determined in step S102. Specifically, for the level events corresponding to the group behaviors, a corresponding group configuration strategy is pre-configured, and the action parameters of each target character in the target character group are configured based on the group configuration strategy to prevent behavior conflicts between the characters. The action parameters can be set according to actual needs. For example, the action parameters can include but are not limited to the real-time position parameters of the target character, the type of action to be performed, the execution time of the action, etc.
[0064] Furthermore, through step S103, each target character is controlled based on the action parameters of each target character to complete the group behavior of the level event.
[0065] The solution in the embodiments of this specification, when performing level events of group behavior, uniformly configures the target character group through the group configuration strategy, and can reasonably configure the action parameters corresponding to each character from the perspective of the group, so that when each target character executes the corresponding action parameters, there will be no conflict in the group behavior process, thereby improving the user's gaming experience.
[0066] In order to better understand the game character control method provided in the embodiments of this specification, the following is explained by taking the level events as the follow-up events and the coordinated attack events for the main control character as examples.
[0067] 1. Level events are follow-up events for the main character
[0068] In a specific implementation process, when the level event is a follow event for the main control character, determining the target character group of the follow event can be achieved in the following manner: determining a first number of follow characters that follow the main control character in the follow character list corresponding to the target level as the target character group, wherein the follow characters are non-player controlled characters. Correspondingly, determining the action parameters of each target character in the target character group based on the group configuration strategy corresponding to the level event includes: determining the follow coordinates of each target character when following the main control character based on the group configuration strategy corresponding to the follow event.
[0069] Specifically, the follow event for the main control character corresponds to multiple game characters, including the main control character controlled by the player, and a first number of follow characters controlled by AI, that is, the follow characters are non-player characters (NPC). When executing the follow event, the follow characters controlled by AI always follow near the main control character.
[0070] It should be noted that the first number can be the number of characters selected by the user or the default number of characters in the game, for example, the first number is 2, 3, 4, etc. The follower characters that follow the main controller can be characters specified by the user, can be randomly selected, or can be selected in other ways (such as according to the level of the character, the occupation of the character, the attack ability, etc.), which is not limited here.
[0071] In the embodiment of this specification, taking the first number of 3 as an example, that is, there are 3 follower characters following the main control character, then, the follower character list corresponding to the target level can be obtained first, and then the 3 follower characters that follow the main control character can be determined by detecting the user's follower character selection operation, or 3 characters can be randomly selected from the follower character list to follow the main control character, etc.
[0072] In order to avoid behavioral collisions, crowding and other conflicts between the main control character corresponding to the follow event and the follower character following the main control, the group configuration strategy corresponding to the follow event is used to allocate the follow coordinates of each target character in the target character group when following the main control character. The group configuration strategy can be set according to actual needs. For example, the group configuration strategy can be to ensure that the distance between any two characters in the main control character and the follower character meets the preset range. Based on this, the follow coordinates of the target character following the main control can be determined according to the preset range and the current position coordinates of the main control player, so that it can be ensured that there will be no behavioral conflicts between the characters. Alternatively, the group configuration strategy can also be to set the target character near the main control character according to the preset queue distribution, and determine the follow coordinates of each target character according to the preset queue distribution.
[0073] In an embodiment of the present specification, the following coordinates of each target character are determined based on the group configuration strategy corresponding to the following event, which can be achieved in the following manner: determining the current position coordinates of the main control character; determining a target circular ring with the current position coordinates as the center based on a preset circular ring outer diameter and a preset circular ring inner diameter; and determining the following coordinates of each target character relative to the main control character within the circular area of the target circular ring.
[0074] Specifically, the preset outer diameter of the ring and the preset inner diameter of the ring can be set according to actual needs, for example, the preset outer diameter of the ring is 3m, and the preset inner diameter of the ring is 1m; or the preset outer diameter of the ring is 2.8m, and the preset inner diameter of the ring is 0.6m, etc. In the embodiment of this specification, taking the preset outer diameter of the ring as 3m and the preset inner diameter of the ring as 1m as an example, then a ring with an outer diameter of 3m and an inner diameter of 1m is determined with the current position coordinates of the main control character as the center of the circle, such as Figure 2 shown.
[0075] Furthermore, the position of the target character is set within the circular area of the target ring. On the one hand, it can enable the target character to follow the main control character. On the other hand, it can keep a certain distance between the target character and the main control character to avoid collision between the target character and the main control character. In addition, in order to ensure that there will be no behavioral conflicts between the target characters following the main control, the position of the target character needs to be limited to ensure that a certain distance is maintained between the target characters. In the specific implementation process, in order to ensure that there will be no behavioral conflicts between the target characters, N rays can be emitted in all directions with the main control player as the center, and the number N is greater than or equal to the first number, and each target character is located on a different ray in the ring. Figure 2 As shown, 8 rays are emitted from the main control player's position. When there are 3 target characters, each target character occupies one of the rays. It should be noted that the angle between any two adjacent rays can be the same or different, and there is no limitation here. The angle between two adjacent rays needs to ensure that the target characters located on the two adjacent rays will not collide.
[0076] Through the above method, the following coordinates of each target character relative to the main control character can be determined. For example, the target character A is located on the ray a, and based on the current position coordinates of the main control character, the part of the ray a located in the target ring is determined and the coordinate range of the part is calculated. The coordinate range is used as the range corresponding to the following coordinates of the target character A, that is, the following coordinates can select any coordinates from the coordinate range as the following coordinates of the current following main control character.
[0077] It should be noted that since the position of the main control character will change under the control of the player, for example, when the main control character is controlled to walk, the position coordinates of the main control character change in real time. Therefore, the circular area determined based on the position coordinates of the main control character also changes in real time, and the following coordinates of each target character also change in real time.
[0078] Furthermore, in order to make the target character's following behavior more natural, after the current following event is completed, if the following event needs to be executed again, a new following coordinate can be reallocated to the target character. When reallocating the following coordinate, the ray corresponding to the target character can be different from the ray corresponding to the last time, so that there will be no obvious sense of queuing, and the following will not appear to be achieved in a fixed formation. It can be seen that through the solution of the embodiment of this specification, in the following event, the target characters can be naturally distributed around the main control character without overlapping and without producing an obvious sense of queuing.
[0079] It should be noted that the target character that follows the main control character can be a player character, a non-player character, or both a player character and a non-player character. For the target character in each case, the determination of the following coordinates is similar to the above steps, which will not be repeated here.
[0080] 2. The level event is a coordinated attack event
[0081] In a specific implementation process, when the level event is a coordinated attack event, determining the target character group of the coordinated attack event can be achieved by: determining a second number of enemy characters in the enemy character list corresponding to the target level as the target character group. Correspondingly, determining the action parameters of each target character in the target character group based on the group configuration strategy corresponding to the level event includes: determining the attack parameters of each target character based on the group configuration strategy corresponding to the coordinated attack event.
[0082] Specifically, in a coordinated attack, in order to avoid multiple enemy characters each performing their own actions, which would result in all enemy characters being crowded together to attack and causing visual confusion for the players in extreme cases, in an embodiment of this specification, the target character group can be controlled through the group configuration strategy corresponding to the coordinated attack to prevent behavioral conflicts between the target characters.
[0083] The coordinated attack event corresponds to multiple enemy characters that launch a group attack. When determining the target character group corresponding to the coordinated attack event, the number of characters included in the target character group, i.e., the second number, can be set according to actual needs. For example, the second number can be determined according to the number of players attacked. The more players there are, the larger the second number. In one embodiment, when there is one player character, the second number can be 3, and when there are two player characters, the second number can be 5.
[0084] When determining the target characters in the target character group, the second number of enemy characters can be randomly selected from the enemy character list corresponding to the target level, or can be selected based on the attributes of the enemy characters (such as attack capability, distance from the player character, etc.) and the player attributes (such as the number of players, the player level, etc.). In one embodiment, the enemy characters within the player's field of view can be determined, and then these enemy characters are sorted from high to low according to their attack capabilities, and the second number of enemy characters with the highest attack capabilities are selected as the target character group.
[0085] Furthermore, according to the group configuration strategy of the coordinated attack event, the attack parameters of each target character are determined. Among them, the attack parameters may include but are not limited to the attack area, the attack timing, the attack action, etc. Specifically, the attack area may be an area within the player's field of view, and the attack area may be an area at a preset distance from the player's character. The size of the area may be determined based on the number of target characters. The attack timing is the time when each target character performs an attack action. For example, the timing of the attack action performed by each target character may be the same, or may be separated by a preset time length, which is not limited here. The offensive action is the specific action performed by each target character when attacking.
[0086] When the target character group performs a coordinated attack, in order to ensure that the positions of each target character do not overlap, in the embodiment of this specification, the position of each target character can also be limited. For example, each target character is made to maintain a preset distance from other target characters during the attack, or each target character is assigned a fixed relative coordinate relative to the player character.
[0087] It should be noted that in the embodiment of this specification, when executing a coordinated attack event, each target character in the target character group performs an attack action, and for enemy characters other than the target character group, it is not necessary to perform an attack, and keep the default behavior action (such as standby, wandering, etc.). In this way, when there are a large number of enemy characters, only the selected target character group attacks the player character, and other enemy characters temporarily do not perform an attack, so as to avoid all enemy characters attacking the player character and causing behavioral conflicts between enemy characters.
[0088] Furthermore, when executing a coordinated attack event, when there is a change in the number of characters on both sides of the enemy, it is possible that the target character group will change. For example, when the number of players increases, in order to maintain the difficulty of the game, the number of target characters performing coordinated attacks also needs to be increased accordingly; when one or more target characters in the target character group are eliminated, it is also necessary to re-add characters performing coordinated attacks. Therefore, in the embodiment of this specification, the following steps are also included: when a change in the current game character is detected, the enemy character list is refreshed, and a third number of enemy characters are re-determined from the refreshed enemy character list as the target character group.
[0089] Specifically, the current game characters may be all the characters of the enemy and the friendly party currently present. If changes are detected in the characters of the enemy and the friendly party (including the increase or decrease of the player characters and / or the increase or decrease of the enemy characters), the enemy character list needs to be refreshed, and a third number of enemy characters is re-determined from the refreshed enemy character list, wherein the third number may be the same as the second number or may be different from the second number. For example, when the number of enemy characters is less than the second number, the number of the re-determined target character group is less than the second number.
[0090] In the embodiments of this specification, a coordinated attack may include a non-coordinated attack and a coordinated attack. When performing a coordinated attack, the target characters in the target character group need to perform specific behaviors in an orderly manner. When performing a non-coordinated attack, the group attack behavior of the target characters is not limited.
[0091] In a specific implementation process, when the coordinated attack event is a joint attack event, when it is detected that the number of characters corresponding to the target character group is less than the second number, the target character group is screened again.
[0092] Specifically, the number of characters in the chain attack is fixed, that is, the chain attack can only be launched when the number of target character groups is the second number, and if one or more characters are lost in the process of organizing the chain attack, the chain attack cannot continue. Therefore, when it is detected that the number of characters in the chain attack is less than the second number, the current chain attack can be interrupted, or the second number of target characters can be re-screened from the enemy character list to re-launch the chain attack.
[0093] In summary, the solution in the embodiments of this specification can uniformly configure the target role group through the group configuration strategy, and reasonably configure the action parameters corresponding to each target role from the perspective of the group to ensure that there will be no behavioral conflicts between the roles.
[0094] Furthermore, the method provided in the embodiments of this specification can be implemented through a level behavior tree. Specifically, the target level corresponds to a level behavior tree for group configuration, and step S101 and step S102 can be implemented in the following manner: based on the group screening node in the level behavior tree of the target level, the target character group is determined, and based on the group control node in the level behavior tree, the action parameters of each target character are determined; wherein the group screening node is configured based on the character screening strategy corresponding to the level event, and the group control node is configured based on the group configuration strategy corresponding to the level event.
[0095] Specifically, each target level has its own level behavior tree. When creating a level behavior tree, if there is a level event of group behavior in the target level, a node corresponding to the group behavior needs to be created in the level behavior tree to execute the group control logic.
[0096] In the specific implementation process, a group filtering node and a group control node are set in the level behavior tree, wherein the logic corresponding to the group filtering node is the role filtering strategy of the level event, and the logic corresponding to the group control node is the group configuration strategy of the level event. It should be noted that the group filtering node may include one or more functional nodes, such as a node for determining the number of target characters, a node for determining the target character identification, etc. Similarly, the group control node may also include one or more functional nodes, such as when the level event is the above-mentioned follow event, the group control node includes a node for setting the parameters of the ring, a node for calculating the follow coordinates of each target character, etc.; when the level event is the above-mentioned coordinated attack event, the group control node includes a node for determining the position of the target character, a node for determining the attack timing, etc.
[0097] In the embodiments of this specification, the relevant information of the level event can be set by initializing the level behavior tree. For example, when the level event is the above-mentioned follow event for the main control character, the target character group corresponding to the group filter node can be set by initializing the level behavior tree, and the number of emission rays corresponding to the ring parameter setting node, the preset ring outer diameter, the preset ring inner diameter, etc. can be set; when the level event is the above-mentioned coordinated attack event, the target character group corresponding to the group filter node can be set by initializing the level behavior tree, and the attack area corresponding to the position determination node can be set.
[0098] In the embodiments of this specification, each non-player-controlled game character has its own corresponding character behavior tree to realize individual AI control, and the level behavior tree can be associated with the character behavior tree to realize the variable intercommunication between the level behavior tree and the character behavior tree, so as to configure the parameters of the character behavior tree when executing group behavior. In the specific implementation process, the level behavior tree is controlled to send the corresponding action parameters to the character behavior tree of each target character, so that the character behavior tree of each target character is parameterized based on the corresponding action parameters; further, the configured character behavior tree corresponding to each target character is executed to control each target character to execute the level event.
[0099] Specifically, the level behavior tree sends the parameters configured in the initialization phase, including but not limited to the coordinates of the target character, the attack timing of the target character, and the attack action of the target character, to the character behavior tree of the corresponding target character. The character behavior tree configures relevant nodes based on the received parameters to control the target character to perform group behaviors according to the above action parameters to avoid behavior conflicts.
[0100] In addition, in the embodiments of this specification, when each target character in the target character group can be used as a main control character, the player can switch the main control character during the game. For example, the target character group includes three characters, namely character 1, character 2, and character 3. The user first selects character 1 as the main control character, for example, controls character 1 to fight, and when the battle is over, the user may select character 2 as the main control character and control character 2 to perform other tasks. When the switching operation of the main control character is detected, the level behavior tree needs to correspondingly notify the character behavior tree to perform the respective character control.
[0101] In a specific implementation process, the level behavior tree communicates with the character behavior tree through a communication node. When a switching operation for the master character is detected, the target master character and the non-player controlled character corresponding to the switching operation are re-determined from the target character group through the level behavior tree; based on the target master character and the non-player controlled character, the communication node is updated. Further, based on the updated communication node, the action parameters of the target master character and the non-player controlled character are sent to the corresponding character behavior tree.
[0102] Specifically, after the user switches the main control character, the coordinate information, attack parameters, etc. of each non-player controlled character in the target character group need to be reallocated according to the switched target main control character. Further, the communication node is updated based on the newly determined target main control character and non-player controlled character, and the reallocated coordinate information, attack parameters, etc. are respectively sent to the corresponding character behavior tree through the communication node to control the corresponding character to perform the corresponding action.
[0103] Based on the same inventive concept, Figure 3 As shown, this embodiment provides a game character control device, including:
[0104] A group determination module 301 is used to determine a target character group corresponding to the level event from among the game characters corresponding to the target level based on the level event of the target level, wherein the level event is a group behavior event;
[0105] An action parameter determination module 302, configured to determine an action parameter of each target character in the target character group based on the group configuration strategy corresponding to the level event;
[0106] The control module 303 is used to control each target character to execute the level event based on the action parameters of each target character.
[0107] Optionally, the group determination module 301 is used to determine, when the level event is a follow-up event for the main control character, a first number of follower characters that follow the main control character in the follower character list corresponding to the target level as the target character group, wherein the follower characters are non-player controlled characters;
[0108] The action parameter determination module 302 is used to determine the following coordinates of each target character when following the main control character based on the group configuration strategy corresponding to the following event.
[0109] Optionally, the action parameter determination module 302 is used to:
[0110] Determine the current position coordinates of the master character;
[0111] Based on a preset outer diameter of the ring and a preset inner diameter of the ring, determine a target ring with the current position coordinate as the center, and emit N rays outward from the center, where N is an integer greater than or equal to the first number;
[0112] The following coordinates of each target character relative to the main control character are determined within the circular area of the target ring, wherein each target character is located within the circular area and on one of the N rays, and different target characters correspond to different rays.
[0113] Optionally, the group determination module 301 is used to determine a second number of enemy characters in the enemy character list corresponding to the target level as the target character group when the level event is a coordinated attack event;
[0114] The action parameter determination module 302 is used to determine the attack area of the target character group and the attack parameter of each target character based on the group configuration strategy of the coordinated attack event.
[0115] Optionally, the device further comprises:
[0116] The refresh module is used to refresh the enemy character list when a change in the current game character is detected, and to re-determine a third number of enemy characters from the refreshed enemy character list as the target character group.
[0117] Optionally, the device further comprises:
[0118] The coordinated attack processing module is used to, when the coordinated attack event is a coordinated attack event, re-screen the target character group or interrupt the coordinated attack event when it is detected that the number of characters corresponding to the target character group is less than the second number.
[0119] Optionally, the target level corresponds to a level behavior tree for group configuration, a group determination module 301 and an action parameter determination module 302, which are used to:
[0120] Determining the target character group based on a group screening node set in a level behavior tree of the target level, and determining an action parameter of each target character based on a group control node in the level behavior tree;
[0121] The group screening node is configured based on the role screening strategy corresponding to the level event, and the group control node is configured based on the group configuration strategy corresponding to the level event.
[0122] Optionally, each game character corresponds to a character behavior tree, and the character behavior tree corresponding to each game character is associated with the level behavior tree, and the device further includes:
[0123] A parameter sending module, used to control the level behavior tree to send corresponding action parameters to the character behavior tree of each target character, so that the character behavior tree of each target character performs parameter configuration based on the corresponding action parameters;
[0124] The control module 303 is used to execute the configured character behavior tree corresponding to each target character, and control each target character to execute the level event.
[0125] Optionally, the level behavior tree is associated with the character behavior tree via a communication node, and when each target character in the target character group can serve as a master control character, the device further comprises:
[0126] A switching module, configured to, when a switching operation for a main control character is detected, redetermine a target main control character and a non-player control character corresponding to the switching operation from the target character group through the level behavior tree;
[0127] An updating module, for updating the communication node based on the target master-controlled character and the non-player-controlled character;
[0128] The parameter sending module is used to send the action parameters of the target master-controlled character and the non-player-controlled character to the corresponding character behavior tree based on the updated communication node.
[0129] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0130] Figure 4 1 is a structural diagram of a game character control device according to an exemplary embodiment. For example, the device 1800 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0131] Reference Figure 4 , device 1800 may include one or more of the following components: a processing component 1802 , a memory 1804 , a power component 1806 , a multimedia component 1808 , an audio component 1810 , an input / output (I / O) interface 1812 , a sensor component 1814 , and a communication component 1816 .
[0132] The processing component 1802 generally controls the overall operation of the device 1800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 1820 to execute instructions to complete all or part of the steps of the above-described method. In addition, the processing component 1802 may include one or more modules to facilitate interaction between the processing component 1802 and other components. For example, the processing component 1802 may include a multimedia module to facilitate interaction between the multimedia component 1808 and the processing component 1802.
[0133] The memory 1804 is configured to store various types of data to support operations on the device 1800. Examples of such data include instructions for any application or method operating on the device 1800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0134] The power component 1806 provides power to the various components of the device 1800. The power component 1806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1800.
[0135] The multimedia component 1808 includes a screen that provides an output interface between the device 1800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1808 includes a front camera and / or a rear camera. When the device 1800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0136] The audio component 1810 is configured to output and / or input audio signals. For example, the audio component 1810 includes a microphone (MIC), and when the device 1800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1804 or sent via the communication component 1816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0137] I / O interface 1812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0138] The sensor assembly 1814 includes one or more sensors for providing various aspects of the status assessment of the device 1800. For example, the sensor assembly 1814 can detect the open / closed state of the device 1800, the relative positioning of components, such as the display and keypad of the device 1800, the sensor assembly 1814 can also detect the position change of the device 1800 or a component of the device 1800, the presence or absence of user contact with the device 1800, the orientation or acceleration / deceleration of the device 1800, and the temperature change of the device 1800. The sensor assembly 1814 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0139] The communication component 1816 is configured to facilitate wired or wireless communication between the device 1800 and other devices. The device 1800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0140] In an exemplary embodiment, the device 1800 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned methods.
[0141] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1804 including instructions, and the instructions can be executed by a processor 1820 of the device 1800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0142] A non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to execute a game character control method, including: based on a level event of a target level, determining a target character group corresponding to the level event among the game characters corresponding to the target level, wherein the level event is a group behavior event; based on a group configuration strategy corresponding to the level event, determining an action parameter of each target character in the target character group; based on the action parameter of each target character, controlling each target character to execute the level event.
[0143] Figure 5 1 is a structural diagram of a game character control device in an embodiment of the present invention when used as a server. The server 1900 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1922 (for example, one or more processors) and memory 1932, and one or more storage media 1930 (for example, one or more mass storage devices) storing application programs 1942 or data 1944. Among them, the memory 1932 and the storage medium 1930 can be short-term storage or permanent storage. The program stored in the storage medium 1930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server. Furthermore, the central processing unit 1922 can be configured to communicate with the storage medium 1930 and execute a series of instruction operations in the storage medium 1930 on the server 1900.
[0144] The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input and output interfaces 1958, one or more keyboards 1956, and / or, one or more operating systems 1941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0145] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0146] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A game character control method, characterized in that: include: Based on a level event of a target level, a target character group corresponding to the level event is determined from the game characters corresponding to the target level, wherein the level event is a group behavior event; wherein when the level event is a follow-up event for a main control character, a first number of follow-up characters that follow the main control character are determined from a follow-up character list corresponding to the target level as the target character group, wherein the follow-up characters are non-player-controlled characters; Based on the group configuration strategy corresponding to the level event, determining the action parameters of each target character in the target character group; wherein, based on the group configuration strategy corresponding to the follow event, determining the follow coordinates of each target character when following the master character; Based on the action parameters of each target character, each target character is controlled to execute the level event.
2. The method according to claim 1, characterized in that: The determining the following coordinates of each target character when following the main control character based on the group configuration strategy corresponding to the following event includes: Determine the current position coordinates of the master character; Based on a preset outer diameter of the ring and a preset inner diameter of the ring, determine a target ring with the current position coordinate as the center, and emit N rays outward from the center, where N is an integer greater than or equal to the first number; The following coordinates of each target character relative to the main control character are determined within the circular area of the target ring, wherein each target character is located within the circular area and on one of the N rays, and different target characters correspond to different rays.
3. The method according to claim 1, characterized in that: The step of determining a target character group corresponding to the level event from among the game characters corresponding to the target level based on the level event of the target level includes: When the level event is a coordinated attack event, determining a second number of enemy characters in the enemy character list corresponding to the target level as the target character group; The determining the action parameter of each target character in the target character group based on the group configuration strategy corresponding to the level event includes: Based on the group configuration strategy of the coordinated attack event, the attack parameters of each target character are determined.
4. The method according to claim 3, characterized in that The method further comprises: When a change in the current game character is detected, the enemy character list is refreshed, and a third number of enemy characters are re-determined from the refreshed enemy character list as the target character group.
5. The method according to claim 3, characterized in that: The method further comprises: When the coordinated attack event is a linked attack event, when it is detected that the number of characters corresponding to the target character group is less than the second number, the target character group is screened again or the linked attack event is interrupted.
6. The method according to any one of claims 1 to 5, characterized in that: The target level corresponds to a level behavior tree for group configuration, the level event based on the target level, determining a target character group corresponding to the level event from game characters corresponding to the target level, and the group configuration strategy based on the level event, determining an action parameter of each target character in the target character group, including: Determining the target character group based on a group screening node in a level behavior tree of the target level, and determining an action parameter of each target character based on a group control node in the level behavior tree; The group screening node is configured based on the role screening strategy corresponding to the level event, and the group control node is configured based on the group configuration strategy corresponding to the level event.
7. The method according to claim 6, characterized in that Each game character has a corresponding character behavior tree, and the character behavior tree corresponding to each game character is associated with the level behavior tree. The method further includes: Controlling the level behavior tree to send corresponding action parameters to the character behavior tree of each target character, so that the character behavior tree of each target character performs parameter configuration based on the corresponding action parameters; The controlling each target character to execute the level event based on the action parameter of each target character includes: Execute the configured character behavior tree corresponding to each target character to control each target character to execute the level event.
8. The method according to claim 7, characterized in that The level behavior tree is associated with the character behavior tree via a communication node, and when each target character in the target character group can be used as a master control character, the method further includes: When a switching operation for a main control character is detected, a target main control character and a non-player controlled character corresponding to the switching operation are re-determined from the target character group through the level behavior tree; Based on the target main control character and the non-player controlled character, updating the communication node; The controlling the level behavior tree to send corresponding action parameters to the character behavior tree of each target character includes: Based on the updated communication node, the action parameters of the target master-controlled character and the non-player-controlled character are sent to the corresponding character behavior tree.
9. A game character control device, characterized in that: include: A group determination module, for determining a target character group corresponding to the level event from among the game characters corresponding to the target level based on the level event of the target level, wherein the level event is a group behavior event; An action parameter determination module, used to determine the action parameter of each target character in the target character group based on the group configuration strategy corresponding to the level event; A control module, used for controlling each target character to execute the level event based on the action parameters of each target character; The group determination module is further configured to determine, when the level event is a follow-up event for the main control character, a first number of follow-up characters that follow the main control character in the follow-up character list corresponding to the target level as the target character group, wherein the follow-up characters are non-player-controlled characters; The action parameter determination module is further used to determine the following coordinates of each target character when following the main control character based on the group configuration strategy corresponding to the following event.
10. A game character control device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method steps according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method steps according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Game role behavior control method and device, storage medium and electronic equipment
CN111632379A
Action set output method and system based on multi-agent reinforcement learning
CN111860649A
Multi-agent reinforcement learning method, electronic equipment and storage medium
CN111898770A
Multi-Agent System for Efficient Decentralized Information Aggregation by Modeling Other Agents' Behavior
US20200074328A1
Policy representations and mechanisms for the control of software
US7240015B1
