Control method, device and storage medium of virtual component and electronic device
By replacing the multiple relationships between virtual components with the relationship between virtual components and spatial grids, and using standard and unified spatial grid parameters for matching and judgment, the problem of low control efficiency of virtual components is solved, and rapid and accurate matching and combination and control efficiency are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-09-01
- Publication Date
- 2026-06-16
AI Technical Summary
The control efficiency of virtual components in existing technologies is low, and they cannot be quickly and accurately combined, resulting in low control efficiency.
By replacing the multiple relationships between virtual components with the relationship between virtual components and spatial grids, matching and judgment are performed using standard and unified spatial grid parameters, simplifying the matching conditions.
It improves the control efficiency of virtual components, reduces control complexity, and enables fast and accurate combination.
Smart Images

Figure CN115721937B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computers, and more specifically, to a method, apparatus, storage medium, and electronic device for controlling virtual components. Background Technology
[0002] In recent years, building games (where players control virtual components to construct elaborate buildings) have seen rapid growth. However, current technologies for controlling virtual components only restrict the relationships between individual components; a virtual component to be placed is limited to the previously placed, adjacent component. Because there are numerous types of virtual components, and the combination conditions between different types are complex, it's difficult to quickly and accurately control each component to fit into its specific combination, thus reducing control efficiency. In other words, current technologies suffer from low control efficiency for virtual components.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a method, apparatus, storage medium, and electronic device for controlling virtual components, in order to at least solve the technical problem of low control efficiency of virtual components.
[0005] According to one aspect of the present invention, a method for controlling a virtual component is provided, comprising: acquiring a first placement request executed on a first virtual component, wherein the first placement request is used to request that the first virtual component be placed in a first grid region of a preset spatial grid region, the first virtual component having a correspondence with a pre-configured first set of spatial grid parameters, the first set of spatial grid parameters being spatial grid parameters required for placing the first virtual component; responding to the first placement request, acquiring a second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters being spatial grid parameters that allow the placement of the virtual component; and when the second set of spatial grid parameters matches the first set of spatial grid parameters, placing the first virtual component in the first grid region.
[0006] According to another aspect of the present invention, a control device for a virtual component is also provided, comprising: a first acquisition unit, configured to acquire a first placement request executed on a first virtual component, wherein the first placement request is used to request the placement of the first virtual component in a first grid region of a preset spatial grid region, the first virtual component having a correspondence with a pre-configured first set of spatial grid parameters, the first set of spatial grid parameters being spatial grid parameters required for placing the first virtual component; a second acquisition unit, configured to respond to the first placement request and acquire a second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters being spatial grid parameters that allow the placement of the virtual component; and a first placement unit, configured to place the first virtual component in the first grid region when the second set of spatial grid parameters matches the first set of spatial grid parameters.
[0007] As an optional solution, the second acquisition unit includes: a first acquisition module, used to acquire the first subgroup spatial grid parameters corresponding to the first grid region, and the second subgroup spatial grid parameters corresponding to the second grid region in the spatial grid region, wherein the second group spatial grid parameters include the first subgroup spatial grid parameters and the second subgroup spatial grid parameters, the first grid region is the grid region occupied by the first virtual component, and the second grid region is the grid region on which the first virtual component is placed.
[0008] As an optional solution, the above-mentioned device further includes: a first determining module, configured to determine the second grid region in the above-mentioned spatial grid region according to the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters before obtaining the second subgroup of spatial grid parameters corresponding to the second grid region in the above-mentioned spatial grid region, wherein the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the first virtual component is placed.
[0009] As an optional solution, the first determining module includes: a determining submodule, used to determine, starting from the first grid region, a second grid region that matches at least one of the point parameters, line parameters, surface parameters and volume parameters on which the placement of the first virtual component depends when the spatial grid parameters of the fourth subgroup include at least one of the point parameters, line parameters, surface parameters and volume parameters.
[0010] As an optional solution, the above-mentioned device further includes: a second acquisition module, used to acquire the third subgroup of spatial grid parameters and the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters, wherein the third subgroup of spatial grid parameters are the spatial grid parameters occupied by the first virtual component, and the fourth subgroup of spatial grid parameters are the spatial grid parameters on which the first virtual component depends; and a second determination module, used to determine that the second group of spatial grid parameters matches the first group of spatial grid parameters when the first subgroup of spatial grid parameters matches the third subgroup of spatial grid parameters and the second subgroup of spatial grid parameters matches the fourth subgroup of spatial grid parameters.
[0011] As an optional solution, the above-mentioned device further includes: a third determining module, used to determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters when the number of unoccupied points, lines, surfaces, and volumes represented by the first subgroup spatial grid parameters is greater than the number of points, lines, surfaces, and volumes required to be occupied as identified by the third subgroup spatial grid parameters; and / or a fourth determining module, used to determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters when the number of occupied points, lines, surfaces, and volumes represented by the second subgroup spatial grid parameters is greater than the number of dependent points, lines, surfaces, and volumes identified by the fourth subgroup spatial grid parameters.
[0012] As an optional solution, the above-mentioned device further includes: an updating unit, used to update the first subgroup spatial grid parameters corresponding to the first grid region in the spatial grid region to the fifth subgroup spatial grid parameters after the first virtual component is placed in the first grid region, wherein the fifth subgroup spatial grid parameters indicate that the points, lines, surfaces and volumes in the first grid region have been occupied.
[0013] As an optional solution, the above-mentioned device further includes: a third acquisition unit, configured to acquire a second placement request for the second virtual component after updating the first subgroup spatial grid parameters corresponding to the first grid region to the fifth subgroup spatial grid parameters, wherein the second placement request is used to request the placement of the second virtual component in a third grid region within the spatial grid region whose fifth subgroup spatial grid parameters have been updated, wherein the second virtual component corresponds to a pre-configured third set of spatial grid parameters, and the third set of spatial grid parameters are the spatial grid parameters required for placing the second virtual component; a fourth acquisition unit, configured to, after updating the first subgroup spatial grid parameters corresponding to the first grid region to the fifth subgroup spatial grid parameters, respond to the second placement request and acquire a fourth set of spatial grid parameters corresponding to the third grid region within the spatial grid region, wherein the fourth set of spatial grid parameters are the spatial grid parameters that allow the placement of the virtual component; and a second placement unit, configured to, after updating the first subgroup spatial grid parameters corresponding to the first grid region to the fifth subgroup spatial grid parameters, place the second virtual component in the third grid region when the fourth set of spatial grid parameters matches the third set of spatial grid parameters.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, wherein the computer program is configured to execute the control method of the virtual component described above when running.
[0015] According to another aspect of the present invention, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the control method of the virtual component described above through the computer program.
[0016] In this embodiment of the invention, the association between virtual components is transferred to the association between virtual components and spatial grids. Since the parameters of the spatial grids are standard and uniform, the complexity of the matching conditions brought about by the association between virtual components and spatial grids is lower than that brought about by multiple different associations between virtual components. This eliminates the need to consider the complex matching conditions brought about by multiple different associations between virtual components during the control process of virtual components, thereby achieving the technical objective of reducing the control complexity of virtual components and improving the control efficiency of virtual components. This solves the technical problem of low control efficiency of virtual components. Attached Figure Description
[0017] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0018] Figure 1 This is a schematic diagram of an application environment for an optional virtual component control method according to an embodiment of the present invention;
[0019] Figure 2 This is a schematic diagram of the flow of an optional virtual component control method according to an embodiment of the present invention;
[0020] Figure 3 This is a schematic diagram of an optional virtual component control method according to an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0022] Figure 5 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0023] Figure 6 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0024] Figure 7 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0025] Figure 8 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0026] Figure 9 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0027] Figure 10 This is a schematic diagram of another optional virtual component control method according to an embodiment of the present invention;
[0028] Figure 11 This is a schematic diagram of a control device for an optional virtual component according to an embodiment of the present invention;
[0029] Figure 12 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0032] First, to facilitate understanding of the embodiments of the present invention, some terms or nouns involved in the present invention will be explained below:
[0033] Meshization: Construct a virtual, regular grid space for the reference building to facilitate subsequent discrete segmentation.
[0034] Discretization: The process of cutting a reference house into prefabricated building components.
[0035] Building modules: Prefabricated building structures, such as a wall, a door, or a staircase. Players use these modules to assemble the building structures they want.
[0036] According to one aspect of the present invention, a method for controlling a virtual component is provided. Optionally, as an alternative implementation, the above-described method for controlling a virtual component may be applied to, but is not limited to, [examples of other methods]. Figure 1 The environment shown may include, but is not limited to, user equipment 102, network 110, and server 112. The user equipment 102 may include, but is not limited to, a display 108, a processor 106, and a memory 104.
[0037] The specific process can be summarized in the following steps:
[0038] In step S102, the user equipment 102 obtains a first placement request for the first virtual component 1022, wherein the first placement request is used to request the first virtual component 1022 to be placed in a first grid region in a preset spatial grid region 1024.
[0039] In steps S104-S106, user equipment 102 sends the first placement request to server 112 via network 110;
[0040] In step S108, server 112 searches for the spatial grid parameters corresponding to the first grid region in spatial grid region 1024 through database 114, and performs matching processing on the spatial grid parameters with the spatial grid parameters corresponding to the first virtual component 1022 through processing engine 116, thereby generating a placement result. The placement result is used to indicate whether the first virtual component 1022 has been successfully placed in the first grid region, and the basis for generating the placement result may be, but is not limited to, whether the spatial grid parameters match the spatial grid parameters corresponding to the first virtual component 1022. For example, if they match, the placement is successful; otherwise, if they do not match, the placement fails.
[0041] In steps S110-S112, server 112 sends the placement result to user equipment 102 via network 110. Processor 106 in user equipment 102 displays the placement result on display 108 and stores the adjusted first detection area information in memory 104.
[0042] remove Figure 1 Beyond the illustrated example, the above steps can be performed independently by the user equipment 102. Specifically, the user equipment 102 performs steps such as searching for the spatial grid parameters corresponding to the first grid region within the spatial grid region 1024, and matching these spatial grid parameters with the spatial grid parameters corresponding to the first virtual component 1022, thereby reducing the processing load on the server. The user equipment 102 includes, but is not limited to, handheld devices (such as mobile phones), laptops, desktop computers, and in-vehicle devices. This invention does not limit the specific implementation of the user equipment 102.
[0043] Alternatively, as an optional implementation, such as Figure 2 As shown, the control methods for virtual components include:
[0044] S202, Obtain a first placement request executed on the first virtual component, wherein the first placement request is used to request the first virtual component to be placed in a first grid area of a preset spatial grid area, the first virtual component has a corresponding relationship with a first set of pre-configured spatial grid parameters, and the first set of spatial grid parameters are the spatial grid parameters required to place the first virtual component;
[0045] S204, in response to the first placement request, obtain the second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters are the spatial grid parameters that allow the placement of virtual components;
[0046] S206, when the second set of spatial grid parameters matches the first set of spatial grid parameters, the first virtual component is placed in the first grid region.
[0047] Optionally, in this embodiment, the above-mentioned virtual component control method can be applied, but is not limited to, in the application scenario of virtual games that construct building types. For example, in the running of a game of the target virtual game, a spatial grid area is allocated to the virtual object controlled by the user so that the user can control the virtual object to complete the construction of the target building. Before the user controls the virtual object to complete the construction of the target building, multiple virtual components are provided to the virtual object to complete the construction of the target building. The multiple virtual components include a first virtual component, and the multiple virtual components can be, but are not limited to, virtual components obtained by splitting the target building.
[0048] Optionally, in this embodiment, the virtual component may be, but is not limited to, a component of a virtual building. In other words, a virtual building typically includes multiple virtual components. For example, virtual component A is a door, virtual component B is a wall, and virtual component C is a window. Controlling a virtual component A, multiple virtual components B, and a virtual component C to place them in a combination within the corresponding area, and treating them as a whole, constitutes a virtual building (house).
[0049] Optionally, in this embodiment, the spatial grid region can be understood, but is not limited to, as a three-dimensional spatial region, and this spatial region is composed of multiple equally divided virtual grids. The virtual grid can be understood, but is not limited to, as a spatial unit of the spatial grid region, and the attributes, state, or distribution information of the virtual grid can be used, but is not limited to, as a basis for determining whether a virtual component can be placed in the corresponding grid region.
[0050] Optionally, in this embodiment, to ensure that each virtual component has a corresponding association with a spatial grid region, a corresponding spatial grid parameter is pre-configured for each virtual component. This spatial grid parameter can be understood, but is not limited to, a standard and unified attribute parameter. Before placing each virtual component, the pre-configured spatial grid parameter must be matched with the real-time spatial grid parameter in the current spatial grid region. Placement is only allowed if a match is found. In this way, only the association between each virtual component and the spatial grid region needs to be considered. This association is simple and singular, without needing to consider the complex and cumbersome associations between different virtual components, thereby improving the control efficiency of virtual components.
[0051] Optionally, in this embodiment, obtaining the second set of spatial grid parameters corresponding to the first grid region may include, but is not limited to, obtaining the spatial grid parameters of the first grid region, and may also include, but is not limited to, obtaining the spatial grid parameters of other grid regions besides the first grid region. The other grid regions are associated with the first grid region, and the association between the two may be, but is not limited to, related to the spatial grid parameters of the first virtual component. For example, if the spatial grid parameters of the first virtual component indicate that it needs to be associated with grid region A, then while obtaining the spatial grid parameter 1 of the first grid region, the spatial grid parameter 2 of grid region A should also be obtained, and then the spatial grid parameter 1 and the spatial grid parameter 2 should be used separately or together with the spatial grid parameters of the first virtual component for matching and judgment.
[0052] It should be noted that the relationships between virtual components are transferred to the relationships between virtual components and spatial grids. Since the parameters of the spatial grids are standard and uniform, the complexity of the matching conditions brought about by the relationships between virtual components and spatial grids is lower than that brought about by multiple different relationships between virtual components. This eliminates the need to consider the complex matching conditions brought about by multiple different relationships between virtual components during the control process of virtual components, thereby reducing the control complexity of virtual components and improving the control efficiency of virtual components.
[0053] Further examples, such as Figure 3 As shown, the specific steps are as follows:
[0054] Step S302: Obtain a placement request for the virtual component 302 (such as a virtual wall). The placement request is used to request the virtual component 302 to be placed at a first position 306 in the target area 306. The target area 306 and the spatial grid area 310 are the same area. The first grid area 308 and the first position 306 are the same position. The target area 306 and the first position 306 are visible spaces for display. The spatial grid area 310 and the first area 308 are invisible spaces for determining whether the placement meets the conditions.
[0055] Step S304: Obtain the first set of spatial grid parameters 304 corresponding to the virtual component 302;
[0056] Step S306: Match the obtained first set of spatial grid parameters 304 with the spatial grid parameters in spatial grid region 310 that correspond to the first grid region 308;
[0057] Step S308: Output the matching determination result and execute the following steps based on the matching determination result. If the determination result is yes, execute step S310-1; if it is no, execute step S310-2.
[0058] Step S310-1, placement successful;
[0059] Step S310-2, placement failed.
[0060] As can be seen, in the control process of the virtual component 302 shown in the above embodiment, no relevant data of other virtual components is obtained. Instead, the grid parameters corresponding to the spatial grid region 310 are directly obtained to complete the matching judgment of the virtual component 302. That is to say, in the control process of the virtual component 302, there is no need to consider the relationship between other virtual components and the virtual component 302, and there is no need to consider the complex matching conditions brought about by multiple different relationships between virtual components. This reduces the control complexity of the virtual component and improves the control efficiency of the virtual component.
[0061] Through the embodiments provided in this application, a first placement request is obtained for a first virtual component, wherein the first placement request is used to request the placement of the first virtual component in a first grid area of a preset spatial grid area. The first virtual component has a corresponding relationship with a first set of pre-configured spatial grid parameters, which are the spatial grid parameters required to place the first virtual component. In response to the first placement request, a second set of spatial grid parameters corresponding to the first grid area is obtained in the spatial grid area, wherein the second set of spatial grid parameters are the spatial grid parameters that allow the placement of the virtual component. When the second set of spatial grid parameters matches the first set of spatial grid parameters, the first virtual component is placed in the first grid area, thereby achieving the technical objective of reducing the control complexity of the virtual component and thus realizing the technical effect of improving the control efficiency of the virtual component.
[0062] As an optional approach, a second set of spatial grid parameters corresponding to the first grid region is obtained within the spatial grid region, including:
[0063] Obtain the first subgroup spatial grid parameters corresponding to the first grid region, and the second subgroup spatial grid parameters corresponding to the second grid region in the spatial grid region. The second group of spatial grid parameters includes the first subgroup spatial grid parameters and the second subgroup spatial grid parameters. The first grid region is the grid region occupied by the first virtual component, and the second grid region is the grid region on which the first virtual component is placed.
[0064] Optionally, in this embodiment, successfully placing the first virtual component requires at least one condition A to be met, namely, the area space provided by the first grid area must be at least greater than or equal to the area space occupied by the first virtual component to be placed. For example, if the area space occupied by the first virtual component is 3, then if the area space provided by the first grid area is greater than or equal to 3, then condition A is considered to be met.
[0065] Optionally, in this embodiment, successful placement of the first virtual component may also require, but is not limited to, satisfying a condition B, namely, that the current spatial grid parameters of the second grid region must at least meet the spatial grid parameter conditions required by the first virtual component to be placed. For example, the spatial grid parameter conditions required by the first virtual component are that the current available area space range of the second grid region must be greater than or equal to 3. In this case, if the available area space range of the second grid region is greater than or equal to 3, then condition B is considered to be satisfied.
[0066] It should be noted that obtaining the spatial grid parameters of the first subgroup corresponding to the first grid region, and the spatial grid parameters of the second subgroup corresponding to the second grid region in the spatial grid region, can be understood, but is not limited to, obtaining the spatial grid parameters of the first grid region that has a direct relationship with the first virtual component, and also obtaining the spatial grid parameters of the second grid region that has an indirect relationship with the first virtual component.
[0067] To further illustrate, optional examples include... Figure 4 As shown, during the process of requesting the first virtual component 404 to be placed in the first grid region 408 in the spatial grid region 402, the first subgroup spatial grid parameters corresponding to the first grid region 408 and the second subgroup spatial grid parameters corresponding to the second grid region 410 in the spatial grid region 402 are obtained.
[0068] Assuming that other virtual components (such as virtual walls) are pre-placed in the second grid region 410, and the placement conditions of the first virtual component 404 include that the contact area in the grid region requiring horizontal side contact is greater than or equal to an area threshold, and the area space occupied in the second subgroup spatial grid parameter represents the area space occupied in the second grid region 410, and the contact area between the occupied area space and the first grid region 408 is greater than or equal to the area threshold, then if the area space area that can be provided in the first grid region 408 is greater than the area space area occupied by the first virtual component 404, it is considered that the first virtual component 404 is allowed to be placed in the first grid region 408.
[0069] As an optional approach, before obtaining the spatial grid parameters of the second subgroup corresponding to the second grid region within the spatial grid region, the method further includes:
[0070] Based on the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters, a second grid region is determined in the spatial grid region, wherein the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the first virtual component depends.
[0071] It should be noted that the second grid region is determined within the spatial grid region based on the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters.
[0072] To further illustrate, optional examples include... Figure 5 As shown, assuming that a virtual building 502 has been constructed, and that the virtual building 502 is constructed by combining a first virtual component 504 and a virtual component 506; based on this, before constructing the virtual building 502 by combining the first virtual component 504 and the virtual component 506, during the process of requesting the placement of the first virtual component 504, the spatial grid parameters corresponding to the first grid region 510 and the second grid region 512 in the spatial grid region 508 are obtained respectively, and then matched with the spatial grid parameters corresponding to the first virtual component 504 to determine whether the current spatial grid region 508 meets the placement conditions of the first virtual component 504;
[0073] Optionally, in this embodiment, the first grid region 510 may be, but is not limited to, a grid region determined in the spatial grid region 508 based on the grid parameters used to determine the space area to be occupied for placement in the spatial grid parameters of the first virtual component 504; the second grid region 512 is a grid region determined in the spatial grid region 508 based on the grid parameters used to determine the space area to which the placement depends in the spatial grid parameters of the first virtual component 504, wherein dependence may be, but is not limited to, understood as the association relationship of other virtual components associated with the placement of the first virtual component 504 as reflected in the grid parameters in the spatial grid region 508.
[0074] Through the embodiments provided in this application, a second grid region is determined in the spatial grid region according to the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters, thereby achieving the purpose of refining the granularity of the placement conditions of virtual components and improving the control accuracy of virtual components.
[0075] As an optional approach, a second grid region is determined within the spatial grid region based on the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters, including:
[0076] When the fourth subgroup of spatial grid parameters includes at least one of the point parameters, line parameters, surface parameters, and volume parameters on which the placement of the first virtual component depends, a second grid region is determined in the spatial grid region, starting from the first grid region, that matches at least one of the point parameters, line parameters, surface parameters, and volume parameters.
[0077] Optionally, in this embodiment, as Figure 6 As shown, the spatial grid region 602 is composed of multiple spatial grids 604, and each spatial grid 604 is provided with point parameters, line parameters, surface parameters and volume parameters corresponding to points, lines, surfaces and volumes respectively. Therefore, judging whether the spatial grid parameters meet the matching conditions can be understood as judging whether the point parameters, line parameters, surface parameters and volume parameters of each spatial grid 604 in the spatial grid region 602 indicated by the spatial grid parameters meet the matching conditions.
[0078] Optionally, in this embodiment, starting with the first grid region can be understood, but is not limited to, determining a second grid region within the spatial grid region that matches at least one of the point parameters, line parameters, surface parameters, and volume parameters. It can be, but is not limited to, referencing the regional location of the first grid region, such as... Figure 5 As shown, the second grid region 512 is a grid region that is adjacent to or located below the first grid region 510.
[0079] Through the embodiments provided in this application, when the spatial grid parameters of the fourth subgroup include at least one of the point parameters, line parameters, surface parameters, and volume parameters on which the placement of the first virtual component depends, a second grid region matching at least one of the point parameters, line parameters, surface parameters, and volume parameters is determined in the spatial grid region, starting from the first grid region. This achieves the purpose of flexibly determining the second grid region and realizes the effect of improving the flexibility of determining the second grid region.
[0080] As an alternative approach, the method also includes:
[0081] S1, obtain the third subgroup spatial grid parameters and the fourth subgroup spatial grid parameters in the first group of spatial grid parameters, wherein the third subgroup spatial grid parameters are the spatial grid parameters occupied by the placement of the first virtual component, and the fourth subgroup spatial grid parameters are the spatial grid parameters on which the placement of the first virtual component depends;
[0082] S2, when the spatial grid parameters of the first subgroup match the spatial grid parameters of the third subgroup, and the spatial grid parameters of the second subgroup match the spatial grid parameters of the fourth subgroup, determine that the spatial grid parameters of the second group match the spatial grid parameters of the first group.
[0083] To further illustrate, optional examples include... Figure 7As shown, the third and fourth subgroup spatial grid parameters in the first group of spatial grid parameters of the first virtual component 502 are obtained. The third subgroup spatial grid parameters are the spatial grid parameters occupied by the first virtual component 502 (such as the number of spatial grids occupied), and the fourth subgroup spatial grid parameters are the spatial grid parameters on which the first virtual component 502 depends (such as the state of the dependent spatial grid). When the first subgroup spatial grid parameters match the third subgroup spatial grid parameters of each region 506 of the first grid, and the second subgroup spatial grid parameters of the second grid region 508 match the fourth subgroup spatial grid parameters, it is determined that the second group of spatial grid parameters matches the first group of spatial grid parameters.
[0084] Through the embodiments provided in this application, the third subgroup and the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters are obtained. The third subgroup of spatial grid parameters is the spatial grid parameter occupied by the placement of the first virtual component, and the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the placement of the first virtual component depends. When the first subgroup of spatial grid parameters matches the third subgroup of spatial grid parameters, and the second subgroup of spatial grid parameters matches the fourth subgroup of spatial grid parameters, it is determined that the second group of spatial grid parameters matches the first group of spatial grid parameters. This achieves the purpose of judging whether the spatial grid parameters match from multiple perspectives and improves the matching accuracy of the spatial grid parameters.
[0085] As an alternative approach, the method also includes:
[0086] S1, when the number of unoccupied points, lines, surfaces, and volumes represented by the first subgroup spatial grid parameters is greater than the number of points, lines, surfaces, and volumes required to be occupied as identified by the third subgroup spatial grid parameters, determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters; and / or
[0087] S2, when the number of occupied points, lines, surfaces, and volumes represented by the second subgroup spatial grid parameters is greater than the number of dependent points, lines, surfaces, and volumes identified by the fourth subgroup spatial grid parameters, determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters.
[0088] As an optional approach, after placing the first virtual component in the first grid region, the method further includes:
[0089] Update the first subgroup spatial grid parameters corresponding to the first grid region in the spatial grid region to the fifth subgroup spatial grid parameters, where the fifth subgroup spatial grid parameters indicate that the points, lines, surfaces, and volumes in the first grid region have been occupied.
[0090] To further illustrate, optional examples include... Figure 8As shown, the first virtual component 602 is placed in the first grid region of the spatial grid region 604, as follows. Figure 8 As shown in (a); and after placing the first virtual component 602 in the first grid region, as Figure 8 As shown in (b), update the spatial grid parameters corresponding to the first grid region in spatial grid region 604, such as updating the status of the corresponding spatial grid to occupied.
[0091] Through the embodiments provided in this application, the spatial grid parameters of the first subgroup corresponding to the first grid region in the spatial grid region are updated to the spatial grid parameters of the fifth subgroup, thereby achieving the purpose of timely updating the spatial grid parameters in the spatial grid region and improving the timeliness of matching in the spatial grid region.
[0092] As an optional approach, after updating the spatial grid parameters of the first subgroup corresponding to the first grid region to the spatial grid parameters of the fifth subgroup, the method further includes:
[0093] S1, obtain a second placement request executed on the second virtual component, wherein the second placement request is used to request the second virtual component to be placed in the third grid region of the spatial grid region that has been updated with the fifth subgroup spatial grid parameters, the second virtual component has a corresponding relationship with the pre-configured third group of spatial grid parameters, and the third group of spatial grid parameters are the spatial grid parameters required to place the second virtual component;
[0094] S2, responding to the second placement request, obtain the fourth set of spatial grid parameters corresponding to the third grid region in the spatial grid region, wherein the fourth set of spatial grid parameters are the spatial grid parameters that allow the placement of virtual components;
[0095] S3, when the fourth set of spatial grid parameters matches the third set of spatial grid parameters, place the second virtual component in the third grid region.
[0096] It should be noted that the process involves obtaining a second placement request for the second virtual component, wherein the second placement request is used to request that the second virtual component be placed in the third grid region of the spatial grid region that has been updated with the fifth subgroup spatial grid parameters. The second virtual component has a corresponding relationship with the pre-configured third set of spatial grid parameters, which are the spatial grid parameters required for placing the second virtual component. In response to the second placement request, the process involves obtaining a fourth set of spatial grid parameters in the spatial grid region that corresponds to the third grid region, wherein the fourth set of spatial grid parameters are the spatial grid parameters that allow the placement of the virtual component. When the fourth set of spatial grid parameters matches the third set of spatial grid parameters, the second virtual component is placed in the third grid region.
[0097] To further illustrate, the optional based on Figure 8The scenario shown continues, for example... Figure 9 As shown, after placing the first virtual component 602 in the spatial grid region 604 and updating the spatial grid parameters within the spatial grid region 604, a second placement request is obtained for the second virtual component 702, as follows: Figure 9 As shown in (a) in the figure; and for example Figure 9 As shown in (b), in response to the second placement request, the fourth set of spatial grid parameters corresponding to the third grid region in the spatial grid region 604 is obtained; when the fourth set of spatial grid parameters matches the third set of spatial grid parameters, the second virtual component 702 is placed in the third grid region in the spatial grid region 604, and the spatial grid parameters in the spatial grid region 604 are updated accordingly.
[0098] Through the embodiments provided in this application, a second placement request is obtained for the second virtual component. This second placement request requests that the second virtual component be placed in a third grid region within a spatial grid region whose fifth subgroup spatial grid parameters have been updated. The second virtual component corresponds to a pre-configured third set of spatial grid parameters, which are the spatial grid parameters required for placing the second virtual component. In response to the second placement request, a fourth set of spatial grid parameters corresponding to the third grid region is obtained. This fourth set of spatial grid parameters is the spatial grid parameters that allow the placement of the virtual component. When the fourth set of spatial grid parameters matches the third set of spatial grid parameters, the second virtual component is placed in the third grid region. This achieves the technical objective of reducing the control complexity of the virtual component, thereby improving the control efficiency of the virtual component.
[0099] As an optional approach, and for ease of understanding, a building game is used as an example. In this embodiment, the aim is to transform the original N*N combination relationship between building modules into an N*1 relationship between building modules and grid frames by studying the connections and mutual exclusion relationships between them. This allows for better and faster coding of the free construction function, supporting the unlimited addition of building modules and the dynamic addition and modification of module placement rules. Furthermore, the player's construction range, height, and shape can be restricted and changed directly by modifying the grid frame data.
[0100] For example, suppose there are N building modules. If each module is connected to any other module, there are N*N possible combinations. If each module then interacts with a third module, the number of combinations increases to N*N*N, and so on. As the number of building modules grows, these relationships become increasingly difficult to control and encode. Research has shown that a virtual wireframe can be constructed between the building modules, and the relationships between modules can be transformed into relationships between modules and the wireframe. This reduces the exponential complexity of these relationships to linear complexity, making it easier to manage the connection rules of the modules and to expand them. Furthermore, by configuring the internal data of the wireframe, the player's building area can be easily limited, and the unlocked area can gradually expand as the game progresses.
[0101] In the game, players construct houses at designated locations. Using pre-provided building components, players place modules that conform to linking rules within the designated area to ultimately create a beautiful building structure. The specific steps are as follows:
[0102] S1, virtual meshing of architectural concept art;
[0103] S2, discretizes the gridded building structure to obtain simplified building components;
[0104] S3, in the game, use the building structure obtained from the discretization in the previous step to build or recreate houses;
[0105] S4, The relationship between the structure and the grid frame is configured by configuring the relationship between the points, lines, surfaces, and volumes in the structure and the grid frame. This requires configuring the input data (points, lines, surfaces, volumes) and output data (points, lines, surfaces, volumes) of the structure.
[0106] In other words, whether a building structure can be placed in a certain location is transformed into whether the building structure can be placed in the corresponding position within the grid frame. The correctness of the placement method is uniquely determined by the data of points, lines, surfaces, and volumes within the grid frame. Before placing a building structure, it is necessary to query whether the points, lines, surfaces, and volumes at the corresponding location meet the placement requirements of the structure (referred to as the structure's input data). After placing the structure, the impact of the structure on the points, lines, surfaces, and volumes is recorded (referred to as the structure's output data). The data of points, lines, surfaces, and volumes is further divided into exclusive, shared, and structure-specific shared types.
[0107] To further illustrate, this embodiment uses the interaction relationship between the user side 1002, the interaction layer 1004, the logic layer 1006, and the grid wireframe data 1008 as an example. Specifically... Figure 10 As shown, the steps are as follows:
[0108] S1, User side clicks on building structure 1002;
[0109] S2, the clicked building structure is displayed in the scene;
[0110] S3, determine the placement of the building structure;
[0111] S4, Submit the building information corresponding to the building structure;
[0112] S5, check if the building structure can be placed;
[0113] S6-1, This building structure is capable of being placed;
[0114] S7-1, write module output data;
[0115] S8-1, returns the write status;
[0116] S9-1, Structure placement successful;
[0117] S10-1 displays the placement result;
[0118] S6-2, The building structure does not conform to the regulations;
[0119] S7-2, structural placement failed;
[0120] S8-2, placement is prohibited.
[0121] The embodiments provided in this application significantly increase the number of building structures, supporting tens to hundreds or more, and simplify the relationships between building structures from the traditional N*N relationship to an N*1 relationship. Furthermore, adding new building structures is simple, requiring only a straightforward configuration of the relationship between the building structure and the grid wireframe.
[0122] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.
[0123] According to another aspect of the present invention, a control device for a virtual component for implementing the above-described control method for a virtual component is also provided. For example... Figure 11 As shown, the device includes:
[0124] The first acquisition unit 1102 is used to acquire a first placement request executed on the first virtual component, wherein the first placement request is used to request the first virtual component to be placed in a first grid area of a preset spatial grid area, the first virtual component has a corresponding relationship with a pre-configured first set of spatial grid parameters, and the first set of spatial grid parameters are the spatial grid parameters required to place the first virtual component.
[0125] The second acquisition unit 1104 is used to respond to the first placement request and acquire a second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters are spatial grid parameters that allow the placement of virtual components;
[0126] The first placement unit 1106 is used to place the first virtual component in the first grid area when the second set of spatial grid parameters matches the first set of spatial grid parameters.
[0127] Optionally, in this embodiment, the control device for the virtual components can be applied, but is not limited to, in the application scenario of virtual games that construct building types. For example, in the running of a game of the target virtual game, a spatial grid area is allocated to the virtual object controlled by the user so that the user can control the virtual object to complete the construction of the target building. Before the user controls the virtual object to complete the construction of the target building, multiple virtual components are provided to the virtual object to complete the construction of the target building. The multiple virtual components include a first virtual component, and the multiple virtual components can be, but are not limited to, virtual components obtained by splitting the target building.
[0128] Optionally, in this embodiment, the virtual component may be, but is not limited to, a component of a virtual building. In other words, a virtual building typically includes multiple virtual components. For example, virtual component A is a door, virtual component B is a wall, and virtual component C is a window. Controlling a virtual component A, multiple virtual components B, and a virtual component C to place them in a combination within the corresponding area, and treating them as a whole, constitutes a virtual building (house).
[0129] Optionally, in this embodiment, the spatial grid region can be understood, but is not limited to, as a three-dimensional spatial region, and this spatial region is composed of multiple equally divided virtual grids. The virtual grid can be understood, but is not limited to, as a spatial unit of the spatial grid region, and the attributes, state, or distribution information of the virtual grid can be used, but is not limited to, as a basis for determining whether a virtual component can be placed in the corresponding grid region.
[0130] Optionally, in this embodiment, to ensure that each virtual component has a corresponding association with a spatial grid region, a corresponding spatial grid parameter is pre-configured for each virtual component. This spatial grid parameter can be understood, but is not limited to, a standard and unified attribute parameter. Before placing each virtual component, the pre-configured spatial grid parameter must be matched with the real-time spatial grid parameter in the current spatial grid region. Placement is only allowed if a match is found. In this way, only the association between each virtual component and the spatial grid region needs to be considered. This association is simple and singular, without needing to consider the complex and cumbersome associations between different virtual components, thereby improving the control efficiency of virtual components.
[0131] Optionally, in this embodiment, obtaining the second set of spatial grid parameters corresponding to the first grid region may include, but is not limited to, obtaining the spatial grid parameters of the first grid region, and may also include, but is not limited to, obtaining the spatial grid parameters of other grid regions besides the first grid region. The other grid regions are associated with the first grid region, and the association between the two may be, but is not limited to, related to the spatial grid parameters of the first virtual component. For example, if the spatial grid parameters of the first virtual component indicate that it needs to be associated with grid region A, then while obtaining the spatial grid parameter 1 of the first grid region, the spatial grid parameter 2 of grid region A should also be obtained, and then the spatial grid parameter 1 and the spatial grid parameter 2 should be used separately or together with the spatial grid parameters of the first virtual component for matching and judgment.
[0132] It should be noted that the relationships between virtual components are transferred to the relationships between virtual components and spatial grids. Since the parameters of the spatial grids are standard and uniform, the complexity of the matching conditions brought about by the relationships between virtual components and spatial grids is lower than that brought about by multiple different relationships between virtual components. This eliminates the need to consider the complex matching conditions brought about by multiple different relationships between virtual components during the control process of virtual components, thereby reducing the control complexity of virtual components and improving the control efficiency of virtual components.
[0133] For specific embodiments, please refer to the example shown in the control device of the virtual component above, which will not be repeated here.
[0134] Through the embodiments provided in this application, a first placement request is obtained for a first virtual component, wherein the first placement request is used to request the placement of the first virtual component in a first grid area of a preset spatial grid area. The first virtual component has a corresponding relationship with a first set of pre-configured spatial grid parameters, which are the spatial grid parameters required to place the first virtual component. In response to the first placement request, a second set of spatial grid parameters corresponding to the first grid area is obtained in the spatial grid area, wherein the second set of spatial grid parameters are the spatial grid parameters that allow the placement of the virtual component. When the second set of spatial grid parameters matches the first set of spatial grid parameters, the first virtual component is placed in the first grid area, thereby achieving the technical objective of reducing the control complexity of the virtual component and thus realizing the technical effect of improving the control efficiency of the virtual component.
[0135] As an optional solution, the second acquisition unit 1104 includes:
[0136] The first acquisition module is used to acquire the first subgroup spatial grid parameters corresponding to the first grid region, and the second subgroup spatial grid parameters corresponding to the second grid region in the spatial grid region. The second group spatial grid parameters include the first subgroup spatial grid parameters and the second subgroup spatial grid parameters. The first grid region is the grid region occupied by the first virtual component, and the second grid region is the grid region on which the first virtual component is placed.
[0137] For specific implementation examples, please refer to the examples shown in the control method of the virtual component described above, which will not be repeated here.
[0138] As an optional solution, the device further includes:
[0139] The first determining module is used to determine the second grid region in the spatial grid region according to the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters before obtaining the second subgroup of spatial grid parameters corresponding to the second grid region in the spatial grid region, wherein the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the first virtual component depends.
[0140] For specific implementation examples, please refer to the examples shown in the control method of the virtual component described above, which will not be repeated here.
[0141] As an optional solution, the device further includes:
[0142] The second acquisition module is used to acquire the third subgroup of spatial grid parameters and the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters, wherein the third subgroup of spatial grid parameters is the spatial grid parameter occupied by the first virtual component, and the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the first virtual component depends;
[0143] The second determining module is used to determine that the second set of spatial grid parameters matches the first set of spatial grid parameters when the spatial grid parameters of the first subgroup match the spatial grid parameters of the third subgroup and the spatial grid parameters of the second subgroup match the spatial grid parameters of the fourth subgroup.
[0144] For specific implementation examples, please refer to the examples shown in the control method of the virtual component described above, which will not be repeated here.
[0145] As an optional solution, the device further includes:
[0146] The third determining module is used to determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters when the number of unoccupied points, lines, surfaces, and volumes represented by the first subgroup spatial grid parameters is greater than the number of points, lines, surfaces, and volumes that need to be occupied as identified by the third subgroup spatial grid parameters; and / or
[0147] The fourth determining module is used to determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters when the number of occupied points, lines, surfaces, and volumes represented by the second subgroup spatial grid parameters is greater than the number of dependent points, lines, surfaces, and volumes identified by the fourth subgroup spatial grid parameters.
[0148] For specific implementation examples, please refer to the examples shown in the control method of the virtual component described above, which will not be repeated here.
[0149] As an optional solution, the device further includes:
[0150] The third determining module is used to determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters when the number of unoccupied points, lines, surfaces, and volumes represented by the first subgroup spatial grid parameters is greater than the number of points, lines, surfaces, and volumes that need to be occupied as identified by the third subgroup spatial grid parameters; and / or
[0151] The fourth determining module is used to determine that the first subgroup spatial grid parameters match the third subgroup spatial grid parameters when the number of occupied points, lines, surfaces, and volumes represented by the second subgroup spatial grid parameters is greater than the number of dependent points, lines, surfaces, and volumes identified by the fourth subgroup spatial grid parameters.
[0152] For specific implementation examples, please refer to the examples shown in the control method of the virtual component described above, which will not be repeated here.
[0153] As an optional solution, the device further includes:
[0154] The third acquisition unit is used to acquire a second placement request for the second virtual component after updating the first subgroup spatial grid parameters corresponding to the first grid region to the fifth subgroup spatial grid parameters. The second placement request is used to request the second virtual component to be placed in the third grid region of the spatial grid region that has been updated with the fifth subgroup spatial grid parameters. The second virtual component has a corresponding relationship with the pre-configured third group of spatial grid parameters, which are the spatial grid parameters required to place the second virtual component.
[0155] The fourth acquisition unit is used to, after updating the first subgroup spatial grid parameters corresponding to the first grid region to the fifth subgroup spatial grid parameters, respond to the second placement request and acquire the fourth group of spatial grid parameters corresponding to the third grid region in the spatial grid region, wherein the fourth group of spatial grid parameters are spatial grid parameters that allow the placement of virtual components.
[0156] The second placement unit is used to place the second virtual component in the third grid region after updating the first subgroup spatial grid parameters corresponding to the first grid region to the fifth subgroup spatial grid parameters, when the fourth group spatial grid parameters match the third group spatial grid parameters.
[0157] For specific implementation examples, please refer to the examples shown in the control method of the virtual component described above, which will not be repeated here.
[0158] According to another aspect of the present invention, an electronic device for implementing the control method of the above-described virtual component is also provided, such as... Figure 12 As shown, the electronic device includes a memory 1202 and a processor 1204. The memory 1202 stores a computer program, and the processor 1204 is configured to execute the steps of any of the above method embodiments through the computer program.
[0159] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0160] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0161] S1, obtain a first placement request for the first virtual component, wherein the first placement request is used to request the first virtual component to be placed in a first grid area of a preset spatial grid area, the first virtual component has a corresponding relationship with a pre-configured first set of spatial grid parameters, and the first set of spatial grid parameters are the spatial grid parameters required to place the first virtual component;
[0162] S2, in response to the first placement request, obtain the second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters are spatial grid parameters that allow the placement of virtual components;
[0163] S3, when the second set of spatial grid parameters matches the first set of spatial grid parameters, the first virtual component is placed in the first grid area.
[0164] Alternatively, as those skilled in the art will understand, Figure 12 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 12 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 12 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 12 The different configurations shown.
[0165] The memory 1202 can be used to store software programs and modules, such as the program instructions / modules corresponding to the virtual component control method and device in this embodiment of the invention. The processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, thereby realizing the aforementioned virtual component control method. The memory 1202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1202 may further include memory remotely located relative to the processor 1204, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1202 may be used, but is not limited to, to store information such as the first virtual component, the first set of spatial grid parameters, and the second set of spatial grid parameters. As an example, such as Figure 12As shown, the memory 1202 may include, but is not limited to, the first acquisition unit 1102, the second acquisition unit 1104, and the first placement unit 1106 in the control device for the virtual component. Furthermore, it may include, but is not limited to, other module units in the control device for the virtual component, which will not be elaborated upon in this example.
[0166] Optionally, the transmission device 1206 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1206 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1206 is a radio frequency (RF) module, used for wireless communication with the Internet.
[0167] In addition, the above-mentioned electronic device also includes: a display 1208 for displaying information such as the first virtual component, the first set of spatial grid parameters and the second set of spatial grid parameters; and a connection bus 1210 for connecting the various module components in the above-mentioned electronic device.
[0168] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.
[0169] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the control method of the virtual component described above, wherein the computer program is configured to execute the steps of any of the method embodiments described above during runtime.
[0170] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0171] S1, obtain a first placement request for the first virtual component, wherein the first placement request is used to request the first virtual component to be placed in a first grid area of a preset spatial grid area, the first virtual component has a corresponding relationship with a pre-configured first set of spatial grid parameters, and the first set of spatial grid parameters are the spatial grid parameters required to place the first virtual component;
[0172] S2, in response to the first placement request, obtain the second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters are spatial grid parameters that allow the placement of virtual components;
[0173] S3, when the second set of spatial grid parameters matches the first set of spatial grid parameters, the first virtual component is placed in the first grid area.
[0174] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0175] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0176] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0177] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0178] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device 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. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.
[0179] 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.
[0180] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0181] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for controlling a virtual component, characterized in that, include: The original architectural design is processed into a virtual grid to obtain a gridded architectural structure; The gridded building structure is discretized and deconstructed to obtain the first virtual component; Obtain a first placement request for the first virtual component, wherein the first placement request is used to request the first virtual component to be placed in a first grid area of a preset spatial grid area, the first virtual component has a corresponding relationship with a first set of pre-configured spatial grid parameters, and the first set of spatial grid parameters are the spatial grid parameters required to place the first virtual component; In response to the first placement request, a second set of spatial grid parameters corresponding to the first grid region is obtained in the spatial grid region, wherein the second set of spatial grid parameters are spatial grid parameters that allow the placement of virtual components; When the second set of spatial grid parameters matches the first set of spatial grid parameters, the first virtual component is placed in the first grid region.
2. The method according to claim 1, characterized in that, The step of obtaining the second set of spatial grid parameters corresponding to the first grid region in the spatial grid region includes: Obtain the first subgroup spatial grid parameters corresponding to the first grid region, and the second subgroup spatial grid parameters corresponding to the second grid region in the spatial grid region, wherein the second group spatial grid parameters include the first subgroup spatial grid parameters and the second subgroup spatial grid parameters, the first grid region is the grid region occupied by the first virtual component, and the second grid region is the grid region on which the first virtual component depends.
3. The method according to claim 2, characterized in that, Before obtaining the second subgroup spatial grid parameters corresponding to the second grid region in the spatial grid region, the method further includes: Based on the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters, the second grid region is determined in the spatial grid region, wherein the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the first virtual component depends.
4. The method according to claim 3, characterized in that, Determining the second grid region in the spatial grid region based on the fourth subgroup of spatial grid parameters in the first group of spatial grid parameters includes: When the fourth subgroup of spatial grid parameters includes at least one of the point parameters, line parameters, surface parameters, and volume parameters on which the first virtual component depends, a second grid region is determined in the spatial grid region, starting from the first grid region, that matches at least one of the point parameters, line parameters, surface parameters, and volume parameters.
5. The method according to claim 2, characterized in that, The method further includes: Obtain the third subgroup and the fourth subgroup of spatial grid parameters from the first group of spatial grid parameters, wherein the third subgroup of spatial grid parameters is the spatial grid parameter occupied by the first virtual component, and the fourth subgroup of spatial grid parameters is the spatial grid parameter on which the first virtual component depends; When the spatial grid parameters of the first subgroup match the spatial grid parameters of the third subgroup, and the spatial grid parameters of the second subgroup match the spatial grid parameters of the fourth subgroup, it is determined that the spatial grid parameters of the second group match the spatial grid parameters of the first group.
6. The method according to claim 5, characterized in that, The method further includes: When the number of unoccupied points, lines, surfaces, and volumes represented by the first subgroup of spatial grid parameters is greater than the number of points, lines, surfaces, and volumes required to be occupied as identified by the third subgroup of spatial grid parameters, it is determined that the first subgroup of spatial grid parameters matches the third subgroup of spatial grid parameters; and / or When the number of occupied points, lines, surfaces, and volumes represented by the second subgroup spatial grid parameters is greater than the number of points, lines, surfaces, and volumes that the fourth subgroup spatial grid parameters identify as dependent on, it is determined that the second subgroup spatial grid parameters match the fourth subgroup spatial grid parameters.
7. The method according to any one of claims 1 to 6, characterized in that, After placing the first virtual component in the first grid area, the method further includes: The first subgroup spatial grid parameters corresponding to the first grid region in the spatial grid region are updated to the fifth subgroup spatial grid parameters, wherein the fifth subgroup spatial grid parameters indicate that the points, lines, surfaces, and volumes in the first grid region have been occupied.
8. The method according to claim 7, characterized in that, After updating the spatial grid parameters of the first subgroup corresponding to the first grid region to the spatial grid parameters of the fifth subgroup, the method further includes: Obtain a second placement request for the second virtual component, wherein the second placement request is used to request the placement of the second virtual component in a third grid region of the spatial grid region that has updated the spatial grid parameters of the fifth subgroup, the second virtual component having a correspondence with a pre-configured third set of spatial grid parameters, the third set of spatial grid parameters being the spatial grid parameters required to place the second virtual component; In response to the second placement request, a fourth set of spatial grid parameters corresponding to the third grid region in the spatial grid region is obtained, wherein the fourth set of spatial grid parameters are spatial grid parameters that allow the placement of virtual components; When the fourth set of spatial grid parameters matches the third set of spatial grid parameters, the second virtual component is placed in the third grid region.
9. A control device for a virtual component, characterized in that, include: The device is also used to perform virtual meshing processing on architectural original designs to obtain a meshed architectural structure. The gridded building structure is discretized and deconstructed to obtain the first virtual component; The first acquisition unit is used to acquire a first placement request executed on the first virtual component, wherein the first placement request is used to request the first virtual component to be placed in a first grid area of a preset spatial grid area, the first virtual component has a corresponding relationship with a first set of pre-configured spatial grid parameters, and the first set of spatial grid parameters are the spatial grid parameters required to place the first virtual component; The second acquisition unit is used to respond to the first placement request and acquire a second set of spatial grid parameters corresponding to the first grid region in the spatial grid region, wherein the second set of spatial grid parameters are spatial grid parameters that allow the placement of virtual components; The first placement unit is used to place the first virtual component in the first grid area when the second set of spatial grid parameters matches the first set of spatial grid parameters.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 8.
11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 8 through the computer program.