A behavior tree-based game AI control system

CN122806070APending Publication Date: 2026-09-25GUANGZHOU YUELIANG TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611024901.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

[0004]为此,本发明提供一种基于行为树的游戏AI控制系统,用以克服现有技术中未能考虑高地形限制的条件下对玩家的交互意愿进行灵活筛选,导致静态的行为树设置无法适应玩家交互时的实际变化情况而产生交互机械的问题

Benefits of technology

[0015]与现有技术相比,本发明的有益效果在于,本发明通过地形限制指数确定目标AI角色对应基础范围内地形对于目标AI角色以及玩家的限制程度,在地形限制指数大于预设地形限制指数的高地形限制条件下,玩家的行动路线是较为固定的,因此分析玩家的行动路径与移动倾向可以有效获取与目标AI角色的交互意愿,从而实现预期交互玩家的有效筛选。并通过移动倾向度确定玩家向着目标AI角色移动的倾向程度,从而选择移动倾向度大于预设移动倾向度的目标玩家作为预期交互玩家,实现了在高地形限制条件下的预期交互玩家的精准确定,避免在复杂地形中因范围筛选不精准导致的交互遗漏或误判,提升了预期交互判定的准确性与适应性

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122806070A_ABST
    Figure CN122806070A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of artificial intelligence, in particular to a game AI control system based on a behavior tree, which comprises a tendency will obtaining module, a screening reference judging module, a moving screening module, a range screening module and an interaction adjusting module. The tendency will obtaining module is used to determine a tendency path and a moving tendency degree. The screening reference judging module is used to determine whether to adjust the screening mode of an expected interactive player based on a terrain restriction index. The moving screening module is used to determine whether to select the expected interactive player based on the moving tendency degree. The range screening module is used to adjust a basic range based on a player quantity change degree and obtain the expected interactive player in the basic range. The interaction adjusting module is used to determine whether to perform interaction adjustment based on action richness and group threat degree and determine whether to adjust an interaction adjustment strategy based on effective contact degree. The correlation influence module is used to determine whether to perform resource adjustment analysis based on a role action dependence value of a dependence group and determine a resource inclination reference. The application improves the control flexibility and interaction richness of game AI.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a game AI control system based on behavior trees. Background Technology

[0002] In existing game AI agent settings, behavior trees, with their modularity, hierarchy, and high readability, have become one of the mainstream technical solutions for game AI behavior control. Behavior trees traverse from top to bottom starting from the root node, determining the final action node to be executed through conditional judgments. The execution result of the node is fed back to the parent node to drive subsequent decisions. However, when the number of players changes drastically or is highly concentrated, the feedback results from nodes will accumulate significantly. Using a fixed range for filtering interactions can easily cause lag. In such cases, it is necessary to consider other influencing factors to predict player interaction intentions in advance, allowing the behavior tree to adaptively adjust and thus improve the game AI's responsiveness. In subsequent actual interactions with players, fluctuations in the number of players, changes in actions, and the relationships between game AIs all become factors affecting the smoothness of game AI interactions. Therefore, how to flexibly improve the smoothness of player-game AI interactions is a problem of great concern to researchers in this field.

[0003] Chinese Patent Publication No. CN117180750A discloses a method, apparatus, device, and medium for controlling non-user characters based on behavior trees. The method includes: acquiring basic data of a non-user character through a data acquisition node based on the behavior tree; wherein the basic data includes self-attribute data and perception data; identifying whether the basic data meets behavior triggering conditions based on the behavior tree; if so, determining the behavior node corresponding to the behavior triggering condition; and controlling the non-user character to perform a behavior action corresponding to the triggering condition based on the behavior node of the behavior tree according to pre-configured execution logic. It is evident that the above technical solution has the following problems: it fails to flexibly filter the player's interaction intentions under conditions of high terrain limitations, resulting in a static behavior tree setting that cannot adapt to the actual changes in player interaction, leading to mechanical interaction. Summary of the Invention

[0004] To address this issue, the present invention provides a game AI control system based on behavior trees, which overcomes the problem in the prior art that fails to flexibly filter players' interaction intentions under conditions of high terrain limitations, resulting in static behavior tree settings being unable to adapt to the actual changes in player interaction and thus producing mechanical interaction.

[0005] To achieve the above objectives, the present invention provides a game AI control system based on behavior trees, comprising: The data acquisition module is used to acquire terrain range data for each target AI and action data for each target player; The tendency intention acquisition module is used to determine the tendency path based on the number of historical preset interactive players, and to obtain the movement tendency based on the reference distance between the target player and the target AI character; The screening benchmark determination module is used to determine whether to adjust the screening method of expected interactive players to the movement tendency screening based on the terrain restriction index of the target AI character. The movement filtering module is used to perform movement preference filtering, and determines whether the target player's category is the expected interactive player based on movement preference. The range filtering module is used to determine whether to increase the base range based on the change in the number of players for the target AI character, and to record the target players within the base range as expected interactive players; The interaction adjustment module is used to determine whether to adjust the interaction for the target AI character based on the richness of the actions of each expected interactive player and the collective threat level, and to determine whether to change the interaction adjustment strategy from adjusting the behavior tree update frequency to adding action nodes based on the effective contact level. The correlation impact module is used to determine whether to perform resource adjustment analysis based on the role action dependency value of the dependency group. When performing resource adjustment analysis, it determines the resource tilt benchmark for adjusting resources for the target dependency group based on the dependency execution difference of the dependency group.

[0006] Furthermore, the screening benchmark determination module includes a restriction analysis unit, which is used to respond to the action restriction condition that the terrain restriction index of the target AI character is greater than the preset terrain restriction index, and to determine the screening method of the expected interactive player is adjusted from benchmark range screening to movement tendency screening.

[0007] Furthermore, the preference acquisition module includes a preference path confirmation unit and a movement preference confirmation unit; The bias path confirmation unit is used to detect movable paths within the baseline range and to record movable paths whose frequency of passage by historical preset interactive players is greater than the preset passage frequency as bias paths. The movement tendency confirmation unit is used to periodically obtain the reference distance between the target player and the target AI character within the reference range on the tendency path, and the difference between the most recently collected reference distance and the previous collected reference distance is recorded as the movement tendency of the target player. The historical preset interactive players are those who interacted with the target AI character within a historical period.

[0008] Furthermore, the movement filtering module includes a movement filtering unit, which is used to record target players whose movement tendency is greater than a preset movement tendency as expected interactive players.

[0009] Furthermore, the range filtering module includes a change adjustment unit and an expected confirmation unit; The variable adjustment unit is used to respond to player activity conditions where the change in the number of players is greater than the preset change in the number of players, and to determine the adjustment of the projected area increase based on the increase in player interaction within the reference range. The expected confirmation unit is used to record the target players within the baseline range as expected interactive players.

[0010] Furthermore, the interaction adjustment module includes an interaction analysis unit, which responds to the condition that the action richness of each expected interactive player is greater than the preset action richness or the collective threat level is greater than the preset collective threat level, and determines to make interaction adjustments for the target AI character.

[0011] Furthermore, the interaction adjustment module also includes a character interaction analysis unit and a node addition unit; The character interaction analysis unit is used to respond to character interaction conditions where the effective contact degree is less than or equal to the preset effective contact degree, and to determine the interaction adjustment strategy within the interaction time window, which is to change the behavior tree update frequency to adding new action nodes. The node addition unit is used to record the candidate action nodes whose action difference satisfaction is greater than the preset action difference satisfaction as new nodes, and to add the new nodes to the active selection nodes of the target AI character behavior tree.

[0012] Furthermore, the interaction adjustment module also includes a frequency analysis unit, which is used to adjust the behavior tree update frequency and increase the behavior tree update frequency based on the expected increase index of the interaction player's action difference. The adjustment range of update frequency is positively correlated with the action difference climbing index.

[0013] Furthermore, the correlation impact module includes an impact relationship analysis unit, which is used to determine resource adjustment analysis in response to relevant conditions where the role action dependency value of the dependency group is greater than the preset role action dependency value.

[0014] Furthermore, the correlation impact module also includes a resource adjustment analysis unit and a benchmark tilt unit; The resource adjustment analysis unit is used to respond to the condition that the dependency execution difference of each target dependency group is greater than the preset dependency execution difference, and to determine the resource tilt benchmark to be adjusted from the number of dependency executions to the dependency execution ratio. The baseline tilt unit is used to increase the base update frequency for target dependency groups whose resource tilt baseline is greater than the preset resource tilt baseline. The base update frequency is positively correlated with the difference in resource skew baseline for the target dependency group.

[0015] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention determines the degree of restriction imposed on the target AI character and the player by the terrain restriction index within a basic range corresponding to the target AI character. Under high terrain restriction conditions where the terrain restriction index is greater than a preset terrain restriction index, the player's movement path is relatively fixed. Therefore, analyzing the player's movement path and movement tendency can effectively obtain the interaction intention with the target AI character, thereby achieving effective screening of expected interaction players. Furthermore, by determining the player's tendency to move towards the target AI character through movement tendency, target players with movement tendency greater than a preset movement tendency are selected as expected interaction players. This achieves accurate identification of expected interaction players under high terrain restriction conditions, avoiding interaction omissions or misjudgments caused by inaccurate range screening in complex terrain, and improving the accuracy and adaptability of expected interaction determination. Furthermore, this invention determines the degree of change in the number of players within the basic range of the target AI character by measuring the degree of change in the number of players. Thus, when the degree of change in the number of players is greater than the preset degree of change in the number of players, it is determined that the number of interactions between the target AI character and the target player has changed significantly. Based on the increase in player interaction, the basic range projection area is increased. The increase in player interaction reflects the degree of change in the recent upward trend of the interaction frequency of the target AI character, thereby providing players with a more flexible interaction triggering method and further improving the flexibility of game AI control.

[0016] Furthermore, this invention determines whether to adjust the interaction of the target AI character to obtain a smoother interaction process by considering the richness of the expected interactive player's actions and the collective threat level. The richness of actions determines the extent of the expected interactive player's game actions, while the collective threat level determines the tendency for multiple expected interactive players to spatially gather and surround the target AI character. Therefore, when the richness of actions exceeds a preset richness of actions or the collective threat level exceeds a preset collective threat level, it is determined that the expected interactive player's operation difficulty for the target AI character is relatively high, and the interaction requirements for the target AI character are high. In this case, the interaction process of the target AI character should be adjusted to obtain a smoother interaction experience, further improving the accuracy and adaptability of the game AI control strategy.

[0017] Furthermore, this invention determines the degree of interaction between the expected interactive player and the target AI character through effective contact. When the effective contact is greater than a preset effective contact, it is determined that the player's interaction level is high, and the possibility of deep interaction is higher. In this case, the player's interactive experience should be improved, and the interaction adjustment method is determined to be to increase the update frequency of the behavior tree. When the effective contact is less than or equal to the preset effective contact, it is determined that the current action library of the behavior tree cannot meet the player's interaction needs. Therefore, the interaction adjustment strategy is changed, and nodes are added to the behavior tree of the target AI character to obtain richer interactive actions, enhance the depth of player interaction, and avoid the target AI character having a large mechanical feeling during the interaction due to insufficient action nodes. This improves the flexibility and scene adaptability of the interaction adjustment strategy.

[0018] Furthermore, this invention determines the degree of relevance of dependency groups during interaction by using role action dependency values. When a role action dependency value is greater than a preset role action dependency value, a dependency group is identified as having a dependency relationship, and this dependency group is recorded as the target dependency group. Resource adjustment analysis is then performed, and the basic update frequency of the target dependency group is adjusted differentially based on the dependency execution difference. This allows system resources to be dynamically allocated according to the actual execution load, avoiding performance bottlenecks caused by rigid resource tilt strategies. Attached Figure Description

[0019] Figure 1 This is a module connection diagram of the behavior tree-based game AI control system according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating how, in an embodiment of the present invention, the method for selecting expected interactive players is adjusted from baseline range selection to movement tendency selection based on the terrain limitation index. Figure 3 This is a flowchart illustrating how to determine whether to adjust the interaction for a target AI character based on action richness and collective threat level, according to an embodiment of the present invention. Figure 4 This is a flowchart illustrating how, in an embodiment of the present invention, an interaction adjustment strategy within an interaction time window is determined based on effective contact degree, from adjusting the behavior tree update frequency to adding new action nodes. Detailed Implementation

[0020] To make the objectives and advantages of the present invention clearer, the present invention will be further described below with reference to embodiments; it should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention.

[0021] Preferred embodiments of the present invention will now be described with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of the present invention and are not intended to limit the scope of protection of the present invention.

[0022] It should be noted that in the description of this invention, the terms "upper," "lower," "left," "right," "inner," and "outer," etc., which indicate directions or positional relationships, are based on the directions or positional relationships shown in the accompanying drawings. This is merely for ease of description and does not indicate or imply that the device or element must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation of this invention.

[0023] Please see Figure 1 The diagram shown is a module connection diagram of a behavior tree-based game AI control system according to an embodiment of the present invention. The system includes: The data acquisition module is used to acquire terrain range data for each target AI and action data for each target player; The tendency intention acquisition module, which is connected to the data acquisition module, is used to determine the tendency path based on the number of historical preset interactive players, and to obtain the movement tendency based on the reference distance between the target player and the target AI character. The screening benchmark determination module, which is connected to the data acquisition module and the tendency intention acquisition module respectively, is used to determine whether to adjust the screening method of expected interactive players to the movement tendency screening based on the terrain restriction index of the target AI character. The mobile filtering module is connected to the tendency intention acquisition module and the filtering benchmark determination module, respectively, to perform mobile tendency filtering and determine whether the target player's category is the expected interactive player based on the mobile tendency. The range filtering module, which is connected to the filtering benchmark determination module, is used to determine whether to increase the base range based on the change in the number of players of the target AI character, and to record the target players within the base range as expected interactive players; The interaction adjustment module, which is connected to the movement filtering module and the range filtering module respectively, is used to determine whether to make interaction adjustments for the target AI character based on the action richness and collective threat level of each expected interactive player, and to determine whether to change the interaction adjustment strategy from adjusting the behavior tree update frequency to adding action nodes based on the effective contact level. The correlation impact module is connected to the data acquisition module, the movement filtering module, and the range filtering module, respectively. It is used to determine whether to perform resource adjustment analysis based on the role action dependency value of the dependency group. When performing resource adjustment analysis, it determines the resource tilt benchmark for adjusting resources for the target dependency group based on the dependency execution difference of the dependency group.

[0024] In this embodiment of the invention, the target AI character is controlled by a behavior tree. When a player enters the basic range of the target AI character, he / she is designated as the target player. The interaction tendency of the target player is detected to determine whether he / she is the expected interaction player. When the expected interaction player enters the interaction range of the target AI character, the target AI character detects the expected interaction player and determines to use an action node to interact with the target player through the selection node of the behavior tree.

[0025] The target AI character is an artificial intelligence entity with an activity area. The activity area is a basic range centered on the target AI character and with a basic construction distance as the radius. Objects within the basic range that affect the action of the target AI character are recorded as obstacles. The obstacles include, but are not limited to, rocks, houses, cliffs, and trees.

[0026] Terrain range data includes, but is not limited to, the location coordinates of obstacles within the basic range, the number of target players, the distance between each target player and the target AI character, and the interaction duration. Target player action data includes, but is not limited to, the target player's location, reference distance, and the number of area blocks covered by the action.

[0027] Please see Figure 2 As shown, it is a flowchart of an embodiment of the present invention for determining whether to adjust the screening method of expected interactive players from benchmark range screening to movement tendency screening based on terrain restriction index. The screening benchmark determination module includes a restriction analysis unit, which is used to determine the expected interactive player screening method from benchmark range screening to movement tendency screening in response to the action restriction condition that the terrain restriction index of the target AI character is greater than the preset terrain restriction index.

[0028] In this embodiment of the invention, the screening benchmark determination module further includes a terrain restriction calculation unit, which is used to obtain the terrain restriction index within the basic range where the target AI character is located. In this embodiment, the terrain restriction index is used to determine the degree of restriction that the terrain within the basic range corresponding to the target AI character places on the target AI character and the player's actions. The larger the terrain restriction index, the more obstacles there are within the basic range, the higher the degree of restriction on actions, and the higher the predictability of the target player's action path. Therefore, the movement characteristics of the target player are used to obtain the expected interactive player. The smaller the terrain restriction index, the more open and flat the area corresponding to the basic range where the target AI character is located, the lower the degree of restriction on the target player's actions, and the higher the degree of freedom of action for the target player. At this time, the reliability of the screening based on the movement tendency of the fixed path decreases. Therefore, the system can meet the basic interaction determination by maintaining the benchmark range screening. The process of obtaining the terrain restriction index includes: the terrain restriction index is determined based on the movement restriction index corresponding to the combination of each local block within the basic range, and the terrain restriction index and the movement restriction index are positively correlated. Specifically, the terrain restriction index is the average of the movement restriction indices corresponding to each local block combination. For a single local block combination, the movement restriction index is the ratio of the length of the shortest movable path between two local blocks in the combination to the distance between the center points of the projected areas of the two local blocks. A local block combination consists of the local block where the target AI character's initial point is located and any other local block. The initial point is the center point of the target AI character's projected area. The process of obtaining local blocks includes: obtaining the smallest projected rectangle that can enclose the basic area where the target AI character is located; uniformly dividing the projected rectangle to obtain several sub-region blocks of the same area; and recording the portion of the basic area corresponding to each sub-region block as a local block.

[0029] In this embodiment of the invention, the higher the accuracy requirement of the user for the recognition of the expected interactive player, the lower the value of the preset terrain restriction index. In this embodiment, by collecting terrain data of game scenes with different obstacle densities and different obstacle distribution methods, different terrain restriction index thresholds are set for screening and simulation. The recognition accuracy of the expected interactive player is used as the evaluation index, and the minimum threshold that meets the constraints is selected as the preset value.

[0030] Please continue reading. Figures 1 to 2 As shown, the tendency intention acquisition module includes a tendency path confirmation unit and a movement tendency confirmation unit; The bias path confirmation unit is used to detect movable paths within the baseline range and to record movable paths whose frequency of passage by historical preset interactive players is greater than the preset passage frequency as bias paths. The movement tendency confirmation unit is used to periodically obtain the reference distance between the target player and the target AI character within the reference range on the tendency path, and the difference between the most recently collected reference distance and the previous collected reference distance is recorded as the movement tendency of the target player. The historical preset interactive players are those who interacted with the target AI character within a historical period.

[0031] In this embodiment of the invention, a tendency detection period is set to detect the action data of each target player within the basic range corresponding to the target AI character. The longer the tendency detection period, the more action data of the target players are obtained, and the higher the accuracy of the movement tendency acquisition. The higher the user's control precision requirement for the target AI character, the longer the tendency detection period value is.

[0032] The tendency intention acquisition module also includes a tendency calculation unit to obtain the frequency of movement of movable paths and the movement tendency of target players within the tendency detection period. In this embodiment, the frequency of movement is used to quantify how frequently movable paths are used by historically preset interactive players. The higher the frequency of movement, the more times the path is selected by interactive players within the historical period, and the greater the probability that it is selected as the path to the initial point of the target AI character. The process of obtaining the communication frequency of a single movable path includes: the frequency of movement is determined based on the number of target players on the movable path and the duration of the tendency detection period. The frequency of movement is positively correlated with the number of target players and negatively correlated with the duration of the tendency detection period. Specifically, the communication frequency is the ratio of the number of target players acting on the movable path to the duration of the tendency detection period within the most recent complete tendency detection period. Wherein, a movable path is a path that can connect an edge block to a local block where the center point of the target AI character's projected area is located. The edge block is a region block whose projected area is smaller than the projected area of ​​a sub-region block.

[0033] The tendency calculation unit is also used to obtain the movement tendency of each target player. In this embodiment, the movement tendency is used to determine the movement trend of the target player towards the target AI character along the tendency path. The greater the movement tendency, the clearer the player's intention to move towards the target AI character along the tendency path. The process of obtaining the movement tendency includes: the movement tendency is determined based on the reference distance, and the movement tendency is positively correlated with the decrease in the reference distance. Specifically, the movement tendency is the difference between the most recently collected reference distance and the reference distance collected in the previous period. The collection distance is the length of the tendency path segment between the area block where the target player is located and the edge block corresponding to the tendency path. The data acquisition module obtains the reference distance of the target player every basic collection frequency. It can be understood that the higher the basic collection frequency, the higher the granularity of the reference distance acquisition; the higher the accuracy of the user's reference distance acquisition, the higher the value of the basic collection frequency. In this embodiment, the basic collection frequency of the data acquisition module is recorded as the average value of the basic collection frequency after removing outliers by obtaining the basic collection frequency from historical qualified working conditions.

[0034] In this embodiment of the invention, the preset passage frequency is obtained by simulating the game operation data of multiple different players moving along different movable paths. Different passage frequency thresholds are set to simulate the determination of the preferred path. The accuracy of preferred path identification and the mislabeling rate of non-preferred path are used as evaluation indicators, and the threshold that meets the constraints is selected as the preset passage frequency.

[0035] Specifically, the movement filtering module includes a movement filtering unit, which is used to record target players whose movement tendency is greater than a preset movement tendency as expected interactive players.

[0036] In this embodiment of the invention, the preset movement tendency is obtained by simulating the movement of multiple sets of players with different movement trends and different approach speeds. Different movement tendency thresholds are set to simulate the selection of expected interactive players. The accuracy of the identification of expected interactive players is used as the evaluation index, and the threshold that meets the constraints is selected as the preset player number change degree.

[0037] Specifically, the range filtering module includes a change adjustment unit and an expected confirmation unit; The variable adjustment unit is used to respond to player activity conditions where the change in the number of players is greater than the preset change in the number of players, and to determine the adjustment of the projected area increase based on the increase in player interaction within the reference range. The expected confirmation unit is used to record the target players within the baseline range as expected interactive players.

[0038] In this embodiment of the invention, the range filtering module further includes a quantity calculation unit, which is used to obtain the change in the number of expected interactive players and the increase in player interaction within the most recent complete tendency detection period. In this embodiment, the change in the number of players is used to determine the degree of fluctuation in the number of players within the basic range of the target AI character over time. The larger the change in the number of players, the more drastic the fluctuation in the number of players within the basic range, the higher the frequency of target players entering and leaving the area near the basic range, or the higher the group mobility. In this case, the baseline range should be adjusted to adapt to the dynamic changes in the number of players. The method for confirming the change in the number of players is that the change in the number of players is determined based on the number of target players. The change in the number of players is positively correlated with the variance and negatively correlated with the average. Specifically, the change in the number of players is the ratio of the variance of the number of target players at each detection time to the average value. The detection time is a number of times uniformly sampled within the tendency detection period.

[0039] Player interaction rise rate is used to determine the degree of increase in the expected number of interactive players within the base range of a target AI character over time. A larger player interaction rise rate indicates a more significant increase in the expected number of interactive players over time, and a stronger player interest or intention to approach the target AI character. In this embodiment, the player interaction rise rate is obtained based on the expected number of interactive players at each detection time, and the player interaction rise rate is positively correlated with the rate of change of the expected number of interactive players over time. Specifically, the player interaction rise rate is the slope of the linear regression equation corresponding to the expected number of interactive players at each detection time. When the player interaction rise rate is greater than a preset player interaction rise rate, the base range is increased. The projected area of ​​the adjusted base range is the product of the projected area of ​​the base range before adjustment and the interaction adjustment ratio, which is the ratio of the player interaction rise rate to the preset player interaction rise rate.

[0040] In this embodiment of the invention, the larger the number of samples taken at the detection time, the higher the calculation accuracy of the player interaction increase, the more precise the adjustment of the target AI character's basic range, and the higher the user's control precision requirements for the target AI character. Therefore, the larger the value of the number of samples taken at the detection time. In this embodiment, the average value of the number of samples taken after removing outliers from the historical qualified working conditions is calculated and recorded as the number of samples taken at the detection time.

[0041] In this embodiment of the invention, the preset player number change degree is obtained by simulating multiple sets of game scene data with different player number fluctuations. Different player number change degree thresholds are set for the simulation of baseline range adjustment. The expected interactive player recognition accuracy and computing resource increase rate after range adjustment are used as evaluation indicators, and the threshold that meets the constraints is selected as the preset player number change degree.

[0042] Please see Figure 3 As shown, it is a flowchart of an embodiment of the present invention for determining whether to make interaction adjustments for a target AI character based on action richness and collective threat level. The interaction adjustment module includes an interaction analysis unit, which is used to determine whether to make interaction adjustments for the target AI character in response to the condition that the action richness of each expected interactive player is greater than the preset action richness or the collective threat level is greater than the preset collective threat level.

[0043] In this embodiment of the invention, an action detection cycle is set to obtain the interaction actions of each expected interactive player. The shorter the duration of the action detection cycle, the higher the frequency of obtaining interaction actions, the higher the analysis accuracy of interaction adjustment, and the higher the user's control accuracy over the target AI character. In this embodiment, the duration of the action detection cycle is calculated by obtaining the duration of the action detection cycle in historical qualified working conditions and removing outliers. This average duration of the action detection cycle is recorded as the duration of the action detection cycle in this embodiment.

[0044] The interaction adjustment module also includes an action calculation unit to obtain the action richness and aggregate threat level of each expected interactive player. In this embodiment, action richness is used to determine the spatial range covered by the expected interactive player during movement. The greater the action richness, the more regional blocks the player involves during interaction, the wider the distribution range of the action process, and the more complex and varied the operation behavior. The action richness is determined based on the action coverage reference value of the expected interactive player, and there is a positive correlation between action richness and action coverage reference value. Specifically, action richness is the average of the action coverage reference values ​​of each expected interactive player. For a single expected interactive player, the action coverage reference value is the number of local blocks covered by the expected interactive player during movement within a single action detection period.

[0045] The ensemble threat level is used to determine the spatial concentration of expected interactive players within the target AI character's interaction area. A higher ensemble threat level indicates a higher concentration of expected interactive players and a more complex interaction among them. In this case, interaction adjustments should be made to the target AI character to accommodate the responsiveness requirements of the high-density player cluster. The ensemble threat level is determined based on the number of expected players within the target AI character's interaction area and the total number of expected interactive players within the base area. The ensemble threat level is positively correlated with the number of expected players within the interaction area and negatively correlated with the total number of expected interactive players within the base area. Specifically, for a single action detection cycle, the ensemble threat level is the ratio of the number of expected players within the target AI character's interaction area to the number of expected interactive players within the base area.

[0046] In this embodiment of the invention, the preset action richness and preset set threat level are obtained by acquiring the action richness and set threat level in historical working conditions, and the average value of the action richness and set threat level after removing outliers is calculated and recorded as the preset action richness and preset set threat level.

[0047] Please see Figure 4 As shown, it is a flowchart of an embodiment of the present invention for determining whether to adjust the interaction adjustment strategy within the interaction time window from adjusting the behavior tree update frequency to adding action nodes based on the effective contact degree. The interaction adjustment module also includes a role interaction analysis unit and a node addition unit. The character interaction analysis unit is used to respond to character interaction conditions where the effective contact degree is less than or equal to the preset effective contact degree, and to determine the interaction adjustment strategy within the interaction time window, which is to change the behavior tree update frequency to adding new action nodes. The node addition unit is used to record the candidate action nodes whose action difference satisfaction is greater than the preset action difference satisfaction as new nodes, and to add the new nodes to the active selection nodes of the target AI character behavior tree.

[0048] In this embodiment of the invention, the interaction adjustment module further includes an action interaction calculation unit, which is used to obtain the effective contact degree of each interactive player and the action difference satisfaction degree of each action node. In this embodiment, the effective contact degree is used to determine the degree of effective interaction between the expected interactive player and the target AI character. The larger the effective contact degree, the higher the proportion of time the player is within the effective interaction distance during the interaction process, and the more sufficient the interaction between the player and the AI ​​character. At this time, the behavior tree update frequency should be increased to improve the responsiveness. The smaller the effective contact degree, the lower the proportion of effective contact, even though the player is within the interaction area. At this time, action node addition selection should be performed to obtain richer interaction options. The process of obtaining the effective contact degree includes: the effective contact degree is determined based on the effective interaction time between the interactive player and the target AI character and the historical interaction time. The effective contact degree is positively correlated with the effective interaction time and negatively correlated with the historical interaction time. Specifically, for a single interactive player, effective contact is the ratio of the effective interaction time between the interactive player and the target AI character within the tendency detection period to the historical interaction time. Effective interaction time is the duration during which the distance between the center point of the interactive player and the center point of the target AI character is less than or equal to the interaction construction distance. Historical interaction time is the average interaction time of all interactive players within the most recent complete tendency detection period. Interaction duration is the time interval between the interaction start time and the interaction termination time. Specifically, the interaction start time and interaction termination time are determined as follows: the interaction start time is the moment when the target AI character first detects the interactive player within the tendency detection period, and continues to detect the interactive player until the target AI character is unable to detect the interactive player for the first time, at which point the interaction stops, and this moment is recorded as the interaction termination time.

[0049] Interactive players are those who are within the interaction area of ​​the target AI character.

[0050] Action difference satisfaction is used to determine the degree of difference between the executed action corresponding to the selected action node and the executed actions corresponding to each action node in the behavior tree of the target AI character. The larger the action difference satisfaction, the greater the difference in the executed action corresponding to the selected action node, and the higher the diversity of executed actions after being added to the behavior tree. The process of obtaining action difference satisfaction includes: the action difference satisfaction is determined based on the action change value of each action node in the behavior tree of the target AI character. The action difference satisfaction is negatively correlated with the range of action change values ​​and positively correlated with the average value of action change values. Specifically, the action difference satisfaction is the ratio of the range of action change values ​​of each action node in the behavior tree corresponding to the target AI character to the average value. The action change value is the number of local blocks covered by the target AI character when completing a single action node at the initial point.

[0051] The action nodes to be selected are those that are not in the behavior tree of the target AI character, while the active selection nodes are the selection nodes that have been traversed the most times in the behavior tree of the target AI character in the most recent complete action detection cycle.

[0052] In this embodiment of the invention, the preset effective contact degree and the preset action difference satisfaction degree are determined by obtaining the effective contact degree and action difference satisfaction degree in historical working conditions, and the average values ​​of the effective contact degree and action difference satisfaction degree after removing outliers are calculated and recorded as the preset effective contact degree and the preset action difference satisfaction degree, respectively.

[0053] Please continue reading. Figures 1 to 4 As shown, the interaction adjustment module also includes a frequency analysis unit, which is used to adjust the behavior tree update frequency and increase the behavior tree update frequency based on the expected increase index of the interaction player's action difference. The adjustment range of update frequency is positively correlated with the action difference climbing index.

[0054] In this embodiment of the invention, the Action Difference Climbing Index is used to determine the extent to which the area covered by the player's actions expands during the interaction. A larger Action Difference Climbing Index indicates a more significant spatial extension of the player's actions and a higher degree of expansion in the interactive behavior. The process of obtaining the Action Difference Climbing Index includes: the Action Difference Climbing Index is determined based on the number of area blocks involved in the interaction at the current moment. The Action Difference Climbing Index is positively correlated with the total number of area blocks involved during the interaction and negatively correlated with the number of area blocks covered by the player's own projection. Specifically, for a single player, the Action Difference Climbing Index is the ratio of the difference between the total number of area blocks involved in the interaction between the player and the target AI character at the current moment and the number of area blocks covered by the player's projection, to the total number of area blocks covered by the player's projection.

[0055] In adjusting the update frequency of the behavior tree, the adjusted update frequency is the product of the original update frequency and the difference adjustment coefficient. The difference adjustment coefficient is the ratio of the action difference climbing index to the preset action difference climbing index.

[0056] In this embodiment of the invention, the preset action difference escalation index is obtained by simulating player interaction data with different action changes during multiple interaction processes. Different action difference escalation index thresholds are set to conduct behavior tree update frequency adjustment tests. The response time of the target AI character after adjustment is used as the evaluation index, and the threshold that meets the constraints is selected as the preset action difference escalation index.

[0057] Specifically, the correlation impact module includes an impact relationship analysis unit, which is used to determine resource adjustment analysis in response to relevant conditions where the role action dependency value of the dependency group is greater than the preset role action dependency value.

[0058] The association impact module also includes a dependency calculation unit, which is used to obtain the dependency group and the role action dependency value of the dependency group.

[0059] The character action dependency value quantifies the degree of association between dependent characters due to player interaction. A higher character action dependency value indicates a higher proportion of the total time a player spends interacting with dependent characters within a dependency group, and a tighter connection between the actions of each dependent character within the dependency group. The process of obtaining the character action dependency value includes: the character action dependency value is determined based on the path movement time and interaction interval time of the dependency group. The character action dependency value is positively correlated with the path movement time and negatively correlated with the interaction interval time. Specifically, the character action dependency value is the ratio of the path movement time to the interaction interval time of the dependency group. The path movement time is the average of the overall interaction time of all interacting players within the most recent complete tendency detection period. The overall interaction time is obtained by dividing the time interval between the moment a single interacting player first enters the dependency area and interacts with subsequent dependent characters, and the moment they first leave the dependency area and stop interacting with any dependent character. The interaction interval time is the average of the actual interaction time of all interacting players, which is the time a single interacting player spends within the dependency area without interacting with any dependent character within the most recent complete tendency detection period.

[0060] The process of constructing a dependency group includes: randomly obtaining the initial point of a single target AI role, performing dependency analysis on the target AI role, and recording the dependent roles that meet the dependency analysis along with the target AI role as a dependency group. The dependency analysis process includes: recording each target AI role within the distance of the target AI role's initial point as a dependent role, and iteratively checking whether there are other non-dependent target AI roles within the distance of each dependent role's initial point. If so, recording the target AI roles within that distance as dependent roles; otherwise, stopping the check, until no new dependent roles appear, at which point the loop stops. It is important to note that all target AI roles in a dependency group are dependent roles, and the dependency group is constructed only once for a single dependent role.

[0061] The dependency scope is the smallest circular area that can contain the interaction scope of all dependent roles in the dependency group.

[0062] In this embodiment of the invention, the preset role action dependency value is determined by obtaining the role action dependency value in historical working conditions, and the average value of the role action dependency value after removing outliers is recorded as the preset role action dependency value.

[0063] Specifically, the related impact module also includes a resource adjustment analysis unit and a benchmark tilt unit; The resource adjustment analysis unit is used to respond to the condition that the dependency execution difference of each target dependency group is greater than the preset dependency execution difference, and to determine the resource tilt benchmark to be adjusted from the number of dependency executions to the dependency execution ratio. The baseline tilt unit is used to increase the base update frequency for target dependency groups whose resource tilt baseline is greater than the preset resource tilt baseline. The base update frequency is positively correlated with the difference in resource skew baseline for the target dependency group.

[0064] The target dependency group is the dependency group whose character action dependency value is greater than the preset character action dependency value.

[0065] The related influence module also includes an execution calculation unit, which is used to obtain the number of dependency executions, dependency execution difference, and dependency execution ratio of the target dependency group. In this embodiment, the dependency execution difference is used to determine the degree of load imbalance among the dependency roles within the dependency group during interaction. The larger the dependency execution difference, the more significant the difference in the number of interactive players handled by each dependency role within the dependency group. This may result in some dependency roles being overloaded while others are relatively idle. In this case, the update resources of dependency roles should be coordinated to avoid resource waste and performance bottlenecks. The process of obtaining the dependency execution difference includes: the dependency execution difference is determined based on the number of dependency executions of each dependency role, and the degree of dispersion of the dependency execution difference is positively correlated with the number of dependency executions. Specifically, the dependency execution difference is the standard deviation of the number of dependency executions of each dependency role in the target dependency group within the most recent complete tendency detection period. For a single dependency role, the number of dependency executions is the number of players who interacted with that dependency role within the most recent complete tendency detection period.

[0066] The dependency execution ratio is used to determine the relative load proportion of an individual dependency role within a dependency group in the allocation of interaction tasks. A higher dependency execution ratio indicates a higher proportion of the average effective interaction time for that dependency role, and a more concentrated distribution of interaction tasks undertaken by that dependency role. The process of obtaining the dependency execution ratio includes: the dependency execution ratio is determined based on the average effective interaction time of the dependency role, and the dependency execution ratio and average effective interaction time are positively correlated. Specifically, the dependency execution ratio is the ratio of the average effective interaction time of an individual dependency role to the average of the average effective interaction times of all dependency roles within the most recent complete tendency detection period. The average effective interaction time is the average of the effective interaction times of the dependency role with each interacting player within the most recent complete tendency detection period.

[0067] The related impact module also includes an update adjustment unit, which is used to adjust the base update frequency of the behavior tree. The adjusted base update frequency is the ratio of the base update frequency before adjustment to the frequency adjustment coefficient. The frequency adjustment coefficient is the ratio of the resource tilt benchmark to the preset resource tilt benchmark. The adjusted base update frequency is used as the update frequency of the target AI character in the interaction adjustment.

[0068] When the resource skew benchmark is the number of dependent executions, a smaller resource skew benchmark indicates fewer interactive players supported by that dependent role, resulting in a lighter task load. When the dependency skew benchmark is the percentage of dependent executions, a smaller resource skew benchmark indicates a smaller percentage of interaction time for that dependent role within the group, lower resource consumption requirements relative to other dependent roles, and lower requirements for resource coordination. The higher the user's requirements for the interactive response speed and resource allocation accuracy of the game AI control system, the smaller the value of the preset resource skew benchmark. In this embodiment, the preset resource skew benchmark is determined by obtaining the resource skew benchmark from historical working conditions, and the average value of the resource skew benchmark after removing outliers is recorded as the preset resource skew benchmark.

[0069] In this embodiment of the invention, historical operating conditions refer to parameter records of the game AI control system during character control in a historical process. These records document the parameter values ​​used in the system. For any given operating condition, if the control effect of the game AI control system meets the character control requirements, then that historical operating condition is considered a historically qualified operating condition. Whether the control effect corresponding to the historical operating condition meets the character control requirements can be determined based on, but is not limited to, control response timeliness and interaction matching rate. How to determine whether the character control requirements are met is content already understood by those skilled in the art and will not be elaborated further.

[0070] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.

Claims

1. A game AI control system based on behavior trees, characterized in that, include: The data acquisition module is used to acquire terrain range data for each target AI and action data for each target player; The tendency intention acquisition module is used to determine the tendency path based on the number of historical preset interactive players, and to obtain the movement tendency based on the reference distance between the target player and the target AI character; The screening benchmark determination module is used to determine whether to adjust the screening method of expected interactive players to the movement tendency screening based on the terrain restriction index of the target AI character. The movement filtering module is used to perform movement preference filtering, and determines whether the target player's category is the expected interactive player based on movement preference. The range filtering module is used to determine whether to increase the base range based on the change in the number of players for the target AI character, and to record the target players within the base range as expected interactive players; The interaction adjustment module is used to determine whether to adjust the interaction for the target AI character based on the richness of the actions of each expected interactive player and the collective threat level, and to determine whether to change the interaction adjustment strategy from adjusting the behavior tree update frequency to adding action nodes based on the effective contact level. The correlation impact module is used to determine whether to perform resource adjustment analysis based on the role action dependency value of the dependency group. When performing resource adjustment analysis, it determines the resource tilt benchmark for adjusting resources for the target dependency group based on the dependency execution difference of the dependency group.

2. The game AI control system based on behavior tree according to claim 1, characterized in that, The screening benchmark determination module includes a restriction analysis unit, which is used to respond to the action restriction condition that the terrain restriction index of the target AI character is greater than the preset terrain restriction index, and to determine the screening method of the expected interactive player is changed from benchmark range screening to movement tendency screening.

3. The game AI control system based on behavior tree according to claim 2, characterized in that, The intention acquisition module includes an intention path confirmation unit and a movement intention confirmation unit; The bias path confirmation unit is used to detect movable paths within the baseline range and to record movable paths whose frequency of passage by historical preset interactive players is greater than the preset passage frequency as bias paths. The movement tendency confirmation unit is used to periodically obtain the reference distance between the target player and the target AI character within the reference range on the tendency path, and the difference between the most recently collected reference distance and the previous collected reference distance is recorded as the movement tendency of the target player. The historical preset interactive players are those who interacted with the target AI character within a historical period.

4. The game AI control system based on behavior tree according to claim 3, characterized in that, The movement filtering module includes a movement filtering unit, which is used to identify target players whose movement tendency is greater than a preset movement tendency as expected interactive players.

5. The game AI control system based on behavior tree according to claim 4, characterized in that, The range filtering module includes a change adjustment unit and an expected confirmation unit; The variable adjustment unit is used to respond to player activity conditions where the change in the number of players is greater than the preset change in the number of players, and to determine the adjustment of the projected area increase based on the increase in player interaction within the reference range. The expected confirmation unit is used to record the target players within the baseline range as expected interactive players.

6. The game AI control system based on behavior tree according to claim 5, characterized in that, The interaction adjustment module includes an interaction analysis unit, which responds to conditions where the action richness of each expected interactive player is greater than the preset action richness or the collective threat level is greater than the preset collective threat level, and determines to make interaction adjustments for the target AI character.

7. The game AI control system based on behavior tree according to claim 6, characterized in that, The interaction adjustment module also includes a character interaction analysis unit and a node addition unit; The character interaction analysis unit is used to respond to character interaction conditions where the effective contact degree is less than or equal to the preset effective contact degree, and to determine the interaction adjustment strategy within the interaction time window, which is to change the behavior tree update frequency to adding new action nodes. The node addition unit is used to record the candidate action nodes whose action difference satisfaction is greater than the preset action difference satisfaction as new nodes, and to add the new nodes to the active selection nodes of the target AI character behavior tree.

8. The game AI control system based on behavior tree according to claim 7, characterized in that, The interaction adjustment module also includes a frequency analysis unit, which is used to adjust the behavior tree update frequency and increase the behavior tree update frequency based on the expected increase index of the interaction player's action difference. The adjustment range of update frequency is positively correlated with the action difference climbing index.

9. The game AI control system based on behavior tree according to claim 8, characterized in that, The correlation impact module includes an impact relationship analysis unit, which is used to determine resource adjustment analysis in response to relevant conditions where the role action dependency value of the dependency group is greater than the preset role action dependency value.

10. The game AI control system based on behavior tree according to claim 9, characterized in that, The related impact module also includes a resource adjustment analysis unit and a baseline tilt unit; The resource adjustment analysis unit is used to respond to the condition that the dependency execution difference of each target dependency group is greater than the preset dependency execution difference, and to determine the resource tilt benchmark to be adjusted from the number of dependency executions to the dependency execution ratio. The baseline tilt unit is used to increase the base update frequency for target dependency groups whose resource tilt baseline is greater than the preset resource tilt baseline. The base update frequency is positively correlated with the difference in resource skew baseline for the target dependency group.

Citation Information

Patent Citations

  • Non-user role control method and device based on behavior tree, equipment and medium

    CN117180750A