Abnormal collision detection method and device, electronic equipment and storage medium

By loading resource configuration information in the virtual scene, identifying the matching degree of grid vertices and collider vertices of virtual objects, the problems of low efficiency and poor accuracy of abnormal collision detection in the virtual scene are solved, and efficient detection and optimization are achieved in the design stage .

CN119113519APending Publication Date: 2024-12-13SHENZHEN TENCENT NETWORK INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411250581.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The prior art has low efficiency and poor accuracy in virtual scenes, and all virtual scene resources need to be detected, resulting in wasted time and computing resources.

Method used

By loading resource configuration information of the virtual scene, traversing the virtual object, determining the matching degree between mesh vertices and collider vertices, identifying the collider vertices that do not meet the preset matching conditions as abnormal collider vertices, avoiding full detection of temporary levels.

Benefits of technology

It improves the efficiency and accuracy of abnormal collision detection, reduces the waste of time and computing resources, and discovers and optimizes the collision problems of virtual objects in advance at the design stage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119113519A_ABST
    Figure CN119113519A_ABST
Patent Text Reader

Abstract

The invention discloses an abnormal collision detection method and device, electronic equipment and a storage medium. The method comprises the steps that virtual objects in all scene areas are loaded based on resource configuration information of a virtual scene; traversing the loaded virtual object, and for the traversed current virtual object, respectively determining target grid vertex data and collision body vertex data based on the grid body of the current virtual object and the corresponding collision body; and for each collision body vertex in the collision body vertex data, determining the matching degree between the collision body vertex and the grid body based on the position information of the collision body vertex and the target grid vertex data, and if the matching degree does not meet a preset matching condition, determining the collision body vertex as an abnormal collision body vertex. According to the method and the device, the waste of time and computing resources caused by abnormal collision detection on various temporary checkpoints is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an abnormal collision detection method, device, electronic device and storage medium. Background Art

[0002] In the related art, abnormal collision detection for virtual objects in a virtual scene is implemented after all virtual scene resources are packaged into a virtual scene installation package. Therefore, the abnormal collision detection in the related art requires detection of virtual objects in various temporary scene areas in the virtual scene installation package, which results in a waste of detection time and computing resources, which not only reduces the detection efficiency but also has poor detection accuracy. Summary of the invention

[0003] In order to solve the problems of the prior art, the embodiments of the present application provide an abnormal collision detection method, device, electronic device and storage medium. The technical solution is as follows:

[0004] In one aspect, a method for detecting abnormal collision is provided, the method comprising:

[0005] Based on the resource configuration information of the virtual scene, loading the virtual objects in each scene area included in the virtual scene;

[0006] Traversing the loaded virtual objects, for the traversed current virtual object, determining target mesh vertex data based on the mesh body of the current virtual object; the target mesh vertex data includes position information of a plurality of mesh vertices;

[0007] Determine collision body vertex data based on the collision body corresponding to the current virtual object; the collision body vertex data includes position information of multiple collision body vertices;

[0008] For each collision body vertex among the multiple collision body vertices, a matching degree between the collision body vertex and the grid body is determined based on the position information of the collision body vertex and the target mesh vertex data; if the matching degree does not meet a preset matching condition, the collision body vertex is determined as an abnormal collision body vertex.

[0009] On the other hand, an abnormal collision detection device is provided, the device comprising:

[0010] A virtual object loading module, used for loading virtual objects in various scene areas contained in the virtual scene based on resource configuration information of the virtual scene;

[0011] A mesh vertex data determination module, used for traversing the loaded virtual objects, and for a current virtual object traversed, determining target mesh vertex data based on a mesh body of the current virtual object; the target mesh vertex data includes position information of a plurality of mesh vertices;

[0012] A collision body vertex data determination module, used to determine collision body vertex data based on the collision body corresponding to the current virtual object; the collision body vertex data includes position information of multiple collision body vertices;

[0013] An abnormal vertex determination module is used to determine, for each collision body vertex among the multiple collision body vertices, a matching degree between the collision body vertex and the grid body based on the position information of the collision body vertex and the target grid vertex data, and to determine the collision body vertex as an abnormal collision body vertex when the matching degree does not meet a preset matching condition.

[0014] In some exemplary embodiments, the abnormal vertex determination module includes:

[0015] A distance determination module, used to determine the distance between the collision body vertex and each of the mesh vertices based on the position information of the collision body vertex and the position information of each of the mesh vertices, and obtain a distance set corresponding to the collision body vertex;

[0016] A matching quantification module is used to determine a minimum distance in the distance set, and use the minimum distance as a matching degree between the collision body vertex and the mesh body.

[0017] In some exemplary embodiments, the abnormal vertex determination module further includes:

[0018] A comparison module, used for comparing the matching degree with a preset matching degree threshold;

[0019] The first determination module is used to determine that the matching degree does not meet the preset matching condition when the comparison result indicates that the matching degree exceeds the preset matching degree threshold; and determine the collision body vertex as an abnormal collision body vertex.

[0020] In some exemplary embodiments, the mesh vertex data determination module includes:

[0021] A mesh component determination module, used to determine the mesh component bound to the current virtual object;

[0022] A vertex data information determination module, configured to determine vertex data information based on a rendering data storage structure in the mesh body component; the vertex data information includes a plurality of mesh vertex data sets corresponding to different mesh vertex densities;

[0023] The selection module is used to obtain the mesh vertex data set with the largest mesh vertex density from the multiple mesh vertex data sets to obtain the target mesh vertex data.

[0024] In some exemplary embodiments, the collision body vertex data determination module includes:

[0025] A mesh instance acquisition module, used to acquire a mesh instance based on the mesh component bound to the current virtual object;

[0026] The second determination module is used to determine the collision body vertex data based on the collision body prototype in the mesh body instance.

[0027] In some exemplary embodiments, the virtual object loading module includes:

[0028] A resource path acquisition module, used to acquire resource path information of the virtual scene; the resource path information indicates the storage location of resource configuration information of the virtual scene in an external storage space, the resource configuration information including virtual object resources of each scene area contained in the virtual scene;

[0029] A loading module is used to load the virtual object resources of each of the scene areas from the external storage space to the internal storage space based on the resource path information to obtain the virtual objects in each of the scene areas.

[0030] In some exemplary embodiments, the apparatus further comprises:

[0031] A detection result generating module, used for generating an abnormal collision detection result corresponding to the current virtual object based on the position information of each abnormal collision body vertex corresponding to the current virtual object;

[0032] The detection result display module is used to display the abnormal collision detection results corresponding to each virtual object in the editing interface of the Unreal Engine in response to traversing the loaded virtual objects; wherein the abnormal collision detection result corresponding to each virtual object includes the total number of abnormal collision body vertices and the position information of each abnormal collision body vertex.

[0033] On the other hand, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any of the above-mentioned abnormal collision detection methods.

[0034] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the abnormal collision detection method as described in any of the above aspects.

[0035] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs any of the above-mentioned abnormal collision detection methods.

[0036] The embodiment of the present application loads virtual objects in various scene areas contained in the virtual scene based on resource configuration information of the virtual scene, and then traverses the loaded virtual objects. For the current virtual object traversed, target mesh vertex data is determined based on the mesh body of the current virtual object, and the target mesh vertex data includes position information of multiple mesh vertices. Collision body vertex data is determined based on the collision body corresponding to the current virtual object, and the collision body vertex data includes position information of multiple collision body vertices. For each collision body vertex, the matching degree between the collision body vertex and the mesh body of the current virtual object is determined based on the position information of the collision body vertex and the above-mentioned target mesh vertex data, and when the matching degree does not meet the preset matching condition, the collision body vertex is determined as an abnormal collision body vertex. Therefore, the above-mentioned technical solution realizes abnormal collision detection of virtual objects actually designed in each game level during the design stage of the virtual scene, avoids the waste of time and computing resources caused by the need to perform abnormal collision detection on various temporary levels, and not only improves the detection efficiency, but also improves the accuracy of abnormal collision detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0039] Figure 2 It is a flowchart of an abnormal collision detection method provided in an embodiment of the present application;

[0040] Figure 3It is a flowchart of another abnormal collision detection method provided in an embodiment of the present application;

[0041] Figure 4 It is a flowchart of another abnormal collision detection method provided in an embodiment of the present application;

[0042] Figure 5 is a schematic diagram of abnormal collision detection results corresponding to each virtual object displayed in the editing interface of the Unreal Engine provided by an embodiment of the present application;

[0043] Figure 6 is a structural block diagram of an abnormal collision detection device provided in an embodiment of the present application;

[0044] Figure 7 It is a hardware structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0047] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

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

[0049] The terms involved in the embodiments of the present application are explained below.

[0050] Level: refers to the scene area contained in the defined virtual scene, such as the game area of ​​a virtual game. Levels can be created, viewed, and modified by placing, transforming, and editing the properties of virtual objects (Actors). In the Unreal Editor, each level is saved as a separate .umap file, which is different from the project file (.uproject).

[0051] Virtual object (Actor): refers to the base class of Object that can be placed or generated in a level. Actor can contain many components (Actor Components) to control the movement and rendering of the actor, as well as attribute replication and function calls through the network. A virtual object is a virtual image in the level used to represent an object. Each virtual object has its own shape and volume in the virtual scene and occupies a part of the space in the virtual scene. For example, virtual objects can include vegetation actors, mountain actors, sky actors, river actors, etc. in the level.

[0052] Virtual scene (world): It is the scene in the virtual game displayed (or provided) when the application is running on the terminal. It can also be called a virtual world, which includes multiple levels. Each level includes multiple virtual objects (Actors), which constitutes the basic relationship between virtual scenes, levels and virtual objects in Unreal Engine. The virtual scene is a simulation environment of the real world, or a semi-simulated and semi-fictional virtual environment, or a purely fictional virtual environment. Optionally, the virtual scene is any one of a two-dimensional virtual space, a 2.5-dimensional virtual space or a three-dimensional virtual space. The embodiment of the present application does not limit the dimension of the virtual scene.

[0053] Unreal Engine (UE): A game engine that is primarily designed for the development of first-person shooter games, but can also be used to develop simulation games, horror games, role-playing games, and many other types of games. In addition, Unreal Engine can also be used for virtual film production.

[0054] See also Figure 1, which is a schematic diagram of an implementation environment provided by an embodiment of the present application, the implementation environment includes a terminal 110 and a server 120, wherein the terminal 110 and the server 120 can communicate via a wired or wireless network connection.

[0055] The terminal 110 includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The terminal 110 is installed with client software with a virtual scene editing function, and the edited virtual scene can be used to form a game application or a cloud game application. Exemplarily, the game application or cloud game application may include: MMOG (Massive Multiplayer Online Game), MMORPG (Massive Multiplayer Online Role-Playing Game), MOBA (Multiplayer Online Battle Arena), shooting games, virtual reality applications, three-dimensional map programs, multiplayer machine survival games, etc.

[0056] The server 120 can provide background services for the client software in the terminal 110. The server 120 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and artificial intelligence platforms.

[0057] See also Figure 2 , which shows a flow chart of an abnormal collision detection method provided in an embodiment of the present application. It should be noted that this specification provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the system or product is executed in practice, it can be executed in sequence or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, a parallel processor or a multi-threaded processing environment). Specifically, Figure 2 As shown, the method may include:

[0058] S201, based on resource configuration information of a virtual scene, loading virtual objects in each scene area included in the virtual scene.

[0059] Among them, the virtual scene includes multiple set scene areas, that is, multiple levels, and the resource configuration information of the virtual scene includes virtual object resources of each scene area in the multiple scene areas. The virtual object resources of each scene area may include a first virtual object resource and a second virtual object resource, wherein the first virtual object resource is used to indicate the virtual objects on the game map of the scene area, such as vegetation Actor, mountain Actor, sky Actor, river Actor, and the second virtual object resource is used to indicate the virtual objects referenced by the scene area, such as game props Actor, etc.

[0060] In a specific implementation, during the design phase of a virtual scene, resource configuration information of the virtual scene is usually stored in an external storage space, such as a hard disk, and virtual object resources of each of the multiple scene areas are stored in the external storage space as a separate resource file (such as a .umap file). By loading virtual objects in each scene area included in the virtual scene based on the resource configuration information of the virtual scene, all virtual objects designed in each level of the virtual scene can be loaded into the memory together with the level.

[0061] Based on this, in some exemplary implementations, the above step S201 may include, when loading virtual objects in each scene area included in the virtual scene based on the resource configuration information of the virtual scene:

[0062] Acquire resource path information of the virtual scene, where the resource path information indicates a storage location of resource configuration information of the virtual scene in an external storage space;

[0063] Based on the resource path information, the virtual object resources of each scene area are loaded from the external storage space to the internal storage space to obtain a full amount of virtual objects in the virtual scene.

[0064] In a specific implementation, the abnormal collision detection method of the embodiment of the present application can be implemented through an abnormal collision detection script. The resource path information of the virtual scene can be pre-set in the abnormal collision detection script, such as the resource path information is " / Game / AssetsSN / Scene / Maps / WDC / WDC". Therefore, when the abnormal collision detection script is executed, the resource configuration information of the virtual scene can be searched from the external storage space based on the resource path information of the virtual scene. When the resource file (such as a .umap file) of each scene area in the resource configuration information is found, it is loaded from the external storage space into the internal storage space (such as the memory). Therefore, all virtual objects designed in each level of the virtual scene (including virtual objects referenced and contained in the level) can be loaded into the memory together with the level for subsequent processing.

[0065] S203, traversing the loaded virtual objects, and for the traversed current virtual object, determining target mesh vertex data based on the mesh body of the current virtual object.

[0066] The target mesh vertex data includes position information of a plurality of mesh vertices. Specifically, the position information of each mesh vertex in the target mesh vertex data may be the spatial coordinate of the mesh vertex relative to the center of the mesh body.

[0067] Specifically, by loading the virtual objects in each scene area contained in the virtual scene, all virtual objects designed in each level of the virtual scene can be obtained, and then all virtual objects designed in each level of the virtual scene can be traversed. For example, the iterator Iterator (World) of the game map can be used to traverse all loaded virtual objects.

[0068] For the traversed current virtual object, the target mesh vertex data may be determined based on the mesh of the current virtual object, wherein the mesh of the current virtual object may be a static mesh and / or a skeletal mesh.

[0069] Static meshes are a basic unit in Unreal Engine. They are 3D models used to create geometric bodies in virtual scenes. Skeletal meshes consist of two parts: a set of polygons that make up the surface of the skeletal mesh, and a set of hierarchical associated bones that animate the polygon vertices. In Unreal Engine, skeletal meshes are often used to represent game characters or other animated virtual objects.

[0070] In some exemplary embodiments, when determining the target mesh vertex data based on the mesh body of the current virtual object, the above step S203 may include:

[0071] Determine the mesh component bound to the current virtual object;

[0072] Determining vertex data information based on a rendering data storage structure in the mesh body component, the vertex data information comprising a plurality of mesh vertex data sets corresponding to different mesh vertex densities;

[0073] A mesh vertex data set with the largest mesh vertex density is obtained from the multiple mesh vertex data sets to obtain target mesh vertex data.

[0074] Specifically, the mesh component (Mesh component) bound to the current virtual object can be determined from multiple components bound to the current virtual object by obtaining the mesh component function. For example, the mesh component obtaining function can be GetComponentsByClass(UMeshComponent::StaticClass()). Among them, the mesh component has a rendering data storage structure RenderData, which stores vertex data information. The vertex data information includes multiple mesh vertex data sets. The multiple mesh vertex data sets correspond to different mesh vertex densities. The mesh vertex density can represent the number of mesh vertices. The more mesh vertices there are, the greater the corresponding mesh vertex density. Furthermore, the mesh vertex data set with the largest mesh vertex density can be obtained from the multiple mesh vertex data sets, and the mesh vertex data set with the largest mesh vertex density is used as the target mesh vertex data.

[0075] The above implementation method obtains the mesh vertex data set with the largest mesh vertex density through the mesh body component bound to the current virtual object as the target mesh vertex data for subsequent matching quantization, which helps to improve the accuracy of subsequent abnormal collision body vertex determination.

[0076] S205: Determine collision body vertex data based on the collision body corresponding to the current virtual object.

[0077] The collision body vertex data includes position information of a plurality of collision body vertices. Specifically, the position information of each collision body vertex in the collision body vertex data may be the spatial coordinate of the collision body vertex relative to the center of the collision body.

[0078] Specifically, the collision body is a three-dimensional model with a preset volume. The three-dimensional model can be of any shape and is determined according to research and development needs. For example, the three-dimensional model can be a sphere, a cylinder, a tricone, a cube, etc.

[0079] In some exemplary embodiments, when determining the collision body vertex data based on the collision body corresponding to the current virtual object, the above step S205 may include:

[0080] Get the mesh instance based on the mesh component bound to the current virtual object;

[0081] Based on the collision body prototype in the mesh body instance, collision body vertex data is determined.

[0082] Specifically, after determining the mesh component bound to the current virtual object, the mesh instance of the current virtual object can be obtained by obtaining the mesh instance function based on the type of mesh indicated by the mesh component (static mesh / skeletal mesh). For example, the mesh instance function can be GetBodyInstance(), and then the collision body prototype in the mesh instance can be obtained by calling the GetCollisionPrimitive() function, thereby obtaining the collision body vertex data.

[0083] The above implementation method obtains the corresponding mesh instance through the mesh component bound to the current virtual object, and then determines the collision body vertex data based on the collision body prototype in the mesh body instance, thereby improving the accuracy of the collision body vertex data, which is beneficial to improving the accuracy of abnormal collision detection.

[0084] S207, for each collision body vertex among the above-mentioned multiple collision body vertices, based on the position information of the collision body vertex and the aforementioned target mesh vertex data, determine the matching degree between the collision body vertex and the mesh body of the current virtual object; if the matching degree does not meet the preset matching condition, determine the collision body vertex as an abnormal collision body vertex.

[0085] The matching degree between the collision body vertex and the mesh body of the current virtual object reflects the matching degree between the collision body vertex and the mesh body. The greater the matching degree, the more adapted the collision body vertex is to the mesh body, and the smaller the possibility of collision.

[0086] The preset matching condition may be that the matching degree is greater than or equal to a set matching degree threshold, and the matching degree threshold may be set based on actual experience. Specifically, if the matching degree reflected by the matching degree is less than the matching degree threshold, the matching degree does not meet the preset matching condition.

[0087] Specifically, in the embodiment of the present application, the degree of match between the collision body vertex and the mesh body of the current virtual object can be characterized or quantified by the distance between the collision body vertex and the mesh body. The larger the distance, the farther the collision body vertex is from the mesh body of the current virtual object, and thus the degree of match between the collision body vertex and the mesh body of the current virtual object is small. On the contrary, the smaller the distance, the closer the collision body vertex is to the mesh body of the current virtual object, and thus the degree of match between the collision body vertex and the mesh body of the current virtual object is large. In other words, when the distance between the collision body vertex and the mesh body is used to quantify the degree of match between the collision body vertex and the mesh body, the distance and the degree of match are inversely correlated. The larger the distance, the smaller the degree of match, and the smaller the distance, the greater the degree of match.

[0088] Based on this, in some exemplary embodiments, Figure 3As shown, the above step S207, when determining the matching degree between the vertex of the collision body and the mesh body of the current virtual object based on the position information of the vertex of the collision body and the aforementioned target mesh vertex data, may include the following steps S301 to S303:

[0089] S301, based on the position information of the collision body vertex and the position information of each mesh vertex in the target mesh vertex data, determine the distance between the collision body vertex and each mesh vertex, and obtain a distance set corresponding to the collision body vertex.

[0090] In a specific implementation, the mesh vertices in the target mesh vertex data can be traversed, and for the traversed current mesh vertex, the distance between the two points is calculated based on the position information of the collision body vertex and the position information of the current mesh vertex, thereby obtaining the distance between the collision body vertex and the current mesh vertex. After traversing all the mesh vertices in the target mesh vertex data, the distance set corresponding to the collision body vertex can be obtained, and the distance set includes the distance between the collision body vertex and each mesh vertex in the target mesh vertex data.

[0091] S303, determining the minimum distance in the distance set, and using the minimum distance as the matching degree between the vertex of the collision body and the mesh body of the current virtual object.

[0092] In the above implementation, by calculating the distance between a collision body vertex and each mesh vertex in the target mesh vertex data, and then selecting the minimum distance from the calculated distance set corresponding to the collision body vertex as the matching degree between the collision body vertex and the mesh body of the current virtual object, not only the accuracy of the matching degree measurement is ensured, but also the quantification method of the matching degree is simplified, which is conducive to improving the accuracy and efficiency of abnormal collision detection.

[0093] Please continue to see Figure 3 In the case where the matching degree is characterized by distance, when the step S207 is implemented, when the matching degree does not meet the preset matching condition, the collision body vertex is determined as an abnormal collision body vertex, the following steps 305 to S309 may be included:

[0094] S305: Compare the matching degree with a preset matching degree threshold.

[0095] Among them, the preset matching degree threshold is consistent with the representation method of the matching degree. Since the matching degree is quantified by distance, the preset matching degree threshold here is also represented by distance, which can be a preset distance threshold, for example, the preset distance threshold can be 50mm.

[0096] S307: If the comparison result indicates that the matching degree exceeds a preset matching degree threshold, it is determined that the matching degree does not satisfy a preset matching condition, and the collision body vertex is determined as an abnormal collision body vertex.

[0097] S309: If the result of the comparison indicates that the matching degree does not exceed the preset matching degree threshold, it is determined that the matching degree meets the preset matching condition and the collision body vertex is a normal collision body vertex.

[0098] Specifically, since the distance represents the matching degree, the distance and the matching degree are inversely correlated. Therefore, when the comparison result indicates that the matching degree exceeds the preset matching degree threshold, it means that the distance between the collision body vertex and the grid body exceeds the preset distance threshold, for example, it exceeds 50mm. In this case, the collision body vertex is too far away from the grid body of the current virtual object and is a collision body vertex to be optimized. Then, the collision body vertex is determined as an abnormal collision body vertex.

[0099] On the contrary, when the comparison result indicates that the matching degree does not exceed the preset matching degree threshold, it means that the distance between the collision body vertex and the mesh body does not exceed the preset distance threshold, for example, it does not exceed 50mm. Then the collision body vertex is close to the mesh body of the current virtual object and no further optimization is required. That is, the collision body vertex is determined to be a normal collision body vertex.

[0100] In the above implementation, when the distance is used to characterize the degree of matching, by determining the collision body vertices whose distance exceeds a preset distance threshold as abnormal collision body vertices, the accuracy and efficiency of abnormal collision detection are greatly improved.

[0101] In some exemplary embodiments, Figure 4 As shown, after completing the processing of the collision volume vertex data of the current virtual object based on the aforementioned step S207, the method may further include:

[0102] S401, generating an abnormal collision detection result corresponding to the current virtual object based on the position information of each abnormal collision body vertex corresponding to the current virtual object.

[0103] In a specific implementation, for the current virtual object traversed, an abnormal collision vertex set corresponding to the current virtual object can be established to store abnormal collision body vertices detected for the current virtual object, and then after completing the processing of the collision body vertex data of the current virtual object based on the aforementioned step S207, an abnormal collision detection result corresponding to the current virtual object can be generated based on the position information of each abnormal collision vertex in the abnormal collision vertex set. Specifically, the abnormal collision detection result can be the object identifier of the current virtual object (such as the name of the Actor), the total number of abnormal collision vertices, and the corresponding relationship between the position information of each abnormal collision vertex.

[0104] S403, in response to traversing the loaded virtual objects, displaying abnormal collision detection results corresponding to each virtual object in the editing interface of the Unreal Engine.

[0105] The abnormal collision detection result corresponding to each virtual object includes the total number of abnormal collision body vertices and the position information of each abnormal collision body vertex.

[0106] Specifically, after traversing all loaded virtual objects and obtaining the abnormal collision detection results corresponding to each virtual object, the abnormal collision detection results corresponding to each virtual object can be displayed in the form of a table on the editing interface of the Unreal Engine, so that game developers in the design stage can timely know the abnormal collision detection status of each virtual object, and then can make optimization adjustments in the early stage of design to avoid collision risks.

[0107] like Figure 5 The figure shows a schematic diagram of abnormal collision detection results corresponding to each virtual object displayed in the editing interface of the Unreal Engine, where the first column shows the Actor name of the virtual object in the level, the second column shows the total number of abnormal collision vertices in the corresponding collider, and the third column shows the coordinates of all abnormal collision vertices in the corresponding collider.

[0108] It can be seen from the above technical solutions of the embodiments of the present application that the embodiments of the present application realize abnormal collision detection of virtual objects actually used in the design of each game level during the design stage of the virtual scene, which can avoid various design defects in advance in the early stage of design and avoid the waste of time and computing resources caused by the need to perform abnormal collision detection on various temporary levels, thereby improving not only the detection efficiency but also the accuracy of abnormal collision detection.

[0109] Corresponding to the abnormal collision detection methods provided in the above-mentioned embodiments, the embodiment of the present application also provides an abnormal collision detection device. Since the abnormal collision detection device provided in the embodiment of the present application corresponds to the abnormal collision detection methods provided in the above-mentioned embodiments, the implementation methods of the aforementioned abnormal collision detection methods are also applicable to the abnormal collision detection device provided in this embodiment and will not be described in detail in this embodiment.

[0110] See also Figure 6 , which is a schematic diagram of the structure of an abnormal collision detection device provided in an embodiment of the present application, the device has the function of implementing the abnormal collision detection method in the above method embodiment, and the function can be implemented by hardware or by hardware executing corresponding software. Figure 6 As shown, the abnormal collision detection device 600 may include:

[0111] A virtual object loading module 610 is used to load virtual objects in each scene area included in the virtual scene based on resource configuration information of the virtual scene;

[0112] A mesh vertex data determination module 620 is used to traverse the loaded virtual object, and for the traversed current virtual object, determine target mesh vertex data based on the mesh body of the current virtual object; the target mesh vertex data includes position information of a plurality of mesh vertices;

[0113] A collision body vertex data determination module 630 is used to determine collision body vertex data based on the collision body corresponding to the current virtual object; the collision body vertex data includes position information of multiple collision body vertices;

[0114] The abnormal vertex determination module 640 is used to determine, for each collision body vertex among the multiple collision body vertices, the matching degree between the collision body vertex and the grid body based on the position information of the collision body vertex and the target grid vertex data, and determine the collision body vertex as an abnormal collision body vertex when the matching degree does not meet the preset matching condition.

[0115] In some exemplary embodiments, the abnormal vertex determination module 640 includes:

[0116] A distance determination module, used to determine the distance between the collision body vertex and each of the mesh vertices based on the position information of the collision body vertex and the position information of each of the mesh vertices, and obtain a distance set corresponding to the collision body vertex;

[0117] A matching quantification module is used to determine a minimum distance in the distance set, and use the minimum distance as the matching degree between the vertex of the collision body and the mesh body.

[0118] In some exemplary embodiments, the abnormal vertex determination module 640 further includes:

[0119] A comparison module, used to compare the matching degree with a preset matching degree threshold;

[0120] The first determination module is used to determine that the matching degree does not meet the preset matching condition when the comparison result indicates that the matching degree exceeds the preset matching degree threshold; and determine the collision body vertex as an abnormal collision body vertex.

[0121] In some exemplary embodiments, the mesh vertex data determination module 620 includes:

[0122] A mesh component determination module, used to determine the mesh component bound to the current virtual object;

[0123] A vertex data information determination module, configured to determine vertex data information based on a rendering data storage structure in the mesh body component; the vertex data information includes a plurality of mesh vertex data sets corresponding to different mesh vertex densities;

[0124] The selection module is used to obtain the mesh vertex data set with the largest mesh vertex density from the multiple mesh vertex data sets to obtain the target mesh vertex data.

[0125] In some exemplary embodiments, the collision body vertex data determination module 630 includes:

[0126] A mesh instance acquisition module, used to acquire a mesh instance based on a mesh component bound to the current virtual object;

[0127] The second determination module is used to determine the vertex data of the collision body based on the collision body prototype in the mesh body instance.

[0128] In some exemplary embodiments, the virtual object loading module 610 includes:

[0129] A resource path acquisition module, used to acquire resource path information of the virtual scene; the resource path information indicates the storage location of resource configuration information of the virtual scene in the external storage space, and the resource configuration information includes virtual object resources of each scene area contained in the virtual scene;

[0130] The loading module is used to load the virtual object resources of each scene area from the external storage space to the internal storage space based on the resource path information to obtain the virtual objects in each scene area.

[0131] In some exemplary embodiments, the apparatus 600 further includes:

[0132] A detection result generating module, used for generating an abnormal collision detection result corresponding to the current virtual object based on the position information of each abnormal collision body vertex corresponding to the current virtual object;

[0133] The detection result display module is used to display the abnormal collision detection results corresponding to each virtual object in the editing interface of the Unreal Engine in response to traversing the loaded virtual objects; wherein the abnormal collision detection results corresponding to each virtual object include the total number of abnormal collision body vertices and the position information of each abnormal collision body vertex.

[0134] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0135] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any abnormal collision detection method provided in the above method embodiments.

[0136] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.

[0137] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a server or a similar computing device, that is, the above electronic device can include a computer terminal, a server or a similar computing device. Taking running on a terminal as an example, Figure 7 : is a hardware structure block diagram of an electronic device running an abnormal collision detection method provided in an embodiment of the present application, specifically:

[0138] The terminal may include components such as an RF (Radio Frequency) circuit 710, a memory 720 including one or more computer-readable storage media, an input unit 730, a display unit 740, a sensor 750, an audio circuit 760, a WiFi (wireless fidelity) module 770, a processor 780 including one or more processing cores, and a power supply 790. Those skilled in the art will appreciate that Figure 7 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0139] The RF circuit 710 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 780 for processing; in addition, the data related to the uplink is sent to the base station. Generally, the RF circuit 710 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a user identity module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. In addition, the RF circuit 710 can also communicate with the network and other terminals through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.

[0140] The memory 720 can be used to store software programs and modules, and the processor 780 executes various functional applications and data processing by running the software programs and modules stored in the memory 720. The memory 720 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, application programs required for functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 720 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 720 may also include a memory controller to provide the processor 780 and the input unit 730 with access to the memory 720.

[0141] The input unit 730 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 730 may include a touch-sensitive surface 731 and other input devices 732. The touch-sensitive surface 731, also known as a touch display screen or touch pad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 731), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 731 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 780, and can receive and execute commands sent by the processor 780. In addition, the touch-sensitive surface 731 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 731, the input unit 730 may further include other input devices 732. Specifically, the other input devices 732 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0142] The display unit 740 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the terminal, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 740 may include a display panel 741. Optionally, the display panel 741 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 731 may cover the display panel 741. When the touch-sensitive surface 731 detects a touch operation on or near it, it is transmitted to the processor 780 to determine the type of touch event, and then the processor 780 provides corresponding visual output on the display panel 741 according to the type of touch event. Among them, the touch-sensitive surface 731 and the display panel 741 can be two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface 731 and the display panel 741 can also be integrated to realize input and output functions.

[0143] The terminal may also include at least one sensor 750, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 741 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 741 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the terminal posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured in the terminal, they will not be repeated here.

[0144] The audio circuit 760, the speaker 761, and the microphone 762 can provide an audio interface between the user and the terminal. The audio circuit 760 can transmit the received audio data to the speaker 761 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 762 converts the collected sound signal into an electrical signal, which is received by the audio circuit 760 and converted into audio data, and then the audio data is output to the processor 780 for processing, and then sent to another terminal through the RF circuit 710, or the audio data is output to the memory 720 for further processing. The audio circuit 760 may also include an earplug jack to provide communication between an external headset and the terminal.

[0145] WiFi is a short-range wireless transmission technology. The terminal can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 770, which provides users with wireless broadband Internet access. Figure 7 A WiFi module 770 is shown, but it is understandable that it is not an essential component of the terminal and can be omitted as needed without changing the essence of the invention.

[0146] The processor 780 is the control center of the terminal, and uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal and processes data by running or executing software programs and / or modules stored in the memory 720, and calling data stored in the memory 720. Optionally, the processor 780 may include one or more processing cores; preferably, the processor 780 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 780.

[0147] The terminal also includes a power supply 790 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 780 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 790 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0148] Although not shown, the terminal may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the terminal also includes a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors. The one or more programs include instructions for executing the abnormal collision detection method provided in the above method embodiment.

[0149] An embodiment of the present application also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to implementing an abnormal collision detection method. The at least one instruction or the at least one program is loaded and executed by the processor to implement any abnormal collision detection method provided in the above method embodiments.

[0150] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the electronic device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the electronic device performs any abnormal collision detection method provided in the above method embodiment.

[0151] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0152] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0153] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0154] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0155] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. An abnormal collision detection method, characterized in that: The method comprises: Based on the resource configuration information of the virtual scene, loading the virtual objects in each scene area included in the virtual scene; Traversing the loaded virtual objects, for the traversed current virtual object, determining target mesh vertex data based on the mesh body of the current virtual object; the target mesh vertex data includes position information of a plurality of mesh vertices; Determine collision body vertex data based on the collision body corresponding to the current virtual object; the collision body vertex data includes position information of multiple collision body vertices; For each collision body vertex among the multiple collision body vertices, a matching degree between the collision body vertex and the grid body is determined based on the position information of the collision body vertex and the target mesh vertex data; if the matching degree does not meet a preset matching condition, the collision body vertex is determined as an abnormal collision body vertex.

2. The method according to claim 1, characterized in that The determining the matching degree between the collision body vertices and the mesh body based on the position information of the collision body vertices and the target mesh vertex data includes: Based on the position information of the collision body vertex and the position information of each mesh vertex, determine the distance between the collision body vertex and each mesh vertex to obtain a distance set corresponding to the collision body vertex; A minimum distance in the distance set is determined, and the minimum distance is used as a matching degree between the collision body vertex and the mesh body.

3. The method according to claim 2, characterized in that When the matching degree does not satisfy a preset matching condition, determining the collision body vertex as an abnormal collision body vertex includes: Comparing the matching degree with a preset matching degree threshold; If the comparison result indicates that the matching degree exceeds the preset matching degree threshold, determining that the matching degree does not satisfy the preset matching condition; The collision body vertex is determined as an abnormal collision body vertex.

4. The method according to claim 1, characterized in that: The determining target mesh vertex data based on the mesh body of the current virtual object comprises: Determine the mesh component bound to the current virtual object; Determining vertex data information based on a rendering data storage structure in the mesh body component; the vertex data information includes a plurality of mesh vertex data sets corresponding to different mesh vertex densities; A mesh vertex data set with the largest mesh vertex density is obtained from the multiple mesh vertex data sets to obtain the target mesh vertex data.

5. The method according to claim 4, characterized in that The determining of collision body vertex data based on the collision body corresponding to the current virtual object includes: Obtaining a mesh instance based on the mesh component bound to the current virtual object; The collision volume vertex data is determined based on a collision volume prototype in the mesh volume instance.

6. The method according to claim 1, characterized in that Based on the resource configuration information of the virtual scene, loading virtual objects in each scene area contained in the virtual scene includes: Acquire resource path information of the virtual scene; the resource path information indicates a storage location of resource configuration information of the virtual scene in an external storage space, the resource configuration information including virtual object resources of each scene area contained in the virtual scene; Based on the resource path information, the virtual object resource of each scene area is loaded from the external storage space to the internal storage space to obtain the virtual object in each scene area.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Based on the position information of each of the abnormal collision body vertices corresponding to the current virtual object, generating an abnormal collision detection result corresponding to the current virtual object; In response to traversing the loaded virtual objects, abnormal collision detection results corresponding to each of the virtual objects are displayed in the editing interface of the Unreal Engine; wherein the abnormal collision detection results corresponding to each of the virtual objects include the total number of abnormal collision body vertices and position information of each abnormal collision body vertex.

8. An abnormal collision detection device, characterized in that: The device comprises: A virtual object loading module, used for loading virtual objects in various scene areas contained in the virtual scene based on resource configuration information of the virtual scene; A mesh vertex data determination module, used for traversing the loaded virtual objects, and for a current virtual object traversed, determining target mesh vertex data based on a mesh body of the current virtual object; the target mesh vertex data includes position information of a plurality of mesh vertices; A collision body vertex data determination module, used to determine collision body vertex data based on the collision body corresponding to the current virtual object; the collision body vertex data includes position information of multiple collision body vertices; An abnormal vertex determination module is used to determine, for each collision body vertex among the multiple collision body vertices, a matching degree between the collision body vertex and the grid body based on the position information of the collision body vertex and the target grid vertex data, and to determine the collision body vertex as an abnormal collision body vertex when the matching degree does not meet a preset matching condition.

9. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the abnormal collision detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the abnormal collision detection method according to any one of claims 1 to 7.

11. A computer program, characterized in that When the computer program is executed by a processor, the abnormal collision detection method according to any one of claims 1 to 7 is implemented.