Configurable ugc construction method, apparatus, and electronic device
Patent Information
- Application Number
- CN202610907912.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-20
AI Technical Summary
但是,在现有方案中主流系统仅支持如矩形构件这类标准构件,无法处理三角形地基异形结构
[0016]本发明提供一种可配置的UGC建造方法、装置和电子设备,通过生成UGC场景中异形构件的虚拟拓扑结构,以使异形构件与标准构件保持吸附逻辑统一。将所有异形构件和标准构件存入构件拓扑数据库中。建立包含不同构件类型之间的吸附面匹配关系及位置偏移量的匹配规则表。响应玩家从拓扑数据库中选择并移动预览构件靠近UGC场景中被吸附构件的操作,分别获得预览构件和被吸附构件的构件类型。基于预览构件和被吸附构件的构件类型,查找匹配规则表获得对应的吸附面匹配关系及位置偏移量,以得到最终的吸附位置,基于吸附位置完成吸附建造操作。本方案中,通过虚拟拓扑映射,使得异形构件保持与标准构件一致的吸附能力,且通过配置匹配规则表使得吸附规则可动态扩展,无需修改引擎核心代码,提高了方案的扩展性。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to a configurable UGC (User Generated Content) creation method, apparatus, and electronic device. Background Technology
[0002] User-generated content (UGC) games have attracted a large number of players with their high degree of freedom and creativity. These games not only provide rich gameplay content but also allow players to further enrich the game world by creating and sharing their own works. With continuous technological advancements and evolving player needs, UGC games will continue to develop and grow.
[0003] In current UGC building games, players can use basic components (such as foundations, walls, stairs, etc.) to build custom structures. One of the core experiences of this type of game is the component snapping function, where when a player brings one component close to another, the system automatically aligns them to the appropriate position.
[0004] In existing technologies, a fixed number of snap points are typically predefined for each component. When two components are close together, the system attempts to align their snap points. This technique simplifies the mesh of complex components into simple geometry (e.g., simplifying a staircase into a cuboid) and then applies standard snap rules. However, current solutions only support standard components such as rectangular components and cannot handle irregular structures with triangular foundations. Furthermore, the snap rules are hard-coded at the code level, requiring modifications to the core code to add new component types, resulting in poor scalability. Summary of the Invention
[0005] The purpose of this invention is to provide a configurable UGC construction method, apparatus, and electronic device, so that irregularly shaped components maintain the same adsorption capacity as standard components, and the adsorption rules can be dynamically expanded by configuring a matching rule table.
[0006] In a first aspect, the present invention provides a configurable UGC construction method, the method comprising: Generate a virtual topology structure for irregularly shaped components in a UGC scene to ensure that the irregularly shaped components maintain the same adsorption logic as standard components; Store all irregular and standard components in the component topology database; Establish a matching rule table, which contains the adsorption surface matching relationship and position offset between different component types; In response to the player's operation of selecting and moving a preview component from the topology database closer to a component that is snapped into the UGC scene, the component types of the preview component and the snapped component are obtained respectively; Based on the component types of the preview component and the component to be adsorbed, the corresponding adsorption surface matching relationship and position offset are obtained by searching the matching rule table to obtain the final adsorption position, and the adsorption construction operation is completed based on the adsorption position.
[0007] In an optional implementation, the step of generating the virtual topology of irregularly shaped components in the UGC scene includes: Obtain the base cube of the irregular component in the UGC scene, and obtain the vertex set formed by the midpoint of each edge of the base cube and the vertex of the specified face; The key point is determined from the midpoint, and the corresponding offset point is obtained by rotating the key point. A new set of vertices for the specified face is constructed by combining the offset point and the vertices of the specified face; Update the vertex sets of other faces based on the new vertex set of the specified face; By combining the vertex set of the specified face and other faces, a virtual topology of the irregular component is constructed.
[0008] In an optional implementation, the step of constructing a new vertex set for the specified face by combining the offset point and the vertices of the specified face includes: Replace two vertices of the specified face with the offset point, and construct a new vertex set for the specified face using the offset point and the remaining two vertices; or The midpoint of the edge on the specified face is combined with the offset point to form a new vertex, and a new vertex set of the specified face is constructed based on the new vertex.
[0009] In an optional implementation, the step of finding the corresponding adsorption surface matching relationship and position offset in the matching rule table based on the component types of the preview component and the adsorbed component to obtain the final adsorption position includes: Based on the component types of the preview component and the adsorbed component, the surface data of each face of the preview component and the adsorbed component are obtained by searching the component topology database. Based on the surface data of each surface of the preview component and the adsorbed component, the matching rule table is searched to determine the matching adsorption surface pair. The initial adsorption position is determined based on the adsorption surface matching pair, and the initial adsorption position is adjusted based on the obtained position offset to obtain the final adsorption position.
[0010] In an optional implementation, the step of determining matching adsorption surface pairs based on the surface data of each surface of the preview component and the adsorbed component includes: Traverse each face direction of the preview component and the adsorbed component, and determine whether the two faces match based on the face data of the two traversed faces and the adsorption face matching relationship in the matching rule table. If two surfaces match, then those two surfaces are determined to be an adsorption surface matching pair.
[0011] In an optional implementation, the step of adjusting the initial adsorption position based on the obtained position offset to obtain the final adsorption position includes: The initial adsorption position is corrected according to the position offset defined in the matching rule table; The initial adsorption position is fine-tuned based on the point differences and size differences between the preview component and the adsorbed component to obtain the final adsorption position.
[0012] In an optional embodiment, the step of fine-tuning the initial adsorption position based on the point differences and size differences between the preview component and the adsorbed component to obtain the final adsorption position includes: Determine the center point of the bottom surface of the preview component and the target center point of the target surface of the component to be adsorbed that matches the bottom surface, obtain the difference between the center point of the bottom surface and the target center point, and revise the corrected preliminary adsorption position based on the difference; The initial adsorption position is fine-tuned based on the size difference between the preview component and the adsorbed component to obtain the final adsorption position.
[0013] In an optional implementation, the step of determining matching adsorption surface pairs based on the surface data of each surface of the preview component and the adsorbed component includes: Based on the surface data of each surface of the preview component and the adsorbed component, a matching candidate adsorption surface pair is determined. If the number of candidate adsorption surface matching pairs exceeds one pair, the candidate adsorption surface matching pair with the smallest difference between the bottom center point and the target center point is obtained as the final adsorption surface matching pair.
[0014] Secondly, the present invention provides a configurable UGC construction device, the device comprising: The generation module is used to generate a virtual topology structure for the irregularly shaped components so that the irregularly shaped components maintain the same adsorption logic as the standard components. The storage module is used to store all irregular and standard components into the component topology database. A module is established to create a matching rule table, which contains the adsorption surface matching relationship and position offset between different component types. The response module is used to respond to the player's operation of selecting and moving the preview component from the topology database and moving it close to the snapped component in the UGC scene, and to obtain the component types of the preview component and the snapped component respectively; The construction module is used to find the corresponding adsorption surface matching relationship and position offset in the matching rule table based on the component types of the preview component and the adsorbed component, so as to obtain the final adsorption position and complete the adsorption construction operation based on the adsorption position.
[0015] Thirdly, the present invention provides an electronic device, comprising: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in any of the foregoing embodiments.
[0016] This invention provides a configurable UGC (User-Generated Content) construction method, apparatus, and electronic device. By generating a virtual topology structure of irregularly shaped components in a UGC scene, the adsorption logic of irregularly shaped components is kept consistent with that of standard components. All irregularly shaped and standard components are stored in a component topology database. A matching rule table containing adsorption surface matching relationships and position offsets between different component types is established. In response to a player selecting and moving a preview component from the topology database closer to an adsorbed component in the UGC scene, the component types of both the preview and adsorbed components are obtained. Based on the component types of the preview and adsorbed components, the matching rule table is consulted to obtain the corresponding adsorption surface matching relationship and position offset, thus determining the final adsorption position. The adsorption construction operation is completed based on this position. In this solution, virtual topology mapping ensures that irregularly shaped components maintain the same adsorption capability as standard components, and the adsorption rules can be dynamically expanded by configuring the matching rule table without modifying the engine's core code, improving the scalability of the solution. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a configurable UGC construction method provided in an embodiment of the present invention; Figure 2 for Figure 1 A flowchart of the sub-steps included in S11; Figure 3 for Figure 1 A flowchart of the sub-steps included in S15; Figure 4 for Figure 3 A flowchart of the sub-steps included in S152; Figure 5 for Figure 3 A flowchart of the sub-steps included in S153; Figure 6 A functional block diagram of a configurable UGC construction device provided in an embodiment of the present invention; Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0020] Please see Figure 1 This is a flowchart illustrating a configurable UGC construction method provided in an embodiment of the present invention. It should be understood that in other embodiments, the order of some steps in the configurable UGC construction method of this embodiment can be interchanged according to actual needs, or some steps can be omitted or deleted. The detailed steps of this configurable UGC construction method are described below.
[0021] S11, Generate a virtual topology structure for irregularly shaped components in the UGC scene so that the irregularly shaped components and standard components maintain the same adsorption logic; S12, store all irregular and standard components into the component topology database; S13, Establish a matching rule table, which contains the adsorption surface matching relationship and position offset between different component types; S14, in response to the player's operation of selecting and moving the preview component from the topology database to the snapped component in the UGC scene, the component types of the preview component and the snapped component are obtained respectively; S15, based on the component types of the preview component and the adsorbed component, search the matching rule table to obtain the corresponding adsorption surface matching relationship and position offset, so as to obtain the final adsorption position, and complete the adsorption construction operation based on the adsorption position.
[0022] The configurable UGC construction method provided in this embodiment generates a virtual topology structure for irregularly shaped components, ensuring that the adsorption logic of irregularly shaped components and standard components remains consistent. This avoids the limitations of existing technologies that only support the adsorption of standard components and cannot handle the adsorption of irregularly shaped components such as triangular foundations. Furthermore, by configuring a matching rule table, modifications to the adsorption rules can be made without modifying the engine's core proxy, enabling the addition of new component types and the modification of adsorption rules. This avoids the problems of hard-coding adsorption rules at the code level and poor scalability found in existing technologies.
[0023] The specific implementation methods of each of the above steps will be explained in detail below.
[0024] In this embodiment, irregularly shaped components mainly refer to non-cubic components such as triangular foundations, while standard components mainly refer to cubic components such as rectangular foundations.
[0025] This embodiment generates a virtual topology structure for irregularly shaped components in a UGC scene. For details, please refer to [link to relevant documentation]. Figure 2 This step can be achieved in the following ways: S111, obtain the basic cube of the irregular component in the UGC scene, and obtain the vertex set composed of the midpoint of each side of the basic cube and the vertex of the specified face; S112, Determine the key point from the midpoint, and perform a rotation transformation on the key point to obtain the corresponding offset point; S113, Combine the offset point and the vertices of the specified face to construct a new vertex set for the specified face; S114, Update the vertex sets of other faces based on the new vertex set of the specified face; S115, Combining the vertex set of the specified face and other faces, construct the virtual topology of the irregular component.
[0026] In this embodiment, a base cube for the irregular component is obtained, which can be the smallest cube enclosing the irregular component. The midpoint of each edge in the base cube and the set of vertices of a specified face are obtained. The specified face can be the bottom or top face of the base cube.
[0027] The key points are determined from the midpoints of each edge. For example, the key point can be the midpoint of any edge on a specified surface. Then, the key points are rotated according to the set rotation angle and axis to obtain the rotated offset points.
[0028] Based on this, a new set of vertices on the specified face is constructed by combining the offset point and the vertices on the specified face.
[0029] One possible implementation is to use offset points to replace two vertices of a specified face, and then construct a new vertex set for the specified face using the offset points and the remaining two vertices. That is, if a specified face originally has 4 vertices, offset points can be used to replace two adjacent vertices of the original 4 vertices, thus obtaining a new vertex set consisting of the offset points and the remaining two vertices.
[0030] As another possible implementation, the midpoint and offset point of an edge on a specified face can be combined to form a new vertex, and a new vertex set for the specified face can be constructed based on the new vertex. For example, the midpoint and offset point can be merged according to their corresponding weights to obtain a new merged vertex. It should be noted that the number of new vertices obtained is also three, and a new vertex set is constructed based on these three new vertices.
[0031] After processing a specified face of the basic cube in the manner described above, the vertex sets of the other faces are updated based on the new vertex set of the specified face. A virtual topological structure of irregular components can be constructed based on the vertex sets of each face. The constructed virtual topological structure can be a structure containing three planes: a top face, a bottom face, and two sides, where the top and bottom faces are triangles. Thus, a virtual topological structure with 5 faces and 6 vertices is formed.
[0032] In this embodiment, the virtual topology of the irregular component constructed in the above manner is similar to the cube of the standard component, so that the irregular component is equivalent to the standard component in the adsorption calculation.
[0033] To avoid the poor scalability issues caused by hard-coding, this embodiment no longer uses hard-coding for the adsorption rules, but instead stores them in a table format. Specifically, a matching rule table is configured, which defines the adsorption surface matching relationships and position offsets between different component types.
[0034] In real-world applications, players select the desired component to be placed (i.e., the preview component) and bring it close to an existing snapped-to-the-grid component in the scene. The game application responds to this action by obtaining the component types of both the preview and snapped-to-the-grid components.
[0035] Based on this, and according to the component types of the preview component and the component being adsorbed, the matching rule table is consulted to obtain the corresponding adsorption surface matching relationship and position offset, thus obtaining the final adsorption position. For details, please refer to [link to relevant documentation]. Figure 3 This step can be achieved in the following way: S151, based on the component types of the preview component and the adsorbed component, search the component topology database to obtain the surface data of each surface of the preview component and the adsorbed component; S152, based on the surface data of each surface of the preview component and the adsorbed component, search the matching rule table to determine the matching adsorption surface pair; S153, determine the initial adsorption position according to the adsorption surface matching pair, and adjust the initial adsorption position based on the obtained position offset to obtain the final adsorption position.
[0036] In this embodiment, the component topology database stores the surface data of various components. For the preview component and the component being snapped, the surface data of each surface of the preview component and the component being snapped are obtained by searching the component topology database.
[0037] Then, based on the surface data of each face of the preview component and the adsorbed component, a matching rule table is searched to determine if there are any matching face faces.
[0038] Specifically, please refer to Figure 4 The step of determining the matching adsorption surface pair based on the surface data of each surface of the preview component and the adsorbed component can be implemented in the following way: S1521, Traverse each face direction of the preview component and the adsorbed component, and determine whether the two faces match based on the face data of the two traversed faces and the adsorption face matching relationship in the matching rule table. S1522, if two surfaces match, then the two surfaces are determined to be an adsorption surface matching pair.
[0039] In this embodiment, the preview component and the adsorbed component are traversed in each surface direction, including up, down, front, back, left, right, etc., to find whether the surfaces of the preview component and the adsorbed component have a matching relationship in each surface direction. The matching relationship is pre-configured and stored in the matching rule table.
[0040] If two surfaces are found to have a matching relationship, then these two surfaces can be identified as an adsorption surface matching pair.
[0041] After determining the adsorption surface matching pair, the initial adsorption position can be determined based on the adsorption surface matching pair, and the alignment offset of the two components in the corresponding surface direction can be further calculated.
[0042] The matching rule table is configured with corresponding position offsets, which can be used to adjust the initial adsorption position to achieve alignment offset processing. These position offsets can be set based on the rotation angle set during the aforementioned rotation processing, primarily to compensate for the offset between the irregularly shaped component and its corresponding virtual topology.
[0043] Specifically, please refer to Figure 5 The step of adjusting the initial adsorption position based on the obtained position offset to obtain the final adsorption position can be achieved in the following way: S1531, Correct the initial adsorption position according to the position offset defined in the matching rule table; S1532, the initial adsorption position is fine-tuned based on the point difference and size difference between the preview component and the adsorbed component to obtain the final adsorption position.
[0044] Considering the offset between the irregularly shaped component and its virtual topology, when correcting the initial adsorption position using the position offset, the difference between the face of the irregularly shaped component and the corresponding face of the adsorbed component may prevent precise alignment during adsorption. Therefore, fine-tuning based on the point differences between the two is also necessary. Furthermore, considering the potential volume differences between the irregularly shaped component and the adsorbed component, and consequently the area differences between their corresponding matching faces, fine-tuning based on their dimensional differences is also required.
[0045] Specifically, the step of fine-tuning the initial adsorption position based on the point differences and size differences between the preview component and the adsorbed component to obtain the final adsorption position includes: Determine the center point of the bottom surface of the preview component and the target center point of the target surface of the component to be adsorbed that matches the bottom surface, obtain the difference between the center point of the bottom surface and the target center point, and revise the corrected preliminary adsorption position based on the difference; The initial adsorption position is fine-tuned based on the size difference between the preview component and the adsorbed component to obtain the final adsorption position.
[0046] There may be no adsorption surface matching pairs between the surfaces of the preview component and the adsorbed component, or there may be one pair of adsorption surface matching pairs, or there may be multiple pairs of adsorption surface matching pairs.
[0047] Therefore, in the step of determining matching adsorption surface pairs based on the surface data of each surface of the preview component and the adsorbed component, candidate adsorption surface pairs are first determined based on the surface data of each surface of the preview component and the adsorbed component. If the number of candidate adsorption surface pairs exceeds one pair, the candidate adsorption surface pair with the smallest difference between the bottom center point and the target center point is obtained as the final adsorption surface pair.
[0048] The configurable UGC construction method provided in this embodiment enables irregularly shaped components such as triangles to acquire the same adsorption capacity as standard rectangular components through virtual topology mapping. Furthermore, a matching rule table is configured and hot-updated; when adding a new component type, only an entry needs to be added to the matching rule table, without modifying the engine code.
[0049] Based on the same inventive concept, please refer to Figure 6This invention also provides a functional module diagram of a configurable UGC construction device. This embodiment divides the configurable UGC construction device into functional modules based on the above method embodiments. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware or as software functional modules. It should be noted that the module division in this embodiment is illustrative and represents only one logical functional division; other division methods may be used in actual implementation.
[0050] The configurable UGC building device can include a generation module, a saving module, a creation module, a response module, and a search module. The functions of each module of the configurable UGC building device are described in detail below.
[0051] The generation module is used to generate a virtual topology structure for the irregularly shaped components so that the irregularly shaped components maintain the same adsorption logic as the standard components. The storage module is used to store all irregular and standard components into the component topology database. A module is established to create a matching rule table, which contains the adsorption surface matching relationship and position offset between different component types. The response module is used to respond to the player's operation of selecting and moving the preview component from the topology database and moving it close to the snapped component in the UGC scene, and to obtain the component types of the preview component and the snapped component respectively; The construction module is used to find the corresponding adsorption surface matching relationship and position offset in the matching rule table based on the component types of the preview component and the adsorbed component, so as to obtain the final adsorption position and complete the adsorption construction operation based on the adsorption position.
[0052] In one possible implementation, the above-mentioned generation module can be used for: Obtain the base cube of the irregular component in the UGC scene, and obtain the vertex set formed by the midpoint of each edge of the base cube and the vertex of the specified face; The key point is determined from the midpoint, and the corresponding offset point is obtained by rotating the key point. A new set of vertices for the specified face is constructed by combining the offset point and the vertices of the specified face; Update the vertex sets of other faces based on the new vertex set of the specified face; By combining the vertex set of the specified face and other faces, a virtual topology of the irregular component is constructed.
[0053] In one possible implementation, the above-mentioned generation module can be used for: Replace two vertices of the specified face with the offset point, and construct a new vertex set for the specified face using the offset point and the remaining two vertices; or The midpoint of the edge on the specified face is combined with the offset point to form a new vertex, and a new vertex set of the specified face is constructed based on the new vertex.
[0054] In one possible implementation, the above-mentioned lookup construction module can be used for: Based on the component types of the preview component and the adsorbed component, the surface data of each face of the preview component and the adsorbed component are obtained by searching the component topology database. Based on the surface data of each surface of the preview component and the adsorbed component, the matching rule table is searched to determine the matching adsorption surface pair. The initial adsorption position is determined based on the adsorption surface matching pair, and the initial adsorption position is adjusted based on the obtained position offset to obtain the final adsorption position.
[0055] In one possible implementation, the above-mentioned lookup construction module can be used for: Traverse each face direction of the preview component and the adsorbed component, and determine whether the two faces match based on the face data of the two traversed faces and the adsorption face matching relationship in the matching rule table. If two surfaces match, then those two surfaces are determined to be an adsorption surface matching pair.
[0056] In one possible implementation, the above-mentioned lookup construction module can be used for: The initial adsorption position is corrected according to the position offset defined in the matching rule table; The initial adsorption position is fine-tuned based on the point differences and size differences between the preview component and the adsorbed component to obtain the final adsorption position.
[0057] In one possible implementation, the above-mentioned lookup construction module can be used for: Determine the center point of the bottom surface of the preview component and the target center point of the target surface of the component to be adsorbed that matches the bottom surface, obtain the difference between the center point of the bottom surface and the target center point, and revise the corrected preliminary adsorption position based on the difference; The initial adsorption position is fine-tuned based on the size difference between the preview component and the adsorbed component to obtain the final adsorption position.
[0058] In one possible implementation, the above-mentioned lookup construction module can be used for: Based on the surface data of each surface of the preview component and the adsorbed component, a matching candidate adsorption surface pair is determined. If the number of candidate adsorption surface matching pairs exceeds one pair, the candidate adsorption surface matching pair with the smallest difference between the bottom center point and the target center point is obtained as the final adsorption surface matching pair.
[0059] It should be noted that the configurable UGC construction device provided in this embodiment can be used to execute the configurable UGC construction method under any of the above embodiments. For details not covered in this embodiment, please refer to the corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.
[0060] Please see Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. The electronic device can be, for example, a computer device or a server. The electronic device includes a memory, a processor, and a communication module. The memory, processor, and communication module are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0061] The memory is used to store computer programs or data. Memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc.
[0062] The processor is used to read / write data or programs stored in the memory and to execute the configurable UGC construction method provided in any embodiment of the present invention.
[0063] The communication module is used to establish communication connections between electronic devices and other communication terminals via a network, and to send and receive data via the network.
[0064] It should be understood that, Figure 7 The structure shown is only a schematic diagram of an electronic device; the electronic device may also include components that are larger than those shown. Figure 7 The more or fewer components shown, or having the same Figure 7 The different configurations shown.
[0065] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing machine-executable instructions, which, when executed, implement the configurable UGC construction method provided in the above embodiments.
[0066] Specifically, the computer-readable storage medium can be a general-purpose storage medium, such as a removable disk or hard disk. When the computer program on the computer-readable storage medium is run, it can execute the aforementioned configurable UGC construction method. The processes involved in the execution of the executable instructions on the computer-readable storage medium can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0067] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0068] Furthermore, 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.
[0069] Furthermore, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0070] It should be noted that if the functionality is implemented as a software module 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 invention, or the part that contributes to the prior art, or a 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 personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. 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.
[0071] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0072] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A configurable UGC construction method, characterized in that, The method includes: Generate a virtual topology structure for irregularly shaped components in a UGC scene to ensure that the irregularly shaped components maintain the same adsorption logic as standard components; Store all irregular and standard components in the component topology database; Establish a matching rule table, which contains the adsorption surface matching relationship and position offset between different component types; In response to the player's operation of selecting and moving a preview component from the topology database closer to a component that is snapped into the UGC scene, the component types of the preview component and the snapped component are obtained respectively; Based on the component types of the preview component and the component to be adsorbed, the corresponding adsorption surface matching relationship and position offset are obtained by searching the matching rule table to obtain the final adsorption position, and the adsorption construction operation is completed based on the adsorption position.
2. The configurable UGC construction method according to claim 1, characterized in that, The step of generating the virtual topology of irregularly shaped components in the UGC scene includes: Obtain the base cube of the irregular component in the UGC scene, and obtain the vertex set composed of the midpoint of each edge of the base cube and the vertex of the specified face; The key point is determined from the midpoint, and the corresponding offset point is obtained by rotating the key point. A new set of vertices for the specified face is constructed by combining the offset point and the vertices of the specified face; Update the vertex sets of other faces based on the new vertex set of the specified face; By combining the vertex set of the specified face and other faces, a virtual topology of the irregular component is constructed.
3. The configurable UGC construction method according to claim 2, characterized in that, The step of constructing a new vertex set for the specified face by combining the offset point and the vertices of the specified face includes: Replace two vertices of the specified face with the offset point, and construct a new vertex set for the specified face using the offset point and the remaining two vertices; or The midpoint of the edge on the specified face is combined with the offset point to form a new vertex, and a new vertex set of the specified face is constructed based on the new vertex.
4. The configurable UGC construction method according to claim 1, characterized in that, The step of finding the corresponding adsorption surface matching relationship and position offset in the matching rule table based on the component types of the preview component and the adsorbed component to obtain the final adsorption position includes: Based on the component types of the preview component and the adsorbed component, the surface data of each face of the preview component and the adsorbed component are obtained by searching the component topology database. Based on the surface data of each surface of the preview component and the adsorbed component, the matching rule table is searched to determine the matching adsorption surface pair. The initial adsorption position is determined based on the adsorption surface matching pair, and the initial adsorption position is adjusted based on the obtained position offset to obtain the final adsorption position.
5. The configurable UGC construction method according to claim 4, characterized in that, The step of determining matching adsorption surface pairs based on the surface data of each surface of the preview component and the adsorbed component includes: Traverse each face direction of the preview component and the adsorbed component, and determine whether the two faces match based on the face data of the two traversed faces and the adsorption face matching relationship in the matching rule table. If two surfaces match, then those two surfaces are determined to be an adsorption surface matching pair.
6. The configurable UGC construction method according to claim 4, characterized in that, The step of adjusting the initial adsorption position based on the obtained position offset to obtain the final adsorption position includes: The initial adsorption position is corrected according to the position offset defined in the matching rule table; The initial adsorption position is fine-tuned based on the point differences and size differences between the preview component and the adsorbed component to obtain the final adsorption position.
7. The configurable UGC construction method according to claim 6, characterized in that, The step of fine-tuning the initial adsorption position based on the point differences and size differences between the preview component and the adsorbed component to obtain the final adsorption position includes: Determine the center point of the bottom surface of the preview component and the target center point of the target surface of the component to be adsorbed that matches the bottom surface, obtain the difference between the center point of the bottom surface and the target center point, and revise the corrected preliminary adsorption position based on the difference; The initial adsorption position is fine-tuned based on the size difference between the preview component and the adsorbed component to obtain the final adsorption position.
8. The configurable UGC construction method according to claim 7, characterized in that, The step of determining matching adsorption surface pairs based on the surface data of each surface of the preview component and the adsorbed component includes: Based on the surface data of each surface of the preview component and the adsorbed component, a matching candidate adsorption surface pair is determined. If the number of candidate adsorption surface matching pairs exceeds one pair, the candidate adsorption surface matching pair with the smallest difference between the bottom center point and the target center point is obtained as the final adsorption surface matching pair.
9. A configurable UGC construction device, characterized in that, The device includes: The generation module is used to generate a virtual topology structure for the irregularly shaped components so that the irregularly shaped components maintain the same adsorption logic as the standard components. The storage module is used to store all irregular and standard components into the component topology database. A module is established to create a matching rule table, which contains the adsorption surface matching relationship and position offset between different component types. The response module is used to respond to the player's operation of selecting and moving the preview component from the topology database and moving it close to the snapped component in the UGC scene, and to obtain the component types of the preview component and the snapped component respectively; The construction module is used to find the corresponding adsorption surface matching relationship and position offset in the matching rule table based on the component types of the preview component and the adsorbed component, so as to obtain the final adsorption position and complete the adsorption construction operation based on the adsorption position.
10. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1 to 8.
