A method for detecting a virtual scene and a related device
Patent Information
- Application Number
- CN202211312229.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-10-25
AI Technical Summary
[0004]然而,相关技术中的方法依赖于人工标记,自动化程度低,尤其当游戏地图发生变更时(如游戏版本更新使得游戏地图发生变更等),则需人工重新进行标记
[0025]另一方面,本申请实施例提供一种计算机程序产品,包括计算机程序,当其在计算机设备上运行时,使得所述计算机设备执行时实现前述任一方面所述的方法。
Smart Images

Figure CN116983641B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method and related apparatus for detecting virtual scenes. Background Technology
[0002] Path detection technology is a crucial foundational technology for the integration of mapping and artificial intelligence. For example, in the context of game maps, path detection technology can be used to control virtual objects to automatically detect themselves within the virtual environment provided by the game map. This automatic detection process can be considered an automatic exploration process of the virtual environment.
[0003] After the virtual object completes its automatic exploration of the virtual scene, the movement paths explored by the virtual object can be used for game performance testing, invisible wall testing, and other purposes. Related technologies primarily involve manually marking key points in the game map, and then generating movement paths based on these marked key points. This allows the virtual object to automatically explore along these paths. Specifically, after the virtual object spawns in the virtual scene provided by the game map, it can sequentially reach the pre-marked key points according to the movement path, thus performing automatic exploration.
[0004] However, the methods in the relevant technologies rely on manual marking, which has a low degree of automation. In particular, when the game map changes (such as when the game version is updated and the game map changes), manual remarking is required. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a method and related apparatus for detecting virtual scenes, which can reduce computational load and improve the efficiency of automatic detection.
[0006] The embodiments of this application disclose the following technical solutions:
[0007] On one hand, embodiments of this application provide a method for detecting virtual scenes, the method comprising:
[0008] During the process of detecting a virtual scene through virtual objects, when the movement path of the virtual object meets the update conditions, the position of the virtual object is obtained as the initial feasible point.
[0009] Based on the initial feasible points, a ray detection operation is performed to obtain m feasible points; m is a positive integer.
[0010] The m feasible points are filtered to obtain n feasible points; n is a positive integer less than m;
[0011] Based on each of the n feasible points, i sets of feasible points are determined by iterating the ray detection operation i times; where i is a positive integer.
[0012] For the i sets of feasible points, the target movement path starting from the initial feasible point is determined by iterating i times backtracking.
[0013] The virtual object is controlled to detect the virtual scene according to the target movement path.
[0014] In another aspect, embodiments of this application provide a virtual scene detection device, the device comprising an acquisition unit, a detection unit, a filtering unit, a determination unit, and a control unit:
[0015] The acquisition unit is used to acquire the position of the virtual object as an initial feasible point when the movement path of the virtual object meets the update condition during the process of detecting the virtual scene through the virtual object;
[0016] The detection unit is used to perform ray detection based on the initial feasible point to obtain m feasible points; m is a positive integer.
[0017] The filtering unit is used to filter the m feasible points to obtain n feasible points; n is a positive integer less than m.
[0018] The detection unit is further configured to determine i sets of feasible points based on each of the n feasible points by iterating the ray detection operation i times; where i is a positive integer.
[0019] The determining unit is used to determine the target movement path starting from the initial feasible point by iterating i backtracking operations on the i sets of feasible points.
[0020] The control unit is used to control the virtual object to detect the virtual scene according to the target movement path.
[0021] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory:
[0022] The memory is used to store computer programs and to transfer the computer programs to the processor;
[0023] The processor is configured to execute the method described in any of the foregoing aspects according to instructions in the computer program.
[0024] On the other hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for performing the methods described in any of the foregoing aspects.
[0025] On the other hand, embodiments of this application provide a computer program product, including a computer program that, when run on a computer device, causes the computer device to execute the method described in any of the foregoing aspects.
[0026] As can be seen from the above technical solution, in the process of detecting a virtual scene using virtual objects, when the movement path of the virtual object meets the update conditions, the position of the virtual object is first obtained as the initial feasible point. Based on the initial feasible point, a ray detection operation is performed to determine m feasible points. These m feasible points represent all feasible points near the initial feasible point. Then, the m feasible points are filtered to obtain n feasible points. That is, some feasible points are selected from all feasible points near the initial feasible point to represent the feasible points near the initial feasible point. Thus, only i iterations of ray detection operation are needed for the n feasible points to determine i sets of feasible points, thereby reducing the computational load. Finally, the target movement path starting from the initial feasible point is determined by iterating i backtracking operations on the i sets of feasible points. Once the target movement path is determined, it indicates that the movement path of the virtual object has been updated, and the virtual object can be controlled to continue detecting the virtual scene according to the target movement path. Based on this, virtual objects can be automatically detected in virtual scenes without manual marking, improving the level of automation. Furthermore, during the detection process, once the movement path of a virtual object meets the update conditions, the planning process of the target movement path can be triggered. It can be seen that the embodiments of this application provide a dynamic automatic detection, which can improve the efficiency of automatic detection. At the same time, limiting the number of feasible points in multiple iterations of ray detection operations can reduce the amount of computation and improve the efficiency of automatic detection. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A schematic diagram of a game scene for a battle game provided in an embodiment of this application;
[0029] Figure 2 A schematic diagram illustrating an application scenario of a virtual scene detection method provided in this application embodiment;
[0030] Figure 3 A flowchart illustrating a virtual scene detection method provided in this application embodiment;
[0031] Figure 4a A schematic diagram of a radiographic detection operation provided in an embodiment of this application;
[0032] Figure 4b This application provides a schematic diagram of the direction of emitted detection rays in an embodiment.
[0033] Figure 5a A schematic diagram of path sampling provided for an embodiment of this application;
[0034] Figure 5b A schematic diagram illustrating a method for calculating the shortest distance, as provided in an embodiment of this application;
[0035] Figure 6 A schematic diagram comparing the number of location points for path sampling provided in this application embodiment;
[0036] Figure 7 A schematic diagram illustrating an iterative ray detection operation performed i times, provided in an embodiment of this application;
[0037] Figure 8 A schematic diagram comparing a radiographic detection method provided in this application embodiment with a traditional radiographic detection method;
[0038] Figure 9 This application provides a schematic diagram of an i-th iteration backtracking operation process.
[0039] Figure 10 A structural diagram of a virtual scene detection device provided in an embodiment of this application;
[0040] Figure 11 A structural diagram of a terminal device provided in an embodiment of this application;
[0041] Figure 12 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation
[0042] The embodiments of this application will now be described with reference to the accompanying drawings.
[0043] In the process of detecting virtual scenes using virtual objects, movement paths can be planned to control the virtual objects to move according to those paths, thus completing the automatic detection of the virtual scene. Virtual objects refer to virtualized objects with a certain form; they can move within the virtual scene and interact with scene elements. In practical applications, a virtual scene can be represented as a map, such as a game map or a navigation map. Correspondingly, the process of detecting a virtual scene using virtual objects can be considered as an exploration of a map.
[0044] Taking a game map as an example of a virtual scene, virtual objects can be virtualized objects corresponding to game players after they log into the game; in this case, virtual objects can also be called virtual characters. Before the game is officially launched or after a game version update, virtual objects can be controlled to detect the game map and complete its exploration. After completing the exploration, the game's performance can also be tested. As another example, taking a navigation map as a virtual scene, the navigation map can be provided by a navigation system. After a user logs into the navigation system, virtual objects can be created within the system. The movement of these virtual objects on the navigation map can simulate the user's movement on a real map; that is, by planning the movement paths of virtual objects on the navigation map, a driving route can be provided to the user.
[0045] To make it easier to understand, let's take a fighting game as an example. Fighting games are a type of game with higher playability and fun. Correspondingly, the game map of a fighting game can be considered a virtual scene. (For examples of fighting game maps, see...) Figure 1 As shown, it should be noted that Figure 1 This is not an example of all game maps in a multiplayer game, but rather a selection of them. A game map, also known as a game world or scene map, refers to a specific virtual environment provided to virtual objects within a game. A game map typically includes elements such as roads, buildings, obstacles, rivers, mountains, trees, and bushes. Furthermore, game maps can contain game missions, which are purposefully designed to guide players through game activities, such as defusing bombs or eliminating opponents. Game maps can also include resources, such as items to collect in-game, including offensive tools, ammunition, bandages, and body armor.
[0046] Generally, game map testing can be used to perform various functional tests such as game performance testing, invisible wall detection, and aerial combat testing. Related technologies require manual marking of key points on the entire game map to generate virtual objects with automatically detected movement paths. However, relying entirely on manual setting of virtual object movement paths results in low automation. For example, manually marking all game maps requires personnel with extensive map knowledge, leading to a significant workload. Furthermore, if the game map changes (e.g., due to game version updates), manual remarking is necessary, consuming substantial marking time and maintenance costs.
[0047] Based on this, this application provides a method and related apparatus for detecting virtual scenes. In the process of detecting virtual scenes through virtual objects, once the movement path of the virtual object meets the update conditions, the position of the virtual object is obtained as the initial feasible point. The target movement path is determined by iterating multiple ray detection operations, thereby controlling the virtual object to detect the virtual scene according to the target movement path. Based on this, the automatic detection of virtual scenes by virtual objects can be achieved without manual marking, thus improving the degree of automation.
[0048] The virtual scene detection method provided in this application can be implemented using a computer device, which can be a terminal device or a server. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Terminal devices include, but are not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, and in-vehicle terminals. Terminal devices and servers can be directly or indirectly connected via wired or wireless communication, which is not limited herein. This invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0049] This application can be applied to the field of artificial intelligence (AI). AI is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0050] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, smart customer service, vehicle networking, and intelligent transportation. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.
[0051] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.
[0052] This application primarily relates to machine learning and computer vision technologies. Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory, among others. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.
[0053] Computer vision (CV) is a science that studies how to enable machines to "see." More specifically, it refers to machine vision, which uses cameras and computers to replace human eyes in recognizing and measuring targets, and then performs image processing to create images more suitable for human observation or transmission to instruments. As a scientific discipline, computer vision studies related theories and technologies, attempting to build artificial intelligence systems capable of extracting information from images or multidimensional data. Computer vision technologies typically include image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, 3D object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), autonomous driving, intelligent transportation, and common biometric recognition technologies such as facial recognition and fingerprint recognition.
[0054] See Figure 2 This is a schematic diagram illustrating an application scenario of the virtual scene detection method provided in the embodiments of this application. Figure 2 In the scenario shown, terminal device 200 is used as an example of the aforementioned computer device for illustration:
[0055] The terminal device 200 can run an application (APP) that provides virtual scenes, such as a game application or a navigation application. For ease of understanding, let's take a game application as an example. For instance, if a battle game APP runs on the terminal device 200, in practical application, one can log in to the battle game APP through the terminal device 200. The game map of the game can serve as a virtual scene. After logging in with the game account, one can control the virtual object corresponding to that account to detect it. For example, the battle game could be a large-scale open-world game. During the detection of the virtual scene through the virtual object, when the movement path of the virtual object meets the update conditions, it can be considered that the virtual object can no longer continue to detect the virtual scene based on the current movement path. For example, if it encounters an obstacle and gets stuck while moving according to the movement path, the movement path update mechanism can be triggered to plan a new movement path for the virtual object. Specifically:
[0056] We can first obtain the location of the virtual object as the initial feasible point, and then use ray detection to detect the virtual scene near the initial feasible point to determine the feasible points near the initial feasible point. A feasible point can refer to a position point in the virtual scene that the virtual object can reach. In other words, ray detection is performed based on the initial feasible point to determine m feasible points. The m feasible points are used to represent all feasible points near the initial feasible point.
[0057] Because raycasting has a limited detection range, it can only capture feasible points within a small radius of the initial feasible point. To determine a larger range of feasible points near the initial feasible point and thus better control virtual objects for automatic detection of the virtual scene, iterative raycasting can be performed on these smaller feasible points to identify feasible points within that larger radius. However, since m feasible points represent all feasible points, performing iterative raycasting on all m points results in a large computational load and high performance overhead. Consequently, completing all raycasting takes a considerable amount of time. This is especially problematic for games with large map areas, such as open-world games. If iterative raycasting based on m feasible points is used to plan new paths for virtual objects, it can lead to difficulties in quickly planning new movement paths and low automatic detection efficiency. To quickly identify feasible points within a larger range near the initial feasible point and plan new movement paths, thereby improving automatic detection efficiency, m feasible points can be filtered to obtain n feasible points. That is, a subset of feasible points are selected from all feasible points within a small range near the initial feasible point to represent feasible points within that small range. Then, only i iterations of ray detection operation are needed for the n feasible points to determine i sets of feasible points. This reduces the computational load in the ray detection process, allows for faster identification of feasible points within a larger range near the initial feasible point, and improves automatic detection efficiency.
[0058] Since the i sets of feasible points are generated through i iterations of raycasting, each set of feasible points can represent feasible points within different ranges near the initial feasible point. Therefore, the target movement path can be determined by iterating i backtracking operations on the i sets of feasible points, starting from the initial feasible point. The target movement path is used to identify feasible areas in the virtual scene near the initial feasible point. Once the target movement path is determined, it indicates that the movement path of the virtual object has been updated, and the virtual object can then be controlled to continue detecting the virtual scene according to the target movement path.
[0059] Based on this, virtual objects can be automatically detected in virtual scenes without manual marking, improving the level of automation. Furthermore, during the detection process, once the movement path of a virtual object meets the update conditions, the planning process of the target movement path can be triggered. It can be seen that the embodiments of this application provide a dynamic automatic detection, which can improve the efficiency of automatic detection. At the same time, limiting the number of feasible points in multiple iterations of ray detection operations can reduce the amount of computation and improve the efficiency of automatic detection.
[0060] Figure 3 A flowchart illustrating a virtual scene detection method provided in this application embodiment, using a terminal device as an example of the aforementioned computer device, the method includes S301-S306:
[0061] S301: During the process of detecting a virtual scene through virtual objects, when the movement path of a virtual object meets the update conditions, the position of the virtual object is obtained as the initial feasible point.
[0062] In this context, a virtual scene can refer to a virtual environment constructed for the activities of virtual objects. Taking a game as an example, a virtual scene can be a virtual environment that recreates scene elements such as buildings, trees, sky, and roads in the game according to the requirements of the project. In game planning, the game map is a virtual environment that includes various scene elements in the game. Correspondingly, the game map can be considered a virtual scene. It can be understood that as the game map changes, the virtual scene can also change, and the scene elements within it can be different. A virtual object can refer to a character constructed according to the project requirements in the game. This application does not impose any restrictions on the form of the virtual object; for example, a virtual object can be a character in human form. In practical applications, players can log into the game through a terminal device using a game account. After logging in, the virtual object corresponding to that game account will be born in the virtual scene of the game, and then the virtual object can be controlled to detect the virtual scene.
[0063] During the detection of a virtual scene using virtual objects, when the virtual object's movement path meets the update conditions, it indicates that the virtual object can no longer continue detecting the virtual scene based on its current movement path. At this point, a movement path update mechanism can be triggered to obtain the virtual object's current position as an initial feasible point, allowing for the planning of a new movement path for the virtual object. The update conditions are used to determine whether the virtual object's movement path can instruct it to continue detecting the virtual scene. The specific conditions can vary depending on the actual situation, and this application does not impose any limitations on them. For example, if the virtual object gets stuck during detection, or if it has just spawned in the virtual scene after logging into the game, or if it reaches the end of a movement path, it indicates that the virtual object cannot continue detecting the virtual scene. In this case, the movement path update mechanism can be triggered to obtain the virtual object's current position as an initial feasible point, allowing for the planning of a new movement path for the virtual object. Based on this, once the virtual object's movement path meets the update conditions during detection, the movement path update mechanism can be triggered, thus providing a dynamic automatic detection mechanism that improves the efficiency of automatic detection.
[0064] Based on this dynamic automatic detection method, only a portion of the feasible areas in the virtual scene needs to be detected each time, until the entire virtual scene is detected. During each detection process, only the virtual scene corresponding to the feasible area being detected needs to be loaded, instead of loading the entire virtual scene, thereby reducing performance overhead. Compared to related technologies that require constructing all feasible areas in the game map based on 3D skeleton lines before detection, this dynamic automatic detection method has significant advantages for games with large and complex map areas. For example, for large-scale open-world games, dynamic automatic detection can reduce performance overhead and effectively avoid problems such as long loading times, high memory consumption, and frequent crashes.
[0065] S302: Based on the initial feasible points, perform ray detection to obtain m feasible points.
[0066] Ray detection can be performed based on an initial feasible point to detect the virtual scene near the initial feasible point and determine feasible points in the vicinity. Ray detection involves emitting a detection ray from a detection point in a specific direction, using the collision information returned by the ray to complete the detection of the virtual scene, and determining feasible points based on the returned collision information. A feasible point can be a position point in the virtual scene that a virtual object can reach. Based on this, m feasible points near the initial feasible point can be determined first, where m is a positive integer, and these m feasible points represent all feasible points near the initial feasible point.
[0067] Generally, in a game's virtual scene, virtual objects can be controlled to jump over obstacles (such as low walls or boxes). Therefore, in one possible implementation, a ray detection point can be obtained by moving a preset height upwards from an initial feasible point. A detection ray is then emitted from this point to detect the virtual scene near the initial feasible point. If the endpoint of the detection ray does not collide with any objects in the virtual scene, and there is a landing point below the endpoint for the virtual object, this landing point can be considered a feasible point, resulting in m feasible points. The preset height is less than or equal to the virtual object's jump height, which refers to the maximum jump height set for the virtual object during game planning. Based on this, the ray detection point has a preset height relative to the virtual object's location, thus avoiding interference from obstacles that can be jumped over near the virtual object's location.
[0068] See also Figure 4aThis illustrates the process of performing ray detection after moving upwards by a preset height from an initial feasible point. It should be noted that the diagram is merely an example and does not limit the direction of the emitted detection rays. In one possible implementation, to achieve omnidirectional detection, rays can be emitted from the ray detection point in eight directions: east, southeast, south, southwest, west, northwest, north, and northeast. (See [reference needed]). Figure 4b This enables comprehensive detection, and the identified feasible points more fully reflect the situation of feasible points near the initial feasible point. It is understood that the detection ray has a certain detection distance, which can be set according to actual detection needs; this application does not impose any limitations on this. For example, the detection distance can be set based on the jump height of the virtual object, setting it to 1.5 times the jump height.
[0069] As one possible implementation, detection rays can be emitted using capsule-based ray detection, where the size of the capsule can be set according to the jump height of the virtual object in order to detect real feasible points.
[0070] S303: Filter m feasible points to obtain n feasible points.
[0071] The m feasible points obtained through ray detection are used to represent feasible points within a small range near the initial feasible point. In order to determine feasible points within a larger range near the initial feasible point, so as to better control the virtual object to detect the virtual scene, the feasible points within a larger range near the initial feasible point can be determined by iterating the ray detection operation multiple times using the m feasible points.
[0072] To reduce the computational cost of multiple raycasting operations and more quickly identify feasible points within a larger range near the initial feasible point, we can filter out m feasible points to obtain n feasible points. In other words, we select a subset of feasible points from all available points to represent feasible points within a small range near the initial feasible point. Subsequent raycasting operations only need to be performed on the selected n feasible points, thus reducing computational complexity. Here, n is a positive integer less than m.
[0073] In one possible implementation, S303 can be specifically implemented as follows: when m is greater than a preset number, n feasible points are selected from m feasible points, thereby reducing the computational load; while when m is less than or equal to the preset number, since the number of m is small, in order to ensure the reliability of the detection results of multiple iterations of ray detection operations, all m feasible points can be selected for subsequent ray detection operations, thereby completing the detection of feasible points near the initial feasible point and ensuring the reliability of the detection results. This application does not impose any limitations on the setting of the preset number; for example, the preset number can be set to 10.
[0074] Automatic detection of virtual scenes is based on movement paths, and the automatic detection provided in this application is a dynamic automatic detection. Specifically, it can plan a movement path at a time, which can identify a portion of feasible areas in the virtual scene. Controlling virtual objects to move according to the movement path can complete the detection of this portion of feasible areas. Based on this, in the dynamic automatic detection method, only a portion of feasible areas can be detected each time until the entire virtual scene has been detected.
[0075] Understandably, if a virtual object takes too long to navigate a local area, it will affect the efficiency of automatic detection of the entire virtual scene. To avoid this, when planning a new movement path for a virtual object, historical paths should be avoided as much as possible. This prevents the feasible area identified by the new movement path from overlapping with the feasible area identified by the historical path. The historical path refers to the path taken by the virtual object from its spawn point to its current position in the virtual scene. The historical path identifies the feasible area in the virtual scene that the virtual object has already detected.
[0076] In practical implementation, we can first obtain the historical paths corresponding to the initial feasible points, and then calculate the shortest distances between each of the m feasible points and the historical paths. These shortest distances reflect the positional relationship between the m feasible points and the historical paths. Therefore, we can filter the m feasible points based on these shortest distances to obtain n feasible points. Thus, the n feasible points are obtained by filtering the m feasible points based on the shortest distances between them and the historical paths. The historical paths are considered during the filtering process to ensure that new movement paths avoid historical paths as much as possible, preventing virtual objects from spending too much time in local areas and improving the efficiency of automatic detection.
[0077] It should be noted that the method for selecting n feasible points from m feasible points based on the shortest distance between them can be chosen according to actual needs, and this application does not impose any restrictions on it. For ease of understanding, this application provides the following example:
[0078] Since the shortest distances corresponding to the m feasible points can reflect the positional relationship between the m feasible points and the historical path, and the larger the shortest distance, the farther the feasible point is from the initial feasible point, in one possible implementation, the shortest distances corresponding to the m feasible points can be sorted in descending order, and the top n feasible points can be selected as the n feasible points. Based on this selection, the n feasible points are the more advanced feasible points among the m feasible points. Therefore, planning the subsequent target movement path based on the more advanced n feasible points can make it easier for the virtual object to leave its current position, thus making it less likely to spend too much time in the local area of its current position.
[0079] The historical path is the path a virtual object takes in a virtual scene from its spawn point to its current location. During this journey, the virtual object passes through countless points in the virtual scene; that is, the historical path includes countless points. To reduce computational complexity, one possible implementation involves sampling the historical path to obtain t points, where t is a positive integer. See [link to relevant documentation]. Figure 5a The example illustrates a historical path, from which t location points are obtained through path sampling (taking t=14 as an example). Furthermore, for each of the m feasible points, the distances between it and the t location points are calculated, resulting in t distances. The minimum of these t distances is taken as the shortest distance to the feasible point. (See [link to example]). Figure 5b This paper demonstrates a method for calculating the shortest distance by calculating the distances between feasible points and t locations along historical paths to determine the shortest distance. Based on this, the computational load can be reduced, thereby improving the efficiency of automatic detection.
[0080] This application does not impose any restrictions on the method of path sampling. For example, as a possible implementation, historical paths can be sampled using time-series sampling.
[0081] By using path sampling to filter out a small number of locations along historical paths, not only can computational costs be reduced, but the virtual object can also avoid getting trapped in local optima and moving only within a small area. This is especially true for spiral-shaped historical paths, and a smaller number of sampled locations is more conducive to detecting new feasible regions. See details in [link to relevant documentation]. Figure 6 When there are many sampling points along the path, it is easy to get stuck in a dead loop in a local area and be unable to detect new feasible areas. Reducing the number of sampling points along the path will bring more detection possibilities and make it easier to detect new feasible areas.
[0082] S304: Based on each of the n feasible points, determine i sets of feasible points by iterating through i ray detection operations.
[0083] As mentioned earlier, n feasible points can reflect the feasible point situation within a small range near the initial feasible point. Therefore, after determining n feasible points, i sets of feasible points can be determined based on each of the n feasible points by iterating through i ray detection operations, where i is a positive integer. Since the i sets of feasible points are generated by iterating through i ray detection operations, each set of feasible points in the i sets can represent feasible points within different ranges near the initial feasible point. This application does not impose any restrictions on the setting of the iteration number i. For example, based on detection experience, i can be set according to the size of the map in the virtual scene corresponding to a detectable feasible region in one iteration. After i iterations, the i-th set of feasible points can represent the boundary of the feasible region detected in the next iteration, starting from the initial feasible point. For example, in the detection process of a large-scale game, i can be set to 60 according to the size of the game map corresponding to a detectable feasible region in one iteration. Here, a detectable feasible region in one iteration can be a part of the feasible region in the virtual scene. Based on this, movement paths corresponding to a portion of feasible areas can be planned at once, and virtual objects can be controlled to detect a portion of feasible areas accordingly. During the detection process, once the movement path of the virtual object meets the update conditions, the next path planning can be performed, thus providing a dynamic automatic detection method. Under the dynamic automatic detection method, only a portion of feasible areas can be detected each time until the entire virtual scene has been detected.
[0084] Specifically, a first ray detection operation can be performed based on each of the n feasible points to obtain multiple feasible points. Then, these multiple feasible points are filtered to obtain a first group of feasible points. A j-th ray detection operation is then performed based on each feasible point in the (j-1)-th group to obtain multiple feasible points. Finally, these multiple feasible points from the j-th ray detection operation are filtered to obtain a j-th group of feasible points, where j is a positive integer greater than 1 and less than or equal to i. It is evident that by filtering the multiple feasible points obtained from each ray detection operation and then performing the next ray detection operation based on the filtered feasible points, the computational load can be reduced.
[0085] See also Figure 7 The diagram illustrates the process of iterating through i ray detection operations. The first ray detection operation is performed on each of the n feasible points, resulting in a total of m1 feasible points. These m1 points are then filtered to obtain the first group of feasible points (n1 points). A second ray detection operation is performed on each of the first group of feasible points, resulting in a total of m2 feasible points. This process is repeated until the (i-1)th group of feasible points is used for the i-th ray detection operation, resulting in a total of m... i There are 1 feasible points, which are then filtered to obtain n. iThe i-th feasible point is selected as the i-th feasible point. Based on this, the i-th feasible point is obtained by iterating through the ray detection operation i times.
[0086] Meanwhile, compared to traditional ray detection methods, limiting the number of feasible points in multiple iterations of ray detection allows for faster identification of new feasible regions. Because feasible points obtained from each iteration are filtered during the iteration process, and the next ray detection operation is based on these filtered points, multiple ray detection operations in local areas are avoided. This allows for a greater detection distance in a single path planning iteration, resulting in higher efficiency for automatic detection. See also Figure 8 As shown, traditional ray detection methods are prone to getting stuck in local areas during multiple iterations of ray detection operations. However, the ray detection operation provided in this application, which limits the number of feasible points, makes it easier to find new feasible areas during multiple iterations of ray detection operations. At the same time, limiting the number of feasible points also allows multiple iterations of ray detection operations to be performed in a certain detection direction, thereby increasing the distance that can be detected by multiple iterations of ray detection operations in a single path planning, and thus improving the efficiency of automatic detection.
[0087] S305: For i sets of feasible points, determine the target movement path starting from the initial feasible point by iterating i backtracking operations.
[0088] After determining i sets of feasible points through i iterations of raycasting, the target movement path, starting from the initial feasible point, can be determined through i iterations of backtracking operations. This target movement path is the new movement path determined by this path planning, allowing the virtual object to continue detecting the virtual scene. The target movement path can identify the feasible region for the next detection, specifically a portion of the feasible region in the virtual scene starting from the initial feasible point.
[0089] Since the i-th group of feasible points is generated by i iterations of ray detection, any feasible point in the j-th group must be generated by a feasible point in the (j-1)-th group. That is, the (j-1)-th group contains the parent node of every feasible point in the j-th group. Therefore, there is a parent-child relationship between adjacent groups of feasible points in the i-th group. Thus, during the i-th iterations of backtracking, this parent-child relationship can be relied upon to determine the target movement path. Specifically:
[0090] First, we can obtain the adjacency relationships of the i groups of feasible points. The adjacency relationships are used to identify the parent-child relationship between two adjacent groups of feasible points in the i groups. Since the feasible point obtained from the last ray detection operation of the i-th group of feasible points is a feasible point, and during the i-th iteration of ray detection operations, it can be assumed that as the number of iterations increases, the corresponding feasible point is farther away from the initial feasible point. Therefore, we can select a feasible point in the i-th group of feasible points as the endpoint of the target movement path. In specific implementation, since the larger the shortest distance between the feasible point and the historical path, the more advanced the feasible point is, we can select the feasible point in the i-th group of feasible points with the largest shortest distance to the historical path as the endpoint of the target movement path.
[0091] Then, starting from the endpoint, based on adjacency relationships, i backtracking operations are performed on i groups of feasible points to obtain i target location points. These target location points are used to generate the target movement path. Specifically, the backtracking operation can include: based on adjacency relationships, obtaining the parent node of the target location point corresponding to the k-th feasible point from the (k-1)-th feasible point group, where k is a positive integer less than i. When k = i-1, the k-th feasible point group is the (i-1)-th feasible point group, and the target location point corresponding to the k-th feasible point group is the parent node of the endpoint. When k = 1, the k-th feasible point group is the 1st feasible point group, and the 1st feasible point group is generated based on n feasible points; therefore, the (k-1)-th feasible point group at this time consists of n feasible points.
[0092] To better understand the process of iterating backtracking i times, please refer to [link to relevant documentation]. Figure 9 First, the feasible point with the largest shortest distance among the feasible points in the i-th group is selected as the endpoint. Then, the first backtracking operation begins from the endpoint. Based on adjacency relationships, the parent node of the endpoint is selected from the (i-1)-th feasible points as the first target location. Similarly, based on the (i-1)-th backtracking operation, the parent node of the (i-2)-th target location is selected from the first feasible points as the (i-1)-th target location. Finally, based on the i-th backtracking operation, the parent node of the (i-1)-th target location is selected from the n feasible points as the i-th target location. Finally, the path from the initial feasible point, passing through i target locations sequentially, to the endpoint is the target movement path.
[0093] S306: Control the virtual object to detect the virtual scene based on the target movement path.
[0094] Once the target movement path is determined, it indicates that the virtual object's movement path has been updated. At this point, the virtual object can be controlled to continue detecting the virtual scene based on the target movement path. Based on this, automatic detection of the virtual scene is achieved. Once the virtual object's movement path meets the update conditions, the target movement path planning process can be triggered, and the virtual object can be controlled to detect the virtual scene based on the target movement path. It can be seen that the embodiments of this application provide a dynamic automatic detection method, which can improve the efficiency of automatic detection.
[0095] Specifically, virtual objects can be controlled to move along a target path. During this movement, the virtual object's orientation is controlled to point from its current location towards the target point, which is the closest point on the target path to the virtual object. Therefore, as the virtual object moves along the target path, its orientation changes with the direction it points towards the target point, always maintaining its direction towards the destination. It's understandable that when the virtual object's orientation changes, its field of view changes, requiring different scene elements to be loaded. Thus, changing the virtual object's orientation allows for updating scene elements in the virtual scene; for example, only scene elements in front of the virtual object can be loaded at a time, updating accordingly as the virtual object moves. To optimize the change in field of view, the orientation can be gradually changed as the virtual object moves from its current location towards the target point, such as changing the viewpoint by 2 degrees per frame. This optimizes the change in field of view, making the performance more human-like.
[0096] This application does not impose any limitations on how to control the virtual object to detect the virtual scene according to the target movement path. One possible implementation is to call the virtual scene's movement function through an interface, and then control the virtual object to detect the virtual scene according to the target movement path based on this function. For example, the movement function can be used to control the virtual object to start from an initial feasible point, move along the target movement path, sequentially reach each target location point on the target movement path, and finally reach the destination.
[0097] During the process of controlling a virtual object to move along a target movement path, if the virtual object gets stuck or reaches the end of the target movement path, the movement path is considered to meet the update conditions, triggering an update of the movement path in order to plan a new target movement path. It should be noted that this application does not limit the type of getting stuck. For example, taking a game map as a virtual scene, it could be when the virtual object encounters an invisible wall or other obstacle, or it could be due to a misoperation while controlling the virtual object.
[0098] Based on this dynamic automatic detection method, a target movement path is planned each time. This target path can identify a portion of the feasible area in the virtual scene starting from the initial feasible point. Therefore, only the virtual scene corresponding to this portion of the feasible area needs to be loaded each time, which can reduce performance overhead. The feasible area is detected according to the target movement path until the entire virtual scene is detected. To this end, this application embodiment also provides a mechanism for determining whether the entire virtual scene has been detected. Specifically, the target movement path can be used as a pending movement path. The shortest distance between the endpoint of the pending movement path and the historical path corresponding to the initial feasible point is obtained. Then, the shortest distance is compared with a preset distance. If the shortest distance is less than the preset distance, it can be considered that the pending movement path is still near the historical path, indicating that no new feasible area has been found in this planning. At this time, the step of obtaining the location of the virtual object as the initial feasible point can be re-executed to determine a new target movement path as the pending movement path. If the number of times the shortest distance is less than the preset distance reaches the preset number, that is, if the target movement paths planned for the preset number of times from the initial feasible point are all near the historical paths, then the detection of the entire virtual scene can be considered complete, and the detection can be stopped, controlling the virtual object to exit the detection of the virtual scene. It should be noted that this application does not impose any restrictions on the setting method of the preset distance; for example, the preset distance can be set according to the detection distance of the raycasting operation, specifically, the preset distance can be set to 5 times the detection distance. Similarly, this application does not impose any restrictions on the setting of the preset number of times; for example, the preset number of times can be set to 5.
[0099] After completing the detection of the entire virtual scene, the actual movement path of the virtual objects during the detection process can be recorded as the actual detection path, so that the actual detection path can be used for related tests in the future.
[0100] For example, taking the game map as a virtual scene, subsequent performance tests, invisible wall detection, and floating tests can be performed by replaying the game based on the actual detection path.
[0101] For example, taking a navigation map as a virtual scene, a driving route can be recommended to the user based on the real-world detection path. The starting point of the route can be the location of a virtual object (simulating the user's current location), and the ending point can be any point on the real-world detection path (simulating a location the user can reach on the real map). In practical applications, the ending point can be chosen by the user based on the real-world detection path. Of course, when a user wants to randomly explore an area on the real map, the virtual scene detection method provided in this application can be used to dynamically plan a random route for the user. The starting point of the random route can be the location of a virtual object (simulating the user's current location), and the ending point can be any feasible point within an area on the navigation map (simulating a location the user can reach on the real map). Thus, the user can explore this area on the real map based on the random route. The random route is more random than the driving route provided by the navigation map, which can increase the user's enjoyment when exploring areas on the real map. For example, during a user's hike, the above process can be used to dynamically plan a random route for the user.
[0102] As can be seen from the above technical solution, in the process of detecting a virtual scene using virtual objects, when the movement path of the virtual object meets the update conditions, the position of the virtual object is first obtained as the initial feasible point. Based on the initial feasible point, a ray detection operation is performed to determine m feasible points. These m feasible points represent all feasible points near the initial feasible point. Then, the m feasible points are filtered to obtain n feasible points. That is, some feasible points are selected from all feasible points near the initial feasible point to represent the feasible points near the initial feasible point. Thus, only i iterations of ray detection operation are needed for the n feasible points to determine i sets of feasible points, thereby reducing the computational load. Finally, the target movement path starting from the initial feasible point is determined by iterating i backtracking operations on the i sets of feasible points. Once the target movement path is determined, it indicates that the movement path of the virtual object has been updated, and the virtual object can be controlled to continue detecting the virtual scene according to the target movement path. Based on this, virtual objects can be automatically detected in virtual scenes without manual marking, improving the level of automation. Furthermore, during the detection process, once the movement path of a virtual object meets the update conditions, the planning process of the target movement path can be triggered. It can be seen that the embodiments of this application provide a dynamic automatic detection, which can improve the efficiency of automatic detection. At the same time, limiting the number of feasible points in multiple iterations of ray detection operations can reduce the amount of computation and improve the efficiency of automatic detection.
[0103] It should be noted that, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.
[0104] based on Figure 3Corresponding to the virtual scene detection method provided in the embodiments, this application also provides a virtual scene detection device 1000, the structural diagram of which is shown below. Figure 10 As shown, the device includes an acquisition unit 1001, a detection unit 1002, a screening unit 1003, a determination unit 1004, and a control unit 1005.
[0105] The acquisition unit 1001 is used to acquire the position of the virtual object as an initial feasible point when the movement path of the virtual object meets the update condition during the process of detecting the virtual scene through the virtual object.
[0106] The detection unit 1002 is used to perform ray detection based on the initial feasible points to obtain m feasible points; m is a positive integer.
[0107] The filtering unit 1003 is used to filter the m feasible points to obtain n feasible points; n is a positive integer less than m.
[0108] The detection unit 1002 is further configured to determine i sets of feasible points based on each of the n feasible points by iterating the ray detection operation i times; where i is a positive integer.
[0109] The determining unit 1004 is used to determine the target movement path starting from the initial feasible point by iterating i backtracking operations on the i groups of feasible points.
[0110] The control unit 1005 is used to control the virtual object to detect the virtual scene according to the target movement path.
[0111] In one possible implementation, the filtering unit is further configured to:
[0112] Obtain the historical path corresponding to the initial feasible point;
[0113] Calculate the shortest distance between each of the m feasible points and the historical path to obtain the shortest distances corresponding to the m feasible points;
[0114] Based on the shortest distances corresponding to the m feasible points, the m feasible points are filtered to obtain the n feasible points.
[0115] In one possible implementation, the filtering unit is further configured to:
[0116] The historical path is sampled to obtain t location points; t is a positive integer;
[0117] For each of the m feasible points, calculate the distance between the feasible point and the t location points to obtain t distances;
[0118] The minimum value among the t distances is taken as the shortest distance corresponding to the feasible point.
[0119] In one possible implementation, the filtering unit is further configured to:
[0120] Sort the shortest distances corresponding to the m feasible points in descending order;
[0121] The top n feasible points are selected as the n feasible points.
[0122] In one possible implementation, the detection unit is further configured to:
[0123] Based on the initial feasible point, move upward by a preset height to obtain the ray detection point; the preset height is less than or equal to the jump height of the virtual object.
[0124] Detection rays are emitted from the ray detection point;
[0125] If the endpoint of the detection ray does not collide with an object in the virtual scene, and there is a landing point below the endpoint for the virtual object to land, the landing point is taken as a feasible point, and the m feasible points are obtained.
[0126] In one possible implementation, the detection unit is further configured to:
[0127] The first ray detection operation is performed based on each of the n feasible points to obtain multiple feasible points;
[0128] The first set of feasible points is obtained by filtering the multiple feasible points obtained from the first ray detection operation;
[0129] Multiple feasible points are obtained by performing the j-th ray detection operation on each feasible point in the j-1 group of feasible points;
[0130] The j-th feasible point is obtained by filtering the multiple feasible points obtained from the j-th ray detection operation; j is a positive integer greater than 1 and less than or equal to i.
[0131] In one possible implementation, the determining unit is further configured to:
[0132] Obtain the adjacency relationship of the i groups of feasible points; the adjacency relationship is used to identify the parent-child relationship between two adjacent groups of feasible points in the i groups of feasible points;
[0133] The feasible point with the largest shortest distance from the historical path corresponding to the initial feasible point in the i-th group of feasible points is taken as the endpoint of the target movement path;
[0134] Based on the adjacency relationship, the i groups of feasible points are iteratively backtracked i times to obtain i target location points; the backtracking operation includes: based on the adjacency relationship, obtaining the parent node of the target location point corresponding to the kth group of feasible points from the (k-1)th group of feasible points, as the target location point corresponding to the (k-1)th group of feasible points; when k = i-1, the target location point corresponding to the kth group of feasible points is the parent node of the endpoint, when k = 1, the (k-1)th group of feasible points is the n feasible points, where k is a positive integer less than i;
[0135] Starting from the initial feasible point, the path that passes through the i target location points in sequence to reach the destination is taken as the target movement path.
[0136] In one possible implementation, the control unit is further configured to:
[0137] Control the virtual object to move along the target movement path;
[0138] As the virtual object moves along the target movement path, the orientation of the virtual object is controlled to be the direction from the virtual object's current position to the target point, where the target point is the target location point to be reached on the target movement path that is closest to the virtual object's current position.
[0139] In one possible implementation, the update condition includes, during the process of controlling the virtual object to move along the target movement path, if the virtual object gets stuck or the virtual object reaches the endpoint.
[0140] In one possible implementation, the device further includes a comparison unit, the comparison unit being used for:
[0141] The target movement path is taken as the movement path to be determined.
[0142] Obtain the shortest distance between the endpoint of the undetermined movement path and the historical path corresponding to the initial feasible point;
[0143] Compare the shortest distance with the preset distance;
[0144] If the shortest distance is less than the preset distance, the step of obtaining the location of the virtual object as the initial feasible point is executed again to determine a new target movement path as the pending movement path.
[0145] If the number of times the shortest distance is less than the preset distance reaches a preset number, the virtual object is controlled to exit the detection of the virtual scene.
[0146] As can be seen from the above technical solution, in the process of detecting a virtual scene using virtual objects, when the movement path of the virtual object meets the update conditions, the position of the virtual object is first obtained as the initial feasible point. Based on the initial feasible point, a ray detection operation is performed to determine m feasible points. These m feasible points represent all feasible points near the initial feasible point. Then, the m feasible points are filtered to obtain n feasible points. That is, some feasible points are selected from all feasible points near the initial feasible point to represent the feasible points near the initial feasible point. Thus, only i iterations of ray detection operation are needed for the n feasible points to determine i sets of feasible points, thereby reducing the computational load. Finally, the target movement path starting from the initial feasible point is determined by iterating i backtracking operations on the i sets of feasible points. Once the target movement path is determined, it indicates that the movement path of the virtual object has been updated, and the virtual object can be controlled to continue detecting the virtual scene according to the target movement path. Based on this, virtual objects can be automatically detected in virtual scenes without manual marking, improving the level of automation. Furthermore, during the detection process, once the movement path of a virtual object meets the update conditions, the planning process of the target movement path can be triggered. It can be seen that the embodiments of this application provide a dynamic automatic detection, which can improve the efficiency of automatic detection. At the same time, limiting the number of feasible points in multiple iterations of ray detection operations can reduce the amount of computation and improve the efficiency of automatic detection.
[0147] This application also provides a computer device, which can be a terminal device, taking a smartphone as an example:
[0148] Figure 11 The diagram shown is a block diagram of a portion of the structure of a smartphone provided in an embodiment of this application. (Reference) Figure 11 The smartphone includes components such as a radio frequency (RF) circuit 1110, a memory 1120, an input unit 1130, a display unit 1140, a sensor 1150, an audio circuit 1160, a Wi-Fi module 1170, a processor 1180, and a power supply 1190. The input unit 1130 may include a touch panel 1131 and other input devices 1132, the display unit 1140 may include a display panel 1141, and the audio circuit 1160 may include a speaker 1161 and a microphone 1162. Those skilled in the art will understand that... Figure 11 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0149] The memory 1120 can be used to store software programs and modules. The processor 1180 executes various functions and data processing of the smartphone by running the software programs and modules stored in the memory 1120. The memory 1120 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the smartphone (such as audio data, phonebook, etc.). In addition, the memory 1120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0150] The processor 1180 is the control center of the smartphone, connecting various parts of the smartphone via various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1120 and calling data stored in the memory 1120. Optionally, the processor 1180 may include one or more processing units; preferably, the processor 1180 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1180.
[0151] In this embodiment, the processor 1180 in the smartphone can perform the following steps:
[0152] During the process of detecting a virtual scene through virtual objects, when the movement path of the virtual object meets the update conditions, the position of the virtual object is obtained as the initial feasible point.
[0153] Based on the initial feasible points, a ray detection operation is performed to obtain m feasible points; m is a positive integer.
[0154] The m feasible points are filtered to obtain n feasible points; n is a positive integer less than m;
[0155] Based on each of the n feasible points, i sets of feasible points are determined by iterating the ray detection operation i times; where i is a positive integer.
[0156] For the i sets of feasible points, the target movement path starting from the initial feasible point is determined by iterating i times backtracking.
[0157] The virtual object is controlled to detect the virtual scene according to the target movement path.
[0158] The computer device provided in this application embodiment can also be a server. Please refer to [link / reference]. Figure 12 As shown, Figure 12 This is a structural diagram of the server 1200 provided in this application embodiment. The server 1200 can vary significantly due to different configurations or performance. It may include one or more processors, such as a central processing unit (CPU) 1222, and a memory 1232, and one or more storage media 1230 (e.g., one or more mass storage devices) for storing application programs 1242 or data 1244. The memory 1232 and storage media 1230 can be temporary or persistent storage. The program stored in the storage media 1230 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 1222 may be configured to communicate with the storage media 1230 and execute the series of instruction operations in the storage media 1230 on the server 1200.
[0159] Server 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input / output interfaces 1258, and / or one or more operating systems 1241, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.
[0160] In this embodiment, the steps executed by the central processing unit 1222 in the server 1200 can be based on Figure 12 The structure shown is implemented.
[0161] According to one aspect of this application, a computer-readable storage medium is provided for storing a computer program for implementing the virtual scene detection method described in the foregoing embodiments.
[0162] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0163] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0164] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0165] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0166] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0167] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0168] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0169] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for detecting virtual scenes, characterized in that, The method includes: During the detection of a virtual scene using virtual objects, when the movement path of the virtual object meets the update conditions, the position of the virtual object is obtained as an initial feasible point. Based on the initial feasible points, a ray detection operation is performed to obtain m feasible points; m is a positive integer. The m feasible points are filtered to obtain n feasible points; n is a positive integer less than m; Based on each of the n feasible points, i sets of feasible points are determined by iterating the ray detection operation i times; where i is a positive integer. For the i sets of feasible points, the target movement path starting from the initial feasible point is determined by iterating i times backtracking. The virtual object is controlled to detect the virtual scene according to the target movement path; The step of determining the target movement path starting from the initial feasible point by iterating i times backtracking through the i groups of feasible points includes: Obtain the adjacency relationship of the i groups of feasible points; the adjacency relationship is used to identify the parent-child relationship between two adjacent groups of feasible points in the i groups of feasible points; The feasible point with the largest shortest distance from the historical path corresponding to the initial feasible point in the i-th group of feasible points is taken as the endpoint of the target movement path; Based on the adjacency relationship, the i groups of feasible points are iteratively backtracked i times to obtain i target location points; the backtracking operation includes: based on the adjacency relationship, obtaining the parent node of the target location point corresponding to the kth group of feasible points from the (k-1)th group of feasible points, as the target location point corresponding to the (k-1)th group of feasible points; when k=i-1, the target location point corresponding to the kth group of feasible points is the parent node of the endpoint, when k=1, the (k-1)th group of feasible points is the n feasible points, where k is a positive integer less than i; Starting from the initial feasible point, the path that passes through the i target location points in sequence to reach the destination is taken as the target movement path.
2. The method according to claim 1, characterized in that, The process of filtering the m feasible points to obtain n feasible points includes: Obtain the historical path corresponding to the initial feasible point; Calculate the shortest distance between each of the m feasible points and the historical path to obtain the shortest distances corresponding to the m feasible points; Based on the shortest distances corresponding to the m feasible points, the m feasible points are filtered to obtain the n feasible points.
3. The method according to claim 2, characterized in that, The step of calculating the shortest distance between each of the m feasible points and the historical path to obtain the shortest distance corresponding to the m feasible points includes: The historical path is sampled to obtain t location points; t is a positive integer; For each of the m feasible points, calculate the distance between the feasible point and the t location points to obtain t distances; The minimum value among the t distances is taken as the shortest distance corresponding to the feasible point.
4. The method according to claim 2, characterized in that, The step of filtering the m feasible points to obtain the n feasible points based on the shortest distances corresponding to the m feasible points includes: Sort the shortest distances corresponding to the m feasible points in descending order; The top n feasible points are selected as the n feasible points.
5. The method according to claim 1, characterized in that, The ray-detection operation based on the initial feasible points yields m feasible points, including: Based on the initial feasible point, move upward by a preset height to obtain the ray detection point; the preset height is less than or equal to the jump height of the virtual object. Detection rays are emitted from the ray detection point; If the endpoint of the detection ray does not collide with an object in the virtual scene, and there is a landing point below the endpoint for the virtual object to land, the landing point is taken as a feasible point, and the m feasible points are obtained.
6. The method according to claim 1, characterized in that, Based on each of the n feasible points, i sets of feasible points are determined through i iterations of ray detection operations, including: Based on each of the n feasible points, the first ray detection operation is performed to obtain multiple feasible points; The first set of feasible points is obtained by filtering the multiple feasible points obtained from the first ray detection operation; Multiple feasible points are obtained by performing the j-th ray detection operation on each feasible point in the j-1 group of feasible points; The j-th feasible point is obtained by filtering the multiple feasible points obtained from the j-th ray detection operation; j is a positive integer greater than 1 and less than or equal to i.
7. The method according to claim 1, characterized in that, The step of controlling the virtual object to detect the virtual scene according to the target movement path includes: Control the virtual object to move along the target movement path; As the virtual object moves along the target movement path, the orientation of the virtual object is controlled to be the direction from the virtual object's current position to the target point, where the target point is the target location point to be reached on the target movement path that is closest to the virtual object's current position.
8. The method according to claim 7, characterized in that, The update conditions include, during the process of controlling the virtual object to move along the target movement path, if the virtual object gets stuck or the virtual object reaches the destination.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: The target movement path is taken as the movement path to be determined. Obtain the shortest distance between the endpoint of the undetermined movement path and the historical path corresponding to the initial feasible point; Compare the shortest distance with the preset distance; If the shortest distance is less than the preset distance, the step of obtaining the location of the virtual object as the initial feasible point is executed again to determine a new target movement path as the pending movement path. If the number of times the shortest distance is less than the preset distance reaches a preset number, the virtual object is controlled to exit the detection of the virtual scene.
10. A detection device for a virtual scene, characterized in that, The device includes an acquisition unit, a detection unit, a screening unit, a determination unit, and a control unit: The acquisition unit is used to acquire the position of the virtual object as an initial feasible point when the movement path of the virtual object meets the update condition during the process of detecting the virtual scene through the virtual object; The detection unit is used to perform ray detection operation based on the initial feasible point to obtain m feasible points; m is a positive integer; The filtering unit is used to filter the m feasible points to obtain n feasible points; n is a positive integer less than m; The detection unit is further configured to determine i sets of feasible points based on each of the n feasible points by iterating the ray detection operation i times; i is a positive integer; The determining unit is used to determine the target movement path starting from the initial feasible point by iterating i backtracking operations on the i groups of feasible points. This includes: obtaining the adjacency relationships of the i groups of feasible points; the adjacency relationships are used to identify the parent-child relationship between adjacent groups of feasible points in the i groups; obtaining the feasible point in the i-th group of feasible points with the largest shortest distance to the historical path corresponding to the initial feasible point as the endpoint of the target movement path; and based on the adjacency relationships, iteratively performing the backtracking operation i times on the i groups of feasible points to obtain i target positions. The backtracking operation includes: based on the adjacency relationship, obtaining the parent node of the target location point corresponding to the kth feasible point from the (k-1)th feasible point group, and using it as the target location point corresponding to the (k-1)th feasible point group; when k=i-1, the target location point corresponding to the kth feasible point group is the parent node of the endpoint, and when k=1, the (k-1)th feasible point group is the n feasible points, where k is a positive integer less than i; starting from the initial feasible point, passing through the i target location points in sequence, and the path to the endpoint is used as the target movement path; The control unit is used to control the virtual object to detect the virtual scene according to the target movement path.
11. The apparatus according to claim 10, characterized in that, The filtering unit is also used for: Obtain the historical path corresponding to the initial feasible point; Calculate the shortest distance between each of the m feasible points and the historical path to obtain the shortest distances corresponding to the m feasible points; Based on the shortest distances corresponding to the m feasible points, the m feasible points are filtered to obtain the n feasible points.
12. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store computer programs and to transfer the computer programs to the processor; The processor is configured to execute the method according to any one of claims 1-9 according to instructions in the computer program.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for implementing the method according to any one of claims 1-9.
14. A computer program product, comprising a computer program, characterized in that, When it is run on a computer device, it causes the computer device to perform the method according to any one of claims 1-9.
Citation Information
Patent Citations
Game processing method and device, computer equipment, storage medium and program product
CN113797543A
