Method and terminal for automatically generating way-finding path in game

By collecting and analyzing players' gaming behavior data and using machine learning algorithms to build an automatic pathfinding model, the problem that existing pathfinding methods are unable to cope with temporary obstacles is solved, and personalized and real-time optimized pathfinding path generation is achieved.

CN120605506APending Publication Date: 2025-09-09FUJIAN TQ DIGITAL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410254052.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-06
Publication Date
2025-09-09

AI Technical Summary

Technical Problem

The path-finding methods in existing games cannot effectively cope with temporary changes in the positions of obstacles, and the generated paths rely on manual creation by designers, which is not the optimal path.

Method used

By collecting players' game behavior data, using machine learning algorithms to build an automatic pathfinding model, analyzing players' behavior patterns and goals, and automatically generating personalized pathfinding paths.

Benefits of technology

It realizes personalized path-finding planning for players, can respond to changes in the game environment and player needs in real time, and generate the optimal path.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120605506A_ABST
    Figure CN120605506A_ABST
Patent Text Reader

Abstract

The invention provides a method for automatically generating a way-finding path in a game and a terminal. The method comprises the following steps: collecting game behavior data of historical players; analyzing and learning the game behavior data through a machine learning algorithm, constructing an automatic path-finding model, and determining a player behavior mode of the current player; determining a final target according to the current target of the current player and the current game state; and based on the game behavior data of the current player, the player behavior mode and the final target, automatically generating a way-finding route through the automatic way-finding model. According to the method, the game behavior data of the historical players in the game are obtained, analysis and learning are performed based on the machine learning algorithm, so that the automatic way-finding model is constructed, and the player behavior model and the final target of the current player are determined; and finally, taking the game behavior data of the current player, the player behavior mode and the final target as input, and automatically calculating and generating a way-finding route through the automatic way-finding model, thereby effectively realizing personalized way-finding path planning for the player.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of games and AI technology, and in particular to a method and a terminal for automatically generating a pathfinding path in a game. Background Art

[0002] Currently, pathfinding in games is typically accomplished through pre-configured road networks or nodes. Within a game map, designers manually create a series of traversable paths or use a grid or map partitioning algorithm to generate waypoints. The pathfinding algorithm then calculates the shortest path for the player to move based on information such as the player's position, the target location, and obstacles on the map.

[0003] This method usually requires fixed information such as the target location and obstacles on the map. There is no good solution for sudden changes in the location of temporary obstacles. The path generation method is based on manual creation by the designer, and the created path is not the optimal path. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and terminal for automatically generating pathfinding paths in games, which collects and analyzes players' behavioral data, learns players' behavior patterns, preferences and goals, and generates personalized pathfinding path planning.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A method for automatically generating a pathfinding path in a game, comprising the steps of:

[0007] S1. Collect historical players’ gaming behavior data;

[0008] S2. Analyze and learn the game behavior data using a machine learning algorithm, build an automatic pathfinding model, and determine the player behavior pattern of the current player;

[0009] S3. Determine a final goal based on the current player's current goal and current game status;

[0010] S4. Automatically generate a pathfinding route through the automatic pathfinding model based on the current player's game behavior data, the player behavior pattern, and the final goal.

[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0012] A terminal for automatically generating a pathfinding path in a game comprises a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method for automatically generating a pathfinding path in a game as described above are implemented.

[0013] The beneficial effects of the present invention are: providing a method and terminal for automatically generating pathfinding paths in a game, by acquiring the game behavior data of historical players in the game and analyzing and learning based on a machine learning algorithm, thereby constructing an automatic pathfinding model, and determining the player behavior pattern and final goal of the current player, and finally using the current player's game behavior data, player behavior pattern and final goal as input to automatically calculate and generate a pathfinding route through the automatic pathfinding model, effectively realizing personalized pathfinding path planning for players. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 This is a flow chart of a method for automatically generating a pathfinding path in a game according to an embodiment of the present invention;

[0015] Figure 2 This is a structural diagram of a terminal for automatically generating pathfinding paths in a game according to an embodiment of the present invention.

[0016] Description of labels:

[0017] 1. A terminal for automatically generating pathfinding paths in a game; 2. A memory; 3. A processor. DETAILED DESCRIPTION

[0018] To illustrate the technical content, achieved objectives and effects of the present invention in detail, the following description is given in conjunction with the embodiments and accompanying drawings.

[0019] Please refer to Figure 1 , a method for automatically generating a pathfinding path in a game, comprising the steps of:

[0020] S1. Collect historical players’ gaming behavior data;

[0021] S2. Analyze and learn the game behavior data using a machine learning algorithm, build an automatic pathfinding model, and determine the player behavior pattern of the current player;

[0022] S3. Determine a final goal based on the current player's current goal and current game status;

[0023] S4. Automatically generate a pathfinding route through the automatic pathfinding model based on the current player's game behavior data, the player behavior pattern, and the final goal.

[0024] From the above description, it can be seen that the beneficial effects of the present invention are: providing a method and terminal for automatically generating pathfinding paths in a game, by obtaining the game behavior data of historical players in the game, and analyzing and learning based on a machine learning algorithm, thereby constructing an automatic pathfinding model, and determining the player behavior pattern and final goal of the current player, and finally using the current player's game behavior data, player behavior pattern and final goal as input to automatically calculate and generate a pathfinding route through the automatic pathfinding model, effectively realizing personalized pathfinding path planning for players.

[0025] Furthermore, the game behavior data includes the player's movement trajectory data, game process data, kill records, win rate, mission location, mission type, NPC distribution, obstacle distribution and obstacle type in the game.

[0026] From the above description, we can see that we collect game behavior data including player's movement trajectory data, game process data, kill records, win rate, mission location, mission type, NPC distribution, obstacle distribution and obstacle type in the game, so as to learn and analyze and build an automatic pathfinding model.

[0027] Furthermore, the step S2 is specifically as follows:

[0028] S21. Constructing a behavior pattern recognition model and an automatic path-finding model using a machine learning algorithm, and training and testing the behavior pattern recognition model and the automatic path-finding model based on the game behavior data;

[0029] S22: Input the game behavior data of the current player into the trained and tested behavior pattern recognition model, and output the player behavior pattern of the current player.

[0030] As can be seen from the above description, by using machine learning algorithms to learn and analyze the collected data to build models for training and testing, the accuracy and reliability of the subsequent automatic pathfinding route calculation using the trained model can be effectively ensured. At the same time, a behavior pattern recognition model is also constructed to enable accurate judgment of the intentions and needs of players who need pathfinding routes based on their behavior patterns, thereby realizing personalized route generation. In addition, machine learning algorithms can be implemented using clustering algorithms or decision trees.

[0031] Furthermore, the step S3 is specifically as follows:

[0032] S31. Determine a final target based on the current game task or action intention of the current player, wherein the final target includes the enemy position and the task destination;

[0033] S32. Setting different priorities for different enemy positions and task destinations according to the current game state of the current player;

[0034] S33, monitoring the game situation and the current game task or action intention of the current player in real time to see if there are any changes. If so, re-determine the final goal and set the priority according to the changes.

[0035] As can be seen from the above description, the final goal will be used to generate the path in subsequent steps. At the same time, since there may be multiple enemy positions and task destinations determined in the final goal, different priorities are set for different multiple enemy positions and task destinations according to the needs of the player to optimize the path planning. In addition, when the game environment and the player's personal tasks and action intentions change, the corresponding final goal will also change. Therefore, it is necessary to redetermine and re-prioritize the multiple enemy positions and task destinations in the re-determined final goal so that a path that better suits the player's preferences can be generated subsequently.

[0036] Furthermore, the step S4 is specifically as follows:

[0037] S41, determining a starting point and an end point of a generated path based on the map the current player is in, the difficulty of each level, the current position of the current player, and the final goal in the game behavior data;

[0038] S42: Determine a path optimization method for the current player, including an optimization method for avoiding enemies, an optimization method for pursuing enemies, an optimization method for considering the game environment, and an optimization method for adapting to player behavior;

[0039] The enemy avoidance optimization method is specifically to calculate the enemy-minimizing path based on the automatic path-finding model according to the final goal of the current player and the current game state;

[0040] The optimization method for chasing enemies is specifically to calculate the enemy's maximized path based on the automatic path-finding model according to the final goal of the current player and the current game state;

[0041] The game environment optimization method specifically calculates the optimal path of the environment based on the automatic path-finding model according to the position changes of props and the movement paths of obstacles in the game;

[0042] The player behavior optimization method is specifically to calculate the preferred best path through the automatic path-finding model based on the game behavior pattern of the current player.

[0043] As can be seen from the above description, based on the collected data, determined player behavior patterns and final goals, the path-finding route is generated based on the trained automatic path-finding model, and combined with the corresponding path optimization method, a path that better suits the player's preferences is generated for the player.

[0044] Furthermore, after step S4, the following steps are further included:

[0045] S5. Adjust and adapt the pathfinding route in real time.

[0046] Furthermore, the step S5 is specifically as follows:

[0047] S51, monitoring the changes in the final goal of the current player in real time;

[0048] S52: When the final destination changes, the routing route is regenerated using the automatic routing model.

[0049] From the above description, we can see that by real-time monitoring of changes in the final goal and adaptively adjusting the pathfinding route, we can further ensure the player's experience.

[0050] Furthermore, the step S5 further includes:

[0051] The positions of dynamic obstacles and map information on the path-finding route are monitored in real time to eliminate paths that collide with the dynamic obstacles.

[0052] As can be seen from the above description, it can also quickly adapt to new situations and generate more adaptable paths based on new game status and player needs, flexibly respond to different game scenarios and player behaviors, and provide players with a better pathfinding experience.

[0053] Furthermore, after step S4, the following steps are further included:

[0054] S6. Display the pathfinding route on the game interface of the current player through a visual display path, and trigger the game character to move along the pathfinding route in the game map according to the player's touch operation on the game interface.

[0055] As can be seen from the above description, the generated path is visualized and displayed to the player and executed accordingly based on the player's operation, thereby realizing interaction with the player and meeting the player's personalized needs. It also makes it easier for subsequent players to personalize the path according to their own preferences and needs.

[0056] Please refer to Figure 2 A terminal for automatically generating a pathfinding path in a game includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the method for automatically generating a pathfinding path in a game as described above are implemented.

[0057] From the above description, it can be seen that the beneficial effects of the present invention are: based on the same technical concept, in conjunction with the above-mentioned method for automatically generating a pathfinding path in a game, a terminal for automatically generating a pathfinding path in a game is provided, which obtains the game behavior data of historical players in the game and analyzes and learns based on a machine learning algorithm to construct an automatic pathfinding model, and determines the current player's player behavior pattern and final goal. Finally, the current player's game behavior data, player behavior pattern and final goal are used as input to automatically calculate and generate a pathfinding route through the automatic pathfinding model, effectively realizing personalized pathfinding planning for players.

[0058] The present invention provides a method and terminal for automatically generating pathfinding paths in games, which are suitable for performing personalized pathfinding planning for players based on their needs, preferences, and behavior patterns in game scenarios, thereby improving their gaming experience. The following is a detailed description of the method and terminal with reference to specific embodiments:

[0059] Please refer to Figure 1 , embodiment 1 of the present invention is:

[0060] A method for automatically generating in-game pathfinding paths uses artificial intelligence (AI) algorithms to optimize the in-game pathfinding experience. The feasibility of AI-powered personalized pathfinding is reflected in the following aspects:

[0061] 1. Data-driven: The key to AI-powered personalized pathfinding is to learn from players' behavior patterns and goals by collecting and analyzing their data. In massively multiplayer online games, this can be achieved by tracking players' movement trajectories and game progress data to learn and model, thereby providing players with paths that better meet their needs.

[0062] 2. Real-time: AI-powered personalized pathfinding enables real-time path planning and optimization, dynamically adjusting paths based on the current game state and player needs. For example, in PVP games, AI can generate paths for avoiding or pursuing enemies based on the player's current enemy positions and important targets.

[0063] 3. Flexibility and adaptability: AI-powered personalized pathfinding can adapt and adjust based on the player's dynamic needs and environmental changes. When the player's goals change or the in-game map is updated, AI can quickly generate paths that adapt to the new situation, providing a better gaming experience.

[0064] 4. Increased challenge and depth: Through AI personalized pathfinding, the game can better adapt to the player's ability and level, providing more challenging path choices. AI can adjust the path based on factors such as the player's skill level and tactical tendencies, improving the playability and depth of the game.

[0065] In general, AI personalized pathfinding provides players with a more personalized and optimized automatic pathfinding experience through data-driven, real-time, flexible and adaptable features, as well as increasing the challenge and depth of the game.

[0066] Therefore, in a method for automatically generating a pathfinding path in a game of this embodiment, as shown in FIG. Figure 1 As shown, the steps include:

[0067] S1. Collect historical player game behavior data to help AI understand player behavior patterns and goals. Game behavior data includes player movement trajectory data, game process data, kill records, win rate, mission location, mission type, NPC distribution, obstacle distribution and obstacle type. This data can be collected through the game engine for subsequent learning and analysis, to build an automatic pathfinding model and determine player behavior patterns.

[0068] For example, in terms of data collection, the player's movement trajectory data can record the player's travel path in the game and his or her behavioral choices in different situations; the game process data can record the player's interaction with the enemy, task completion status, etc.

[0069] S2. Analyze and learn game behavior data through machine learning algorithms, build an automatic pathfinding model, and determine the current player's behavior pattern, specifically:

[0070] S21. Construct a behavior pattern recognition model and an automatic path-finding model through a machine learning algorithm, and train and test the behavior pattern recognition model and the automatic path-finding model based on the game behavior data.

[0071] S22. Input the game behavior data of the current player into the trained and tested behavior pattern recognition model, and output the player behavior pattern of the current player.

[0072] In games, a player's behavioral patterns can include a series of actions and strategies, such as attacking enemies, avoiding enemies, and searching for targets. By learning these behavioral patterns, AI can better understand the player's preferences and habits, thereby making decisions that better meet the player's needs during the automatic pathfinding process. For example, by analyzing movement trajectory data, AI can discover the player's preferred path type (straight line, curve, etc.), or their behavioral preferences when encountering enemies (active attack, avoidance, etc.); by analyzing game process data, AI can understand the player's preferred strategies for completing tasks and their interaction patterns with enemies.

[0073] To achieve behavioral pattern learning, AI typically uses machine learning and data mining techniques.

[0074] First, AI collects a large amount of player data, namely the game behavior data mentioned above; then, by analyzing and modeling this data, AI can reveal the patterns and laws therein, and identify player behavior patterns based on these laws.

[0075] For example, the kill records included in game behavior data help AI understand the player's combat style (such as attack tendencies, combat strategies, etc.), thereby identifying whether the player prefers to directly attack the enemy or adopt a more cautious strategy. By analyzing this data, AI can identify the player's behavioral patterns, such as whether they prefer to actively seek combat opportunities or prefer to avoid unnecessary conflicts. The win rate included in game behavior data reflects the player's overall performance and success rate in the game. By analyzing the win rate, AI can judge the player's gaming skill level and performance in specific situations, which is crucial for providing automatic pathfinding decisions that match the player's abilities and preferences. In addition, game behavior data also includes information such as mission locations, mission types, NPC distribution, enemy distribution, obstacle distribution, and obstacle types, which is also very helpful for learning player behavior patterns. For example:

[0076] This data, such as mission location and type, helps AI understand the nature and location of various missions within the game, thereby predicting players' likely destinations and behaviors. By understanding how players perform in specific mission types, AI can better adapt to players' personalized needs and plan the best path for them.

[0077] This data on NPC and enemy distribution allows the AI ​​to take into account dynamic factors in the game environment, such as the location of enemies and the activity areas of NPCs. Based on this data, the AI ​​can plan a path for the player to avoid unnecessary conflicts or guide the player to complete tasks more efficiently.

[0078] Obstacle distribution and types: This data is crucial for understanding the distribution and types of obstacles in the game environment for optimized path planning. AI can use this data to avoid impassable areas while considering how to use environmental features to provide tactical advantages to players.

[0079] By collecting and analyzing data, AI can model players' behavior patterns and the goals generated by automatic pathfinding. These models can more accurately judge players' intentions and needs, thereby serving as the basis for AI path planning and optimization, and providing more personalized automatic pathfinding services.

[0080] For example, for players who like adventure and exploration, AI will be more inclined to generate paths with better expandability so that players can discover more game content; for players who like to kill enemies quickly, AI will be more inclined to generate close-range, high-efficiency paths so that players can quickly approach and defeat enemies.

[0081] At the same time, these models can also be used in subsequent steps to identify important targets for players, such as enemy locations or key tasks.

[0082] In addition, in this embodiment, the machine learning algorithm can be implemented using a clustering algorithm or a decision tree. Taking the K-value clustering algorithm as an example, the K-value clustering algorithm is a widely used unsupervised learning method for grouping data points into K clusters, each cluster being represented by the mean of the data points within it (i.e., the cluster center):

[0083] (1) Data preparation

[0084] ① Collect data: For example, collect data from a multiplayer online role-playing game (MMORPG), including the player's location coordinates, the types of tasks participated in, the interaction records with NPCs, the types of enemies defeated, the obstacles encountered, the player's movement path, the number of kills, and the game win rate.

[0085] ② Preprocess data: Clean the collected data and remove any incomplete or erroneous records. Then, standardize all numerical features (such as kill counts and win rates) to ensure that the values ​​are between 0 and 1 for easy comparison. Finally, based on the needs of game player behavior analysis, select key data that reflects player behavior characteristics, such as the player's activity area, the type and speed of completing tasks, and the number of battles with the enemy as clustering features.

[0086] (2) Select the value of K

[0087] Use the elbow method to determine the K value, plot the SSE (sum of squared errors within clusters) corresponding to different K values, and find the "elbow point" where the SSE decreases slowly. Assume that when K = 5, the decrease in SSE slows down significantly, which indicates that K = 5 is an appropriate number of clusters.

[0088] (3) Initialize cluster centers

[0089] Randomly select K data points as the initial cluster centers.

[0090] (4) Assign data points to the nearest cluster center

[0091] For each player data point, calculate its Euclidean distance to all cluster centers and assign it to the nearest cluster. For example, if a player mainly performs tasks and battles in the forest area, and a cluster center represents the group of players active in the forest area, then this player will be assigned to this cluster.

[0092] (5) Update cluster center

[0093] Based on the player data points assigned to each cluster, calculate the new center of each cluster, that is, the average value of features such as the average position, average completed task type, and average number of battles of all players in each cluster.

[0094] (6) Repeated iteration

[0095] Continue to repeat the steps of assigning data points and updating cluster centers until the change in the cluster centers is less than a predetermined threshold, or the set maximum number of iterations has been executed, indicating that the clustering process has reached a stable state. For example, after 10 iterations, the change in all cluster centers is less than 0.01. At this time, the algorithm stops iterating and considers that the best cluster has been found.

[0096] (7) Evaluate clustering results

[0097] The silhouette coefficient is used to evaluate the final clustering results. If the silhouette coefficient is high, it indicates that the player behaviors within the cluster are highly similar, while the player behaviors between different clusters are significantly different, that is, the clustering results are meaningful.

[0098] (8) Application Model

[0099] Apply clustering models to newly collected game player data to identify their behavioral patterns.

[0100] S3. Determine the final goal based on the current player's current goal and current game status.

[0101] S4. Based on the current player's game behavior data, player behavior pattern and final goal, the automatic pathfinding model automatically generates a pathfinding route.

[0102] That is, in this embodiment, by obtaining the game behavior data of historical players in the game and analyzing and learning based on the machine learning algorithm, an automatic pathfinding model is constructed, and the player behavior pattern and final goal of the current player are determined. Finally, the current player's game behavior data, player behavior pattern and final goal are used as input to automatically calculate and generate a pathfinding route through the automatic pathfinding model, effectively realizing personalized pathfinding path planning for players.

[0103] The second embodiment of the present invention is:

[0104] A method for automatically generating a pathfinding path in a game, based on the above embodiment 1, in this embodiment, step S3 is specifically as follows:

[0105] S31. AI determines the final goal based on the current game task or action intention of the current player. The final goal includes the enemy location and the task destination.

[0106] For example, in a combat game, the player's goal might be to destroy enemies or complete a mission.

[0107] At the same time, in this embodiment, the AI ​​will also identify targets that are important to the player by analyzing the current game status and player behavior patterns. For example, in a team-based game, the AI ​​may identify the location of the enemy or the location of a key mission as an important target for the player.

[0108] Since there may be multiple enemy locations and mission destinations determined in the final goal, different priorities are set for different enemy locations and mission destinations according to the player's needs to ensure optimal path planning, namely:

[0109] S32. AI sets different priorities for different enemy locations and mission destinations based on the current game state of the current player.

[0110] For example, if the player is currently working on an important mission, the AI ​​will prioritize the mission's objectives to ensure they can be completed quickly and efficiently. When the player is assigned multiple missions simultaneously, the AI ​​prioritizes the missions based on the following factors:

[0111] (1) Task relevance: AI will evaluate the relevance between tasks and prioritize tasks that have a greater impact on the current game process. For example, if completing a task can unlock key resources or map areas, then this task may be considered more important.

[0112] (2) Player goals and intentions: AI analyzes the player's behavior patterns and historical choices to understand the player's long-term goals and short-term intentions. If the player's behavior shows a preference for a certain task area, the AI ​​may set tasks in that area as a higher priority.

[0113] (3) Game state: The AI ​​considers the current game state, including factors such as the player’s resources, abilities, and location, to determine which mission is most suitable for the current situation. For example, if the player is close to the location of a mission and has the resources and abilities required to complete the mission, the AI ​​may recommend this mission.

[0114] (4) Task difficulty and reward: AI evaluates the difficulty and potential reward of tasks, and prioritizes tasks with high rewards that match the player's ability. This evaluation is designed to ensure that players can find the best balance between input and return.

[0115] (5) Time sensitivity: For time-sensitive tasks, such as time-limited tasks or parts of a task chain, AI may give these tasks a higher priority to ensure that players can complete them on time.

[0116] (6) Player feedback and choices: AI will also consider the player’s direct choices and feedback on tasks. If the player actively explores or repeatedly tries a task, the AI ​​may think that this task is more important to the player.

[0117] By integrating these factors, AI can dynamically adjust goal priorities to provide players with a personalized gaming experience. This approach takes into account not only the objective conditions within the game, but also the player's subjective preferences and behaviors, thereby indicating the most valuable or most suitable tasks for the player in a multi-tasking environment.

[0118] Due to changes in the game context and player behavior, the goal may change. Therefore, AI needs to monitor the game status and player behavior in real time and dynamically adjust the goal based on the changes, namely:

[0119] S33. Real-time monitoring of the game situation and the current game task or action intention of the current player to see if there are any changes. If so, the final goal is re-determined and the priority is set according to the changes.

[0120] For example, if the enemy's position changes or the player's behavior changes, the AI ​​will re-identify and set targets based on the new situation.

[0121] That is, when the game environment and the player's personal tasks and action intentions change, the corresponding final goal will also change. Therefore, it is necessary to redefine and re-prioritize multiple enemy positions and task destinations in the re-determined final goal in order to subsequently generate a path that is more in line with the player's preferences.

[0122] The third embodiment of the present invention is:

[0123] A method for automatically generating a pathfinding path in a game, based on the above-mentioned embodiment 1 or embodiment 2, in this embodiment, step S4 is specifically as follows:

[0124] S41. Determine the starting point and end point of the generated path based on the map where the current player is located, the difficulty of each level, the current position and final goal of the current player in the game behavior data.

[0125] Based on this information, the AI ​​will consider factors such as avoiding obstacles, finding the shortest path, and choosing to bypass enemies, and generate a path through an optimization algorithm, namely:

[0126] S42. Determine the path optimization method for the current player, including but not limited to the optimization method of avoiding enemies, the optimization method of chasing enemies, the optimization method of considering the game environment, and the optimization method of adapting to player behavior.

[0127] Among them, the enemy avoidance optimization method is to calculate the enemy minimization path based on the automatic pathfinding model according to the current player's final goal and current game status, that is, to avoid contact with the enemy as much as possible so that the player can reach the destination more safely. For example, a path to avoid the enemy is generated by bypassing the enemy's patrol route or avoiding the enemy's field of view.

[0128] The optimization method for chasing enemies is to calculate the maximum enemy path based on the automatic pathfinding model according to the current player's final goal and the current game status. If the player's goal is to destroy or capture the enemy, the AI ​​will take this goal into consideration and generate an optimal path to chase the enemy and gain a better fighting opportunity.

[0129] The specific method of optimizing the game environment is to calculate the optimal path for the environment based on the automatic path-finding model according to the position changes of props and the movement paths of obstacles in the game, so as to ensure that the generated path remains valid when the environment changes.

[0130] The optimization method that fits player behavior is specifically based on the current player's game behavior pattern, and the optimal preferred path is calculated through the automatic path-finding model. By learning the player's behavior pattern before, AI can know that some players prefer to jump and cross obstacles, while other players prefer to bypass obstacles. Based on these personalized needs, AI can adjust the path generation algorithm to generate a path that is more in line with the player's preferences.

[0131] That is, in this embodiment, based on the collected data, the determined player behavior patterns and the final goals, the path-finding route is generated based on the trained automatic path-finding model, and combined with the corresponding path optimization method, a path that is more in line with the player's preferences is generated for the player.

[0132] The fourth embodiment of the present invention is:

[0133] A method for automatically generating a pathfinding path in a game, based on any one of the above embodiments 1 to 3, in this embodiment, after step S4, further includes:

[0134] S5. Real-time adjustment and adaptive pathfinding, specifically:

[0135] S51. Monitor the changes in the final goal of the current player in real time.

[0136] That is, the AI ​​will constantly monitor changes in the player's objectives. If the enemy's position changes or the player's mission objectives change, the AI ​​will quickly detect these changes and take timely action.

[0137] S52. When the final destination changes, the path finding route is regenerated through the automatic path finding model.

[0138] That is, once the goal changes, the AI ​​will re-plan the path according to the new goal. It will take into account the player's new needs, such as avoiding enemies, chasing enemies, etc., to generate a more adaptable path.

[0139] At the same time, step S5 also includes:

[0140] Monitor the location of dynamic obstacles and map information on the pathfinding route in real time to eliminate paths that collide with dynamic obstacles.

[0141] That is, the AI ​​will avoid collisions with dynamic obstacles (such as enemies) based on real-time monitoring of enemy positions, map information, etc. If the enemy's position changes, the AI ​​will re-plan the path accordingly to avoid the enemy.

[0142] At the same time, the AI ​​will adjust the priority of the generated paths in real time according to the current game status and player needs. If a certain goal becomes more important, the AI ​​will give priority to it and adjust the path accordingly. It can flexibly respond to different game scenarios and player behaviors to provide a better pathfinding experience.

[0143] In addition, in this embodiment, after step S5, the following steps are further included:

[0144] S6. Display the pathfinding route on the current player's game interface through a visual display path, and trigger the game character to move along the pathfinding route in the game map according to the player's touch operation on the game interface.

[0145] A common way to display paths is through visual display. The game can display the player's current position and the generated path lines on the interface, allowing players to clearly see the direction and length of the path. In this way, players can judge the feasibility of the path and whether adjustments are needed based on their own needs.

[0146] In addition to visually displaying paths, games can also provide a variety of interactive methods to meet the personalized needs of players. For example, the game can provide an interactive interface for path selection, allowing players to adjust the path according to their preferences and needs; players can manually select certain nodes on the path, or create custom paths by dragging and clicking, so that players can formulate their own action plans based on their own strategies and preferences.

[0147] In addition, the game can also provide path-related information and prompts to help players better understand the path and make decisions. For example, the game can mark the location of enemies on the path, so that players know clearly when to avoid or attack the enemy; the game can also display prompts about tasks or key locations at path nodes, so that players know when to stop to complete tasks or trigger certain events.

[0148] The generated path will be visualized and displayed to the player and executed accordingly based on the player's operations to achieve interaction with the player and meet the player's personalized needs. At the same time, the AI ​​in the game will automatically realize and execute the pathfinding function based on the generated path and the player's interaction results. The AI ​​will control the movement of the game character based on the results of path planning. The character will move in sequence according to the nodes on the path and perform other actions as needed, such as attacking enemies or triggering tasks.

[0149] Please refer to Figure 2 , the fifth embodiment of the present invention is:

[0150] A game path finding automatic generation terminal 1, such as Figure 2 As shown, it includes a memory 2, a processor 3, and a computer program stored in the memory 2 and capable of running on the processor 3. When the processor 3 executes the computer program, the steps of the method for automatically generating a path-finding path in a game in any one of the above-mentioned embodiments 1 to 4 are completed.

[0151] In summary, the present invention provides a method and terminal for automatically generating pathfinding paths in a game. By acquiring the game behavior data of historical players in the game and analyzing and learning based on a machine learning algorithm, an automatic pathfinding model is constructed, and the player behavior pattern and final goal of the current player are determined. Finally, the game behavior data, player behavior pattern and final goal of the current player are used as input to automatically calculate and generate a pathfinding route through the automatic pathfinding model, thereby effectively realizing personalized pathfinding planning for players.

[0152] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's description and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for automatically generating a pathfinding path in a game, characterized in that: Including steps: S1. Collect historical players’ gaming behavior data; S2. Analyze and learn the game behavior data using a machine learning algorithm, build an automatic pathfinding model, and determine the player behavior pattern of the current player; S3. Determine a final goal based on the current player's current goal and current game status; S4. Automatically generate a pathfinding route through the automatic pathfinding model based on the current player's game behavior data, the player behavior pattern, and the final goal.

2. The method for automatically generating a pathfinding path in a game according to claim 1, wherein: The game behavior data includes the player's movement trajectory data, game process data, kill records, win rate, mission location, mission type, NPC distribution, obstacle distribution and obstacle type.

3. The method for automatically generating a pathfinding path in a game according to claim 1, wherein: The step S2 is specifically as follows: S21. Constructing a behavior pattern recognition model and an automatic path-finding model using a machine learning algorithm, and training and testing the behavior pattern recognition model and the automatic path-finding model based on the game behavior data; S22: Input the game behavior data of the current player into the trained and tested behavior pattern recognition model, and output the player behavior pattern of the current player.

4. The method for automatically generating a pathfinding path in a game according to claim 1, wherein: The step S3 is specifically as follows: S31. Determine a final target based on the current game task or action intention of the current player, wherein the final target includes the enemy position and the task destination; S32. Setting different priorities for different enemy positions and mission destinations according to the current game state of the current player; S33, monitoring the game situation and the current game task or action intention of the current player in real time to see if there are any changes. If so, re-determine the final goal and set the priority according to the changes.

5. The method for automatically generating a pathfinding path in a game according to claim 1, wherein: The step S4 is specifically as follows: S41, determining a starting point and an end point of a generated path based on the map the current player is in, the difficulty of each level, the current position of the current player, and the final goal in the game behavior data; S42: Determine a path optimization method for the current player, including an optimization method for avoiding enemies, an optimization method for pursuing enemies, an optimization method for considering the game environment, and an optimization method for adapting to player behavior; The enemy avoidance optimization method is specifically to calculate the enemy minimization path based on the automatic pathfinding model according to the final goal of the current player and the current game state; The optimization method for chasing enemies is specifically to calculate the enemy's maximized path based on the automatic path-finding model according to the final goal of the current player and the current game state; The game environment optimization method specifically comprises calculating the optimal path of the environment based on the automatic path-finding model according to the position changes of props and the movement paths of obstacles in the game; The player behavior optimization method is specifically to calculate the preferred best path through the automatic path-finding model based on the game behavior pattern of the current player.

6. The method for automatically generating a pathfinding path in a game according to claim 1, wherein: After step S4, the following steps are further included: S5. Adjust and adapt the pathfinding route in real time.

7. The method for automatically generating a pathfinding path in a game according to claim 6, wherein: The step S5 is specifically as follows: S51, monitoring the changes in the final goal of the current player in real time; S52: When the final destination changes, the routing route is regenerated using the automatic routing model.

8. The method for automatically generating a pathfinding path in a game according to claim 6, wherein: The step S5 further includes: The positions of dynamic obstacles and map information on the path-finding route are monitored in real time to eliminate paths that collide with the dynamic obstacles.

9. The method for automatically generating a pathfinding path in a game according to claim 1, wherein: After step S4, the following steps are also included: S6. Display the pathfinding route on the game interface of the current player through a visual display path, and trigger the game character to move along the pathfinding route in the game map according to the player's touch operation on the game interface.

10. A terminal for automatically generating pathfinding paths in a game, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps in the method for automatically generating a pathfinding path in a game as described in any one of claims 1 to 9 are implemented.