Hierarchical configuration method and device for 2D game scene and computer program product

By building standard coordinate systems and hierarchical vectors, the hierarchical configuration of 2D game scenes is automatically generated, which solves the problems of manual configuration in traditional methods, and the efficient automatic configuration and real-time update of complex scenarios is achieved.

CN119201104AActive Publication Date: 2024-12-27BEIJING JINGJIA TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411236470.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27
Estimated Expiration
2044-09-04

AI Technical Summary

Technical Problem

The traditional 2D game scene-level configuration method requires manual deployment, which is time-consuming and labor-intensive, and is prone to operational errors in complex scenarios, resulting in visual relationship errors.

Method used

By building a standard coordinate system, the hierarchical vectors of each prefabricated body are generated, the hierarchical relationship is determined based on the relative positional relationship of the hierarchical vectors, the hierarchical relationship topology diagram is constructed, the hierarchical configuration is automatically generated, and the hierarchical configuration is corrected when there are errors to ensure the hierarchical relationship correctness.

Benefits of technology

It realizes automated configuration of multiple prefabricated layers in complex scenarios, reduces error rates, improves configuration efficiency, and ensures real-time dynamic updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201104A_ABST
    Figure CN119201104A_ABST
Patent Text Reader

Abstract

The invention provides a hierarchical configuration method and device for a 2D game scene and a computer program product, which automatically generate hierarchical vectors according to images of preforms formed in an art creation stage, and reflect the relative relationship of the preforms on display hierarchies by using the relative position relationship between the hierarchical vectors. And in combination with the correction of the auditing end on the hierarchical vector, constructing a prefabricated body hierarchical relationship topological graph, and performing correctness examination on the hierarchical relationship by checking whether a topological ring exists in the topological graph or not. And when the topological ring does not exist, the topological queue is directly output, and hierarchical configuration of each preform is automatically generated, so that automatic configuration of multiple preform hierarchies in a complex scene is realized, and the error rate is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device and computer program product for hierarchical configuration of a 2D game scene. Background Art

[0002] During the game development process, the display hierarchy of the objects in the scene needs to be configured according to the visual relationship to ensure that players can get an immersive gaming experience during the game. The traditional hierarchical configuration method needs to be manually deployed by the ground editor staff, and each art scene and prefab must be arranged one by one, which is time-consuming and labor-intensive. For complex scenes with many objects, manually setting the hierarchy one by one may result in operational errors, resulting in visual relationship errors when new objects are introduced or characters are interspersed. Therefore, a new solution is urgently needed to efficiently configure the hierarchy. Summary of the invention

[0003] In view of this, embodiments of the present invention provide a method, device and computer program product for hierarchical configuration of a 2D game scene to eliminate or improve one or more defects existing in the prior art and solve the problem that the prior art cannot efficiently perform automatic hierarchical configuration of a large number of objects in a 2D game scene.

[0004] One aspect of the present invention provides a method for configuring a hierarchy of a 2D game scene, the method comprising the following steps:

[0005] Construct a standard coordinate system, for multiple prefabricated bodies deployed in the target scene, take the lower left corner pixel of the prefabricated body as the starting point, and establish a corresponding hierarchical vector for each prefabricated body along the positive direction of the X-axis of the standard coordinate system with the width of the prefabricated body as the vector length;

[0006] Acquire a hierarchical relationship configuration rule, wherein the hierarchical relationship configuration rule determines the hierarchical relationship between the preforms based on the hierarchical vectors of the preforms; among the overlapping preforms, according to the relative position relationship between the adjacent hierarchical vectors, the one located on the side close to the observer angle is configured as a higher display level, and the one located on the side far from the observer angle is configured as a lower display level;

[0007] When there is a display level error, the level vector correction information of the preset audit end is received, and the level vector correction information marks the level vector correction instructions for adjusting the starting point, length, direction and / or splitting each level vector; the level vector correction instructions reconfigure the corresponding level vector of the prefabricated body with overlapping display and wrong level relationship display according to the landing surface shape of the preset body, and the corrected direction is the positive direction of the X axis or the negative direction of the Y axis of the standard coordinate system, and there is no intersection between the corrected level vectors;

[0008] Constructing a prefabricated body hierarchical relationship topology map, wherein the prefabricated body hierarchical relationship topology map is used to record the display hierarchical relationship between each hierarchical vector and other hierarchical vectors adjacent thereto;

[0009] Check whether there is a topological loop in the prefabricated hierarchical relationship topological diagram. If there is a topological loop, generate an error prompt message to the preset audit end to prompt the preset audit end to feedback new hierarchical vector correction information; if there is no topological loop, output the prefabricated topological queue, and generate a hierarchical configuration for the prefabricated body according to the prefabricated topological queue.

[0010] In some embodiments, the method further comprises:

[0011] Dividing the prefabricated parts in the target scene into a plurality of scene groups according to scene relationships;

[0012] A scene group level configuration instruction is received, and a level value is configured for each scene group respectively, so as to distinguish display levels according to the size of the level value.

[0013] In some embodiments, the method is configured to display the target scene along a 45° top-down viewing angle, and the side on the right side of the adjacent level vector is adjacent to the observer's angle, and its display level is high; the side on the left side of the adjacent level vector is away from the observer's angle, and its display level is low.

[0014] In some embodiments, the method further comprises:

[0015] Setting a role positioning point for a role moving in the target scene, wherein the role positioning point moves in the target scene based on an action instruction of a user terminal;

[0016] Determine one or more intermediate prefabricated bodies overlapping with the character in the target scene according to the real-time position of the character in the target scene and the size of the image displayed by the character;

[0017] The relative position relationship between the character positioning point and the hierarchical vector of the intermediate preform is determined, and the display level of the character is determined according to the hierarchical relationship configuration rule and the determined hierarchical configuration of the intermediate preform in the target scene.

[0018] In some embodiments, a standard coordinate system is constructed. For a plurality of prefabricated bodies deployed in a target scene, the method further includes: starting from the lower left corner pixel point of the prefabricated body and taking the width of the prefabricated body as the vector length along the positive direction of the X-axis of the standard coordinate system. Before establishing a corresponding hierarchical vector for each prefabricated body, the method further includes:

[0019] The prefabricated bodies are divided into a background layer, a ground layer and an item layer, the background layer and the ground layer are configured to have a display level lower than the item layer, and subsequently only the prefabricated bodies in the item layer are configured with a level.

[0020] In some embodiments, after checking whether there is a topological loop in the prefabricated hierarchical relationship topological graph and generating an error prompt message to the preset audit terminal if the topological loop exists, the method further includes:

[0021] The identification information of all abnormal preforms related to the topological ring is searched, and the abnormal preforms are highlighted in a preset form according to the identification information.

[0022] In some embodiments, the preset form includes: adding an abnormal identification display, highlighting display, or adding a red temperature coloring display.

[0023] On the other hand, the present invention also provides a device for hierarchical configuration of prefabricated objects in a 2D game scene, comprising a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above method.

[0024] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.

[0025] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0026] The beneficial effects of the present invention are at least:

[0027] The hierarchical configuration method, device and computer program product of the 2D game scene described in the present invention automatically generate hierarchical vectors based on the images of prefabricated bodies formed in the art creation stage, and use the relative position relationship between the hierarchical vectors to reflect the relative relationship of the prefabricated bodies in the display hierarchy. Combined with the correction of the hierarchical vectors by the audit end, a topological diagram of the hierarchical relationship of the prefabricated bodies is constructed, and the correctness of the hierarchical relationship is checked by checking whether there is a topological ring in the topological diagram. When there is no topological ring, the topological queue is directly output, and the hierarchical configuration of each prefabricated body is automatically generated, thereby realizing the automatic configuration of multiple prefabricated levels in complex scenes and reducing the error rate.

[0028] Furthermore, by setting up the overall level of the established scene group, it is possible to split and combine the level configuration tasks of complex scenes, so that the level of complex scenes can be set more efficiently.

[0029] Furthermore, for the characters in the scene, by constructing the character positioning point and identifying the relative position relationship of the hierarchical vectors of the intermediate prefabs that overlap with it, combined with the determined hierarchical configuration of the intermediate prefabs in the target scene, the display level of the character can be directly determined, which can ensure real-time dynamic updates and higher efficiency.

[0030] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0031] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0033] Figure 1 The figure is a flowchart of a method for configuring a hierarchy of a 2D game scene according to an embodiment of the present invention.

[0034] Figure 2 The figure is a flow chart of executing the hierarchical configuration of scene groups in the hierarchical configuration method of a 2D game scene according to an embodiment of the present invention.

[0035] Figure 3 A schematic diagram of a flow chart of executing character hierarchy configuration in a hierarchy configuration method for a 2D game scene according to an embodiment of the invention.

[0036] Figure 4 This is a display diagram of generating hierarchical vectors for each prefabricated body according to the hierarchical configuration method of a 2D game scene described in an embodiment of the present invention.

[0037] Figure 5 This is a diagram showing the correction of vertical railing and step level vectors in the level configuration method of a 2D game scene described in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0039] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0040] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0041] In 2D game scenes, the difficulty of setting the hierarchy of items lies mainly in dealing with the front-to-back relationship between characters and multiple objects in dynamic scenes, especially in isometric perspectives or complex interactive scenes. To ensure that characters and objects always maintain reasonable occlusion effects in different positions and actions, while avoiding visual confusion and hierarchy conflicts, this is a challenge that requires careful debugging and management. Usually, scene producers need to manually set the hierarchy of items according to the design drawings. Since there are many objects in the scene, this part of the workload is quite large, and manual hierarchy setting may result in operational errors. Moreover, when walking characters appear in the scene, more hierarchy problems will be exposed, and these problems are not easy to check in advance during the scene setting stage.

[0042] In view of the above problems, this application provides a hierarchical configuration method for a 2D game scene, such as Figure 1 As shown, the method includes the following steps S101 to S105:

[0043] Step S101: construct a standard coordinate system. For multiple prefabricated bodies deployed in the target scene, take the lower left corner pixel of the prefabricated body as the starting point, and establish a corresponding hierarchical vector for each prefabricated body along the positive direction of the X-axis of the standard coordinate system with the width of the prefabricated body as the vector length.

[0044] Step S102: Obtain the hierarchical relationship configuration rule, which determines the hierarchical relationship between preforms based on the hierarchical vectors of the preforms; among the overlapping preforms, according to the relative position relationship between adjacent hierarchical vectors, the one located on the side adjacent to the observer's angle is configured as a higher display level, and the one located on the side away from the observer's angle is configured as a lower display level.

[0045] Step S103: When there is a display level error, the level vector correction information of the preset review end is received, and the level vector correction information marks the level vector correction instructions for adjusting the starting point, length, direction and / or splitting of each level vector; the level vector correction instructions reconfigure the corresponding level vectors of the prefabricated bodies with overlapping display and incorrect level relationship display according to the landing surface shape of the preset body, and the corrected direction is the positive direction of the X-axis or the negative direction of the Y-axis of the standard coordinate system, and there is no intersection between the corrected level vectors.

[0046] Step S104: constructing a prefabricated body hierarchical relationship topology map, where the prefabricated body hierarchical relationship topology map is used to record the display hierarchical relationship between each hierarchical vector and other adjacent hierarchical vectors.

[0047] Step S105: Check whether there is a topological loop in the prefabricated hierarchical relationship topological diagram. If there is a topological loop, generate an error prompt message to the preset audit end to prompt the preset audit end to feedback new hierarchical vector correction information; if there is no topological loop, output the prefabricated topological queue, and generate a hierarchical configuration for the prefabricated body according to the prefabricated topological queue.

[0048] In step S101, the standard coordinate system can be deployed according to the blocks presented on the display interface, with the lower left corner as the origin, the right side as the positive direction of the X axis, and the upward direction as the positive direction of the Y axis. The target scene is a 2D game scene where objects need to be deployed, which is the environment in which the characters in the game move. The prefabricated objects deployed in the target scene include buildings, furniture, props, plants, animals and other objects obtained by artistic creation. The prefabricated objects are intuitively presented in the form of pictures. Each prefabricated object is independently created and placed in the target scene by the creator of the scene.

[0049] In the present invention, the program directly generates the hierarchical vector of each preform in the initial stage, starting from the lower left pixel of the preform and taking the width of the preform as the vector length along the positive direction of the X-axis of the standard coordinate system. This process is fully automatic and does not require human intervention. For multiple preforms in complex scenes, the corresponding hierarchical vector can be generated with one click. Figure 4 As shown, corresponding level vectors are automatically generated for all prefabricated bodies in the figure.

[0050] In step S102, the hierarchical relationship configuration rule is a standard for determining the hierarchical relationship through the relative position relationship of the hierarchical vectors. In effect, the side adjacent to the observer's angle is configured as a higher display level, and vice versa. Exemplarily, in the method, the target scene is displayed along a 45° top-down viewing angle. The side on the right side of the adjacent hierarchical vectors is adjacent to the observer's angle, and its display level is high; the side on the left side of the adjacent hierarchical vectors is away from the observer's angle, and its display level is low. Specifically, in the initial stage, all vectors have the same direction. For two adjacent hierarchical vectors, observe from the vector starting point in the X-axis direction to distinguish whether the adjacent vector is on the left or right, wherein the display level on the right side is higher than that on the left side.

[0051] In step S103, for the automatically generated hierarchical vectors of each prefab, there may be display errors due to the hierarchical relationship configuration rules. At this time, adjustments are made by receiving the hierarchical vector correction information from the review end to eliminate errors in the hierarchical relationship display. Specifically, in combination with the situation of the prefab table and the ground, the hierarchical vectors of the objects where the errors occur are corrected. For example, for the prefab with a vertically configured long railing image, it can be adjusted to be deployed from left to right and from top to bottom according to the shape of the ground on which it lands, but its direction must be along the negative Y-axis, and it must be ensured that there is no vector intersection. In general, all prefabs in the scene are basically arranged along the axial direction of the standard coordinate system, so the automatically generated and corrected hierarchical vectors are all along the positive X-axis or the negative Y-axis. Figure 5 As shown in the figure, vector 1 represents the level vector of the vertical railing, and vector 2 represents the level vector of the stairs. The level vectors of the vertical railing and stairs are corrected to point to the negative direction of the Y axis according to the landing surface. At this time, the display level on the right side is higher than that on the left side.

[0052] In steps S104 and S105, according to the hierarchical relationship configuration rules, the relative hierarchical relationship between all hierarchical vectors after the correction is completed is analyzed. Based on this relationship, a prefabricated hierarchical relationship topological map can be constructed. In principle, on each topological link, the hierarchical relationship should be descending step by step, and there will be no topological loop, that is, the level of A is higher than that of B, the level of B is higher than that of C, and the level of C is higher than that of A. By checking whether there is a topological loop, the hierarchical relationship error can be directly reviewed. If there is a topological loop, the preset audit end is prompted to process. Otherwise, the prefabricated topological queue is output based on the prefabricated hierarchical relationship topological map, and the hierarchical configuration is automatically generated according to the sequence of the queue. Exemplarily, on a prefabricated topological queue, the objects from left to right that record the hierarchical vector position relationship are A, B, C and D, respectively, and the level of A is configured to be 1, the level of B is 2, the level of C is 3, and the level of D is 4. There are also prefab queues that record the hierarchical vector position relationships. The objects from left to right are A, E and F, C and F. Then the level of configuration E is 2 and the level of configuration F is 4.

[0053] In some embodiments, Figure 2 As shown, the method further includes steps S201-S202:

[0054] Step S201: Divide the prefabricated parts in the target scene into multiple scene groups according to scene relationships.

[0055] Step S202: receiving a scene group level configuration instruction, and configuring a level value for each scene group, so as to distinguish display levels according to the level value.

[0056] In some embodiments, Figure 3As shown, the method further includes steps S301 to S303:

[0057] Step S301: setting a role positioning point for a role moving in a target scene, and the role positioning point moves in the target scene based on an action instruction of the user terminal.

[0058] Step S302: determining one or more intermediate prefabricated bodies overlapping with the character in the target scene according to the real-time position of the character in the target scene and the size of the image displayed by the character.

[0059] Step S303: Determine the relative position relationship between the character positioning point and the hierarchical vector of the intermediate preform, and determine the display level of the character according to the hierarchical relationship configuration rule and the determined hierarchical configuration of the intermediate preform in the target scene.

[0060] In steps S301 to S303, the characters moving in the game, including player characters or non-player characters, need to be updated and determined in real time. Based on the hierarchical vectors of the prefabricated bodies and scene groups in the target scene determined in steps S101 to S105 and steps S201 to S204 and the corresponding hierarchical levels, a character positioning point is set for the character, and the vector should be configured to be movable in the scene based on the player's control. When the position changes, the positional relationship between the character positioning point and the hierarchical vectors of other prefabricated bodies or scene groups will also change. For one or more intermediate prefabricated bodies or scene groups with display overlap, the positional relationship between the character positioning point and the relevant hierarchical vectors is re-determined, and based on this, combined with the configured hierarchical levels of the prefabricated bodies and scene groups, the display level of the character is determined.

[0061] In some embodiments, a standard coordinate system is constructed, and for multiple preforms deployed in the target scene, the lower left corner pixel of the preform is taken as the starting point, and the width of the preform is taken as the vector length along the positive direction of the X-axis of the standard coordinate system. Before establishing a corresponding hierarchical vector for each preform, the method further includes: dividing the preforms into a background layer, a ground layer, and an object layer, configuring the background layer and the ground layer to display at a level lower than the object layer, and subsequently only performing hierarchical configuration on the preforms in the object layer.

[0062] In some embodiments, after checking whether there is a topological loop in the preform hierarchical relationship topological graph and generating an error prompt message to a preset audit end if there is a topological loop, the method further includes: searching for identification information of all abnormal preforms related to the topological loop, and highlighting the abnormal preforms in a preset form according to the identification information.

[0063] In some embodiments, the preset form includes: adding an abnormal identification display, highlighting display, or adding a red temperature coloring display.

[0064] On the other hand, the present invention also provides a device for hierarchical configuration of prefabricated objects in a 2D game scene, comprising a processor, a memory, and a computer program / instructions stored in the memory, wherein the processor is used to execute the computer program / instructions, and when the computer program / instructions are executed, the device implements the steps of the above method.

[0065] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when the computer program / instruction is executed by a processor.

[0066] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.

[0067] The present invention is described below in conjunction with a specific embodiment:

[0068] This embodiment provides a 2D game scene hierarchy setting method, comprising the following steps:

[0069] 1. Set the background to the Background layer, the ground to the Ground layer, and all items to the Item layer.

[0070] 2. Divide the different courtyards in the scene into different large groups, attach the grouping script, and manually set the group number. The group number represents the overall hierarchical relationship between the courtyards.

[0071] 3. According to the situation of the object landing on the ground, set the hierarchical vector group of the item in the scene, starting from the lower left pixel of the item, and along the positive direction of the X-axis of the standard coordinate system with the width of the item as the vector length, establish a corresponding hierarchical vector for each item. After the hierarchical vector is decomposed, x should always be positive and y should always be negative. During initialization, the hierarchical vector automatically generated by the script for the object may not be completely correct and may need to be adjusted manually. The vector itself has no position information. The vector stored in the prefab only has direction and length, while the hierarchical vector line segment drawn in the example diagram already contains position information.

[0072] 4. Among overlapping objects, according to the relative position relationship between adjacent level vectors, the one located on the side close to the observer angle is configured as a higher display level, and the one located on the side far from the observer angle is configured as a lower display level. If the target scene is displayed along a 45° top-down viewing angle, the one located on the right side of the adjacent level vector is the side close to the observer angle, and its display level is high; the one located on the left side of the adjacent level vector is the side far from the observer angle, and its display level is low.

[0073] Then click the Automatic Scene Setup button. Based on the execution of the above rules, you can check whether the hierarchical effect of the scene calculated automatically meets your expectations. If an error occurs or the effect is inconsistent with the expected effect, you need to rearrange the vectors in the scene. Errors do not occur often, and the main reason is due to position or vector intersection.

[0074] 5. Traverse all groups in the scene, traverse each item in the group, and calculate all other items that may overlap with it based on the position and size of the item (which has been automatically calculated by the script and stored in the prefab). The character's reserved width and height need to be added here. Traverse all possible overlapping items, combine the hierarchical vector group of the item and its possible overlapping items with their own placement position, and determine the topological order of the two items. The rule is that if the direction line segment of item A is to the right of all the direction line segments of item B, then A is considered to have a higher topological order than B. For example, the vector of an item is stored as (1,2), but when it is placed at (0,0), the rectangle it represents is a vector line segment with the starting point (0,0) pointing to the end point (1,2), and when it is placed at (1,1), it is a vector line segment with (1,1) pointing to the end point (2,3). The method for determining the hierarchical relationship between item A and item B is to traverse the starting and ending points of the vector group of item A and the vectors of all the vector groups of item B. If all the points of item A are on one side of the vector of item B, then determine whether item A is on the upper or lower level of item B based on whether it is on the right or left side. If there is an inconsistent result, then traverse all the starting and ending points of the vector group of item B and all the vectors of the vector group of item A in reverse, and the determination method is the same. If there is still an inconsistent result, it means that it is impossible to correctly determine that the two have formed a loop, and an error message is returned. A topological map is constructed for each group.

[0075] 6. Check the topology diagram. If there is a topology loop, an error will be reported.

[0076] 7. Output the topological queue without a topological ring, and perform hierarchical calculations on each item in the topological queue in turn.

[0077] 8. When the character moves in the scene, the surrounding objects that overlap with the character are obtained, and the character's level is set according to the topological relationship between the character and the objects (the topological relationship calculation is consistent with the previous topological relationship calculation rules between objects, except that the character is calculated using points).

[0078] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, the processor is used to execute the computer instructions stored in the memory, and when the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.

[0079] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the aforementioned edge computing server deployment method are implemented. The computer-readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0080] In summary, the hierarchical configuration method, device and computer program product of the 2D game scene described in the present invention automatically generates hierarchical vectors based on the images of prefabricated bodies formed in the art creation stage, and uses the relative position relationship between the hierarchical vectors to reflect the relative relationship of the prefabricated bodies in the display hierarchy. Combined with the correction of the hierarchical vectors by the audit end, a topological diagram of the hierarchical relationship of the prefabricated bodies is constructed, and the correctness of the hierarchical relationship is checked by checking whether there is a topological ring in the topological diagram. When there is no topological ring, the topological queue is directly output, and the hierarchical configuration of each prefabricated body is automatically generated, which realizes the automatic configuration of multiple prefabricated levels in complex scenes and reduces the error rate.

[0081] Furthermore, by setting up the overall level of the established scene group, it is possible to split and combine the level configuration tasks of complex scenes, so that the level of complex scenes can be set more efficiently.

[0082] Furthermore, for the characters in the scene, by constructing the character positioning point and identifying the relative position relationship of the hierarchical vectors of the intermediate prefabs that overlap with it, combined with the determined hierarchical configuration of the intermediate prefabs in the target scene, the display level of the character can be directly determined, which can ensure real-time dynamic updates and higher efficiency.

[0083] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0084] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0085] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.

[0086] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A hierarchical configuration method for a 2D game scene, characterized in that: The method comprises the following steps: Construct a standard coordinate system, for multiple prefabricated bodies deployed in the target scene, take the lower left corner pixel of the prefabricated body as the starting point, and establish a corresponding hierarchical vector for each prefabricated body along the positive direction of the X-axis of the standard coordinate system with the width of the prefabricated body as the vector length; Acquire a hierarchical relationship configuration rule, wherein the hierarchical relationship configuration rule determines the hierarchical relationship between the preforms based on the hierarchical vectors of the preforms; among the overlapping preforms, according to the relative position relationship between the adjacent hierarchical vectors, the one located on the side close to the observer angle is configured as a higher display level, and the one located on the side far from the observer angle is configured as a lower display level; When there is a display level error, the level vector correction information of the preset audit end is received, and the level vector correction information marks the level vector correction instructions for adjusting the starting point, length, direction and / or splitting each level vector; the level vector correction instructions reconfigure the corresponding level vector of the prefabricated body with overlapping display and wrong level relationship display according to the landing surface shape of the preset body, and the corrected direction is the positive direction of the X axis or the negative direction of the Y axis of the standard coordinate system, and there is no intersection between the corrected level vectors; Constructing a prefabricated body hierarchical relationship topology map, wherein the prefabricated body hierarchical relationship topology map is used to record the display hierarchical relationship between each hierarchical vector and other hierarchical vectors adjacent thereto; Check whether there is a topological loop in the prefabricated hierarchical relationship topological diagram. If there is a topological loop, generate an error prompt message to the preset audit end to prompt the preset audit end to feedback new hierarchical vector correction information; if there is no topological loop, output the prefabricated topological queue, and generate a hierarchical configuration for the prefabricated body according to the prefabricated topological queue.

2. The hierarchical configuration method of a 2D game scene according to claim 1, characterized in that: The method further comprises: Dividing the prefabricated parts in the target scene into a plurality of scene groups according to scene relationships; A scene group level configuration instruction is received, and a level value is configured for each scene group respectively, so as to distinguish display levels according to the size of the level value.

3. The hierarchical configuration method of a 2D game scene according to claim 1, characterized in that: In the method, the target scene is displayed along a 45° top-down viewing angle, and the side located on the right side of the adjacent level vector is the side adjacent to the observer's angle, and its display level is high; the side located on the left side of the adjacent level vector is far from the observer's angle, and its display level is low.

4. The hierarchical configuration method of a 2D game scene according to claim 1, characterized in that: The method further comprises: Setting a role positioning point for a role moving in the target scene, wherein the role positioning point moves in the target scene based on an action instruction of a user terminal; Determine one or more intermediate prefabricated bodies overlapping with the character in the target scene according to the real-time position of the character in the target scene and the size of the image displayed by the character; The relative position relationship between the character positioning point and the hierarchical vector of the intermediate preform is determined, and the display level of the character is determined according to the hierarchical relationship configuration rule and the determined hierarchical configuration of the intermediate preform in the target scene.

5. The hierarchical configuration method of a 2D game scene according to claim 1, characterized in that: Constructing a standard coordinate system, for a plurality of prefabricated bodies deployed in the target scene, taking the lower left corner pixel point of the prefabricated body as the starting point, taking the width of the prefabricated body as the vector length along the positive direction of the X-axis of the standard coordinate system, before establishing a corresponding hierarchical vector for each prefabricated body, the method further comprises: The prefabricated bodies are divided into a background layer, a ground layer and an item layer, the background layer and the ground layer are configured to have a display level lower than the item layer, and subsequently only the prefabricated bodies in the item layer are configured with a level.

6. The hierarchical configuration method of a 2D game scene according to claim 1, characterized in that: After checking whether there is a topological loop in the prefabricated body hierarchical relationship topological graph and generating an error prompt message to the preset audit terminal if the topological loop exists, the method further includes: The identification information of all abnormal preforms related to the topological ring is searched, and the abnormal preforms are highlighted in a preset form according to the identification information.

7. The hierarchical configuration method of a 2D game scene according to claim 6, characterized in that: The preset forms include: adding an abnormal identification display, highlighting display or adding a red temperature coloring display.

8. A device for configuring the hierarchy of prefabricated objects in a 2D game scene, comprising a processor, a memory, and a computer program / instruction stored in the memory, characterized in that: The processor is used to execute the computer program / instructions. When the computer program / instructions are executed, the device implements the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Game scene rendering method and device

    CN111773706A

  • Satellite-ground integrated network situation visualization method, server and storage medium

    CN115396321A

  • Game scene generation method and device, computer equipment and storage medium

    CN115591239A

  • LED display system equipment topology editing method and device and electronic equipment

    CN115941496A

  • Method for generating high-precision and microscopic virtual learning resource

    US11164289B1