Target tracking method, device, terminal equipment and storage medium
By drawing semantic paths and path routing matrices in advance in the virtual reality scene, the virtual character reduces real-time path planning in target tracking, solves the problem of low target tracking efficiency of virtual characters in dynamic environments, and achieves more efficient target tracking.
Patent Information
- Application Number
- CN202080001443.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-31
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2040-07-31
AI Technical Summary
When virtual characters in existing virtual reality scenes perform target tracking in a dynamically changing environment, the task is complex and inefficient, resulting in a large amount of calculation and difficulty in completing target tracking efficiently.
The semantic path and path routing matrix are drawn in advance in the virtual reality scene. The virtual character determines the next path node through the pre-stored path matrix based on its own position and target position, reducing real-time path planning and action decisions, and improving target tracking efficiency.
It reduces the complexity and computational load of the virtual character in target tracking, improves the virtual character's tracking efficiency of the target, and ensures that the virtual character can approach the target efficiently.
Smart Images

Figure CN112088349B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of virtual reality technology, and in particular, relates to a target tracking method, device, terminal equipment and storage medium. Background Art
[0002] Existing virtual reality scenes usually consist of virtual characters and virtual environments. Virtual characters refer to three-dimensional models with human images, animal images, or artificially designed virtual images (such as flying dragons) generated by virtual reality technology, which can simulate the perception and behavior of humans or animals.
[0003] Target tracking is a typical task performed by existing virtual characters in virtual reality scenes. In existing virtual reality scenes, the virtual environment may change over time, or may change due to the actions of the virtual characters in the virtual environment or other dynamic factors. That is, the virtual environment in the virtual reality scene is an uncertain and dynamically changing environment. When the virtual character tracks the target in the virtual reality scene, it is often necessary to make complex action decisions based on the real-time dynamic changes in the virtual environment. Therefore, the process of the existing virtual character performing the target tracking task is complex and computationally intensive, resulting in low efficiency of target tracking. Summary of the invention
[0004] In view of this, embodiments of the present application provide a target tracking method, apparatus, terminal device, and storage medium to solve the problem in the prior art of how to improve the efficiency of virtual characters tracking targets in virtual reality scenes.
[0005] The first aspect of the present application provides a target tracking method, which is applied to a virtual character and includes:
[0006] According to the starting position of the virtual character, a path node closest to the virtual character is determined as a destination node, wherein the path node is a node on a semantic path preset in a virtual reality scene; the semantic path is a track composed of nodes and directed connections between the nodes drawn on a geometric figure of a virtual environment, and the information of the path node includes at least node position information and node environment information;
[0007] Moving toward the destination node until reaching the destination node;
[0008] Determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix; the path routing matrix is a matrix storing the optimal next path node from the first path node to the second path node, the first path node and the second path node are any two path nodes, the optimal next path node is the path node closest to the first path node in the optimal path from the first path node to the second path node, and the optimal path is the path with the highest travel efficiency;
[0009] Move to the next path node to get closer to the tracked target.
[0010] A second aspect of the present application provides a target tracking device, comprising:
[0011] a destination node determination unit, configured to determine, according to the starting position of the virtual character, a path node closest to the virtual character as a destination node, wherein the path node is a node on a semantic path preset in the virtual reality scene; the semantic path is a track composed of nodes and directed connections between the nodes drawn on a geometric figure of the virtual environment, and the information of the path node includes at least node position information and node environment information;
[0012] A rushing unit, used for moving toward the rushing node until reaching the rushing node;
[0013] A path routing unit, used to determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and a pre-stored path routing matrix; the path routing matrix is a matrix storing the optimal next path node from the first path node to the second path node, the first path node and the second path node are any two path nodes, the optimal next path node is the path node closest to the first path node in the optimal path from the first path node to the second path node, and the optimal path is the path with the highest traffic efficiency;
[0014] The moving unit is used to move to the next path node to get closer to the tracked target.
[0015] The third aspect of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the target tracking method when executing the computer program.
[0016] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the target tracking method are implemented.
[0017] A fifth aspect of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the steps of the above-mentioned target tracking method.
[0018] In the embodiment of the present application, since a semantic path that can record position information and environmental information (i.e., includes node position information and node environmental semantic information) is drawn in advance on the virtual environment of the virtual reality scene, and a path routing matrix in the virtual reality scene is stored, when the virtual character is tracking the target, it only needs to go to the node according to its own position to enter the semantic path, and then directly and quickly determine the current next path node according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix, so that the virtual character can immediately make an action decision for target tracking according to the pre-constructed semantic path and path routing matrix during the target tracking process, without the need to perform path planning and complex action decisions in real time according to the real-time change information of the virtual environment. Therefore, the complexity of the virtual character's target tracking can be reduced, the amount of calculation can be reduced, and the target tracking efficiency of the virtual character can be improved. Furthermore, since the optimal next path node stored in the path routing matrix is a path node on the optimal path when traveling from any first path node to any second path node in the virtual reality environment, the optimal path is the path with the highest traffic efficiency. Therefore, by determining the next path node according to the path routing matrix and moving, the virtual character can efficiently approach the tracked target, thereby further improving the target tracking efficiency of the virtual character. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 A schematic diagram of a virtual reality scene provided for this application;
[0021] Figure 2 A schematic diagram of the implementation process of a target tracking method provided in this application;
[0022] Figure 3 Schematic diagrams of three semantic paths with different structures provided in this application;
[0023] Figure 4 A schematic diagram of the composition of a target tracking device provided in this application;
[0024] Figure 5 A schematic diagram of the structure of a terminal device provided for this application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0026] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below for illustration.
[0027] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0028] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0029] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0030] In addition, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0031] Existing virtual reality scenes usually consist of virtual characters and virtual environments. Virtual characters move in the virtual environment and complete preset tasks. Among them, target tracking is a typical task, that is, the task of a virtual character chasing a specified target, which can be a specified object or other specified virtual characters in the virtual environment. Since the virtual environment in the virtual reality scene is an uncertain and dynamically changing environment, when the virtual character performs target tracking, it is often necessary to make complex action decisions based on the real-time dynamic changes of the virtual environment, resulting in a complex process for the existing virtual character to perform target tracking tasks, a large amount of calculation, and low efficiency of target tracking. In order to solve this problem, the embodiments of the present application provide a target tracking method, apparatus, terminal device and storage medium. Since a semantic path that can record position information and environmental information (i.e., including node position information and node environmental semantic information) is drawn in advance on the virtual environment of the virtual reality scene, and a path routing matrix in the virtual reality scene is stored, when the virtual character is tracking the target, it only needs to go to the node according to its own position to enter the semantic path, and then according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix, the current next path node can be directly and quickly determined, that is, the virtual character can immediately make an action decision for target tracking according to the pre-constructed semantic path and path routing matrix during the target tracking process, without the need to perform path planning and complex action decisions in real time according to the real-time change information of the virtual environment. Therefore, the complexity of the virtual character's target tracking can be reduced, the amount of calculation can be reduced, and the target tracking efficiency of the virtual character can be improved. Furthermore, since the optimal next path node stored in the path routing matrix is a path node on the optimal path when traveling from any first path node to any second path node in the virtual reality environment, the optimal path is the path with the highest traffic efficiency. Therefore, by determining the next path node according to the path routing matrix and moving, the virtual character can efficiently approach the tracked target, thereby further improving the target tracking efficiency of the virtual character.
[0032] Embodiment 1:
[0033] like Figure 1 As shown, the application scenario of the embodiment of the present application is specifically a virtual reality scene, which is composed of a virtual character, a virtual environment and a semantic path. There can be multiple semantic paths in a virtual reality scene, wherein the semantic path is the medium for the interaction between the virtual character and the virtual environment.
[0034] Specifically, the semantic path is a track composed of directed connections between nodes drawn on the geometric figure of the virtual environment, wherein the node information includes at least the node position information and node environment information of the node. Specifically, the directed connection constitutes the information of the direction and distance that each node can depart and enter; the node position information records the coordinate information of the node in the virtual environment; the node environment information records the state information of the virtual environment where the node is located in real time, which can be represented by a corresponding state identification number, for example, environmentState=29 indicates that a door near the node is closed. Furthermore, the node information also includes node behavior semantic information, which is used to identify the corresponding behavior that needs to be completed when the virtual character moves to the node, which can be represented by a corresponding behavior identification number, for example, behaviorState=28 indicates that the behavior of opening or closing the door is required here.
[0035] Figure 2 The flowchart of a target tracking method provided by an embodiment of the present application is shown. The execution subject of the embodiment of the present application is a virtual character, which is specifically an intelligent entity with a specific image and capable of making autonomous behavioral decisions in a virtual environment. That is, the virtual character is a computing entity controlled by the computing unit of the terminal device and whose image, position and behavior are displayed on the display unit. Figure 2 The target tracking method shown is detailed as follows:
[0036] In S201, according to the starting position of the virtual character, a path node closest to the virtual character is determined as a destination node, wherein the path node is a node on a semantic path preset in the virtual reality scene.
[0037] In the embodiment of the present application, the semantic path is a pre-constructed track consisting of path nodes and directed connections between path nodes. The semantic path is a preset path for the virtual character to move in the virtual environment; and the path node includes node environment information in addition to basic node position information. With the help of the preset semantic path, the virtual character can efficiently and accurately make motion decisions in the virtual environment to move toward the location of the tracked target. Therefore, after receiving the target tracking task, the virtual character needs to move to the path node of the nearest semantic path so that the semantic path can be used to make efficient motion decisions later.
[0038] In an embodiment of the present application, the virtual character can determine its own position information in the virtual reality scene in real time through the position perception module. When the virtual character obtains the target tracking task through the task acquisition module, it obtains its own position through the position perception module, and this position is the starting position of the virtual character. Afterwards, the virtual character determines the path node on the semantic path closest to the starting position as the destination node that the virtual character needs to reach based on the information of the pre-stored semantic path or the information of the semantic path on the virtual environment obtained by its own visual module. The destination node is the position where the virtual character quickly enters the semantic path.
[0039] Specifically, the semantic path of the embodiment of the present application includes a point structure path, a linear structure path and a ring structure path. Figure 3 The figure shows a schematic diagram of a virtual reality scene provided by the implementation of the present application, and the virtual reality scene includes a point structure path 31, a linear structure path 32, and a ring structure path 33. Specifically, the point structure path is a semantic path consisting of only one node. The point structure path is a path node that can be freely entered and exited in path planning. The path node is often used as a relay point, for example, as a path switching point when a virtual character crosses two other different semantic paths. Specifically, the linear structure path is a path including two endpoints, an entry and an exit, and a directed line segment connecting the two endpoints; the linear structure path is often used to indicate a passable path from one destination (such as building A) to another destination (such as building B), or to indicate a path through a passable building. A ring structure path is generally a path composed of multiple nodes and directed connections between nodes, surrounding a convex-type object. The convex-type object is generally an impassable obstacle such as a mountain or a sand pile. Specifically, each node on the ring structure path is a path node that can be freely entered and exited. The virtual character can bypass the obstruction of the convex-type object through the ring structure path to reach the destination.
[0040] In the embodiment of the present application, three different structures of paths, namely, point structure path, linear structure path and ring structure path, are used as semantic paths in the virtual reality scene. Since these three structures of paths can be respectively applicable to the description of relay points, passable paths, and detour paths around obstacles, these three structures of paths can more comprehensively cover paths applicable to different virtual environments, so that the semantic paths in the virtual reality scene can provide comprehensive and effective reference information for path planning for virtual characters.
[0041] In S202, the process moves toward the destination node until the destination node is reached.
[0042] After determining the destination node, the virtual character moves toward the destination node until it reaches the destination node, that is, enters the semantic path closest to the starting position.
[0043] In S203, the next path node to be reached by the current virtual character is determined based on the path node where the virtual character is currently located, the path node closest to the tracked target and the pre-stored path routing matrix; the path routing matrix is a matrix that stores the optimal next path node from the first path node to the second path node, the first path node and the second path node are any two path nodes, the optimal next path node is the path node closest to the first path node in the optimal path from the first path node to the second path node, and the optimal path is the path with the highest travel efficiency.
[0044] After the virtual character reaches the destination node, the motion decision can be directly and efficiently determined with the help of the information of the semantic path to get closer to the tracked target. Specifically, the motion decision includes determining the next path node to be reached by the current virtual character. In the embodiment of the present application, the current next path node is directly and efficiently determined based on the path routing matrix.
[0045] Specifically, the path routing matrix is a matrix storing the optimal next path node between any two path nodes; the optimal next path node is a path node closest to the first path node on the optimal path from the first path node to the second path node. The first path node and the second path node are any two path nodes on the semantic path of the virtual reality scene; the optimal path is the path with the highest traffic efficiency, which can be the shortest path and / or a path with fewer behaviors that the virtual character needs to perform (the behaviors can include door opening behaviors, window opening behaviors, etc.). That is, the path routing matrix in the embodiment of the present application is a matrix obtained by only saving a path node (i.e., the optimal next path node) on the optimal path that is closest to the starting point (i.e., the first path node) of the optimal path after determining the optimal path between any two path nodes; considering the immediacy of the action decision of the virtual character in the target tracking process (i.e., the virtual character only needs to determine the next action), the path routing matrix that only saves one path node can meet the current action decision needs of the virtual character; and, since each element of the path routing matrix only needs to save one path node (i.e., the optimal next path node), storage space can be saved; in summary, the path routing matrix can save storage space while meeting the instant and rapid decision-making of the virtual character.
[0046] Specifically, in the embodiment of the present application, when the virtual character reaches each path node, the position information of the virtual character at this time will be updated. For example, after the virtual character arrives at the destination node, the position information of the current virtual character is updated, and the path node where the virtual character is currently located is determined to be the destination node. At the same time, after the virtual character reaches each path node, it obtains the path node closest to the tracked target. Specifically, since the tracked target is usually a freely moving intelligent entity like the virtual character, its specific position is usually not on the semantic path. Therefore, after the virtual character obtains the position of the tracked target, it is necessary to combine the pre-stored semantic path information to determine the current path node closest to the tracked target. Among them, the position information of the tracked target can be determined by the perception unit of the virtual environment and then passed to the execution subject of the embodiment of the present application-the virtual character, or directly determined by the visual module of the virtual character. After the virtual character determines the path node where the current virtual character is located and the path node that is currently closest to the tracked target, the path node where the current virtual character is located is taken as the first path node, and the path node that is currently closest to the tracked target is taken as the second path node, and the above-mentioned pre-stored path routing matrix is queried to directly obtain the corresponding optimal next path node as the next path node to be reached by the current virtual character.
[0047] In the S204, the method moves to the next path node to approach the tracked target.
[0048] After determining the next path node, the virtual character directly moves from the path node where the current virtual character is located to the next path node according to the information of the semantic path in the virtual reality scene, thereby efficiently approaching the tracked target.
[0049] In the embodiment of the present application, since a semantic path that can record position information and environmental information (i.e., includes node position information and node environmental semantic information) is drawn in advance on the virtual environment of the virtual reality scene, and a path routing matrix in the virtual reality scene is stored, when the virtual character is tracking the target, it only needs to go to the node according to its own position to enter the semantic path, and then directly and quickly determine the current next path node according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix, so that the virtual character can immediately make an action decision for target tracking according to the pre-constructed semantic path and path routing matrix during the target tracking process, without the need to perform path planning and complex action decisions in real time according to the real-time change information of the virtual environment. Therefore, the complexity of the virtual character's target tracking can be reduced, the amount of calculation can be reduced, and the target tracking efficiency of the virtual character can be improved. Furthermore, since the optimal next path node stored in the path routing matrix is a path node on the optimal path when traveling from any first path node to any second path node in the virtual reality environment, the optimal path is the path with the highest traffic efficiency. Therefore, by determining the next path node according to the path routing matrix and moving, the virtual character can efficiently approach the tracked target, thereby further improving the target tracking efficiency of the virtual character.
[0050] Optionally, after step S204, the method further includes:
[0051] S205: updating the path node where the virtual character is currently located and the path node that is currently closest to the tracked target;
[0052] S206: If the path node where the virtual character is currently located is the same path node as the path node currently closest to the tracked target, move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking; otherwise, return to execute step S203.
[0053] In S205, when the virtual character moves to the next path node, the position information of the current virtual character is updated, the path node where the current virtual character is located is re-determined, and the path node closest to the tracked target is re-determined. Specifically, the path node where the current virtual character is located is the next path node described in the previous step. Specifically, at this time, the virtual character re-acquires the position information of the tracked target, and re-determines the path node closest to the tracked target based on the position information of the tracked target and the information of the semantic path.
[0054] In S206, if it is detected that the path node where the current virtual character is located after being updated in step S205 and the path node currently closest to the tracked target are the same path node, it means that the virtual character has reached a path node closest to the tracked target, and at this time, it moves from the path node where the current virtual character is located to the current position of the tracked target, thereby completing the target tracking task. On the contrary, if the path node where the current virtual character is located and the path node currently closest to the tracked target are not the same path node, it means that the virtual character needs to continue to determine the next path node to continue to approach the tracked target. At this time, return to step S203, and re-determine the next path node based on the updated path node where the current virtual character is located and the path node currently closest to the tracked target, combined with the routing path matrix, and continue to approach the tracked target through the path nodes on the semantic path.
[0055] In an embodiment of the present application, after the virtual character reaches the next path node, it re-determines the path node where the current virtual character is located and the path node that is currently closest to the tracked target, and determines the action decision of the current virtual character based on the relationship between the two path nodes, so that the virtual character can eventually reach the position of the tracked target efficiently, that is, catch up with the tracked target, thereby completing the target tracking task.
[0056] Optionally, the step S203 includes:
[0057] If it is detected that the tracked target is a dynamic target, the next path node to be reached by the current virtual character is determined according to the path node where the current virtual character is located, the path node closest to the tracked target and the pre-stored path routing matrix; otherwise, the static target tracking process is directly executed to complete the target tracking, and the static target tracking process includes:
[0058] A1: Determine a tracking path according to the path node where the virtual character is currently located, the path node closest to the tracked target, and a pre-stored optimal path matrix, wherein the optimal path matrix is a pre-constructed matrix containing the optimal path between any two path nodes in the virtual reality scene; the optimal path is the path with the highest travel efficiency;
[0059] A2: moving according to the tracking path until reaching the path node that is currently closest to the tracked target;
[0060] A3: Move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking.
[0061] In the embodiment of the present application, the tracked target can be other intelligent entities in the virtual reality scene, such as other dynamically moving virtual characters, or static objects in the virtual reality scene. When the virtual character detects that the current tracked target is a dynamic target, such as other dynamically moving virtual characters, the above step S203 is executed, otherwise the static target tracking target process is executed to complete the target tracking. The static target tracking process includes steps A1-A3, which are described in detail as follows: In A1, since the current tracked target is a non-dynamic target, that is, the current tracked target is a static target, the position information of the tracked target will not change, and the path node closest to the tracked target is also a fixed path node. Therefore, after the virtual character arrives at the running node, the path node where the current virtual character is located (i.e., the running node) is used as the starting point of the tracking path, and the path node closest to the tracked target is used as the end point of the tracking path to determine the complete tracking path, and the optimal path matrix stored in advance is quickly queried to find the optimal path between the starting point of the tracking path and the end point of the tracking path, and the optimal path is used as the current tracking path. In the embodiment of the present application, the optimal path matrix is a matrix containing the optimal path between any two path nodes in the virtual reality scene. Among them, the arbitrary two path nodes can be path nodes located on the same semantic path, or they can be path nodes located on different semantic paths. Through the pre-stored optimal path matrix, the virtual character does not need to obtain the information of the dynamic virtual environment in real time to plan the path, nor does it need to calculate the optimal path between the two path nodes in real time. It only needs to simply query the optimal path matrix to quickly determine the tracking path, which greatly reduces the calculation amount of the virtual character, thereby improving the efficiency of the virtual character in performing the target tracking task.
[0062] In A2, after the tracking path is determined, the virtual character moves forward on the tracking path according to the information of the path nodes on the tracking path and the directed connections between the path nodes until reaching the end of the tracking path, that is, the path node currently closest to the tracked target.
[0063] In A3, the path node where the virtual character is currently located is the path node closest to the tracked target. The virtual character directly moves to the location of the tracked target based on the location information of the tracked target, thereby completing the target tracking.
[0064] In the embodiment of the present application, since the tracked target is a static target, the static target tracking process can be used to determine the complete tracking path at one time according to the pre-stored optimal path, and the path node closest to the tracked target can be directly reached according to the tracking path, and then the path node is moved to the actual position of the tracked target. Therefore, only one action plan is required to efficiently reach the position of the tracked target, thereby further improving the target tracking efficiency of the virtual character.
[0065] Optionally, the moving toward the destination node in step S202 includes:
[0066] B1: determining a first destination path between the starting position and the destination node according to virtual environment information between the starting position and the destination node in the virtual reality scene;
[0067] B2: moving toward the destination node according to the first destination path until reaching the destination node;
[0068] Correspondingly, the step S206 or the step A3 of moving from the path node where the virtual character is currently located to the current location of the tracked target to complete target tracking includes:
[0069] C1: determining a second running path between the path node where the virtual character is currently located and the current position of the tracked target according to virtual environment information between the path node where the virtual character is currently located and the current position of the tracked target in the virtual reality scene;
[0070] C2: moving to the current position of the tracked target according to the second running path to complete target tracking.
[0071] In the embodiment of the present application, since it is impossible to make motion decisions based on the information on the pre-set semantic path when the virtual character moves from the starting position to the destination node (i.e., the starting point of the tracking path) and from the end point of the tracking path to the current actual location of the tracked target, the virtual character needs to determine the destination path in combination with the information of the real-time virtual environment in these two short distances to connect with the semantic path, accurately reach the actual location of the tracked target, and complete the target tracking. Details are as follows:
[0072] In B1, the virtual character can obtain the virtual environment information between the starting position and the destination node in the virtual reality environment through its own visual module, and make obstacle avoidance decisions based on the virtual environment information, and plan a first destination path from the starting position to the destination node. Optionally, the visual module of the virtual character is specifically a barrel sight module, and the virtual character establishes a barrel sight between the starting position and the destination node through the barrel sight module. Specifically, the outline of the virtual character when facing the target node is the starting cross section, and the plane passing through the destination node and parallel to the starting cross section is the terminal cross section to construct a geometric cylinder; the sight beam on the geometric cylinder that is perpendicular to the starting cross section and points to the terminal cross section is the barrel sight. Afterwards, if there is no collision between the barrel sight and the virtual environment, it means that there is no obstacle between the starting position and the destination node, and the connection between the starting position and the destination node is directly determined as the first destination path; if there is a collision between the barrel sight and the virtual environment, the position information of the obstacle is determined based on the information of the collision, and a path from the starting position to the destination node and bypassing the obstacle is determined based on the position information of the obstacle as the first destination path.
[0073] In B2, the virtual character moves according to the determined first destination path until it reaches the destination node.
[0074] In C1, similarly, when the virtual character reaches the end point of the path closest to the current position of the tracked target, it obtains the virtual environment information between the path node where the current virtual character is located and the current position of the tracked target in the virtual reality environment through its own visual module, and makes obstacle avoidance decisions based on the virtual environment information, and plans a path from the path node where the current virtual character is located to the current position of the tracked target as the second running path.
[0075] In C2, the virtual character moves according to the determined second running path and finally reaches the current location of the tracked target, thereby completing the target tracking task.
[0076] In the embodiment of the present application, since the corresponding first running path and second running path can be accurately determined according to the information of the virtual environment before the virtual character reaches the semantic path and when the virtual character leaves the semantic path to go to the actual location of the tracked target, the virtual character can accurately approach the tracked target outside the semantic path to connect with the tracking path, accurately reach the actual location of the tracked target, and complete the target tracking.
[0077] Optionally, the target tracking method further includes:
[0078] If the second destination path between the path node where the virtual character is currently located and the current position of the tracked target cannot be determined based on the virtual environment information between the path node where the virtual character is currently located in the virtual reality scene and the current position of the tracked target, then the current position of the virtual character is used as the updated starting position, and the process returns to execute the step of determining the path node closest to the virtual character as the destination node based on the starting position of the virtual character.
[0079] In an embodiment of the present application, when the virtual character cannot determine the second path according to the virtual environment information between the path node where the virtual character is currently located and the current position of the tracked target, for example, there is a huge obstacle between the path node where the virtual character is currently located and the tracked target, resulting in the absence of a passable path between the path node where the virtual character is currently located and the tracked target, or when an obstacle suddenly appears during the virtual character's movement to the current position of the tracked target according to the second path, resulting in the virtual character being unable to reach the current position of the tracked target according to the second path, the virtual character needs to re-determine other passable paths with the help of semantic paths. Specifically, at this time, the current position of the virtual character is used as the updated starting position, and step S201 is returned to be executed to re-determine the first path, the next path node, the second path, etc., until the tracked target is finally reached.
[0080] In the embodiment of the present application, when the virtual character cannot determine the second running path or cannot reach the location of the tracked target according to the second running path, the path planning can be readjusted in time, thereby ensuring effective target tracking.
[0081] Optionally, before step S201, the method further includes:
[0082] Take any path node as the first path node and any path node as the second path node in turn, and perform the following steps until each path node has been used as the first path node and each path node has been used as the second path node:
[0083] Determine an optimal path from the first path node to the second path node according to the node information of the first path node, the node information of the second path node and the semantic path; the optimal path is a path with the highest traffic efficiency;
[0084] The path node closest to the first path node on the optimal path is determined as the optimal next path node, and is stored as an element of the path routing matrix.
[0085] In an embodiment of the present application, one is obtained from each path node in the virtual reality scene as the first path node and the other is obtained as the second path node in turn, and the optimal next path node from the first path node to the second path node is determined and stored until each path node in the virtual reality scene has been used as the first path node and each path node has been used as the second path node, thereby obtaining a path routing matrix.
[0086] Specifically, suppose there are n path nodes in the virtual reality scene, then the size of the path routing matrix N is n×n, where the diagonal position of the path routing matrix (assuming Node i For any path node, the diagonal position can be expressed as N ii The optimal next path node corresponding to the same path node as both the starting point and the end point is directly filled in with the path node's own information Node i That's it. In the positions other than the diagonal positions of the optimal path matrix, it represents the optimal next path node between any two different path nodes. Among them, the process of determining the optimal next path node between any first path node and the second path node is as follows:
[0087] Specifically, let Node i is the first path node and Node j is the second path node, then according to Node i 、Node j The node information and the existing directed connection information on the semantic path where the path node is located are determined from Node i Arrival Node j All feasible paths are obtained to obtain k paths; then the efficiency of the virtual character on these k paths is measured, and the path with the highest efficiency among these k paths is L ij Determine as Node i and Node j Then, the path node closest to the first path node in the optimal path is obtained as the optimal next path node, and is stored as an element of the path routing matrix in the i-th row and j-th column of the path routing matrix (i.e., N ij ). Similarly, the n×n positions of the path routing matrix are finally stored with the corresponding optimal next path nodes to obtain the pre-stored path routing matrix. i and path node Node j If there is no traversable path between them, you can directly ij Fill in the empty identifier information, such as "null", in the position.
[0088] Specifically, the above-mentioned virtual character's travel efficiency on these k paths is measured, and the path L with the highest travel efficiency among these k paths is taken as ij Determine as Node i and Node j The optimal path between can be:
[0089] Calculate the length, travel time, and number of behaviors required to be completed on each of the k paths, determine the travel efficiency of each path, and determine the path with the highest travel efficiency as the optimal path. The shorter the path length, the shorter the travel time, and the fewer the behaviors required to be completed, the higher the corresponding travel efficiency.
[0090] In an embodiment of the present application, since the optimal path between any two path nodes can be accurately determined in advance based on the semantic path and the node information of each path node, and the optimal next path node can be further determined based on the optimal path for storage, a pre-stored path routing matrix is obtained, so that when the virtual character subsequently performs a target tracking task, path planning can be directly, accurately and efficiently performed based on the pre-stored path routing matrix, thereby improving the target tracking efficiency of the virtual character.
[0091] Optionally, the number of the semantic paths is at least two, and in the process of sequentially taking any one of the path nodes as the first path node and any one of the path nodes as the second path node, performing the following steps until each path node has been used as the first path node and each path node has been used as the second path node, the process further includes:
[0092] Determine and store two cross-path points between every two adjacent semantic paths in sequence to obtain an adjacent reachable matrix; the two cross-path points include a first cross-path point on a first semantic path and a second cross-path point on a second semantic path, the first semantic path and the second semantic path are the two adjacent semantic paths, the first cross-path point is a path node determined on the first semantic path that is closest to the second semantic path, and the second cross-path point is a path node determined on the second semantic path that is closest to the first semantic path;
[0093] Correspondingly, determining the optimal path from the first path node to the second path node according to the node information of the first path node, the node information of the second path node and the semantic path includes:
[0094] An optimal path from the first path node to the second path node is determined according to the node information of the first path node, the node information of the second path node, the semantic path, and the adjacent reachable matrix.
[0095] In an embodiment of the present application, the number of semantic paths in the virtual reality scene is at least two. When it is necessary to determine the optimal path between a path node i of semantic path s and a path node j of semantic path t, in addition to the node information of the path nodes and the information of the directed connections of the semantic paths, it is also necessary to combine the information of the path connecting the semantic path s and the semantic path t to completely determine the path from path node i to path node j.
[0096] Specifically, first, the cross-path points between any two adjacent semantic paths in the virtual reality scene are determined and stored to obtain an adjacent reachable matrix M. Suppose the first semantic path and the second semantic path are any two adjacent semantic paths, respectively, then the cross-path points include a first cross-path point located on the first semantic path and a second cross-path point located on the second semantic path. Specifically, suppose the first semantic path s and the second semantic path t are any two adjacent semantic paths, then in the first semantic path s, a path node Node_s closest to the second semantic path t is determined as the first cross-path point, and in the second semantic path t, a path node Node_t closest to the first semantic path s is determined as the second cross-path point. After that, the first cross-path point and the second cross-path point are stored at the s-th row and t-th column of the adjacent reachable matrix M (i.e., M st ). And so on, we finally get the adjacent reachable matrix M. Optionally, if there is no accessible cross-path path between the first semantic path s and the second semantic path t, we can directly add the adjacent reachable matrix M in M. st Fill in the empty identifier information, such as "null", in the position.
[0097] After obtaining the adjacent reachable matrix, the optimal path between each two path nodes can be determined and stored according to the node information of each path node, the directed connection information of the semantic path and the information of the adjacent reachable matrix, and finally the optimal path matrix can be obtained. i and Node j are any two different path nodes, if Node i and Node j If they are on the same semantic path, the Node i and Node j The optimal path between Node i and Node j If they are located on different semantic paths, for example, on semantic path s and semantic path t, first determine the node Node from the path on semantic path s. iThe optimal subpath L_s to reach the above path node Node_s, then determine the cross-path path L_st from the path node Node_s to the above path node Node_t according to the adjacent reachable matrix M, and then determine the cross-path path L_st from the path node Node_t to the path node Node on the semantic path t j Finally, connect the optimal subpath L_s, the cross-path path L_st, and the optimal subpath L_t in sequence to get Node i and Node j The optimal path between .
[0098] In an embodiment of the present application, the situation where there are multiple semantic paths in a virtual reality scene is taken into consideration. By determining the cross-path points between adjacent semantic paths, an adjacent reachable matrix is obtained, and then the optimal path of any two path nodes is determined in combination with the adjacent reachable matrix, so that the optimal path matrix finally obtained can completely record the optimal paths of any two path nodes (including two path nodes located on the same semantic path and two path nodes located on different semantic paths), thereby providing more complete and comprehensive pre-stored information for subsequent path planning of virtual characters when performing target tracking tasks, improving the path planning efficiency of virtual characters during target tracking, and further improving the target tracking efficiency of virtual characters.
[0099] Optionally, the information of the path node further includes node behavior semantic information, and the node behavior semantic information is used to identify information of a behavior to be performed on the path node. Correspondingly, the method further includes:
[0100] When the virtual character moves to the path node, a preset action is performed according to the node behavior semantic information and the node environment information.
[0101] In the embodiment of the present application, the information of the path node on the semantic path includes node behavior semantic information in addition to node location information and node environment information, and the node behavior semantic information is used to identify the information of the behavior to be performed on the path node. For example, the node behavior semantic information can be stored in the variable behaviorState, behaviorState=28 is used to identify the behavior of opening or closing the door to be performed on the path node; behaviorState=29 is used to identify the behavior of checking the window to be performed on the path node, etc.
[0102] When the virtual character moves to a path node, it is necessary to determine the current preset action and execute it according to the node behavior semantic information and node environment semantic information of the path node. For example, when the virtual character moves to path node A, the node behavior semantic information "behaviorState=28" (indicating that the door opening or closing behavior is required here) and the node environment information "environmentState=29" (indicating that a door near the node is closed) of path node A are obtained, and according to the node behavior semantic information and node environment information, it is determined that the preset action to be executed at node A is the door opening action, and the door opening action is executed.
[0103] In an embodiment of the present application, when the virtual character performs a target tracking task, in addition to determining a corresponding path to approach the tracked target, the virtual character further performs corresponding preset actions according to the path nodes passed through during the process of tracking the target, thereby further improving the intelligence of the virtual character in performing the target tracking task, ensuring that the virtual character can smoothly pass through each path node on the tracking path, efficiently approach the tracked target, and thus efficiently complete the target tracking task.
[0104] Optionally, after the step S206 or the step A3 moves from the path node where the virtual character is currently located to the current location of the tracked target, the method further includes:
[0105] Perform the target interaction action.
[0106] After the virtual character reaches the position of the tracked target, it determines and executes the target interaction action based on the pre-acquired action instruction information of the target tracking task and / or the identity information, behavior information, etc. of the tracked target, so as to completely complete the target tracking task. Exemplarily, the target tracking task of the embodiment of the present application is a suspect capture task, and the information of the suspect capture task received by the virtual character includes capture action information and pre-stored suspect image information; after the virtual character reaches the position of the tracked target, the image information of the tracked target is obtained through the visual module. If the image information of the tracked target is consistent with the pre-stored suspect image information, the capture action is executed to complete the suspect capture task. Exemplarily, the target tracking of the embodiment of the present application is an object transfer task, and the target interaction action is the action of the virtual character transferring an object to the tracked target.
[0107] In the embodiment of the present application, after the virtual character reaches the position of the tracked target, the target interaction action is performed according to the actual needs of the application scenario, thereby more completely completing the target tracking tasks of various application scenarios and improving the intelligence of the virtual character target tracking.
[0108] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0109] Embodiment 2:
[0110] The present application also provides a target tracking device, such as Figure 4 For the sake of convenience, only the parts related to the embodiment of the present application are shown:
[0111] The target tracking device may be a virtual character (a computing entity controlled by a computing unit of a terminal device and displaying its image, position and behavior on a display unit) or a device composed of some hardware of the virtual character. The target tracking device includes: a destination node determination unit 41, a destination unit 42, a path routing unit 43 and a moving unit 44, wherein:
[0112] The destination node determination unit 41 is used to determine the path node closest to the virtual character as the destination node according to the starting position of the virtual character, wherein the path node is a node on a semantic path preset in the virtual reality scene; the semantic path is a trajectory drawn on a geometric figure of the virtual environment and composed of nodes and directed connections between the nodes, and the information of the path node includes at least node position information and node environment information.
[0113] The rushing unit 42 is used to move toward the rushing node until reaching the rushing node.
[0114] The path routing unit 43 is used to determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix; the path routing matrix is a matrix that stores the optimal next path node from the first path node to the second path node, the first path node and the second path node are any two path nodes, the optimal next path node is the path node closest to the first path node in the optimal path from the first path node to the second path node, and the optimal path is the path with the highest traffic efficiency.
[0115] The moving unit 44 is used to move to the next path node to get closer to the tracked target.
[0116] Optionally, the target tracking device further includes:
[0117] An updating unit, used for updating the path node where the virtual character is currently located and the path node closest to the tracked target;
[0118] A decision-making unit is used to move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking if the path node where the virtual character is currently located is the same as the path node that is currently closest to the tracked target; otherwise, return to execute the step of determining the next path node to be reached by the virtual character based on the path node where the virtual character is currently located, the path node that is currently closest to the tracked target and the pre-stored path routing matrix.
[0119] Optionally, the path routing unit is specifically used to: if it is detected that the tracked target is a dynamic target, determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix; otherwise, directly execute the static target tracking process to complete the target tracking, and the static target tracking process includes:
[0120] Determine a tracking path according to the path node where the virtual character is currently located, the path node closest to the tracked target, and a pre-stored optimal path matrix, wherein the optimal path matrix is a matrix constructed in advance that includes the optimal path between any two path nodes in the virtual reality scene; the optimal path is the path with the highest travel efficiency;
[0121] Moving along the tracking path until reaching the path node that is currently closest to the tracked target;
[0122] Move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking.
[0123] Optionally, the rushing unit is specifically configured to determine, when moving toward the rushing node, a first rushing path between the starting position and the rushing node according to virtual environment information between the starting position and the rushing node in the virtual reality scene; and move toward the rushing node according to the first rushing path until arriving at the rushing node;
[0124] The running unit is also used to determine a second running path between the path node where the virtual character is currently located and the current position of the tracked target based on virtual environment information between the path node where the virtual character is currently located and the current position of the tracked target in the virtual reality scene when moving from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking; and move to the current position of the tracked target according to the second running path to complete target tracking.
[0125] Optionally, the target tracking device further includes:
[0126] A path routing matrix storage unit is used to sequentially use any path node as a first path node and any path node as a second path node, and perform the following steps until each path node has been used as a first path node and each path node has been used as a second path node: determining an optimal path from the first path node to the second path node according to node information of the first path node, node information of the second path node and the semantic path; the optimal path is a path with the highest traffic efficiency; determining a path node closest to the first path node on the optimal path as an optimal next path node, and storing it as an element of the path routing matrix.
[0127] Optionally, the number of the semantic paths is at least two, and the path routing matrix storage unit is used to sequentially use any one path node as the first path node and any one path node as the second path node, and perform the following steps until each path node has been used as the first path node and each path node has been used as the second path node: determining an optimal path from the first path node to the second path node based on node information of the first path node, node information of the second path node and the semantic path; the optimal path is the path with the highest traffic efficiency; determining the path node closest to the first path node on the optimal path as the optimal next path node, and storing it as an element of the path routing matrix.
[0128] Optionally, the information of the path node further includes node behavior semantic information, where the node behavior semantic information is used to identify information of a behavior to be performed on the path node. The target tracking device further includes:
[0129] A preset action execution unit is used to execute a preset action according to the node behavior semantic information and the node environment information when the virtual character moves to the path node.
[0130] The target tracking device further includes:
[0131] The target interaction action execution unit is used to execute the target interaction action.
[0132] Optionally, the semantic path includes a point structure path, a linear structure path and a ring structure path.
[0133] It should be noted that the information interaction, execution process, etc. between the above-mentioned units / modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0134] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0135] Embodiment three:
[0136] Figure 5 Schematic diagram of a terminal device provided by an embodiment of the present invention. Figure 5 As shown, the terminal device 5 of this embodiment includes: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50, such as a virtual reality scene interaction program. When the processor 50 executes the computer program 52, the steps in the above-mentioned virtual reality scene interaction method embodiments are implemented, such as Figure 2 Alternatively, when the processor 50 executes the computer program 52, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 4 The functions of the units 41 to 44 are shown.
[0137] Exemplarily, the computer program 52 may be divided into one or more modules / units, which are stored in the memory 51 and executed by the processor 50 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 52 in the terminal device 5. For example, the computer program 52 may be divided into a node determination unit, a destination unit, a path routing unit, and a mobile unit.
[0138] The terminal device 5 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will appreciate that Figure 5It is only an example of the terminal device 5 and does not constitute a limitation of the terminal device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0139] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0140] The memory 51 may be an internal storage unit of the terminal device 5, such as a hard disk or memory of the terminal device 5. The memory 51 may also be an external storage device of the terminal device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the terminal device 5. The memory 51 is used to store the computer program and other programs and data required by the terminal device. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0141] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0142] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0144] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0146] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0147] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0148] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A target tracking method, the method being applied to a virtual character, characterized in that: include: According to the starting position of the virtual character, a path node closest to the virtual character is determined as a destination node, wherein the path node is a node on a semantic path preset in a virtual reality scene; the semantic path is a track composed of nodes and directed connections between the nodes drawn on a geometric figure of a virtual environment, and the information of the path node includes at least node position information and node environment information; Moving toward the destination node until reaching the destination node; Determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the path node closest to the tracked target and the pre-stored path routing matrix; The path routing matrix is a matrix storing the optimal next path node from the first path node to the second path node, the first path node and the second path node are any two path nodes, the optimal next path node is the path node closest to the first path node in the optimal path from the first path node to the second path node, and the optimal path is the path with the highest traffic efficiency; wherein the tracked target is a freely moving intelligent body; Moving to the next path node to approach the tracked target; After the moving to the next path node, the method further includes: Update the path node where the virtual character is currently located and the path node that is currently closest to the tracked target; If the path node where the virtual character is currently located is the same path node as the path node currently closest to the tracked target, then move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking; otherwise, return to the step of determining the next path node to be reached by the virtual character based on the path node where the virtual character is currently located, the path node currently closest to the tracked target, and the pre-stored path routing matrix; The step of determining the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the path node closest to the tracked target, and the pre-stored path routing matrix includes: If it is detected that the tracked target is a dynamic target, the next path node to be reached by the current virtual character is determined according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix.
2. The target tracking method according to claim 1, characterized in that: The step of determining the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the path node closest to the tracked target, and the pre-stored path routing matrix includes: If it is detected that the tracked target is not a dynamic target, the static target tracking process is directly executed to complete the target tracking, and the static target tracking process includes: Determine a tracking path according to the path node where the virtual character is currently located, the path node closest to the tracked target, and a pre-stored optimal path matrix, wherein the optimal path matrix is a matrix constructed in advance that includes the optimal path between any two path nodes in the virtual reality scene; the optimal path is the path with the highest travel efficiency; Moving along the tracking path until reaching the path node that is currently closest to the tracked target; Move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking.
3. The target tracking method according to claim 2, characterized in that: The moving toward the destination node comprises: Determining a first destination path between the starting position and the destination node according to virtual environment information between the starting position and the destination node in the virtual reality scene; Moving toward the destination node according to the first destination path until reaching the destination node; The moving from the path node where the virtual character is currently located to the current position of the tracked target to complete the target tracking includes: Determine a second running path between the path node where the virtual character is currently located and the current position of the tracked target according to virtual environment information between the path node where the virtual character is currently located and the current position of the tracked target in the virtual reality scene; The target is tracked by moving to the current position of the target according to the second running path, thereby completing the target tracking.
4. The target tracking method according to claim 1, characterized in that: Before determining the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix, the method further includes: Take any path node as the first path node and any path node as the second path node in turn, and perform the following steps until each path node has been used as the first path node and each path node has been used as the second path node: Determine an optimal path from the first path node to the second path node according to the node information of the first path node, the node information of the second path node and the semantic path; the optimal path is a path with the highest traffic efficiency; The path node closest to the first path node on the optimal path is determined as the optimal next path node, and is stored as an element of the path routing matrix.
5. The target tracking method according to claim 4, characterized in that: The number of the semantic paths is at least two, and in the process of sequentially taking any one of the path nodes as the first path node and any one of the path nodes as the second path node, performing the following steps until each path node has been used as the first path node and each path node has been used as the second path node, the process further includes: Determine and store the cross-path points between every two adjacent semantic paths in sequence to obtain an adjacent reachable matrix; the cross-path points include a first cross-path point on a first semantic path and a second cross-path point on a second semantic path, the first semantic path and the second semantic path are the two adjacent semantic paths, the first cross-path point is a path node determined on the first semantic path that is closest to the second semantic path, and the second cross-path point is a path node determined on the second semantic path that is closest to the first semantic path; Correspondingly, determining the optimal path from the first path node to the second path node according to the node information of the first path node, the node information of the second path node and the semantic path includes: An optimal path from the first path node to the second path node is determined according to the node information of the first path node, the node information of the second path node, the semantic path, and the adjacent reachable matrix.
6. The target tracking method according to any one of claims 1 to 5, characterized in that: The information of the path node also includes node behavior semantic information, where the node behavior semantic information is used to identify information about the behavior to be performed on the path node. The method also includes: When the virtual character moves to the path node, a preset action is performed according to the node behavior semantic information and the node environment information.
7. The target tracking method according to any one of claims 1 to 3, characterized in that: After the path node where the virtual character is currently located moves to the current position of the tracked target, the method further includes: Perform the target interaction action.
8. The target tracking method according to claim 1, characterized in that: The semantic path includes a point structure path, a linear structure path and a ring structure path.
9. A target tracking device, characterized in that: include: a destination node determination unit, configured to determine, according to the starting position of the virtual character, a path node closest to the virtual character as a destination node, wherein the path node is a node on a semantic path preset in the virtual reality scene; the semantic path is a track composed of nodes and directed connections between the nodes drawn on a geometric figure of the virtual environment, and the information of the path node includes at least node position information and node environment information; A rushing unit, used for moving toward the rushing node until reaching the rushing node; A path routing unit, used to determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and a pre-stored path routing matrix; The path routing matrix is a matrix storing the optimal next path node from the first path node to the second path node, the first path node and the second path node are any two path nodes, the optimal next path node is the path node closest to the first path node in the optimal path from the first path node to the second path node, and the optimal path is the path with the highest traffic efficiency; wherein the tracked target is a freely moving intelligent body; A moving unit, used to move to the next path node to get closer to the tracked target; The target tracking device also includes: An updating unit, used for updating the path node where the virtual character is currently located and the path node closest to the tracked target; A decision-making unit, configured to move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking if the path node where the virtual character is currently located is the same as the path node currently closest to the tracked target; otherwise, return to the step of determining the next path node to be reached by the virtual character based on the path node where the virtual character is currently located, the path node currently closest to the tracked target and the pre-stored path routing matrix; The path routing unit is specifically used to: if it is detected that the tracked target is a dynamic target, determine the next path node to be reached by the current virtual character according to the path node where the current virtual character is located, the current path node closest to the tracked target and the pre-stored path routing matrix.
10. The target tracking device according to claim 9, wherein: The path routing unit is further configured to: if it is detected that the tracked target is not a dynamic target, directly execute a static target tracking process to complete the target tracking, wherein the static target tracking process includes: Determine a tracking path according to the path node where the virtual character is currently located, the path node closest to the tracked target, and a pre-stored optimal path matrix, wherein the optimal path matrix is a matrix constructed in advance that includes the optimal path between any two path nodes in the virtual reality scene; the optimal path is the path with the highest travel efficiency; Moving along the tracking path until reaching the path node that is currently closest to the tracked target; Move from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking.
11. The target tracking device according to claim 10, wherein: The rushing unit is specifically configured to determine, when moving toward the rushing node, a first rushing path between the starting position and the rushing node according to virtual environment information between the starting position and the rushing node in the virtual reality scene; and move toward the rushing node according to the first rushing path until arriving at the rushing node; The running unit is also used to determine a second running path between the path node where the virtual character is currently located and the current position of the tracked target based on virtual environment information between the path node where the virtual character is currently located and the current position of the tracked target in the virtual reality scene when moving from the path node where the virtual character is currently located to the current position of the tracked target to complete target tracking; and move to the current position of the tracked target according to the second running path to complete target tracking.
12. The target tracking device according to claim 9, wherein: The target tracking device also includes: A path routing matrix storage unit is used to sequentially use any path node as a first path node and any path node as a second path node, and perform the following steps until each path node has been used as a first path node and each path node has been used as a second path node: determining an optimal path from the first path node to the second path node according to node information of the first path node, node information of the second path node and the semantic path; the optimal path is a path with the highest traffic efficiency; determining a path node closest to the first path node on the optimal path as an optimal next path node, and storing it as an element of the path routing matrix.
13. The target tracking device according to claim 12, wherein: The number of the semantic paths is at least two, and the target tracking device further includes: An adjacent reachable matrix determination unit is used to determine the cross-path points between every two adjacent semantic paths in sequence and store them to obtain an adjacent reachable matrix; the cross-path points include a first cross-path point on a first semantic path and a second cross-path point on a second semantic path, the first semantic path and the second semantic path are the two adjacent semantic paths, the first cross-path point is a path node determined on the first semantic path that is closest to the second semantic path, and the second cross-path point is a path node determined on the second semantic path that is closest to the first semantic path; Correspondingly, determining the optimal path from the first path node to the second path node according to the node information of the first path node, the node information of the second path node and the semantic path includes: An optimal path from the first path node to the second path node is determined according to the node information of the first path node, the node information of the second path node, the semantic path, and the adjacent reachable matrix.
14. The target tracking device according to any one of claims 9 to 13, characterized in that: The information of the path node also includes node behavior semantic information, where the node behavior semantic information is used to identify information about the behavior to be performed on the path node. The target tracking device also includes: A preset action execution unit is used to execute a preset action according to the node behavior semantic information and the node environment information when the virtual character moves to the path node.
15. The target tracking device according to any one of claims 9 to 11, characterized in that: The target tracking device further includes: The target interaction action execution unit is used to execute the target interaction action.
16. The target tracking device according to claim 9, wherein: The semantic path includes a point structure path, a linear structure path and a ring structure path.
17. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the terminal device implements the steps of the method according to any one of claims 1 to 8.
18. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the terminal device implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Task execution method and device of virtual character and terminal equipment
CN111279394A
Method and device for processing way-finding path in game, electronic equipment and storage medium
CN111375205A
