Method and device for processing motion path in virtual scene, electronic equipment, computer readable storage medium and computer program product

By detecting the motion endpoints of the navigation mesh in a virtual scene, an accurate motion path is generated, solving the problem of inaccurate path generation in existing technologies and improving the accuracy and interactivity of motion paths for virtual objects in the virtual scene.

CN121623322APending Publication Date: 2026-03-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies suffer from inaccurate collision detection when generating motion paths between two non-walkable areas in a virtual scene, leading to inaccurate path generation.

Method used

By determining that the spatial region between the first and second navigation grids in the virtual scene is not traversable, the motion starting edge of the first navigation grid is used to detect the motion ending edge of the second navigation grid, generating a target motion ending edge, and generating a target motion path that crosses the spatial region based on the motion starting edge and the target motion ending edge.

Benefits of technology

It improves the accuracy of motion paths, making the generated paths conform to actual motion conditions, and enhances the interactivity and fun of virtual objects in virtual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121623322A_ABST
    Figure CN121623322A_ABST
Patent Text Reader

Abstract

The invention provides a processing method and device for a motion path in a virtual scene, electronic equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: determining a first navigation grid and a second navigation grid which are not adjacent in a virtual scene, wherein a space area between the first navigation grid and the second navigation grid cannot walk; detecting a motion end edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid to obtain a target motion end edge; generating a target motion path crossing the space area based on the motion starting edge and the target motion end edge; wherein the target motion path is used for controlling a virtual object to execute a target action along the target motion path when a motion control operation for the virtual object located in the first navigation grid is received, so that the virtual object moves from the first navigation grid to the second navigation grid. According to the invention, the accuracy of generating the motion path can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to computer technology, and more particularly to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing motion paths in a virtual scene. Background Technology

[0002] In virtual scene applications, when there are inaccessible obstacles (such as cliffs, rivers, or walls) between two areas, a motion path needs to be generated to allow virtual objects to cross these two areas. Related technologies typically rely on physical raycasting to generate motion paths. However, this method depends on the object's collider settings. If the collider settings are incorrect or the ray intersects with the object's edge, it may lead to inaccurate collision detection, thus affecting the accuracy of the generated motion path. Summary of the Invention

[0003] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing motion paths in a virtual scene, which can improve the accuracy of generating motion paths.

[0004] The technical solution of this application embodiment is implemented as follows:

[0005] This application provides a method for processing motion paths in a virtual scene, including:

[0006] Determine a first navigation grid and a second navigation grid that are not adjacent in the virtual scene, and the spatial region between the first navigation grid and the second navigation grid is not traversable;

[0007] Based on the motion start edge corresponding to the first navigation grid, the motion end edge corresponding to the second navigation grid is detected to obtain the target motion end edge;

[0008] Based on the starting edge of the motion and the ending edge of the target motion, a target motion path is generated that crosses the spatial region;

[0009] The target motion path is used to control the virtual object to perform a target action along the target motion path when receiving a motion control operation for the virtual object located in the first navigation grid, so as to move from the first navigation grid to the second navigation grid.

[0010] This application provides a motion path processing device in a virtual scene, comprising:

[0011] The determination module is used to determine a first navigation grid and a second navigation grid that are not adjacent in the virtual scene, and the spatial region between the first navigation grid and the second navigation grid is not traversable;

[0012] The detection module is used to detect the motion termination edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid, so as to obtain the target motion termination edge;

[0013] The generation module is used to generate a target motion path that crosses the spatial region based on the motion start edge and the target motion end edge;

[0014] The target motion path is used to control the virtual object to perform a target action along the target motion path when receiving a motion control operation for the virtual object located in the first navigation grid, so as to move from the first navigation grid to the second navigation grid.

[0015] In the above scheme, the detection module is further configured to generate a detection box for detecting the motion termination edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid; perform intersection detection on all motion termination edges corresponding to the second navigation grid based on the detection box to obtain at least one first potential motion termination edge intersecting with the detection box; perform parallelism detection on the motion start edge and each first potential motion termination edge to obtain the parallelism between the motion start edge and each first potential motion termination edge; and determine the target motion termination edge based on the parallelism between the motion start edge and each first potential motion termination edge.

[0016] In the above scheme, the detection module is further configured to obtain the side length of the motion start edge corresponding to the first navigation grid, as well as the minimum height difference, maximum height difference, minimum horizontal distance, and maximum horizontal distance between the first navigation grid and the second navigation grid; and generate a detection box for detecting the motion end edge corresponding to the second navigation grid based on the side length, the minimum height difference, the maximum height difference, the minimum horizontal distance, and the maximum horizontal distance.

[0017] In the above scheme, the detection module is further configured to, based on the parallelism between the starting edge of the motion and each of the first potential ending edges of the motion, filter out the second potential ending edges of the motion whose parallelism is lower than the parallelism threshold from the at least one first potential ending edges of the motion; and determine the target ending edge of the motion based on the second potential ending edges of the motion.

[0018] In the above scheme, when there are multiple second potential motion endpoints, the detection module is further configured to perform distance overlap detection on each second potential motion endpoint based on the motion starting edge to obtain a distance overlap detection result; based on the distance overlap detection result, group the multiple second potential motion endpoints to obtain at least one potential motion endpoint group, wherein there is distance overlap between different second potential motion endpoints in the same potential motion endpoint group; filter out second potential motion endpoints from the potential motion endpoint group whose height meets the height filtering condition and whose length meets the length filtering condition, and determine the filtered second potential motion endpoints as the target motion endpoints.

[0019] In the above scheme, the detection module is further configured to obtain the minimum distance and the maximum distance between the starting edge of the motion and each of the second potential ending edges of the motion; for two different second potential ending edges of the motion, when the minimum distance and the maximum distance of each satisfy the distance overlap condition, a distance overlap detection result indicating that there is a distance overlap between the two different second potential ending edges of the motion is obtained.

[0020] In the above scheme, the generation module is further configured to: trim the motion start edge based on the target motion end edge to obtain the target motion start edge; sample motion points on the target motion start edge and the target motion end edge based on a preset sampling step size to obtain at least one motion start point on the target motion start edge and a motion end point on the target motion end edge corresponding to the motion start point; and determine a target motion path that crosses the spatial region based on each pair of candidate motion paths between the motion start point and the motion end point.

[0021] In the above scheme, the generation module is further configured to generate candidate motion paths that connect the starting point and the ending point of the motion and cross the spatial region for each pair of the starting point and the ending point of the motion; perform channel detection on each candidate motion path to obtain channel detection results; and determine the target motion path that meets the channel detection conditions among each candidate motion path based on the channel detection results.

[0022] In the above scheme, the generation module is further configured to determine the starting point offset and the ending point offset when the sampled motion point has an offset; adjust the starting point and the ending point based on the starting point offset and the ending point offset to obtain the adjusted starting point and the ending point; and generate a candidate motion path that connects the adjusted starting point and the ending point and crosses the spatial region.

[0023] In the above scheme, the generation module is further configured to perform open height field detection on each of the candidate motion paths to obtain a first detection result; perform entity height field detection on each of the candidate motion paths to obtain a second detection result; and determine the channel detection result based on the first detection result and the second detection result.

[0024] In the above scheme, the channel detection result includes the highest point and lowest point of the surface corresponding to each candidate motion path; the generation module is further used to determine the corresponding candidate motion path as the target motion path that satisfies the channel detection condition when there are no obstacles in the area between the plane where the highest point and the lowest point of the surface are located.

[0025] In the above scheme, the generation module is further configured to: determine multiple motion endpoints that satisfy the channel detection conditions when there are multiple candidate motion paths that satisfy the channel detection conditions; determine the middle position of the continuously sampled motion endpoints as the target motion endpoint when the number of continuously sampled motion endpoints among the multiple motion endpoints reaches a number threshold; determine the target motion starting point on the motion starting edge that corresponds to the target motion starting point; and determine the motion path that connects the target motion starting point and the target motion endpoint and crosses the spatial region as the target motion path that satisfies the channel detection conditions.

[0026] In the above scheme, the generation module is further configured to generate candidate motion paths that connect the starting point and the ending point of the motion and cross the spatial region for each pair of the starting point and the ending point of the motion; when there is a walkable path between the starting point and the ending point of the motion, the distance between each candidate motion path and the walkable path is compared; when the distance of each candidate motion path is less than the distance of the walkable path, a target motion path that crosses the spatial region is determined based on each candidate motion path.

[0027] This application provides an electronic device, including:

[0028] Memory is used to store executable instructions or computer programs.

[0029] The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the motion path processing method in the virtual scene provided in the embodiments of this application.

[0030] This application provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the motion path processing method in the virtual scene provided in this application.

[0031] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the motion path processing method in a virtual scene provided in this application.

[0032] The embodiments of this application have the following beneficial effects:

[0033] Applying the embodiments of this application, for a first navigation grid and a second navigation grid in a virtual scene that are not adjacent and whose spatial regions are not traversable, when generating a motion path between the first navigation grid and the second navigation grid, the target motion endpoint is first detected based on the motion start edge corresponding to the first navigation grid and the motion endpoint corresponding to the second navigation grid; then, based on the motion start edge and the target motion endpoint, a target motion path that crosses the spatial region is generated; thus, since the motion endpoint is detected based on the actual motion start edge, it can reflect the actual traversable situation, so the target motion path generated based on the motion start edge and the motion endpoint conforms to the actual traversable situation, improving the accuracy of the motion path. Attached Figure Description

[0034] Figure 1 This is a schematic diagram of the architecture of the motion path processing system 100 in a virtual scene provided in this application embodiment;

[0035] Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application;

[0036] Figure 3 This is a schematic diagram of the process for handling motion paths in a virtual scene provided in an embodiment of this application;

[0037] Figure 4A This is a schematic diagram of the method for determining the target motion terminal edge provided in the embodiments of this application;

[0038] Figure 4B This is a schematic diagram of the method for determining the target motion terminal edge provided in the embodiments of this application;

[0039] Figure 5 This is a schematic diagram illustrating the generation of the detection box provided in an embodiment of this application;

[0040] Figure 6 This is a top view schematic diagram of intersection detection provided in an embodiment of this application;

[0041] Figure 7 This is a schematic diagram of distance overlap detection provided in an embodiment of this application;

[0042] Figure 8 This is a cutting diagram provided in an embodiment of this application;

[0043] Figure 9 This is a sampling diagram provided in an embodiment of this application;

[0044] Figure 10 This is an offset diagram provided in the embodiments of this application;

[0045] Figure 11 This is a schematic diagram of channel detection provided in an embodiment of this application;

[0046] Figure 12 This is a schematic diagram illustrating the determination of the target motion path provided in an embodiment of this application;

[0047] Figure 13 This is a schematic diagram illustrating the determination of the motion path provided in an embodiment of this application;

[0048] Figure 14 This is a schematic flowchart of a method for processing motion paths in a virtual scene provided in an embodiment of this application;

[0049] Figure 15 This is a visual schematic diagram of the height field provided in an embodiment of this application;

[0050] Figure 16 This is a schematic diagram of the interface for generating motion paths provided in an embodiment of this application;

[0051] Figure 17 This is a schematic diagram showing the motion path provided in an embodiment of this application;

[0052] Figure 18 This is a schematic diagram showing the motion path provided in an embodiment of this application;

[0053] Figure 19 This is a visual schematic diagram of the motion path generation process provided in the embodiments of this application;

[0054] Figure 20 This is a schematic diagram showing the motion path type provided in the embodiments of this application. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] It is understood that in the embodiments of this application, data such as user information are involved. When the embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with relevant laws, regulations and standards.

[0057] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0058] In the following description, the terms “first, second…” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first, second…” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0059] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0060] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0061] 1) Navigation Mesh: A pre-computed data structure that describes the walkable surfaces in the game world that characters or objects can walk on. In other words, the navigation mesh is composed of a series of polygons (usually triangles) that fit closely to the surfaces of the terrain and buildings in the game world, representing the areas that characters can walk on.

[0062] 2) MetaLink: This is a term in game development, typically used to describe special connections or paths in a navigation system. In games, it describes a direct connection between two non-adjacent navigation grids, usually separated by inaccessible obstacles (such as cliffs, rivers, or walls), allowing characters or game entities to perform special actions such as jumping, climbing, and hanging between these inaccessible areas.

[0063] 3) A virtual scene is a virtual scene displayed (or provided) by an application when it runs on a terminal. This virtual scene can be a simulation of the real world, a semi-simulated / semi-fictional virtual environment, or a purely fictional virtual environment. A virtual scene can be any of a two-dimensional, 2.5-dimensional, or three-dimensional virtual scene; this application does not limit the dimension of the virtual scene. For example, the virtual scene may include sky, land, ocean, etc., and the land may include environmental elements such as deserts and cities. Users can control virtual objects to move within the virtual scene.

[0064] 4) Virtual objects: These are interactive images of people and things within a virtual scene, or movable objects within the virtual scene. These movable objects can be virtual characters, virtual animals, anime characters, etc., such as people and animals displayed in a virtual scene. A virtual object can be a virtual avatar representing the user within the virtual scene. A virtual scene can include multiple virtual objects, each with its own shape and volume, occupying a portion of the space within the virtual scene. Virtual objects can also be game characters controlled by the user (or player), or non-player characters not controlled by the user (or player).

[0065] This application provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for processing motion paths in a virtual scene, which can improve the accuracy of motion path processing in a virtual scene. The following describes exemplary applications of the electronic device provided in this application. The electronic device provided in this application can be implemented as a laptop computer, tablet computer, desktop computer, set-top box, mobile device (e.g., mobile phone, portable music player, personal digital assistant, dedicated messaging device, portable gaming device), smartphone, smart speaker, smartwatch, smart TV, vehicle terminal, security terminal, and other types of user terminals, or it can be implemented as a server. The following describes exemplary applications when the device is implemented as a terminal.

[0066] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the motion path processing system 100 in the virtual scene provided in the embodiments of this application. In order to support an exemplary application, the terminal (terminal 400-1 and terminal 400-2 are shown as examples) connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0067] In some embodiments, the terminal is provided with a client or application that has the function of processing motion paths in a virtual scene, for implementing the motion path processing method in a virtual scene provided in the embodiments of this application, such as determining a first navigation grid and a second navigation grid that are not adjacent in the virtual scene, wherein the spatial region between the first navigation grid and the second navigation grid is not walkable; based on the motion start edge corresponding to the first navigation grid, detecting the motion end edge corresponding to the second navigation grid to obtain the target motion end edge; based on the motion start edge and the target motion end edge, generating a target motion path that crosses the spatial region; thus, when the terminal receives a motion control operation for a virtual object located in the first navigation grid in the virtual scene (instructing the virtual object to move from the first navigation grid to the second navigation grid), it can control the virtual object to perform a target action along the target motion path to move from the first navigation grid to the second navigation grid.

[0068] In some embodiments, the timing of implementing the motion path processing method in the virtual scene provided in this application embodiment may be when the terminal receives a motion control operation on a virtual object located in the first navigation grid in the virtual scene. If the motion control operation instructs the virtual object to move from the first navigation grid to the second navigation grid, and the spatial region between the first navigation grid and the second navigation grid is not walkable, then the terminal responds to the motion control operation by detecting the motion termination edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid to obtain the target motion termination edge; generating a target motion path across the spatial region based on the motion start edge and the target motion termination edge; and controlling the virtual object to perform a target action along the target motion path to move from the first navigation grid to the second navigation grid.

[0069] In some embodiments, the motion path processing method in the virtual scene provided in this application can also be implemented collaboratively by a terminal and a server. That is, the terminal obtains a first navigation grid and a second navigation grid that are not adjacent in the virtual scene, wherein the spatial region between the first navigation grid and the second navigation grid is not walkable; and can send the obtained first navigation grid and second navigation grid to the server 200; the server 200 detects the motion ending edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid to obtain the target motion ending edge; based on the motion start edge and the target motion ending edge, a target motion path that crosses the spatial region is generated, and the generated target motion path is returned to the terminal. In this way, when the terminal receives a motion control operation for a virtual object located in the first navigation grid in the virtual scene (instructing the virtual object to move from the first navigation grid to the second navigation grid), it can control the virtual object to perform the target action along the target motion path to move from the first navigation grid to the second navigation grid.

[0070] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.

[0071] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application, with the electronic device 500 as an example. Figure 1 Taking the server in the middle as an example, Figure 2The illustrated electronic device 500 includes at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. The various components in the electronic device 500 are coupled together via a bus system 540. It is understood that the bus system 540 is used to implement communication between these components. In addition to a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 540.

[0072] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0073] Memory 550 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 550 described in this application embodiment is intended to include any suitable type of memory. Memory 550 may optionally include one or more storage devices physically located away from processor 510.

[0074] In some embodiments, memory 550 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.

[0075] Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; network communication module 552 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 include: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.

[0076] In some embodiments, the motion path processing device in the virtual scene provided in this application can be implemented in software. The motion path processing device in the virtual scene provided in this application can be provided in various software embodiments, including various forms such as applications, software, software modules, scripts or code. Figure 2 A processing device 555 for motion paths in a virtual scene stored in memory 550 is shown. It may be software in the form of programs and plug-ins, and includes a series of modules, including a determination module 5551, a detection module 5552, and a generation module 5553. These modules are logically related and can therefore be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.

[0077] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the motion path processing method in the virtual scene provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0078] In some embodiments, the terminal or server can implement the motion path processing method in the virtual scene provided in this application embodiment by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run, such as car navigation APPs and security APPs; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.

[0079] The method for processing motion paths in a virtual scene provided in this application will be described in conjunction with exemplary applications and implementations of the electronic devices provided in the embodiments of this application. As mentioned above, the method for processing motion paths in a virtual scene provided in the embodiments of this application can be implemented by various types of electronic devices, such as those provided by... Figure 1Either the terminal or the server 200 can be executed independently, or it can be... Figure 1 The terminal and server 200 work together. Therefore, the executing entities for each step will not be described again below.

[0080] See Figure 3 , Figure 3 This is a flowchart illustrating the processing of motion paths in a virtual scene according to an embodiment of this application, which will be combined with... Figure 3 The steps shown are explained.

[0081] In step 101, a first navigation grid and a second navigation grid that are not adjacent in the virtual scene are determined.

[0082] In practical applications, navigation meshes are used to enable virtual objects to automatically navigate within a virtual scene. In some embodiments, when generating a navigation mesh, stationary objects in the virtual scene are first marked as static. Then, the virtual objects for which navigation meshes need to be generated are selected in the virtual scene, and relevant baking parameters are set, such as proxy parameters like the radius, height, maximum slope, and step height of the navigation mesh, as well as area parameters like ordinary ground, water, and jump points. Finally, the navigation mesh is baked. For example, after clicking the bake button, the virtual engine generates a navigation mesh based on the set baking parameters and the marked static objects. If the generated navigation mesh does not meet expectations, the baking parameters can be adjusted and the mesh can be re-baked until a satisfactory result is achieved.

[0083] In other embodiments, the navigation mesh can be generated as follows: 1) Initialize voxel space: Initialize a voxel space based on the preset voxel units and the size of the virtual scene, i.e., divide the virtual scene into voxel units by voxelizing the virtual scene; 2) Traverse scene geometry: Traverse each static obstacle in the virtual scene, convert their geometry into voxels, and fill the voxel space; 3) Mark idle voxels: Mark voxels that have not been voxelized by obstacles (called idle voxels), which represent the space where virtual objects can walk; 4) Connect idle voxels: Analyze the connectivity between idle voxels to find voxels with passable paths; 5) Create navigation mesh units: Aggregate adjacent idle voxels into navigation mesh units, which are usually polygons; 6) Triangulation and optimization: Triangulate each navigation mesh unit to generate a polygon mesh, which may then need to be optimized, such as removing unnecessary edges and vertices; 7) Baking navigation mesh: Baking navigation mesh data into the virtual scene so that the game can use this data to guide virtual objects in pathfinding. The voxelization process described above is a process of converting a complex 3D scene into a simpler data structure, which facilitates path search and navigation calculations.

[0084] The space between the first and second navigation grids is impassable, meaning there are inaccessible obstacles (such as cliffs, rivers, or walls) in this area. This allows virtual objects in the virtual scene to perform actions such as jumping, climbing, and hanging between these impassable areas. For example, when a virtual object moves to the first navigation grid, if the space between the first and second navigation grids is a cliff, the virtual object can be controlled to jump over the cliff along the target movement path (i.e., control the virtual object to jump over the cliff from the first navigation grid to the second navigation grid); if the space between the first and second navigation grids is a river, the virtual object can be controlled to cross the river along the target movement path (i.e., control the virtual object to cross the river between the first and second navigation grids); if the space between the first and second navigation grids is a wall, the virtual object can be controlled to climb the wall along the target movement path (i.e., control the virtual object to climb over the wall from the first navigation grid to the second navigation grid). This enhances the diversity, dynamism, and fun of virtual object interactions in the virtual scene.

[0085] In step 102, based on the motion start edge corresponding to the first navigation grid, the motion end edge corresponding to the second navigation grid is detected to obtain the target motion end edge.

[0086] In some embodiments, see Figure 4A , Figure 4A This is a schematic diagram of the method for determining the target motion terminal edge provided in an embodiment of this application. Figure 3 Step 102 shown can be achieved through Figure 4A Steps 1021-1024 shown are implemented as follows:

[0087] In step 1021, a detection box is generated based on the motion start edge corresponding to the first navigation grid to detect the motion end edge corresponding to the second navigation grid.

[0088] In some embodiments, the generation of a detection box for detecting the motion termination edge corresponding to the second navigation grid based on the motion start edge in the first navigation grid in step 1021 can be achieved as follows: obtain the side length of the motion start edge corresponding to the first navigation grid, as well as the minimum height difference, maximum height difference, minimum horizontal distance, and maximum horizontal distance between the first navigation grid and the second navigation grid; generate a detection box for detecting the motion termination edge corresponding to the second navigation grid based on the side length, minimum height difference, maximum height difference, minimum horizontal distance, and maximum horizontal distance.

[0089] It is understandable that when the first navigation grid and the second navigation grid are located on the same plane, the minimum height difference and the maximum height difference between them are both 0; when the first navigation grid and the second navigation grid are located on the same vertical line perpendicular to the same plane, the minimum horizontal distance and the maximum horizontal distance between them are both 0.

[0090] In practical applications, in order to detect whether a virtual object can safely move from the starting edge to the ending edge of the movement with the target action, such as jumping, the starting edge is the take-off edge and the ending edge is the landing edge. In order to detect whether the virtual object can safely jump from the take-off edge to the landing edge, it is necessary to detect the landing edge based on the take-off edge. Usually, a detection box needs to be determined to detect whether the virtual object can safely land at a certain position on the ending edge of the movement.

[0091] When determining the detection box, the first step is to determine the motion start edge (such as the take-off edge). The motion start edge is the edge where the starting point of the target motion path to be generated is located, and the motion end edge is the edge where the ending point of the target motion path to be generated is located. The motion start edge can correspond to one or more first navigation grids, and correspondingly, the motion end edge can correspond to one or more second navigation grids.

[0092] The size of the detection box is determined based on the length of the starting edge of the motion and the size of the virtual object. Generally, the length of the starting edge of the motion is greater than the width of the virtual object. In order to fully detect the most suitable endpoint of the motion, the width of the detection box can be set to the length of the starting edge of the motion. The length of the detection box can be set to the maximum distance of the virtual object's movement with the target action (such as the maximum distance of a jump), which is determined by the minimum and maximum horizontal distance between the first and second navigation grids. The height of the detection box depends on the characteristics of the target action. For example, when the target action is a jump, the height of the detection box can be set to the highest point of the virtual object's jump, which is determined by the minimum and maximum height difference between the first and second navigation grids.

[0093] For example, see Figure 5 , Figure 5This is a schematic diagram of the generation of the detection box provided in the embodiments of this application. Assuming that the starting edge of the movement (such as the take-off edge) is determined, the minimum height difference between the first navigation grid and the second navigation grid can be represented by the minimum height difference MinV between the starting edge of the movement and the second navigation grid. The maximum height difference between the first navigation grid and the second navigation grid can be represented by the maximum height difference MaxV between the starting edge of the movement and the second navigation grid. The minimum horizontal distance between the first navigation grid and the second navigation grid can be represented by the minimum horizontal distance MinH between the starting edge of the movement and the second navigation grid. The maximum horizontal distance between the first navigation grid and the second navigation grid can be represented by the maximum horizontal distance MaxH between the starting edge of the movement and the second navigation grid. Based on the side length of the starting edge of the movement, the minimum height difference MinV, the maximum height difference MaxV, the minimum horizontal distance MinH, and the maximum horizontal distance MaxH, a detection box is generated to detect the movement end edge corresponding to the second navigation grid. That is, the side length of the detection box is the side length of the starting edge of the movement, the height of the detection box is the difference between the maximum height difference MaxV and the minimum height difference MinV, and the length of the detection box is the difference between the maximum horizontal distance MaxH and the minimum horizontal distance MinH.

[0094] The detection box can be placed at the starting edge of the motion or slightly forward of it. This ensures that the virtual object, after moving with the target action, can reach the detection range of the detection box. After the detection box is placed, it can be used to detect whether there is a suitable ending edge of the motion (i.e., whether there is a suitable landing surface).

[0095] In step 1022, based on the detection box, intersection detection is performed on all motion terminal edges corresponding to the second navigation mesh to obtain at least one first potential motion terminal edge that intersects with the detection box.

[0096] During detection, detection rays can be emitted on all motion endpoints (various edges of different sizes in the second navigation grid) corresponding to the second navigation grid. By checking whether the detection rays intersect with the detection box, the motion endpoints that intersect with the detection box are detected from all motion endpoints as the first potential motion endpoints. The so-called first potential motion endpoint is the destination edge that can ensure the virtual object can safely reach the target action from the motion start edge, such as the landing edge that can safely jump.

[0097] See Figure 6 , Figure 6 This is a top view schematic diagram of intersection detection provided in an embodiment of this application. Taking R1 and R2 as detection rays as an example, the points from the starting point of the detection ray to the intersection points of the detection ray and the detection box are t1, t2, t3, and t4. For a detection ray, if [t1, t2] and [t3, t4] have an overlapping portion on the number axis, it indicates that the detection ray intersects with the detection box. Figure 6In the process, if the detection ray R1 does not intersect with the detection box, but the detection ray R2 intersects with the detection box, then the motion terminal edge where the detection ray R2 is located is taken as the first potential motion terminal edge. In this way, multiple first potential terminal edges that intersect with the detection box can be detected from all motion terminal edges.

[0098] By using the above method, a portion of potential motion endpoints are first screened out by detecting boxes. This not only improves the accuracy of subsequently determining the target motion endpoint and the target motion path, but also increases the efficiency of generating the target motion path by reducing the amount of subsequent computation.

[0099] In step 1023, parallelism detection is performed on the starting edge of the motion and each first potential ending edge of the motion to obtain the parallelism between the starting edge of the motion and each first potential ending edge of the motion.

[0100] Here, the first potential motion endpoint is the destination endpoint that can ensure the virtual object safely reaches the destination endpoint from the motion start endpoint with the target action. In order to further obtain the target motion endpoint that can truly ensure the virtual object safely reaches the destination endpoint with the target action, it is necessary to further filter out the target motion endpoint from the first potential motion endpoint.

[0101] After obtaining the first potential motion endpoint, in order to improve the accuracy of the target motion endpoint, the parallelism between the motion start edge and each first potential motion endpoint can be detected. For example, the angle between the motion start edge and each first potential motion endpoint can be calculated, and the angle can be used as the parallelism between the motion start edge and the first potential motion endpoint.

[0102] In step 1024, the target motion terminal edge is determined based on the parallelism between the motion start edge and each first potential motion terminal edge.

[0103] In some embodiments, the target motion endpoint can be determined based on the parallelism between the motion start edge and each first potential motion endpoint in the following manner: based on the parallelism between the motion start edge and each first potential motion endpoint, a second potential motion endpoint with a parallelism lower than a parallelism threshold is selected from at least one first potential motion endpoint; the target motion endpoint is determined based on the second potential motion endpoint.

[0104] In practical applications, parallelism can reflect the degree of deviation between the first potential motion endpoint and the motion recognition to a certain extent. If the deviation is too large, it will be impossible to control the virtual object to successfully or safely reach the corresponding first potential motion endpoint from the motion start edge with the target action. Based on this, motion endpoints with parallelism exceeding the parallelism threshold can be filtered out from multiple first potential motion endpoints, and motion endpoints with parallelism below the parallelism threshold can be selected and retained as second potential motion endpoints. The final target motion endpoint can then be determined based on the second potential motion endpoints.

[0105] The parallelism threshold is related to the motion characteristics of the virtual object and the type of the target action. It refers to the maximum angle between the starting and ending edges of the motion when the virtual object can be controlled to successfully reach the corresponding ending edge of the motion from the starting edge of the motion with the target action.

[0106] By using the above method and selecting based on parallelism, we can not only improve the accuracy of the final target motion endpoint, thereby improving the accuracy of the target motion path, but also improve the efficiency of target motion path generation by reducing the amount of subsequent calculations.

[0107] In some embodiments, when there are multiple second potential motion endpoints, the target motion endpoint can be determined based on the second potential motion endpoints in the following manner: based on the motion start edge, perform distance overlap detection on each second potential motion endpoint to obtain a distance overlap detection result; based on the distance overlap detection result, group the multiple second potential motion endpoints to obtain at least one potential motion endpoint group, wherein there is distance overlap between different second potential motion endpoints in the same potential motion endpoint group; filter out the second potential motion endpoints from the potential motion endpoint group whose height meets the height filtering condition and whose length meets the length filtering condition, and determine the filtered second potential motion endpoints as the target motion endpoints.

[0108] In practical applications, when there are many second potential motion endpoints, the final target motion endpoint can be further selected from the second potential motion endpoints.

[0109] It should be noted that the overlap of two sides usually refers to a geometric figure where two line segments or sides share a common line segment in space or a plane, meaning they occupy the same distance or space. For example, in plane geometry, if there are two line segments AB and CD, and a part of line segment AB coincides with a part of line segment CD, then we say that these two sides overlap. This overlap can be partial overlap, full overlap, or staggered overlap. Partial overlap means that a part of the two sides coincides, but the rest does not; full overlap means that one side lies entirely on the other side, that is, every point on both sides coincides; staggered overlap means that the two sides do not overlap on a common line segment, but rather overlap alternately.

[0110] Different distance overlap types have different corresponding distance overlap conditions. For example, suppose there are two line segments A and B, whose endpoints in two-dimensional space are: line segment A: A1(x1,y1)~A2(x2,y2); line segment B: B1(x3,y3)~B2(x4,y4). The following are the conditions for the two line segments A and B to partially overlap: C=(min(x1,x2)<=max(x3,x4))and(max(x1,x2)>=min(x3,x4))and(min(y1,y2)<=max(y3,y4))and(max(y1,y2)>=min(y3,y4)). If condition C is true, it means that line segments A and B partially overlap. If condition C is false, it means that line segments A and B either do not overlap or completely overlap.

[0111] In some embodiments, distance overlap detection can be performed on each second potential motion terminal edge based on the motion start edge to obtain a distance overlap detection result: obtain the minimum distance and maximum distance between the motion start edge and each second potential motion terminal edge; for two different second potential motion terminal edges, when their respective minimum distance and maximum distance satisfy the distance overlap condition, obtain a distance overlap detection result indicating that there is a distance overlap between the two different second potential motion terminal edges.

[0112] The minimum and maximum distances between the starting edge and the second potential ending edge refer to the perpendicular distances from the two endpoints of the second potential ending edge to the line containing the starting edge. When performing distance overlap detection, the minimum and maximum distances between two different second potential ending edges can be used to detect whether there is distance overlap between them.

[0113] For example, see Figure 7 , Figure 7This is a schematic diagram of distance overlap detection provided in an embodiment of this application. The starting edge (or take-off edge) is QP, the second potential ending edge is A1B1, and the second potential ending edge is A2B2. The minimum distance between the second potential ending edge A1B1 and the starting edge QP is the perpendicular distance dmin2 from A1 to QP, and the maximum distance is the perpendicular distance dmax2 from B1 to QP. The minimum distance between the second potential ending edge A2B2 and the starting edge QP is the perpendicular distance dmin1 from A2 to QP. The maximum distance refers to the vertical distance dmax1 from B2 to the starting edge QP. If the minimum and maximum distances corresponding to the second potential moving edge A1B1 and the second potential moving edge A2B2 satisfy the distance overlap condition: dmin1 < dmin2 < dmax1 < dmax2, it is considered that there is a distance overlap between the second potential moving edge A1B1 and the second potential moving edge A2B2 (this distance overlap is an interleaved overlap). Then, the second potential moving edge A1B1 and the second potential moving edge A2B2 are divided into a potential moving edge group.

[0114] Using the above method, multiple second potential motion endpoints can be divided into different potential motion endpoint groups. From these groups, second potential motion endpoints that meet both height and length selection criteria are chosen, and these selected second potential motion endpoints are determined as target motion endpoints. For example, from multiple second potential motion endpoints in a group, the second potential motion endpoint with the highest overall height and longest length is preferentially selected as the target motion endpoint. Figure 7 In the process, the second potential motion terminal edge A1B1 and the second potential motion terminal edge A2B2 are divided into a potential motion terminal edge group. If the overall height of the second potential motion terminal edge A2B2 is greater than the overall height of the second potential motion terminal edge A1B1, and the side length of the second potential motion terminal edge A2B2 is greater than the side length of the second potential motion terminal edge A1B1, then the second potential motion terminal edge A2B2 is selected as the target motion terminal edge.

[0115] When there are multiple potential motion terminal edge groups, a target motion terminal edge can be selected from each potential motion terminal edge group based on the above filtering method. For the target motion terminal edge selected from each potential motion terminal edge group, the above filtering method is still used to determine the optimal target motion terminal edge. For example, assuming that the second potential motion terminal edge is divided into 4 potential motion terminal edge groups, the target motion terminal edges selected from these 4 potential motion terminal edge groups are L1, L2, L3 and L4 respectively. If L1 has the highest overall height and the longest side length, then L1 is taken as the optimal target motion terminal edge, and the subsequent target motion path is generated based on the optimal target motion terminal edge L1.

[0116] By using the above method, grouping based on distance overlap detection results and selecting the optimal target motion endpoint from each potential motion endpoint group, we can not only improve the accuracy of the final target motion endpoint and thus improve the accuracy of the target motion path, but also improve the efficiency of target motion path generation by reducing the amount of subsequent calculations.

[0117] In step 103, a target motion path that crosses the spatial region is generated based on the starting edge of the motion and the ending edge of the target motion.

[0118] Here, after determining the optimal target motion endpoint, a target motion path can be generated based on the motion start edge and the target motion endpoint, spanning the spatial region between the first navigation grid and the second navigation grid. The target motion path can be regarded as a direct connection path between the first navigation grid and the second navigation grid.

[0119] In some embodiments, see Figure 4B , Figure 4B This is a schematic diagram of the method for determining the target motion terminal edge provided in an embodiment of this application. Figure 3 Step 103 shown can be achieved through Figure 4B Steps 1031-1033 shown are implemented as follows:

[0120] In step 1031, the starting edge of the motion is trimmed based on the target motion ending edge to obtain the target motion starting edge.

[0121] In practical applications, in order to ensure that the virtual object can safely move from the starting edge of the motion to the target ending edge of the motion with the target motion, the starting edge of the motion can be trimmed based on the determined target ending edge of the motion. For example, perpendicular lines can be drawn from the two endpoints of the target ending edge of the motion to the starting edge of the motion, and the starting edge of the motion can be trimmed based on the perpendicular points.

[0122] For example, see Figure 8 , Figure 8 This is a trimming diagram provided in the embodiment of this application. Perpendicular lines are drawn from the endpoints A and B of the target motion end side (target landing side) AB to the motion start side (jump side) PQ, with the perpendicular points being Q' and P'. Since Q' is located above the motion start side PQ and P' is located outside the motion start side PQ, PQ' is taken as the target motion start side after trimming the motion start side PQ (i.e., the trimmed jump side).

[0123] By narrowing the range of the initial motion edge as described above, a precise target motion initial edge is obtained, which helps improve the accuracy of subsequent target motion path generation.

[0124] In step 1032, based on a preset sampling step size, motion point sampling is performed on the target motion start edge and the target motion end edge to obtain at least one motion start point on the target motion start edge and a motion end point on the target motion end edge corresponding to the motion start point.

[0125] The preset sampling step size is the interval between consecutive sampling points set by the user when sampling motion points. The preset sampling step size determines the spacing between adjacent motion points and affects the density of the generated motion path. For example, the larger the preset sampling step size, the larger the spacing between adjacent motion points and the sparser the generated motion path; conversely, the smaller the preset sampling step size, the smaller the spacing between adjacent motion points and the denser the generated motion path.

[0126] After determining the target motion start edge and target motion end edge, a preset sampling step size can be used to sample motion points on the target motion start edge and target motion end edge. In order to ensure that the sampled motion points are valid, it is necessary to determine whether each sampled motion point (including the motion start point and motion end point) has been successfully sampled. If the vertical distance between the sampled motion point and the navigation grid corresponding to the motion start edge meets the distance condition, it can be determined that the motion point has been successfully sampled.

[0127] For example, see Figure 9 , Figure 9 This is a sampling diagram provided in an embodiment of this application. Taking the motion point P sampled on the starting edge of the motion as an example, if there is a navigation grid within a certain distance range above and below the motion point P, it can be determined that the motion point P was successfully sampled.

[0128] In the above way, multiple motion starting points successfully sampled on the target motion starting edge and multiple motion ending points successfully sampled on the target motion ending edge can be obtained. It can be understood that the motion starting points sampled on the target motion starting edge and the motion starting points sampled on the target motion ending edge are in one-to-one correspondence, so multiple pairs of motion starting points and motion ending points can be sampled.

[0129] In step 1033, a target motion path that crosses a spatial region is determined based on the candidate motion paths between each pair of motion start points and motion end points.

[0130] Here, after obtaining multiple successfully sampled pairs of motion start points and end points, a candidate motion path is obtained for each pair. The candidate motion path is a direct connection between the motion start point and the motion end point; a direct connection path is one that directly connects the motion start point and the motion end point and crosses any obstacles between them. The shape of the candidate motion path depends on the following factors: the type of unwalkable spatial region between the target motion start edge and the target motion end edge, and the target action used to cross that spatial region. For example, if the spatial region is a cliff and the target action is a jump, the shape of the candidate motion path can be a parabola, and the vertex coordinates of the parabola are related to the motion performance of the virtual object.

[0131] In some embodiments, a target motion path that crosses a spatial region can be determined based on candidate motion paths between each pair of motion start points and motion end points in the following manner: for each pair of motion start points and motion end points, a candidate motion path that connects the motion start point and motion end point and crosses a spatial region is generated; channel detection is performed on each candidate motion path to obtain channel detection results; based on the channel detection results, the target motion path that meets the channel detection conditions among each candidate motion path is determined.

[0132] In practical applications, for each pair of motion start points and end points, candidate motion paths connecting the start and end points and spanning spatial regions can be generated. In some embodiments, candidate motion paths connecting the start and end points and spanning spatial regions can be generated as follows: when the sampled motion points have offsets, the start point offset and end point offset are determined; based on the start point offset and end point offset, the start and end points are adjusted to obtain adjusted start and end points; and candidate motion paths connecting the adjusted start and end points and spanning spatial regions are generated.

[0133] In practical applications, when the sampled motion points are offset (e.g., if the starting point of motion is offset, the corresponding ending point will also be offset), the starting point offset and ending point offset are determined. Then, based on these offsets, the starting and ending points are adjusted to obtain the adjusted starting and ending points. Finally, a candidate motion path is generated that connects the adjusted starting and ending points and traverses a spatial region. (See [link to relevant documentation]). Figure 10 , Figure 10This is an offset diagram provided in the embodiment of this application. When the motion starting point P is offset to P' (offset amount is 25), the corresponding motion ending point Q is also offset to Q' (offset amount is 25). The shape of the candidate motion path 1001 generated between P and Q before the offset and the candidate motion path 1002 generated between P' and Q' after the offset are the same, except that the path length is different. This is to adapt to the situation where the virtual object may not start moving precisely from the target motion starting edge when actually controlling the virtual object to move from the target motion starting edge, thus improving the applicability of motion path generation.

[0134] In some embodiments, channel detection can be performed on each candidate motion path to obtain channel detection results by: performing open height field detection on each candidate motion path to obtain a first detection result; performing entity height field detection on each candidate motion path to obtain a second detection result; and determining the channel detection result based on the first detection result and the second detection result.

[0135] In game development, open heightfields and solid heightfields are two different terrain representation methods used to represent the elevation changes of terrain in games. An open heightfield typically refers to a regular two-dimensional array or grid where each cell (or vertex) has a height value. These height values ​​define the surface of the terrain and are commonly used for terrain rendering and collision detection. In an open heightfield, the edges of the terrain are open and can extend beyond the defined terrain boundaries. This means that players can render and probe areas outside the terrain boundaries, even though these areas may not have a concrete visual representation. The characteristics of open heightfields include: height values ​​are usually stored in a two-dimensional array; they can represent relatively complex terrain variations; and terrain generation and editing are generally relatively simple.

[0136] A solid height field is a three-dimensional data structure that represents terrain as a solid volume, not just a surface. In a solid height field, each region of the terrain is explicitly labeled as either solid or hollow. This representation is extremely useful for collision detection and physics simulations because it accurately indicates which regions are passable and which are impassable. Characteristics of solid height fields include: they are typically represented using three-dimensional arrays or voxel data structures; they can represent the internal structure of the terrain, not just the surface; and they are very useful for simulating activities within the terrain (such as excavation and construction).

[0137] In actual game development, the choice between these two height fields depends on the game's needs and optimization goals. For example, if the game requires highly dynamic terrain changes, a solid height field might be more suitable because it better supports terrain modification and physical interactions. However, if the game primarily focuses on the visual effects of the terrain, an open height field might be sufficient because it can render terrain surfaces more efficiently.

[0138] Here, if there are many candidate motion paths, the optimal target motion path can be further filtered out. For example, channel detection can be performed on each candidate motion path, and the target motion path that meets the channel detection conditions can be filtered out based on the channel detection results. Channel detection includes open height field detection and entity height field detection. The entity height field is usually used to represent the exact height value of each point in the virtual scene. In the entity height field, each cell or voxel contains the height information of the passable area in the virtual scene. When performing entity height field detection, the height value of each voxel is checked by traversing all voxels in the entity height field to determine the characteristics of the candidate motion path. For a specific location, spatial segmentation techniques (such as octrees) can be used to quickly query the terrain height of that location. In the physical simulation, collision detection between the entity height field and obstacles is used to determine whether there are obstacles on the candidate motion path.

[0139] Open height fields (OPFs) are a more efficient terrain representation method that uses less storage space to approximate terrain height. They typically use a series of vertices and edges to represent the terrain. When performing OPF detection on candidate motion paths, features of the candidate motion paths are approximated by traversing the vertices and edges in the OPF. For non-mesh navigation points, interpolation methods (such as linear interpolation, bilinear interpolation, etc.) can be used to estimate terrain height. Edge features of the terrain are identified by detecting changes in the edges.

[0140] Using the methods described above, entity height field detection can accurately detect whether there are obstacles on the candidate motion path. Open height field uses less storage space because it only stores information about vertices and edges, rather than the height of each voxel, resulting in higher detection efficiency. Moreover, since the data structure of open height field is more compact, it is easier to effectively detect complex geometries that may exist on the candidate motion path. Furthermore, path details can be dynamically adjusted according to the field of view or importance, which helps to improve the accuracy of target motion path generation.

[0141] In some embodiments, the channel detection results include the highest and lowest points of the surface corresponding to each candidate motion path; the target motion path that meets the channel detection conditions can be determined based on the channel detection results in the following manner: when there are no obstacles in the area between the plane where the highest and lowest points of the surface are located, the corresponding candidate motion path is determined as the target motion path that meets the channel detection conditions.

[0142] For example, see Figure 11 , Figure 11 This is a schematic diagram of channel detection provided in the embodiments of this application. Taking a space region as a cliff and a target action as a jump as an example, the highest point of the surface (i.e., the surface height Ymax corresponding to the upper surface) and the lowest point of the surface (i.e., the surface height Ymin corresponding to the lower surface) corresponding to each candidate motion path are obtained to simulate the real-time situation during the virtual object's jump. When there are no obstacles in the area between the plane where the highest point and the lowest point of the surface are located, the corresponding candidate motion path is determined as the target motion path that meets the channel detection conditions.

[0143] In some embodiments, the target motion path that meets the channel detection conditions among the candidate motion paths can be determined in the following ways: when there are multiple candidate motion paths that meet the channel detection conditions, multiple motion endpoints that meet the channel detection conditions are determined; when the number of continuously sampled motion endpoints among the multiple motion endpoints reaches a number threshold, the middle position of the continuously sampled motion endpoints is determined as the target motion endpoint; the target motion starting point corresponding to the target motion starting point on the motion starting edge is determined, and the motion path that connects the target motion starting point and the target motion endpoint and crosses the spatial region is determined as the target motion path that meets the channel detection conditions.

[0144] In practical applications, when there are multiple candidate motion paths that meet the channel detection conditions, the motion endpoints corresponding to the candidate motion paths that meet the channel detection conditions are determined (one candidate motion path corresponds to one motion endpoint). When there are consecutively sampled motion endpoints among the multiple motion endpoints, and the number of consecutively sampled motion endpoints reaches a certain threshold (which can be set according to actual needs; for example, if the side length of the target motion endpoint is long and the preset sampling step size is set small, resulting in a large number of sampled motion endpoints, a larger threshold can be set, such as 10; if the side length of the target motion endpoint is short and the preset sampling step size is set large, resulting in a small number of sampled motion endpoints, a smaller threshold can be set, such as 3), the middle position of these consecutively sampled motion endpoints is determined as the target motion endpoint, and the target motion starting point corresponding to the target motion starting point on the target motion starting edge is obtained. Then, the motion path between the target motion endpoint and the target motion starting point is taken as the target motion path that meets the channel detection conditions.

[0145] For example, see Figure 12 , Figure 12 This is a schematic diagram of the determination of the target motion path provided in the embodiments of this application. Taking the spatial area as a cliff and the target action as a jump as an example, there are 14 continuously sampled motion endpoints on the starting edge (landing edge) of the target motion, and the candidate motion paths corresponding to these 14 motion endpoints meet the channel detection conditions. Then, the middle position of the 14 motion endpoints is taken as the target motion endpoint, and the candidate motion path corresponding to the target motion endpoint (the target motion endpoint and the target motion starting point) is taken as the final target motion path. In this way, when the virtual object is about to jump from the starting edge to the target motion endpoint, the target motion starting point is taken as the starting point and the target motion endpoint is taken as the landing point. In this way, the jumping action of the virtual object is the safest and most in line with the actual situation.

[0146] In some embodiments, a target motion path that crosses a spatial region can be determined based on the motion path between each pair of motion start points and motion end points in the following manner: for each pair of motion start points and motion end points, a candidate motion path that connects the motion start point and motion end point and crosses the spatial region is generated; when there is a walkable path between the motion start point and motion end point, the distances of each candidate motion path and the walkable path are compared; when the distance of each candidate motion path is less than the distance of the walkable path, the target motion path that crosses the spatial region is determined based on each candidate motion path.

[0147] In practical applications, see Figure 13 , Figure 13 This is a schematic diagram of motion path determination provided in an embodiment of this application. Taking a cliff as an example and a jump as the target action, multiple candidate motion paths are generated that cross the cliff area between the starting edge (i.e., the take-off edge) and the ending edge (i.e., the landing edge) of the target motion. For example, candidate motion paths (such as the arc path between the starting point A and the ending point B). If there is a walkable path (such as the arrow-indicated path between the starting point A and the ending point B) between the starting edge (i.e., the take-off edge) and the ending edge (i.e., the landing edge), the distance between the candidate motion path (the arc path between the starting point A and the ending point B) and the walkable path (the arrow-indicated path between the starting point A and the ending point B) is determined. If the distance of the candidate motion path (the arc path between the starting point A and the ending point B) is less than the distance of the walkable path (the arrow-indicated path between the starting point A and the ending point B), the final target motion path is determined from the candidate motion path (the arc path between the starting point A and the ending point B). Otherwise, if there is a candidate motion path with a distance greater than the walkable path (the arrow-indicated path between the starting point A and the ending point B), the target motion path is ignored and generated.

[0148] In practical applications, after generating the target motion path, if a virtual object in the virtual scene moves to the starting edge of the motion or the first navigation grid, it can be controlled to perform the target action along the target motion path in response to motion control operations on the virtual object, moving from the first navigation grid to the second navigation grid. For example, if the space between the first and second navigation grids is a cliff, the virtual object can be controlled to jump over the cliff along the target motion path (i.e., control the virtual object to jump over the cliff from the first navigation grid to the second navigation grid); if the space between the first and second navigation grids is a river, the virtual object can be controlled to cross the river along the target motion path (i.e., control the virtual object to cross the river between the first and second navigation grids); if the space between the first and second navigation grids is a wall, the virtual object can be controlled to climb the wall along the target motion path (i.e., control the virtual object to climb over the wall from the first navigation grid to the second navigation grid), thereby enhancing the diversity, dynamism, and fun of virtual object interactions in the virtual scene.

[0149] Using the above method, for the first and second navigation grids in a virtual scene that are not adjacent and whose spatial regions are not traversable, when generating the motion path between the first and second navigation grids, the target motion endpoint is first detected based on the motion start edge corresponding to the first navigation grid and the motion endpoint corresponding to the second navigation grid. Then, based on the motion start edge and the target motion endpoint, a target motion path that crosses the spatial region is generated. In this way, since the motion endpoint is detected based on the real motion start edge, it can reflect the actual traversable situation. Therefore, the target motion path generated based on the motion start edge and the motion endpoint conforms to the actual traversable situation, thus improving the accuracy of the motion path.

[0150] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario. Taking a virtual scene as a game, the spatial region between the first navigation grid and the second navigation grid as a cliff, and the target action as jumping as an example, the method for processing motion paths in a virtual scene provided by the embodiments of this application will be further explained.

[0151] See Figure 14 , Figure 14 This is a flowchart illustrating a method for processing motion paths in a virtual scene according to an embodiment of this application. The method includes:

[0152] Step 201: Perform an intersection detection on the landing side based on the take-off side to determine the first potential landing side.

[0153] The take-off edge is the starting edge of the movement mentioned above, corresponding to the first navigation grid. The first potential landing edge is the first potential ending edge of the movement mentioned above, corresponding to the second navigation grid. The space between the first navigation grid and the second navigation grid is not walkable (i.e., there is a cliff between them).

[0154] When a virtual object (i.e., a game character) moves to the first navigation grid, it cannot be controlled to move directly from the first navigation grid to the second navigation grid because there is a cliff between the first and second navigation grids. Therefore, the virtual object can be controlled to jump from the first navigation grid (i.e., the starting edge) to the second navigation grid (i.e., the landing edge) by jumping. In order to detect whether the virtual object can safely jump from the starting edge to the landing edge, it is necessary to detect the landing edge based on the starting edge. A detection box is generated based on the starting edge to detect the landing edge, so as to detect whether the virtual object can safely land at a certain position on the landing edge.

[0155] When determining the detection box, the starting edge must first be determined. The starting edge can correspond to one or more first navigation grids, and correspondingly, the landing edge can correspond to one or more second navigation grids. The size of the detection box is determined based on the length of the starting edge and the size of the virtual object. Generally, the length of the starting edge is greater than the width of the virtual object. To fully detect the most suitable landing point, the width of the detection box can be set to the length of the starting edge. The length of the detection box can be set to the maximum jump distance of the virtual object, determined by the minimum and maximum horizontal distance between the first and second navigation grids. The height of the detection box depends on the jumping characteristics of the virtual object and can be set to the maximum jump height of the virtual object, such as determined by the minimum and maximum height difference between the first and second navigation grids.

[0156] As shown in the figure, the starting edge is fixed. The minimum height difference between the first and second navigation grids can be represented by the minimum height difference MinV between the starting edge and the second navigation grid. The maximum height difference between the first and second navigation grids can be represented by the maximum height difference MaxV between the starting edge and the second navigation grid. The minimum horizontal distance between the first and second navigation grids can be represented by the minimum horizontal distance MinH between the starting edge and the second navigation grid. The maximum horizontal distance between the first and second navigation grids can be represented by the maximum horizontal distance MaxH between the starting edge and the second navigation grid. Based on the side length of the starting edge, the minimum height difference MinV, the maximum height difference MaxV, the minimum horizontal distance MinH, and the maximum horizontal distance MaxH, a detection box is generated to detect the landing edge corresponding to the second navigation grid.

[0157] The detection box can be placed at the location of the take-off edge or slightly forward of it. This ensures that the virtual object will reach the detection box's detection range after jumping. After the detection box is placed, it can be used to detect whether there is a suitable landing edge (i.e., whether there is a suitable landing surface) within the detection box.

[0158] like Figure 6 As shown, when performing intersection detection on the landing edge based on the detection box, taking R1 and R2 as detection rays as an example, the points from the starting point of the detection ray to the various intersection points of the detection ray and the detection box are t1, t2, t3, and t4. For a detection ray, if [t1, t2] and [t3, t4] have an overlapping part on the number axis, it means that the detection ray intersects with the detection box. Figure 6 In the process, if the detection ray R1 does not intersect with the detection box, but the detection ray R2 intersects with the detection box, then the landing edge where the detection ray R2 is located is taken as the first potential landing edge (i.e., the first potential motion termination edge mentioned above). In this way, multiple first potential landing edges that intersect with the detection box can be detected. The so-called potential landing edge (including the first potential landing edge and the second potential landing edge) refers to the target edge that can ensure that the virtual object can safely reach the landing edge from the starting edge.

[0159] By using the above method, a portion of potential landing edges are first screened out by detecting boxes. This not only improves the accuracy of subsequently determining the target landing edge and the target movement path, but also increases the efficiency of generating the target movement path by reducing the amount of subsequent calculations.

[0160] Step 202: Perform parallelism detection on the first potential landing edge based on the take-off edge to obtain the second potential landing edge.

[0161] Here, after obtaining multiple first potential landing edges, in order to improve the accuracy of the landing edges, the parallelism between the take-off edge and each first potential landing edge can be detected. For example, the angle between the take-off edge and each first potential landing edge can be calculated, and the angle can be used as the parallelism between the take-off edge and the first potential landing edge. First potential landing edges with angles exceeding the angle threshold (i.e., parallelism exceeding the parallelism threshold) can be filtered out to obtain the second potential landing edge (i.e., the second potential motion termination edge mentioned above).

[0162] Among them, the included angle threshold or parallelism threshold is related to the jumping characteristics of the virtual object. It refers to the maximum included angle between the landing side and the starting side when the virtual object can safely jump from the starting side to the landing side.

[0163] By using the above method and filtering based on parallelism, we can not only improve the accuracy of the final target landing edge, thereby improving the accuracy of the target motion path, but also improve the efficiency of target motion path generation by reducing the amount of subsequent calculations.

[0164] Step 203: Group the second potential landing edges and determine the target landing edges.

[0165] Here, when there are many second potential landing edges, the final target landing edge can be further selected from the second potential landing edges. For example, distance overlap detection can be performed on each second potential landing edge based on the take-off edge to obtain the distance overlap detection result; based on the distance overlap detection result, multiple second potential landing edges are grouped to obtain at least one potential landing edge group (i.e., the potential motion end edge group mentioned above); then, second potential landing edges that meet the height selection condition and the length selection condition are selected from the potential landing edge group, and the selected second potential landing edges are determined as the target landing edges.

[0166] like Figure 7 In the above, the starting edge is QP, the second potential landing edge is A1B1, and the second potential landing edge is A2B2. If the minimum and maximum distances corresponding to the second potential landing edges A1B1 and A2B2 satisfy the distance overlap condition: dmin1 < dmin2 < dmax1 < dmax2, it is considered that there is a distance overlap between the second potential landing edges A1B1 and A2B2. Then, the second potential landing edges A1B1 and A2B2 are divided into a potential motion termination edge group. If the overall height of the second potential landing edge A2B2 is greater than the overall height of the second potential landing edge A1B1, and the side length of the second potential landing edge A2B2 is greater than the side length of the second potential landing edge A1B1, then the second potential landing edge A2B2 is selected as the target landing edge.

[0167] When there are multiple potential landing edge groups, a target landing edge can be selected from each potential landing edge group based on the above filtering method. For the target landing edge selected from each potential landing edge group, the above filtering method is still used to determine the optimal target landing edge. For example, suppose the second potential landing edge is divided into 4 potential landing edge groups, and the target landing edges selected from these 4 potential landing edge groups are L1, L2, L3 and L4 respectively. If L1 has the highest overall height and the longest side length, then L1 is taken as the optimal target landing edge, and the subsequent target motion path is generated based on the optimal target landing edge L1.

[0168] By using the above method, grouping based on distance overlap detection results and selecting the optimal target landing edge from each potential landing edge group, we can not only improve the accuracy of the final target landing edge and thus improve the accuracy of the target motion path, but also improve the efficiency of target motion path generation by reducing the amount of subsequent calculations.

[0169] Step 204: Trim the take-off edge according to the target landing edge to obtain the target take-off edge.

[0170] In practical applications, in order to ensure that virtual objects can safely jump from the starting edge to the landing edge, the starting edge can be trimmed based on the determined target landing edge. For example, perpendicular lines can be drawn from the two endpoints of the target landing edge to the starting edge, and the starting edge can be trimmed based on the perpendicular points.

[0171] like Figure 8 In the middle, draw perpendicular lines from the endpoints A and B of the target landing side AB to the take-off side PQ, with the perpendicular points being Q' and P' respectively. Since Q' is above the take-off side PQ and P' is outside the take-off side PQ, PQ' is taken as the target take-off side after trimming the take-off side PQ.

[0172] By narrowing the range of the take-off edge as described above, a precise target take-off edge is obtained, which helps to improve the accuracy of subsequent target motion path generation.

[0173] Step 205: Perform range sampling detection based on the target take-off edge and the target landing edge.

[0174] Here, after determining the target take-off edge and the target landing edge, a preset sampling step size can be used to sample the motion points on the target take-off edge and the target landing edge. The preset sampling step size determines the spacing between adjacent motion points sampled, which affects the density of the generated motion path. For example, the larger the preset sampling step size, the larger the spacing between adjacent motion points sampled, and the sparser the generated motion path; conversely, the smaller the preset sampling step size, the smaller the spacing between adjacent motion points sampled, and the denser the generated motion path.

[0175] To ensure that the sampled motion points are valid, it is necessary to determine whether each sampled motion point (including the take-off point and landing point) was successfully sampled. Figure 9 In the example of sampling a moving point P on the take-off side, if a navigation grid exists within a certain range above and below the moving point P, then it can be determined that the sampling of the moving point P was successful.

[0176] Using the above method, multiple successful take-off points and landing points can be identified on the target take-off side and the target landing side. It can be understood that the take-off points and landing points are often in one-to-one correspondence. In this way, multiple pairs of take-off points and landing points can be identified, and multiple candidate motion paths can be generated based on multiple pairs of take-off points and landing points. Furthermore, the most suitable target motion path can be selected from multiple candidate motion paths.

[0177] Step 206: Perform channel detection based on the take-off point and landing point to determine the target take-off point and target landing point.

[0178] The passage detection includes open height field detection and entity height field detection. The height field is a voxelized representation of the virtual scene; therefore, height field data can be used to accurately determine walkable areas and obstacles (i.e., non-walkable areas). For example, see... Figure 15 , Figure 15 This is a visualization diagram of the height field provided in the embodiments of this application, wherein 1501 refers to the voxelized walkable area (i.e., the visual display of the open height field), and 1502 refers to the voxelized obstacle (the non-walkable area, i.e., the visual display of the solid height field).

[0179] By using open height field detection and solid height field detection, it is possible to determine whether there are obstacles between the take-off point and the landing point that affect the generation of the target's motion path. For example... Figure 11 In the process, the highest point Ymax of the upper surface and the lowest point Ymin of the lower surface corresponding to each pair of take-off and landing edges are obtained to simulate the real-time situation of the virtual object jumping. When there are no obstacles in the area between the planes where the highest point (Ymax) of the upper surface and the lowest point (Ymin) of the lower surface are located, it can be considered that the pair of take-off and landing points meet the channel detection conditions, and it can be determined that the pair of take-off and landing points can generate the corresponding motion path (i.e. the above candidate motion path).

[0180] When there are multiple pairs of start and stop points that meet the channel detection conditions, or when there are multiple candidate motion paths that can be generated, it can be further determined whether these multiple stop points are consecutively sampled stop points. If the number of consecutively sampled stop points reaches a threshold, the middle position of these consecutively sampled stop points is determined as the target stop point. Figure 12 If there are 14 consecutively sampled landing points on the landing edge, the middle position of the 14 landing points is taken as the target landing point, and the target take-off point corresponding to the target landing point is obtained on the take-off edge.

[0181] It should be noted that when the sampled motion points are offset, the start-point offset and end-point offset can be determined. Then, based on these offsets, the take-off point and landing point are adjusted to obtain the adjusted landing point and landing point. Channel detection is then performed on the adjusted landing point and landing point to determine the target take-off point and target landing point. For example... Figure 10 In the process, when the starting point P shifts to P' (with an offset of 25), the corresponding landing point Q also shifts to Q' (with an offset of 25). The candidate motion path 1001 generated between P and Q before the shift and the candidate motion path 1002 generated between P' and Q' after the shift have the same shape, except that the path lengths are different. This is to adapt to the situation where, when actually controlling the virtual object to start jumping from the target starting edge, it may not start jumping precisely from the target starting edge, thus improving the applicability of motion path generation.

[0182] Step 207: Generate the target's motion path based on the target's take-off point and landing point.

[0183] After determining the target take-off point and the target landing point, a target movement path can be generated that connects the target take-off point and the target landing point and crosses the cliff. In this way, the virtual object in the game can be controlled to jump from the target take-off point along the target movement path to the target landing point, thus achieving precise control over the movement of the virtual object.

[0184] The above method generates the target motion path (i.e., the jump path) between the take-off side and the landing side.

[0185] It is understood that the motion path processing method in the virtual scene provided in this application embodiment can be applied not only to jumping scenes, but also to scenes such as climbing walls, vaulting over walls, and crossing rivers. For example, when the space between the first navigation grid and the second navigation grid is a wall and the target action is climbing, the above method can also be used to generate a climbing path based on the climbing start point and climbing end point. The climbing start point is the position where the virtual object in the game begins climbing on the climbing plane. Generally, its relationship with the start point is considered, requiring the vertical height difference from the start point to be the maximum rebound height, and the horizontal distance difference not to be greater than the maximum horizontal distance under various motion types. The climbing end point is the position where the virtual object in the game ends climbing on the climbing plane. Depending on the motion path type, its relationship with the suspension point or the end point will be considered. The suspension point is the position where the virtual object transitions to the end point through animation under certain motion path types, generally located on the plane boundary near the start point. The rebound distance is the horizontal distance between the maximum vertical rebound height of the suspension point and the climbing plane. If the climbing plane is not detected at the maximum rebound height position, a secondary calculation is performed with an error range of ±0.2 meters.

[0186] To verify the effectiveness of the motion path processing method in the virtual scene provided in this application for automatically generating motion paths, visualization tools can be used to quickly iterate the motion path effects and ensure rapid generation of the corresponding motion paths. For example, see... Figure 16 , Figure 16 This is a schematic diagram of the interface for generating motion paths provided in this application embodiment. The interface allows users to select the type of motion path to generate and set relevant parameters, such as generation priority, start-point offset, end-point offset, walkable sampling range, path generation spacing, maximum parallelism, minimum height difference, maximum height difference, minimum horizontal distance, maximum horizontal distance, minimum vaulting height, and maximum vaulting height. After setting the relevant parameters, clicking the "Automatically Generate NavLinks" button in the path editor (NavLink) will generate all required motion paths in the scene with a single click. See also... Figure 17 and Figure 18 , Figure 17 and 18 This is a schematic diagram showing the motion path provided in an embodiment of this application, wherein, Figure 17 In the path editor, the generated results are sorted by path type, such as hanging up and down walls, cliff climbing, climbing up and down walls, etc. Figure 18 In the middle, is Figure 17 The visualization of the generated motion paths also includes hanging up and down walls, cliff crossings, and climbing up and down walls.

[0187] See Figure 19 , Figure 19 This is a visual schematic diagram of the motion path generation process provided in the embodiments of this application. First, a solid height field and an open height field are constructed. Then, based on the solid height field and the open height field, the take-off edge, landing edge, take-off point and landing point are sampled and detected to determine the target take-off point and the target landing point. Finally, the final result, i.e. the target motion path, is generated based on the target take-off point and the target landing point.

[0188] See Figure 20 , Figure 20 This is a schematic diagram showing the motion path type provided in the embodiments of this application, which can be viewed through... Figure 16 The settings interface shown allows you to set different parameters to generate different types of motion paths, such as unlimited hanging up and down walls, 3M climbing up and down walls, unlimited climbing up and down walls, 3M hanging vaulting, traversing, vaulting, unlimited climbing vaulting, and 3M climbing vaulting.

[0189] By adopting the motion path processing method provided in the embodiments of this application, motion paths can be automatically generated without manual configuration. The pipeline is fully automated and requires no manual intervention, allowing for rapid iteration of effects. This avoids the need for reconfiguration after changes in art scenes, thus freeing up productivity. Furthermore, the automatically generated motion paths are accurate and reliable, capable of recognizing complex terrain and buildings, and can meet various climbing and parkour effects in games.

[0190] The exemplary application and implementation of the electronic device provided in the embodiments of this application have been used to describe the method for processing motion paths in a virtual scene provided in the embodiments of this application. The following describes the cooperation of the various modules in the motion path processing device 555 in the virtual scene provided in the embodiments of this application to implement the motion path processing scheme in the virtual scene.

[0191] The determination module 5551 is used to determine a first navigation grid and a second navigation grid that are not adjacent in the virtual scene, and the spatial region between the first navigation grid and the second navigation grid is not traversable; the detection module 5552 is used to detect the motion termination edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid, and obtain the target motion termination edge; the generation module 5553 is used to generate a target motion path that crosses the spatial region based on the motion start edge and the target motion termination edge; wherein, the target motion path is used to control the virtual object to perform a target action along the target motion path to move from the first navigation grid to the second navigation grid when receiving a motion control operation for a virtual object located on the first navigation grid.

[0192] In some embodiments, the detection module is further configured to: generate a detection box for detecting the motion termination edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid; perform intersection detection on all motion termination edges corresponding to the second navigation grid based on the detection box to obtain at least one first potential motion termination edge intersecting with the detection box; perform parallelism detection on the motion start edge and each of the first potential motion termination edges to obtain the parallelism between the motion start edge and each of the first potential motion termination edges; and determine the target motion termination edge based on the parallelism between the motion start edge and each of the first potential motion termination edges.

[0193] In some embodiments, the detection module is further configured to obtain the side length of the motion start edge corresponding to the first navigation grid, as well as the minimum height difference, maximum height difference, minimum horizontal distance, and maximum horizontal distance between the first navigation grid and the second navigation grid; and generate a detection box for detecting the motion end edge corresponding to the second navigation grid based on the side length, the minimum height difference, the maximum height difference, the minimum horizontal distance, and the maximum horizontal distance.

[0194] In some embodiments, the detection module is further configured to, based on the parallelism between the motion start edge and each of the first potential motion end edges, filter out second potential motion end edges whose parallelism is lower than a parallelism threshold from the at least one first potential motion end edge; and determine a target motion end edge based on the second potential motion end edge.

[0195] In some embodiments, when there are multiple second potential motion endpoints, the detection module is further configured to perform distance overlap detection on each second potential motion endpoint based on the motion starting edge to obtain a distance overlap detection result; group the multiple second potential motion endpoints based on the distance overlap detection result to obtain at least one potential motion endpoint group, wherein there is distance overlap between different second potential motion endpoints in the same potential motion endpoint group; filter out second potential motion endpoints from the potential motion endpoint group whose height meets the height filtering condition and whose length meets the length filtering condition, and determine the filtered second potential motion endpoints as the target motion endpoints.

[0196] In some embodiments, the detection module is further configured to obtain the minimum distance and the maximum distance between the motion start edge and each of the second potential motion end edges; and for two different second potential motion end edges, when the minimum distance and the maximum distance of each satisfy the distance overlap condition, obtain a distance overlap detection result indicating that there is a distance overlap between the two different second potential motion end edges.

[0197] In some embodiments, the generation module is further configured to: trim the motion start edge based on the target motion end edge to obtain a target motion start edge; sample motion points on the target motion start edge and the target motion end edge based on a preset sampling step size to obtain at least one motion start point on the target motion start edge and a motion end point on the target motion end edge corresponding to the motion start point; and determine a target motion path that crosses the spatial region based on candidate motion paths between each pair of motion start points and motion end points.

[0198] In some embodiments, the generation module is further configured to generate, for each pair of motion start points and motion end points, a candidate motion path connecting the motion start point and the motion end point and traversing the spatial region; perform channel detection on each of the candidate motion paths to obtain channel detection results; and, based on the channel detection results, determine the target motion path among the candidate motion paths that meets the channel detection conditions.

[0199] In some embodiments, the generation module is further configured to determine the starting point offset and the ending point offset when the sampled motion point has an offset; adjust the starting point and the ending point based on the starting point offset and the ending point offset to obtain the adjusted starting point and the ending point; and generate a candidate motion path that connects the adjusted starting point and the ending point and crosses the spatial region.

[0200] In some embodiments, the generation module is further configured to perform open height field detection on each of the candidate motion paths to obtain a first detection result; perform entity height field detection on each of the candidate motion paths to obtain a second detection result; and determine a channel detection result based on the first detection result and the second detection result.

[0201] In some embodiments, the channel detection result includes the highest point and lowest point of the surface corresponding to each candidate motion path; the generation module is further configured to determine the corresponding candidate motion path as the target motion path that satisfies the channel detection condition when there are no obstacles in the area between the plane where the highest point and the lowest point of the surface are located.

[0202] In some embodiments, the generation module is further configured to: determine multiple motion endpoints that satisfy the channel detection conditions when there are multiple candidate motion paths that satisfy the channel detection conditions; determine the middle position of the continuously sampled motion endpoints as the target motion endpoint when the number of continuously sampled motion endpoints among the multiple motion endpoints reaches a number threshold; determine the target motion starting point on the motion starting edge that corresponds to the target motion starting point; and determine the motion path that connects the target motion starting point and the target motion endpoint and crosses the spatial region as the target motion path that satisfies the channel detection conditions.

[0203] In the above scheme, the generation module is further configured to generate candidate motion paths that connect the starting point and the ending point of the motion and cross the spatial region for each pair of the starting point and the ending point of the motion; when there is a walkable path between the starting point and the ending point of the motion, the distance between each candidate motion path and the walkable path is compared; when the distance of each candidate motion path is less than the distance of the walkable path, a target motion path that crosses the spatial region is determined based on each candidate motion path.

[0204] This application provides a computer program product, which includes a computer program or computer-executable instructions stored in a computer-readable storage medium. The processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the motion path processing method in a virtual scene described above in this application embodiment.

[0205] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the motion path processing method in the virtual scene provided in this application embodiment. For example, ... Figure 3The method for handling motion paths in a virtual scene is shown.

[0206] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.

[0207] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0208] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

[0209] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.

[0210] In summary, the following technical effects can be achieved through the embodiments of this application:

[0211] 1) Since the motion termination edge is obtained based on the actual motion start edge, it can reflect the actual motion situation. Therefore, the target motion path generated based on the motion start edge and motion termination edge conforms to the actual motion situation, thus improving the accuracy of the motion path.

[0212] 2) By first screening out a portion of potential motion endpoints by detecting boxes, we can not only improve the accuracy of subsequently determining the target motion endpoint and the target motion path, but also improve the efficiency of generating the target motion path by reducing the amount of subsequent calculations.

[0213] 3) By using parallelism-based filtering, we can not only improve the accuracy of the final target motion endpoint, thereby improving the accuracy of the target motion path, but also improve the efficiency of target motion path generation by reducing the amount of subsequent calculations.

[0214] 4) By grouping based on distance overlap detection results, the optimal target motion endpoint is selected from each potential motion endpoint group. By narrowing the range of motion starting endpoints, not only can the accuracy of the final target motion endpoint be improved, thus improving the accuracy of the target motion path, but the generation efficiency of the target motion path can also be improved by reducing the subsequent computation.

[0215] 5) It can automatically generate motion paths without manual configuration. The pipeline is fully automated and requires no human intervention. It can quickly iterate effects and avoid the need for reconfiguration after changes in art and scene, thus freeing up productivity. Moreover, the automatically generated motion paths are accurate and reliable, and can recognize complex terrain and buildings, which can meet various climbing and parkour effects in the game.

[0216] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.

Claims

1. A method for processing motion paths in a virtual scene, characterized in that, The method comprises: determining a first navigation grid and a second navigation grid in a virtual scene which are not adjacent, a space region between the first navigation grid and the second navigation grid being non-walkable; detecting a target motion end edge of a motion end edge corresponding to the second navigation grid based on a motion start edge corresponding to the first navigation grid; generating a target motion path spanning the space region based on the motion start edge and the target motion end edge; wherein the target motion path is used to control a virtual object located in the first navigation grid to perform a target action along the target motion path to move from the first navigation grid to the second navigation grid when a motion control operation for the virtual object is received.

2. The method of claim 1, wherein, The detection of the target motion end edge based on the motion start edge corresponding to the first navigation grid comprises: generating a detection box for detecting the motion end edge corresponding to the second navigation grid based on the motion start edge corresponding to the first navigation grid; performing intersection detection on all motion end edges corresponding to the second navigation grid based on the detection box to obtain at least one first potential motion end edge intersecting with the detection box; performing parallelism detection on the motion start edge and each first potential motion end edge to obtain parallelism between the motion start edge and each first potential motion end edge; determining the target motion end edge based on the parallelism between the motion start edge and each first potential motion end edge.

3. The method of claim 2, wherein, The generation of the detection box for detecting the motion end edge corresponding to the second navigation grid based on the motion start edge in the first navigation grid comprises: obtaining the edge length of the motion start edge corresponding to the first navigation grid, and the minimum height difference, the maximum height difference, the minimum horizontal distance, and the maximum horizontal distance between the first navigation grid and the second navigation grid; generating the detection box for detecting the motion end edge corresponding to the second navigation grid based on the edge length, the minimum height difference, the maximum height difference, the minimum horizontal distance, and the maximum horizontal distance.

4. The method of claim 2, wherein, The determination of the target motion end edge based on the parallelism between the motion start edge and each first potential motion end edge comprises: screening, from the at least one first potential motion end edge, a second potential motion end edge with a parallelism lower than a parallelism threshold based on the parallelism between the motion start edge and each first potential motion end edge; determining the target motion end edge based on the second potential motion end edge.

5. The method of claim 4, wherein, When the number of the second potential motion end edges is multiple, the determination of the target motion end edge based on the second potential motion end edge comprises: performing distance overlap detection on each second potential motion end edge based on the motion start edge to obtain a distance overlap detection result; grouping multiple second potential motion end edges based on the distance overlap detection result to obtain at least one potential motion end edge group, wherein different second potential motion end edges in a same potential motion end edge group have distance overlap. screening a second potential motion end edge from the potential motion end edge group, the second potential motion end edge satisfying a height screening condition and a length screening condition, and determining the screened second potential motion end edge as the target motion end edge.

6. The method of claim 5, wherein, The distance overlap detection based on the motion start edge on each of the second potential motion end edges includes: obtaining a minimum distance and a maximum distance between the motion start edge and each of the second potential motion end edges; for two different second potential motion end edges, when the minimum distance and the maximum distance of each of the two different second potential motion end edges satisfy a distance overlap condition, obtaining a distance overlap detection result indicating that there is a distance overlap between the two different second potential motion end edges.

7. The method of claim 1, wherein, The target motion path spanning the space region is generated based on the motion start edge and the target motion end edge, including: cutting the motion start edge based on the target motion end edge to obtain a target motion start edge; sampling motion points based on a preset sampling step length on the target motion start edge and the target motion end edge to obtain at least one motion start point on the target motion start edge and a motion end point on the target motion end edge corresponding to the motion start point; determining a target motion path spanning the space region based on a candidate motion path between each pair of the motion start point and the motion end point.

8. The method of claim 7, wherein, The target motion path spanning the space region is determined based on a candidate motion path between each pair of the motion start point and the motion end point, including: for each pair of the motion start point and the motion end point, generating a candidate motion path connecting the motion start point and the motion end point and spanning the space region; performing channel detection on each of the candidate motion paths to obtain a channel detection result; determining a target motion path satisfying a channel detection condition in each of the candidate motion paths based on the channel detection result.

9. The method of claim 8, wherein, The candidate motion path connecting the motion start point and the motion end point and spanning the space region is generated, including: when the sampled motion points have offsets, determining a start point offset and an end point offset; adjusting the motion start point and the motion end point based on the start point offset and the end point offset to obtain an adjusted motion start point and an adjusted motion end point; generating a candidate motion path connecting the adjusted motion start point and the adjusted motion end point and spanning the space region.

10. The method of claim 8, wherein, The channel detection on each of the candidate motion paths to obtain a channel detection result includes: performing open height field detection on each of the candidate motion paths to obtain a first detection result; performing entity height field detection on each of the candidate motion paths to obtain a second detection result; determining a channel detection result based on the first detection result and the second detection result.

11. The method of claim 8, wherein, The channel detection result includes a curved surface highest point and a curved surface lowest point corresponding to each candidate motion path. The determination of a target motion path satisfying a channel detection condition in each of the candidate motion paths based on the channel detection result includes: When there is no obstacle in the region between the plane where the highest point of the curved surface is located and the plane where the lowest point of the curved surface is located, the corresponding candidate motion path is determined as a target motion path satisfying the passage detection condition.

12. The method of claim 8, wherein, The determining of the target motion path satisfying the passage detection condition from the candidate motion paths comprises: When there are multiple candidate motion paths satisfying the passage detection condition, multiple motion end points satisfying the passage detection condition are determined; When the number of continuously sampled motion end points in the multiple motion end points reaches a number threshold, a middle position of the continuously sampled motion end points is determined as a target motion end point; A target motion start point corresponding to the target motion start point on the motion start edge is determined, and a motion path connecting the target motion start point and the target motion end point and crossing the space region is determined as a target motion path satisfying the passage detection condition.

13. The method of claim 7, wherein, The determining of the target motion path crossing the space region based on the motion path between each pair of the motion start point and the motion end point comprises: For each pair of the motion start point and the motion end point, a candidate motion path connecting the motion start point and the motion end point and crossing the space region is generated; When there is a walkable path between the motion start point and the motion end point, distance comparison is performed on each candidate motion path and the walkable path; When the distance of each candidate motion path is less than the distance of the walkable path, the target motion path crossing the space region is determined based on each candidate motion path.

14. A device for processing motion paths in a virtual scene, characterized in that, The apparatus comprises: A determining module is configured to determine a first navigation mesh and a second navigation mesh that are not adjacent in a virtual scene, and a space region between the first navigation mesh and the second navigation mesh is not walkable; A detecting module is configured to detect a target motion end edge based on a motion start edge corresponding to the first navigation mesh, to obtain a target motion end edge; A generating module is configured to generate a target motion path crossing the space region based on the motion start edge and the target motion end edge. The target motion path is configured to control a virtual object to perform a target action along the target motion path to move from the first navigation mesh to the second navigation mesh when a motion control operation for the virtual object located in the first navigation mesh is received.

15. An electronic device, comprising: It comprises: A memory is configured to store computer executable instructions or computer programs; A processor is configured to execute the computer executable instructions or computer programs stored in the memory to implement the processing method of the motion path in the virtual scene according to any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, A computer executable instruction or a computer program is stored, and the computer executable instruction or the computer program is executed by a processor to implement the processing method of the motion path in the virtual scene according to any one of claims 1 to 13.

17. A computer program product comprising computer programs or computer executable instructions, characterized in that, The computer program or the computer executable instruction is executed by a processor to implement the processing method of the motion path in the virtual scene according to any one of claims 1 to 13.