Game level generation method, device, computer equipment and storage medium

By converting the graphical interface data of the initial level into a data stream, eliminating non-key data and replacing items, and generating graphical interface data of key levels, the problems of high development costs and high personnel requirements in the existing technology are solved, and the effect of reducing development costs and learning costs and improving work efficiency is achieved.

CN118403366BActive Publication Date: 2025-03-07SHENZHEN WANPISHI NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410676383.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-29
Publication Date
2025-03-07
Estimated Expiration
2044-05-29

AI Technical Summary

Technical Problem

The development cost of existing game level configuration plans is high and requires high personnel, especially for small companies and configuring personnel.

Method used

By obtaining the graphical interface data of the initial level, using graphics software to convert the data into a data stream, eliminating non-key data, identifying and replacing object objects, and generating graphical interface data of the key level.

Benefits of technology

It reduces the need for developers to create special level editors, reduces development and learning costs, simplifies the workflow of level configuration personnel, and improves work efficiency and level generation speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118403366B_ABST
    Figure CN118403366B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device, computer equipment and storage medium for generating a game level. By acquiring graphical interface data of an initial level and then exporting an initial data stream, the processing complexity is simplified. Non-key data is eliminated to obtain a first data stream. The object type and replacement requirements of an item are identified, and the item object is replaced to generate a second data stream. Finally, the graphical interface data of a key level is obtained based on the second data stream. The method reduces the production requirements of a level editor, simplifies the workflow and improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of game level generation processing, and in particular to a game level generation method, device, computer equipment and storage medium. Background Art

[0002] In today's fast-paced game development environment, many games need to configure a large number of levels, especially level-passing games, which often have nearly 5,000 or more level configurations. For game level configuration personnel, this is an extremely laborious and arduous task. At present, the common level configuration solutions on the market are mainly: developers develop special game level preset editors, and configuration personnel perform level configuration in the preset editor, which is then stored and imported into the game for verification.

[0003] However, this solution has some problems. First, developers need to create an additional game level editor, which is particularly disadvantageous for small companies because their manpower and resources are relatively limited. Second, game level configuration personnel need to be very familiar with game production software and game level editors, which increases the difficulty of entry and learning cost for configuration personnel. In short, the current game level configuration solution has the problems of high development cost and high personnel requirements, which is a problem that needs to be solved urgently. Summary of the invention

[0004] The main purpose of the present invention is to provide a method, device, computer equipment and storage medium for generating game levels, so as to solve the problems of high development cost and high personnel requirements of game level configuration schemes encountered in the fast-paced environment of game development today.

[0005] To achieve the above-mentioned purpose, the present invention provides a method for generating a game level, comprising the following steps: obtaining graphical interface data of an initial level; using graphic software to export the layers and image data in the graphical interface data of the initial level in the form of a data stream to obtain an initial data stream; eliminating non-key data in the initial data stream to obtain a first data stream; identifying the item type of each item object in the first data stream and obtaining the replacement requirements of each item type; performing replacement processing on each item object in the first data stream according to the replacement requirements of different item types to obtain a second data stream; and obtaining graphical interface data of a key level based on the second data stream.

[0006] Furthermore, non-important data in the initial data stream is eliminated to obtain a first data stream, including: identifying first non-important data in the initial data stream, and eliminating the first non-important data in the initial data stream, wherein the first non-important data is data of decorative elements and / or auxiliary elements; identifying second non-important data in the initial data stream, and eliminating the second non-important data in the initial data stream, wherein the second non-important data is data of elements beyond the visible range of the level and / or data of elements at the logical edge of the level.

[0007] Furthermore, the target type of each object in the first data stream is identified, and the replacement requirement of each target type is obtained, including: identifying the target type of each object in the first data stream, and determining at least a plurality of target types, wherein the target type includes at least one of the following: a player-operated item type, an opponent type, and an obstacle type; determining the replacement requirements corresponding to the plurality of target types, wherein the replacement requirement of the opponent type is that replacement is required, the replacement requirement of the player-operated item type is that replacement is required, and the replacement requirement of the obstacle type is that no replacement is required.

[0008] Furthermore, each object in the first data stream is replaced according to the replacement requirements of different target types to obtain a second data stream, including: determining each target object with replacement requirements according to the replacement requirements of different target types; sending multiple object replacement requests to the user, wherein the object replacement requests correspond to the target objects one-to-one, and the object replacement requests record the target objects with replacement requirements and the replacement requirements corresponding to the target objects; accepting the object replacement instructions input by the user based on the object replacement requests, and replacing each target object in the first data stream based on the object replacement instructions to obtain a second data stream.

[0009] Furthermore, after obtaining the graphical interface data of the key level based on the second data stream, the generation method also includes: randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a test level; brute-forcing the test level to determine whether the test level has a solution; if there is no solution, re-executing the step of "randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a test level"; if there is a solution, determining that the test level is a non-key level generated by the key level; and determining the number of times the non-key level has been cracked by brute force; calculating the cracking difficulty of the non-key level based on the cracking number, and storing the graphical interface data of the non-key level and the cracking difficulty of the non-key level in a database.

[0010] Furthermore, after storing the graphical interface data of the non-key level and the difficulty of cracking the non-key level in the database, the method further includes: determining whether the number of non-key levels generated by the key level stored in the database reaches a preset threshold; if not, re-executing the step of "randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a non-key level"; if reached, taking the key level as the initial level, and re-executing the step of "using graphic software to export the layers and image data in the graphical interface data of the initial level in the form of a data stream to obtain an initial data stream".

[0011] Furthermore, the difficulty of cracking the non-key level is calculated based on the number of cracking times, including: determining basic parameters of the non-key level, wherein the basic parameters include: the number of opponents and opponent levels, the number of obstacles and obstacle levels in the non-key level, and the scene level and shortest path steps of the non-key level; based on the basic parameters of the non-key level and the number of cracking times, a target formula is used for calculation to obtain the difficulty of cracking the non-key level, wherein the target formula is: difficulty = (number of opponents * opponent level) * (number of obstacles * obstacle level) * (scene level) * (shortest path steps) / (number of cracking times).

[0012] The present invention also provides a device for generating a game level, comprising: an acquisition unit, used to acquire graphical interface data of an initial level; an export unit, used to export the layers and image data in the graphical interface data of the initial level in the form of a data stream using graphic software to obtain an initial data stream; a removal unit, used to remove non-key data in the initial data stream to obtain a first data stream; an identification unit, used to identify the item type of each item object in the first data stream and obtain the replacement requirements of each item type; a replacement unit, used to replace each item object in the first data stream according to the replacement requirements of different item types to obtain a second data stream; and a generation unit, used to obtain the graphical interface data of a key level based on the second data stream.

[0013] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0014] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0015] The method, device, computer equipment and storage medium for generating game levels provided by the present invention obtain the graphical interface data of the initial level and use the existing level design as a basis to reduce the workload of designing from scratch. Then, the layers and image data in the graphical interface data of the initial level are exported in the form of data streams using graphic software to obtain the initial data stream. This step converts the complex graphic data into a data stream form that is easier to process, laying the foundation for subsequent processing. Then, the non-key data in the initial data stream is eliminated to obtain the first data stream. This process can filter out unnecessary details, simplify the complexity of data processing, and improve efficiency. Next, the item type of each item object in the first data stream is identified, and the replacement requirements of each item type are obtained. By identifying the item type, it can be determined which items need to be replaced or adjusted. According to the replacement requirements of different item types, each item object in the first data stream is replaced to obtain a second data stream. This step adjusts and replaces the items in the level in an automated manner to generate a new level layout. Finally, based on the second data stream, the graphical interface data of the key level is obtained. This step converts the processed data stream back into graphical interface data to form a new level design.

[0016] Overall, this method of generating game levels has significant technical effects. First, it reduces the need for developers to create specialized level editors, reducing development costs. Second, it simplifies the workflow of level configuration personnel through automation, reducing the difficulty of entry and learning costs. Finally, this method can efficiently generate a large number of levels, greatly improving work efficiency and providing strong support for the rapid development of games. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a schematic diagram of the steps of a method for generating a game level in one embodiment of the present invention;

[0018] Figure 2 is a structural block diagram of a device for generating a game level in one embodiment of the present invention;

[0019] Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0020] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0021] 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 accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0022] Reference Figure 1 , the present application provides a method for generating a game level, comprising the following steps:

[0023] S1, obtaining graphical interface data of the initial level.

[0024] S2, using graphic software to export the layers and image data in the graphical interface data of the initial level in the form of data streams to obtain an initial data stream.

[0025] S3, removing non-important data from the initial data stream to obtain a first data stream.

[0026] S4, identifying the item type of each item object in the first data stream, and obtaining the replacement requirement of each item type.

[0027] S5, performing replacement processing on each item object in the first data stream according to replacement requirements of different item types to obtain a second data stream.

[0028] S6: Based on the second data stream, obtain graphical interface data of the key level.

[0029] The present application provides a method for generating a game level, comprising the following steps: first, obtaining graphical interface data of an initial level. Through this step, the existing level design can be used as a basis to reduce the workload of designing from scratch. Next, the layers and image data in the graphical interface data of the initial level are exported in the form of a data stream using a graphics software to obtain an initial data stream. This step converts complex graphic data into a more easily processable data stream form, laying the foundation for subsequent processing. Then, the non-key data in the initial data stream is eliminated to obtain a first data stream. This process can filter out unnecessary details, simplify the complexity of data processing, and improve efficiency. Next, the item type of each item object in the first data stream is identified, and the replacement requirements of each item type are obtained. By identifying the item type, it can be determined which items need to be replaced or adjusted. According to the replacement requirements of different item types, each item object in the first data stream is replaced to obtain a second data stream. This step adjusts and replaces the items in the level in an automated manner to generate a new level layout. Finally, based on the second data stream, the graphical interface data of the key level is obtained. This step converts the processed data stream back into graphical interface data to form a new level design.

[0030] Overall, this method of generating game levels has significant technical effects. First, it reduces the need for developers to create specialized level editors, reducing development costs. Second, it simplifies the workflow of level configuration personnel through automation, reducing the difficulty of entry and learning costs. Finally, this method can efficiently generate a large number of levels, greatly improving work efficiency and providing strong support for the rapid development of games.

[0031] In one example, non-important data in the initial data stream is eliminated to obtain a first data stream, including: identifying first non-important data in the initial data stream, and eliminating the first non-important data in the initial data stream, wherein the first non-important data is data of decorative elements and / or auxiliary elements; identifying second non-important data in the initial data stream, and eliminating the second non-important data in the initial data stream, wherein the second non-important data is data of elements beyond the visible range of the level and / or data of elements at the logical edge of the level.

[0032] In this example, in the step of removing non-important data in the initial data stream, the first non-important data in the initial data stream is first identified, and the first non-important data in the initial data stream is removed, wherein the first non-important data is data of decorative elements and / or auxiliary elements. This step reduces the complexity of data processing by identifying and removing decorative elements that do not affect the core gameplay of the game, and concentrates resources on the processing of important data. Next, the second non-important data in the initial data stream is identified, and the second non-important data in the initial data stream is removed, wherein the second non-important data is data of elements beyond the visible range of the level and / or data of elements at the logical edge of the level. This process makes the data more concise and improves processing efficiency by removing elements that players cannot see or do not directly affect the game experience.

[0033] Of course, the data of decorative elements and auxiliary elements can be illustrated by specific examples. For example, decorative elements include background items, such as paintings on the background walls in the level, wallpaper patterns, or clouds in the sky. These elements will not affect the player's gaming experience, but only increase the visual effect. Another example is decorative plants. Some flowers, plants, and trees in the game scene are only used to beautify the environment and have no actual impact on the game process. There are also some non-interactive props, such as furniture in the room, street lights on the street, etc., which players cannot interact with. These elements only serve as decoration. Auxiliary elements include UI prompts, such as the prompt "Press A to jump". Although they are important, they are auxiliary data and can be identified as auxiliary elements in data processing. Virtual boundaries are also one of the auxiliary elements. They mark the dotted lines or translucent walls that mark the boundaries of the game area. These elements are only to help players understand the location of the boundaries and are not needed during the actual game process.

[0034] In addition, there are some specific examples of data for elements beyond the visible range of the level and elements at the edge of the level logic. Among the elements beyond the visible range of the level, the distant background is a typical example. In a horizontal scrolling game, the distant mountains or city outlines in the background, although these elements exist in the overall scene, are usually outside the screen for the visible range of the actual level. Another example is unused map blocks. On a large map, players can only see and enter part of it. Other unused areas, even if there is data, are elements beyond the visible range. Elements at the edge of the level logic include edge blockers. There may be some invisible walls or obstacles at the edge of the level to prevent players from leaving the designed game area. These elements are part of the level logic, but they will not appear directly in the player's field of vision. Edge triggers are also one of the elements at the edge of the level logic. Some triggers may be located at the edge of the level to detect whether the player has crossed the boundary or triggered certain events. These triggers are logical elements and do not directly affect the player's visual experience.

[0035] By identifying and removing these non-key data, game developers can simplify the complexity of level data, improve processing efficiency and level generation speed. At the same time, removing the data of decorative elements and auxiliary elements can focus resources on the processing of important data and reduce unnecessary data interference. Removing the data of elements that are beyond the visible range of the level and the elements at the edge of the level logic can make the data more concise, improve processing efficiency, and ensure the integrity and playability of the level. Overall, this method can effectively improve the efficiency of level generation.

[0036] In one example, identifying the target type of each object in the first data stream and obtaining the replacement requirement of each target type includes: identifying the target type of each object in the first data stream and determining at least a plurality of target types, wherein the target type includes at least one of the following: a player-operated item type, an opponent type, and an obstacle type; determining the replacement requirements corresponding to the plurality of target types, wherein the replacement requirement of the opponent type is that replacement is required, the replacement requirement of the player-operated item type is that replacement is required, and the replacement requirement of the obstacle type is that no replacement is required.

[0037] In this example, the technical solution provides a method for identifying the target type of each object in the first data stream and obtaining the replacement requirements of each target type. First, the target type of each object in the first data stream is identified, and at least multiple target types are determined, including player-operated item types, opponent types, and obstacle types. Through this step, the system can automatically identify different types of items in the level. The identification of target types helps to classify and manage various types of objects in the level, making subsequent processing more efficient and accurate. Next, the replacement requirements corresponding to these target types are determined. For the replacement requirements of the opponent type, it needs to be replaced, and the inspection path needs to be set. This setting makes the opponent behavior in the game more intelligent and diversified, and enhances the challenge and fun of the game. For the replacement requirements of the player-operated item type, it needs to be replaced, which means that the key items that the player can operate will be adjusted according to different level requirements to ensure the playability and freshness of the game. For the replacement requirements of the obstacle type, there is no need to replace it, which can reduce unnecessary data processing, maintain the stability of obstacles in the level, and thus reduce complexity.

[0038] Through this method, game developers can effectively simplify the complexity of level data, improve processing efficiency and level generation speed. At the same time, the identification and processing of replacement requirements for target type objects can make data more concise and improve processing efficiency.

[0039] In one example, each object in the first data stream is replaced according to the replacement requirements of different target types to obtain a second data stream, including: determining each target object with replacement requirements according to the replacement requirements of different target types; sending multiple object replacement requests to a user, wherein the object replacement requests correspond to the target objects one-to-one, and the object replacement requests record the target objects with replacement requirements and the replacement requirements corresponding to the target objects; accepting an object replacement instruction input by the user based on the object replacement request, and replacing each target object in the first data stream based on the object replacement instruction to obtain a second data stream.

[0040] It should be noted that the users here refer to game developers.

[0041] In this example, the technical solution provides a method for performing a replacement process on each object in a first data stream according to the replacement requirements of different target types to obtain a second data stream. First, each target object with a replacement requirement is determined according to the replacement requirements of different target types. This step enables the system to automatically identify the objects to be processed, reduce the workload of manual identification, and improve processing efficiency. Next, multiple object replacement requests are sent to game developers, wherein the object replacement requests correspond to the target objects one by one, and the object replacement requests record the target objects with replacement requirements and the replacement requirements corresponding to the target objects. This step ensures the accurate communication of replacement requirements through interaction with game developers and provides clear operation suggestions for game developers. After receiving the object replacement requests, the game developers can input object replacement instructions based on these requests. The system accepts the object replacement instructions input by the game developers based on the object replacement requests, and performs replacement processing on each target object in the first data stream based on the object replacement instructions, thereby obtaining a second data stream. This process makes the replacement operation more flexible and controllable, and the game developers can briefly and flexibly adjust the replacement content to improve the accuracy and personalization of the level configuration.

[0042] Through this method, game developers can effectively simplify the complexity of level data, improve processing efficiency and level generation speed. Object identification and processing are performed according to the replacement requirements of different target types, ensuring the pertinence and efficiency of data processing. By sending replacement requests to game developers and receiving instructions from game developers, the replacement process is more convenient, and the final second data stream can better meet the game design requirements.

[0043] In one example, after obtaining the graphical interface data of the key level based on the second data stream, the generation method also includes: randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a test level; brute-forcing the test level to determine whether the test level has a solution; if there is no solution, re-executing the step of "randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a test level"; if there is a solution, determining that the test level is a non-key level generated by the key level; and, determining the number of times the non-key level has been cracked by brute force; calculating the cracking difficulty of the non-key level based on the cracking number, and storing the graphical interface data of the non-key level and the cracking difficulty of the non-key level in a database.

[0044] In this example, after obtaining the graphical interface data of the key level based on the second data stream, the generation method also includes several steps. First, randomly generate opponents and / or obstacles in the graphical interface data of the key level to obtain a test level. This step ensures the diversity and unpredictability of the level design by randomly generating opponents and obstacles, thereby enhancing the challenge of the game. Next, brute force the test level to determine whether the test level has a solution. Brute force is a method of comprehensively trying all possible solutions to ensure that the level is comprehensible in design. If the test level has no solution, re-execute the step of randomly generating opponents and / or obstacles in the graphical interface data of the key level. This cyclic process ensures that the level finally generated is logically solvable and avoids an uncomprehensible design.

[0045] If the test level has a solution, the test level is determined to be a non-key level generated by the key level, and a brute force crack is performed on it to determine the number of times the non-key level is cracked by brute force. By calculating the number of cracks, the difficulty of cracking the level can be evaluated. Based on the number of cracks, the difficulty of cracking the non-key level is calculated, and the graphical interface data and the difficulty of cracking the non-key level are stored in a database. Since different non-key levels have different difficulties, these non-key levels can be sorted to obtain multiple non-key levels with increasing difficulty. This allows players to challenge multiple non-key levels in turn according to the difficulty of the level after passing the key level.

[0046] With this method, game developers can effectively generate and verify a large number of levels, ensuring the playability and challenge of each level, while greatly improving the efficiency of level generation. The steps of randomly generating opponents and obstacles increase the diversity and unpredictability of the levels, and the brute force cracking process ensures the solvability of the levels, thus avoiding design omissions. The difficulty of the levels is calculated based on the number of cracks and stored in the database, which not only allows these levels to be used directly in the game, but also allows the levels to be sorted by difficulty, allowing players to experience a step-by-step challenge. Overall, this method not only improves the efficiency of level generation and verification, but also improves the performance of the game and the player experience.

[0047] In one example, after storing the graphical interface data of the non-key level and the difficulty of cracking the non-key level in a database, the method further includes: determining whether the number of non-key levels generated by the key level stored in the database reaches a preset threshold; if not, re-executing the step of "randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a non-key level"; if reached, taking the key level as the initial level, and re-executing the step of "using graphics software to export the layers and image data in the graphical interface data of the initial level in the form of a data stream to obtain an initial data stream".

[0048] In this example, after the graphical interface data and cracking difficulty of non-key levels are stored in a database, the method also includes determining whether the number of non-key levels generated by key levels stored in the database reaches a preset threshold. If not, the step of randomly generating opponents and / or obstacles in the graphical interface data of the key levels to obtain non-key levels is re-executed. This ensures that each key level generates enough non-key levels to provide rich game content. If the preset threshold is reached, the key level is used as the initial level, and the step of exporting the layers and image data in the graphical interface data of the initial level in the form of a data stream using graphics software is re-executed to obtain the initial data stream. This process ensures the continuity and diversity of level generation by continuously generating new key levels and non-key levels.

[0049] In one example, calculating the difficulty of cracking the non-key level based on the number of cracking times includes: determining basic parameters of the non-key level, wherein the basic parameters include: the number of opponents and opponent levels, the number of obstacles and obstacle levels in the non-key level, and the scene level and shortest path steps of the non-key level; based on the basic parameters of the non-key level and the number of cracking times, using a target formula for calculation to obtain the difficulty of cracking the non-key level, wherein the target formula is: difficulty = (number of opponents * opponent level) * (number of obstacles * obstacle level) * (scene level) * (shortest path steps) / (number of cracking times).

[0050] In this example, the difficulty of cracking a non-key level is calculated based on the number of cracks, including several steps. First, the basic parameters of the non-key level are determined, where the basic parameters include the number of opponents and the level of opponents, the number of obstacles and the level of obstacles, and the scene level and the shortest path steps of the non-key level. The determination of the basic parameters helps to fully understand the complexity and design characteristics of the level, and provide the necessary data support for the difficulty calculation. Then, based on the basic parameters and the number of cracks of the non-key level, the target formula is used for calculation to obtain the difficulty of cracking the non-key level. The target formula is: Difficulty = (number of opponents * opponent level) * (number of obstacles * obstacle level) * (scene level) * (shortest path steps) / (number of cracks). This formula comprehensively considers various factors that affect the difficulty in the level, such as the number and level of opponents and obstacles, the complexity of the scene, and the length of the path, and is adjusted by the number of cracks to ensure the rationality and accuracy of the calculation results.

[0051] Based on the calculated cracking difficulty, the graphical interface data and cracking difficulty of the non-key levels are stored in the database. Different non-key levels have different difficulties, so these non-key levels can be sorted to obtain multiple non-key levels with increasing difficulty. This allows players to challenge multiple non-key levels in sequence according to the difficulty of the levels after passing the key levels.

[0052] It should be noted that: in the process of generating key levels, the game developers replaced the opponent types and player-operated item types. In the process of generating non-key levels, the system randomly generates opponents based on the opponent types replaced by the game developers. For example: the game developers replaced a low-level opponent with a high-level opponent, and replaced the basic player-operated items (such as low-level weapons) with higher-level items (such as high-level weapons). Based on this replacement information, when the system randomly generates opponents in non-key levels, it will randomly generate them based on the high-level opponents replaced by the developers, instead of returning to the original low-level opponent configuration.

[0053] Finally, let's take an example to illustrate the entire technical solution: suppose we want to add 500 levels to a game, and the first additional level is a key level. The game developer first replaces the original low-level opponents with high-level opponents and replaces the player's basic weapons with more advanced weapons. Next, based on the data stream of this key level, the system will generate non-key levels. The specific steps are as follows:

[0054] First, the system randomly generates opponents and / or obstacles in the graphical interface data of the key level to obtain a test level. For example, the system may randomly generate an enemy and several obstacles at a certain location. Then, the system brute-forces the test level to determine whether the test level has a solution. If the test level is found to be impassable, the system will randomly generate opponents and obstacles again until the test level is solvable. When the test level has a solution, the system determines that the test level is a non-key level generated by the key level and calculates the number of times it has been cracked. Suppose a non-key level has two high-level opponents, three obstacles, a scene level of 2, and a shortest path step of 50, and brute-force cracking requires 100 attempts. The system substitutes these basic parameters into the formula: Difficulty = (Number of opponents * Opponent level) * (Number of obstacles * Obstacle level) * (Scene level) * (Number of shortest path steps) / (Number of cracking times). Assuming that the level of all parameters in the formula is 1, the calculated difficulty is (2 * 1) * (3 * 1) * 2 * 50 / 100 = 6.

[0055] Based on the calculated cracking difficulty, the system stores the graphical interface data and cracking difficulty of the non-key levels in the database. Different non-key levels have different difficulties, so the system can sort these non-key levels to obtain multiple non-key levels with increasing difficulty. Assuming that we need to generate 499 non-key levels to reach the preset threshold, the system will repeat the above process and continuously generate new non-key levels until the number reaches the requirement. If the number of non-key levels in the database is insufficient, the system will continue to randomly generate opponents and obstacles from the data of the key levels until the preset number is reached.

[0056] When the number of non-key levels reaches 499, if we have additional level requirements, the system will use the key level as the initial level, regenerate the key levels in the next 500 levels, and repeat the whole process. This not only ensures a continuous source of levels, but also ensures that every 500 levels has a well-designed key level and 499 non-key levels of increasing difficulty.

[0057] Through this method, game developers can effectively generate and verify a large number of levels, ensuring the playability and challenge of each level, while greatly improving the efficiency of level generation. Key levels ensure high quality and challenge by manually adjusting and replacing opponent types and player-operated item types; non-key levels are automatically generated and sorted by difficulty, allowing players to experience gradual challenges. Overall, this method not only improves the efficiency of level generation and verification, but also improves game performance and player experience.

[0058] Finally, the whole technical solution is explained in detail: 1. This solution greatly reduces the user's usage cost by using graphic image processing software to perform visual level editing at the picture layer, allowing level configuration personnel to get started and debug faster. This method reduces the reliance on specialized level editors, is suitable for small companies with limited resources, and reduces the learning cost; 2. By adding random information and key level flipping technology, more levels can be automatically generated more conveniently, thereby reducing the workload of level editing. It can be quickly expanded from 500 levels of basic data to 2,000 levels, or even more levels, to achieve large-scale level generation, greatly improving the efficiency of level configuration and the richness of game content; 3. It can easily reuse the blasting link in the original game. General games have conventional blasting links to check whether the player has entered the death state, and this application can greatly reduce the development workload by cleverly using this function. It ensures the solvability of each level by brute-forcing the level, further improving the reliability and quality of level design.

[0059] In summary, this patent uses common graphics and image processing software to edit levels, add random information and key level flipping technology to automatically generate a large number of levels, and reuse the blasting links in the game to verify the solvability of the levels. It significantly reduces the cost and difficulty of level configuration, greatly improves the efficiency of level generation and verification, and provides an effective solution for game development.

[0060] Reference Figure 2 , an embodiment of the present invention provides a device for generating a game level, comprising:

[0061] An acquisition unit 1 is used to acquire graphical interface data of an initial level;

[0062] An export unit 2 is used to export the layers and image data in the graphical interface data of the initial level in the form of a data stream using a graphic software to obtain an initial data stream;

[0063] A removal unit 3, used for removing non-important data from the initial data stream to obtain a first data stream;

[0064] an identification unit 4, configured to identify the item type of each item object in the first data stream and obtain a replacement requirement for each item type;

[0065] a replacement unit 5, configured to perform replacement processing on each item object in the first data stream according to replacement requirements of different item types to obtain a second data stream;

[0066] The generating unit 6 is used to obtain the graphical interface data of the key level based on the second data stream.

[0067] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0068] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.

[0069] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0070] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0071] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0072] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0073] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for generating a game level, characterized in that: The following steps are involved: Get the graphical interface data of the initial level; Exporting the layers and image data in the graphical interface data of the initial level in the form of data streams using graphic software to obtain initial data streams; Eliminate non-important data in the initial data stream to obtain a first data stream; Identify the item type of each item object in the first data stream, and obtain replacement requirements for each item type; Perform replacement processing on each item object in the first data stream according to replacement requirements of different item types to obtain a second data stream; Based on the second data stream, graphical interface data of the key level is obtained.

2. The generation method according to claim 1, characterized in that: The non-important data in the initial data stream is removed to obtain a first data stream, including: Identifying first non-key data in the initial data stream, and removing the first non-key data in the initial data stream, wherein the first non-key data is data of decorative elements and / or auxiliary elements; Identify second non-important data in the initial data stream, and remove the second non-important data in the initial data stream, wherein the second non-important data is data of elements beyond the visible range of the level and / or data of elements at the logical edge of the level.

3. The generation method according to claim 1, characterized in that: Identifying the target type of each object in the first data stream and obtaining the replacement requirements of each target type includes: Identify the target type of each object in the first data stream, and determine at least a plurality of target types, wherein the target type includes at least one of the following: a player-operated item type, an opponent type, and an obstacle type; The replacement requirements respectively corresponding to the multiple target types are determined, wherein the replacement requirement of the opponent type is that replacement is required, the replacement requirement of the player-operated item type is that replacement is required, and the replacement requirement of the obstacle type is that no replacement is required.

4. The generation method according to claim 3, characterized in that: Performing replacement processing on each object in the first data stream according to replacement requirements of different target types to obtain a second data stream includes: According to the replacement needs of different target types, determine each target object with replacement needs; Sending multiple object replacement requests to the user, wherein the object replacement requests correspond to the target objects one by one, and the object replacement requests record the target objects of the replacement requirements and the replacement requirements corresponding to the target objects; An object replacement instruction input by the user based on the object replacement request is accepted, and each target object in the first data stream is replaced based on the object replacement instruction to obtain a second data stream.

5. The generation method according to claim 1, characterized in that: After obtaining the graphical interface data of the key level based on the second data stream, the generation method further includes: Randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a test level; Performing brute force cracking on the test level to determine whether the test level has a solution; If there is no solution, re-execute the step of "randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a test level"; If there is a solution, the test level is determined to be a non-key level generated by the key level, and the number of times the non-key level is cracked by brute force is determined, the difficulty of cracking the non-key level is calculated based on the number of cracks, and the graphical interface data of the non-key level and the difficulty of cracking the non-key level are stored in a database.

6. The generation method according to claim 5, characterized in that: After storing the graphical interface data of the non-key level and the difficulty of cracking the non-key level in a database, the method further includes: Determining whether the number of non-key checkpoints generated by the key checkpoints stored in the database reaches a preset threshold; If not, re-execute the step of "randomly generating opponents and / or obstacles in the graphical interface data of the key level to obtain a non-key level"; If it is reached, the key level is taken as the initial level, and the step of "using graphic software to export the layers and image data in the graphical interface data of the initial level in the form of data stream to obtain the initial data stream" is re-executed.

7. The generation method according to claim 1, characterized in that: Calculating the difficulty of cracking the non-key level based on the number of cracking times includes: Determine basic parameters of the non-key level, wherein the basic parameters include: the number and level of opponents, the number and level of obstacles in the non-key level, and the scene level and the number of shortest path steps of the non-key level; Based on the basic parameters of the non-key level and the number of cracking times, the target formula is used to calculate and obtain the difficulty of cracking the non-key level, wherein the target formula is: Difficulty = (number of opponents * opponent level) * (number of obstacles * obstacle level) * (scene level) * (shortest path steps) / (number of cracking times).

8. A device for generating game levels, characterized in that: include: An acquisition unit, used for acquiring graphical interface data of an initial level; An export unit, used to export the layers and image data in the graphical interface data of the initial level in the form of data streams using graphic software to obtain an initial data stream; A removal unit, used for removing non-important data from the initial data stream to obtain a first data stream; an identification unit, configured to identify an item type of each item object in the first data stream and obtain a replacement requirement for each item type; a replacement unit, configured to perform replacement processing on each item object in the first data stream according to replacement requirements of different item types to obtain a second data stream; A generating unit is used to obtain graphical interface data of a key level based on the second data stream.

9. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Checkpoint configuration method and device

    CN107376353A

  • Data copy management method, apparatus, device and system, and readable storage medium

    CN108846053A