Game level generation method and device, storage medium, and computer equipment
Through the method of dynamically generating game levels, the resource waste and performance problems of game scene design in the existing technology are solved, and more efficient storage and richer player experience are achieved.
Patent Information
- Application Number
- CN202010987290.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-18
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-09-18
AI Technical Summary
The existing game scene design method consumes a lot of manpower and material resources, has a low reuse rate, takes up a large storage space, and has poor system performance. Players experience the same content and have low playability.
Through the game level generation method, preset generation rules are obtained according to the level identification, and temporary files are generated, including the number of floors and target floor level templates and elements, to dynamically create floor levels, reduce duplicate storage and system overhead, and improve diversity.
It reduces system memory pressure, improves system performance, ensures the diversity of game levels, improves the freshness and playability of player experience, and enhances the competitiveness of the game.
Smart Images

Figure CN112057870B
Abstract
Description
Technical Field
[0001] The present application relates to the field of game design technology, and in particular to a method and device for generating a game level, a storage medium, and a computer device. Background Art
[0002] Game scenes are the "world" of the player's game and are extremely important in the game. Under the usual development model, game developers can find a group of designers to create a large number of game scenes, and each scene is only used once. The problems with this production method are: first, it consumes a lot of manpower and material resources, has a long development cycle, and has a low reuse rate of scenes. The scene content is pre-designed, and players experience the same game content every time, which has low playability; second, each game scene corresponds to a game scene resource file. A large number of game scenes will take up a lot of storage space, and when game elements in different game scenes are repeated, the same game elements will be stored repeatedly in different resource files. When creating these game scenes, different resource files need to be called, which has a large system overhead and high requirements on system performance. Summary of the invention
[0003] In view of this, the present application provides a method and apparatus for generating a game level, a storage medium, and a computer device.
[0004] According to one aspect of the present application, a method for generating a game level is provided, comprising:
[0005] In response to a game level creation instruction, obtaining a level identifier corresponding to the game level;
[0006] Generate a temporary file corresponding to the game level according to a preset level generation rule corresponding to the level identifier, wherein the temporary file includes the number of floors corresponding to the game level and a target floor level template and a target floor game element corresponding to each floor;
[0007] When a challenge instruction for any floor is received, the target floor level template and the target floor game element corresponding to the any floor are read from the temporary file and a corresponding floor level is created.
[0008] Specifically, generating a temporary file corresponding to the game level includes:
[0009] Determine the number of floors of the game level and the floor identifier corresponding to each floor according to the preset level generation rule;
[0010] A target floor level template matching the floor identifier is acquired from a preset floor level template library, and the temporary file is generated, wherein the target floor level template includes at least one game room of a specified type.
[0011] Specifically, the preset level generation rules include designated rules and / or random rules, wherein the designated rules specifically include at least one designated floor and a game element corresponding to each designated floor, and the random rules specifically include at least one group of random floors and game elements corresponding to each group of the random floors, each group of the random floors includes at least two floors, and the game elements corresponding to any group of random floors are all the game elements contained in any group of random floors.
[0012] Specifically, when the level generation rule includes the specified rule, generating a temporary file corresponding to the game level specifically includes:
[0013] According to the game elements corresponding to the designated floors, the game elements in the game room in the target floor level template corresponding to each designated floor are determined respectively, and saved as the temporary file.
[0014] Specifically, when the level generation rule includes the random rule, generating a temporary file corresponding to the game level specifically includes:
[0015] According to the game elements corresponding to each group of the random floors, the corresponding game elements are randomly allocated to the game rooms in the target floor level targets corresponding to each group of the random floors, and saved as the temporary file so that the allocated game elements are consistent with the game elements corresponding to each group of the random floors.
[0016] Specifically, when a challenge instruction for any floor is received, the target floor level template and the target floor game element corresponding to the any floor are read from the temporary file and a corresponding floor level is created, which specifically includes:
[0017] When the information that the game character enters the game level is received, the first floor level template and the game elements corresponding to the game room in the first floor level template are read from the temporary file, and the first floor level is created.
[0018] Specifically, the game elements corresponding to any floor at least include a portal; after creating the first floor level, the method further includes:
[0019] When the game character successfully challenges the current floor level, the collision effect of the portal is turned on;
[0020] When receiving collision data between the game character and the portal, outputting a level selection interface, wherein the level selection interface at least includes a challenge option for a level below the current floor;
[0021] If a selection instruction for the challenge option of the next level is received, the next level template and the game elements corresponding to the game room in the next level template are read from the temporary file, and the next level is created.
[0022] Specifically, after creating the first floor level, the method further includes:
[0023] When the game character fails in challenging the current floor level, the current floor level is recreated based on a re-challenge instruction for the current floor level.
[0024] Specifically, the method further includes:
[0025] When the game character successfully challenges all floor levels, the temporary file is deleted.
[0026] According to another aspect of the present application, a device for generating a game level is provided, comprising:
[0027] A creation instruction response module, used to respond to a game level creation instruction and obtain a level identifier corresponding to the game level;
[0028] A temporary file generation module, used to generate a temporary file corresponding to the game level according to a preset level generation rule corresponding to the level identifier, wherein the temporary file includes the number of floors corresponding to the game level and a target floor level template and a target floor game element corresponding to each floor;
[0029] The level creation module is used to read the target floor level template and target floor game elements corresponding to any floor in the temporary file and create a corresponding floor level when a challenge instruction for any floor is received.
[0030] Specifically, the temporary file generation module specifically includes:
[0031] A floor identification determination unit, used to determine the number of floors of the game level and the floor identification corresponding to each floor according to the preset level generation rule;
[0032] The temporary file generating unit is used to obtain a target floor level template matching the floor identifier from a preset floor level template library and generate the temporary file, wherein the target floor level template includes at least one game room of a specified type.
[0033] Specifically, the preset level generation rules include designated rules and / or random rules, wherein the designated rules specifically include at least one designated floor and a game element corresponding to each designated floor, and the random rules specifically include at least one group of random floors and game elements corresponding to each group of the random floors, each group of the random floors includes at least two floors, and the game elements corresponding to any group of random floors are all the game elements contained in any group of random floors.
[0034] Specifically, the temporary file generating unit comprises:
[0035] The first temporary file generating subunit is used to determine the game elements in the game room in the target floor level template corresponding to each of the designated floors according to the game elements corresponding to the designated floors when the level generating rules include the designated rules, and save them as the temporary files.
[0036] Specifically, the temporary file generating unit comprises:
[0037] The second temporary file generating subunit is used for randomly allocating corresponding game elements to the game room in the target floor level target corresponding to each group of the random floors according to the game elements corresponding to each group of the random floors when the level generating rule includes the random rule, and saving them as the temporary file so that the allocated game elements are consistent with the game elements corresponding to each group of the random floors.
[0038] Specifically, the level creation module includes:
[0039] The first level creation unit is used to read the first floor level template and the game elements corresponding to the game room in the first floor level template in the temporary file and create the first floor level when receiving information that the game character enters the game level.
[0040] Specifically, the game elements corresponding to any floor at least include a portal; the level creation module specifically includes:
[0041] A portal opening unit, used to open the collision effect of the portal when the game character successfully challenges the current floor level;
[0042] a level selection interface output unit, configured to output a level selection interface when receiving collision data between the game character and the portal, wherein the level selection interface at least includes a challenge option for a level below the current floor;
[0043] The second level creation unit is used to read the next level template and the game elements corresponding to the game room in the next level template from the temporary file and create the next level if a selection instruction for the challenge option of the next level is received.
[0044] Specifically, the level creation module includes:
[0045] The level reconstruction unit is used to recreate the current floor level based on a re-challenge instruction for the current floor level when the game character fails in challenging the current floor level.
[0046] Specifically, the device also includes:
[0047] The temporary file deletion module is used to delete the temporary file when the game character successfully challenges all floor levels.
[0048] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned method for generating game levels is implemented.
[0049] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned method for generating game levels when executing the program.
[0050] By means of the above technical scheme, the present application provides a method and device for generating a game level, a storage medium, and a computer device. When receiving a creation instruction for a certain game level in the game, the preset level generation rule of the game level is obtained through the level identifier of the game level, and a temporary file is generated according to the preset level generation rule. When the game character issues a challenge instruction to any floor in the game level, the corresponding floor level is created by using the level template and game elements corresponding to the floor read from the temporary file. Compared with the traditional game level design method in which the content in each level is pre-designed so that the game level is created based on the pre-designed content when the player challenges the game level, the embodiment of the present application generates a temporary file according to the preset level generation rule corresponding to the level each time the player challenges the game level, and creates the corresponding floor level based on the temporary file when the player challenges each floor in the game level. There is no need to save a large number of game level design files. It is only necessary to set the rules of the game level to generate temporary files based on the rules to create the game level, which reduces the system memory pressure and solves the problem in the prior art that a large number of game level design files will occupy a large amount of memory. The problem of system storage space is solved. At the same time, different floor levels can be generated by calling the game element data corresponding to different floors in the temporary file, which reduces system overhead, improves system performance, and solves the problem of large system overhead and reduced system performance caused by multiple calls to the game level design file in the prior art. The temporary files generated each time the level is challenged are different, and the floor levels created are also different, ensuring the diversity of game levels. Players can experience different game content every time they enter the same game level, which improves the playability of the game, increases the user's sedimentation rate, enhances the game's playability, and improves the competitiveness of the game.
[0051] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0053] Figure 1 A schematic diagram showing a flow chart of a method for generating a game level provided in an embodiment of the present application;
[0054] Figure 2 A schematic diagram showing a flow chart of another method for generating a game level provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of the structure of a device for generating a game level provided in an embodiment of the present application is shown;
[0056] Figure 4 A schematic structural diagram of another game level generation device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0057] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0058] In this embodiment, a method for generating a game level is provided, such as Figure 1 As shown, the method includes:
[0059] Step 101, in response to a game level creation instruction, obtaining a level identifier corresponding to the game level;
[0060] Step 102, generating a temporary file corresponding to the game level according to the preset level generation rule corresponding to the level identifier, wherein the temporary file includes the number of floors corresponding to the game level and the target floor level template and the target floor game element corresponding to each floor;
[0061] Step 103, when a challenge instruction for any floor is received, the target floor level template and target floor game elements corresponding to any floor are read from the temporary file and a corresponding floor level is created.
[0062] The embodiments of the present application are used to create game levels (or game scenes, game copies, etc.). The game levels can be a challenge type level, such as the "Demon Suppression Tower" level. The "Demon Suppression Tower" includes multiple layers, that is, the "Demon Suppression Tower" level includes sub-levels corresponding to multiple floors (referred to as floor levels in this embodiment). In addition, the embodiments of the present application can be applied to the client. After the client receives the game level creation instruction, it generates a temporary file and creates the level. It can also be applied to the server. After the server receives the game level creation instruction sent by the client, it generates a temporary file and sends the temporary file to the client, so that the client can create the corresponding level based on the temporary file. The present application uses this embodiment for the client as an example for explanation, but the implementation method applied to the server also falls within the scope of protection of the present application.
[0063] In the above embodiment, after receiving the instruction to create a game level, first, the instruction is parsed to obtain a level identifier corresponding to the game level, and the level identifier is used to distinguish different game levels, for example, the level identifier corresponding to "Beijing Town Demon Tower" is 124, and the level identifier corresponding to "Luoyang Town Demon Tower" is 125. The instruction to create a game level generally comes from the player's operation in the game, such as the conversation between the game character and the tower guard NPC of "Beijing Town Demon Tower", and another example is the click operation on the link of "Beijing Town Demon Tower".
[0064] Secondly, based on the level identifier of the game level, the preset level generation rule corresponding to the game level is obtained, and a temporary file corresponding to the game level is further generated according to the rule. The temporary file is used to create the game level. It should be noted that each time a creation instruction for a game level is received, a temporary file is generated for the creation instruction received this time using the preset level generation rule. A temporary file is used to create a game level once. The content contained in a temporary file can be used to create a floor level for each floor in a game level. The temporary file specifically includes the number of floors corresponding to the game level, the target floor level template corresponding to each floor, and the target floor game element corresponding to each floor. Among them, the number of floors is the number of sub-levels corresponding to the game level. For example, the number of floors corresponding to the 10-story "Demon Suppression Tower" is 10. Of course, the game level of the embodiment of the present application can also be other types of levels, and is not limited to the level type of "Demon Suppression Tower" that is challenged by floor. "Floor" is just a form of expression used to reflect the order of sub-levels. The target floor level template corresponding to each floor is a blank map of the corresponding floor. The blank map contains wall and terrain information, and does not contain specific content information such as monsters, NPCs, props, etc. in the game. For example, the level template of the first floor can be an empty room, and the level target of the tenth floor can be 3 empty rooms and the connecting paths between the rooms. The target floor game elements include various in-game elements that the game character should encounter when performing level challenges on the corresponding floor, such as monsters, NPCs, game props, etc. It is also necessary to explain that the above information contained in the temporary file should be temporarily generated according to the preset level generation rules. The preset level generation rules can define what the level templates corresponding to different floor levels (or different sub-levels) can be, and what kind of game elements can appear in different floor levels. In order to meet the diversity of game levels and enable players to experience different game content each time they enter the game level, the rules can define some or all of the level templates and game elements to be randomly generated on the premise that certain conditions can be met. For example, the rules can define that a certain elite monster randomly appears on the 4th to 7th floors, which can not only ensure that the elite monster can appear in the level, but also make the appearance position of the elite monster randomly allocated. For example, the rules can define that the 2nd to 8th floors contain a total of 3 floors with two rooms and 4 floors with three rooms. Then, when generating temporary files, these rooms can be randomly allocated on the 2nd to 8th floors, so that players can experience different game content each time they enter the game level.
[0065] Finally, when a challenge instruction from the player for any floor is received, the data of the corresponding floor can be read from the temporary file to create a floor level. For example, when a challenge instruction from the player for the third floor is received, the level template of the third floor and the game elements of the third floor are read from the temporary file to create a floor level for the third floor for the player to challenge the third floor level.
[0066] By applying the technical solution of this embodiment, when a creation instruction for a game level is received within the game, the preset level generation rule of the game level is obtained through the level identifier of the game level, and a temporary file is generated according to the preset level generation rule. When the game character issues a challenge instruction to any floor in the game level, the corresponding floor level is created using the level template and game elements corresponding to the floor read from the temporary file. Compared with the traditional game level design method in which the content in each level is pre-designed so that the game level is created based on the pre-designed content when the player challenges the game level, the embodiment of the present application generates a temporary file according to the preset level generation rules corresponding to the level each time the player challenges the game level, and creates the corresponding floor level based on the temporary file when the player challenges each floor in the game level. There is no need to save a large number of game level design files. Only the rules of the game level need to be set to generate temporary files based on the rules to create the game level, which reduces the system memory pressure. At the same time, different floor levels can be generated by calling the game element data corresponding to different floors in the temporary file, which reduces the system overhead and improves the system performance. Moreover, the temporary files generated each time the level is challenged are different, so the created floor levels are also different, which ensures the diversity of the game levels, so that the player can experience different game content each time entering the same game level, improves the playability of the game, improves the user's sedimentation rate, enhances the playability of the game, and improves the competitiveness of the game.
[0067] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another method for generating a game level is provided, such as Figure 2 As shown, the method includes:
[0068] Step 201, in response to a game level creation instruction, obtaining a level identifier corresponding to the game level;
[0069] Step 202, determining the number of floors of the game level and the floor identifier corresponding to each floor according to a preset level generation rule;
[0070] Step 203, obtaining a target floor level template matching the floor identifier from a preset floor level template library, and generating a temporary file, wherein the target floor level template includes at least one game room of a specified type;
[0071] In the above embodiment, when a creation instruction for a certain game level is received, for example, when information that a player enters a certain game level is received, the level identifier of the game level is obtained, and the preset level generation rule corresponding to the level identifier is read. The rule can record the determination rule of the floor level template. For example, for a 10-story "Demon Suppression Tower", the preset level generation rule stipulates that the first floor is one room, the ninth floor is one room, the tenth floor is 3 rooms, the remaining odd floors are 2 rooms, and the even floors are 3 rooms, or the preset level generation rule stipulates that the first floor is one room, the ninth floor is one room, and the tenth floor is 3 rooms, and five of the remaining 2 to 8 floors are 2 rooms and two floors are 3 rooms. According to this rule, the floor identifier corresponding to each floor can be determined first, for example, the identifier corresponding to the level template of 1 room is 01, the identifier corresponding to the level template of 2 rooms is 02..., and then based on the floor identifier of each floor, the corresponding template is found from the preset floor level template library and saved in a temporary file, so that when creating a game level, this template can be directly taken out from the temporary file to create the corresponding floor level. At this time, the data contained in the temporary file includes the number of floors of the game level, the floor identifier of each floor, and the target floor level template corresponding to the floor identifier.
[0072] In addition, the temporary file generated in step 203 should also include game elements corresponding to each floor, and the game elements should be determined based on the specific content of the preset level generation rules. Specifically, generating the temporary file in step 203 may also include the following steps:
[0073] Step 203-1, when the level generation rule includes a designated rule, the game elements in the game room in the target floor level template corresponding to each designated floor are determined respectively according to the game elements corresponding to the designated floor, and saved as a temporary file.
[0074] Step 203-2, when the level generation rules include random rules, according to the game elements corresponding to each group of random floors, randomly allocate corresponding game elements to the game room in the target floor level target corresponding to each group of random floors, and save them as temporary files to make the allocated game elements consistent with the game elements corresponding to each group of random floors.
[0075] In an embodiment of the present application, specifically, the preset level generation rules include specified rules and / or random rules, wherein the specified rules specifically include at least one specified floor and game elements corresponding to each specified floor, and the random rules specifically include at least one group of random floors and game elements corresponding to each group of random floors, each group of random floors includes at least two floors, and the game elements corresponding to any group of random floors are all the game elements contained in any group of random floors.
[0076] In the above embodiment, on the basis of determining the target floor level template of each floor in step 203, the game elements contained in the game room corresponding to each floor are further determined according to the preset level generation rules. In order to ensure the stability of the game level content, the specified rules can be specifically defined in the preset level generation rules. For example, the specified rules can define which game elements are contained in a specific floor in the game level. For example, three BOSS monsters are respectively set in the three rooms of the tenth floor, and one NPC is set in one room of the first floor. In the above step 203-1, the game elements of the specified floor corresponding to the specified rule part in the preset level generation rules are obtained, and added to the temporary file for storage. In addition, in the specified rules, for example, for the three BOSS monsters set in the three rooms of the tenth floor, the type of BOSS monster placed in each room can be specifically specified, or the three types of BOSS monsters can be randomly assigned to the three rooms. The type of BOSS monster corresponding to each room can be saved in the temporary file. For example, room 1 corresponds to frog BOSS, room 2 corresponds to lizard BOSS, and room 3 corresponds to centipede BOSS, so that when the tenth floor level is subsequently created, the BOSS monster type of the corresponding game room in the temporary file can be directly read for creation, thereby improving the level creation speed.
[0077] In order to improve the diversity of game levels, the random rules can be specifically defined in the preset level generation rules. For example, the random rules can include one or more groups of random floors and game elements corresponding to each group of random floors. For example, the random rules include two groups of random floors, namely, floors 2 to 5 and floors 6 to 8, and further include that floors 2 to 5 correspond to 2 elite monsters, 2 altars, and 2 wishing pools, and floors 6 to 8 include 3 elite monsters and 1 altar. Then, 2 elite monsters, 2 altars, and 2 wishing pools can be randomly allocated in the game rooms corresponding to floors 2 to 5, and 3 elite monsters and 1 altar can be randomly allocated in the game rooms corresponding to floors 6 to 8, and the rest of the game rooms can be filled with ordinary monsters or other content. Thus, on the basis of ensuring that the game level contains specific game elements, the appearance position of the game elements (including floors and rooms) is random, and the player can experience different content every time he enters the game level. Moreover, due to the randomness of the appearance position of the game elements, different challenges are brought to the player to challenge the game level, which improves the playability of the game level and increases the interest of the player to challenge the level repeatedly.
[0078] Step 204, when receiving information that the game character has entered the game level, read the first floor level template and the game elements corresponding to the game room in the first floor level template from the temporary file, and create the first floor level.
[0079] In the above embodiment, after the player enters the game level, he should first challenge the first layer (or the first level). When receiving the information that the game character has entered the game level, the first floor level template and the corresponding game elements should be read from the temporary file, so as to fill in the corresponding game elements in each game room of the first floor level and create the first floor level for the player to challenge.
[0080] Step 205, when the game character successfully challenges the current floor level, the collision effect of the portal is turned on;
[0081] Step 206, when the collision data between the game character and the portal is received, a level selection interface is output, wherein the level selection interface at least includes a challenge option for the next level of the current floor;
[0082] Step 207, if a selection instruction for a challenge option of a next level is received, the next level template and the game elements corresponding to the game room in the next level template are read from the temporary file, and the next level is created;
[0083] Step 208: When the game character fails in challenging the current floor level, the current floor level is recreated based on the re-challenge instruction for the current floor level.
[0084] In the above embodiment, each layer of the game level should include a portal. When the game character successfully challenges the current floor level, for example, defeats all the monsters on the floor, the collision effect of the portal is turned on. When the collision data between the game character and the portal is received, for example, when a player challenges the game level alone, the collision data between the player and the portal is received. When the players challenge in a team, the collision data between the team leader and the portal (or the collision data between any character in the team and the portal) is received, and a level selection interface is output. The level selection interface may include a challenge option for the next level and an option to exit the game level. For example, if the current floor is floor 1, the challenge option for the next level may be "continue to challenge". Or "Challenge the second floor", etc. If the player chooses to challenge the next level, the level objectives and game elements corresponding to the next level will continue to be read from the temporary file, and the next level will be created. When the game character fails to challenge the current level, such as being defeated by the monster on the floor or the props to open the next level are damaged, etc., the level selection interface can also be output. The interface can include options for re-challenging the current level and exiting the game level. For example, if the current floor is the 1st floor, the re-challenge option can be "Re-challenge the first level" or "Fight again if dissatisfied", etc. If the player chooses to re-challenge, the current floor level will be recreated based on the content corresponding to the floor in the temporary file. Triggering the level selection interface by means of a portal to enter the next level does not require correlation processing of each floor level, reducing the amount of game level design.
[0085] Step 209, when the game character successfully challenges all floor levels, the temporary files are deleted.
[0086] In the above embodiment, when the game character successfully challenges all floor levels, for example, successfully challenges the tenth floor of the 10-floor "Demon Suppression Tower", the temporary file corresponding to the game level can be deleted. Because the temporary file is only used for the game character's challenge to the game level this time, when the same game character challenges the same game level again, the temporary file will be regenerated and the level will be created based on the new temporary file. Even if the same character challenges the same level multiple times, the game content experienced each time is different. Therefore, the temporary file can be deleted to reduce the client memory pressure.
[0087] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a device for generating a game level, such as Figure 3 As shown, the device comprises:
[0088] A creation instruction response module 31, used to respond to a game level creation instruction and obtain a level identifier corresponding to the game level;
[0089] A temporary file generation module 32, configured to generate a temporary file corresponding to the game level according to a preset level generation rule corresponding to the level identifier, wherein the temporary file includes the number of floors corresponding to the game level and a target floor level template and a target floor game element corresponding to each floor;
[0090] The level creation module 33 is used to read the target floor level template and target floor game elements corresponding to any floor in the temporary file and create a corresponding floor level when receiving a challenge instruction for any floor.
[0091] In specific application scenarios, such as Figure 4 As shown, the temporary file generation module 32 specifically includes:
[0092] A floor identification determination unit 321, used to determine the number of floors of a game level and the floor identification corresponding to each floor according to a preset level generation rule;
[0093] The temporary file generating unit 322 is used to obtain a target floor level template matching the floor identifier from a preset floor level template library and generate a temporary file, wherein the target floor level template includes at least one game room of a specified type.
[0094] In a specific application scenario, the preset level generation rules include specified rules and / or random rules, wherein the specified rules specifically include at least one specified floor and game elements corresponding to each specified floor, and the random rules specifically include at least one group of random floors and game elements corresponding to each group of random floors, each group of random floors includes at least two floors, and the game elements corresponding to any group of random floors are all the game elements contained in any group of random floors.
[0095] In specific application scenarios, such as Figure 4 As shown, the temporary file generating unit 32 specifically includes:
[0096] The first temporary file generating subunit 323 is used to determine the game elements in the game room in the target floor level template corresponding to each designated floor according to the game elements corresponding to the designated floor when the level generating rule includes the designated rule, and save them as temporary files.
[0097] In specific application scenarios, such as Figure 4 As shown, the temporary file generating unit 32 specifically includes:
[0098] The second temporary file generation subunit 324 is used to randomly allocate corresponding game elements to the game room in the target floor level target corresponding to each group of random floors when the level generation rules include random rules, according to the game elements corresponding to each group of random floors, and save them as temporary files to make the allocated game elements consistent with the game elements corresponding to each group of random floors.
[0099] In specific application scenarios, such as Figure 4 As shown, the level creation module 33 specifically includes:
[0100] The first level creating unit 331 is used to read the first floor level template and the game elements corresponding to the game room in the first floor level template from the temporary file and create the first floor level when receiving the information that the game character enters the game level.
[0101] In specific application scenarios, such as Figure 4 As shown, the game elements corresponding to any floor at least include a portal; the level creation module 33 specifically includes:
[0102] The portal opening unit 332 is used to open the collision effect of the portal when the game character successfully challenges the current floor level;
[0103] The level selection interface output unit 333 is used to output the level selection interface when receiving the collision data between the game character and the portal, wherein the level selection interface at least includes a challenge option for the next level of the current floor;
[0104] The second level creation unit 334 is used to read the next level template and the game elements corresponding to the game room in the next level template from the temporary file and create the next level if a selection instruction for the challenge option of the next level is received.
[0105] In specific application scenarios, such as Figure 4 As shown, the level creation module 33 specifically includes:
[0106] The level reconstruction unit 335 is used to recreate the current floor level based on the re-challenge instruction for the current floor level when the game character fails in challenging the current floor level.
[0107] In specific application scenarios, such as Figure 4 As shown, the device also includes:
[0108] The temporary file deletion module 34 is used to delete the temporary files when the game character successfully challenges all the floor levels.
[0109] It should be noted that for other corresponding descriptions of the functional units involved in the device for generating a game level provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.
[0110] Based on the above Figure 1 to Figure 2 The method shown in the embodiment of the present application is accordingly provided with a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned Figure 1 to Figure 2 The method of generating the game level shown.
[0111] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0112] Based on the above Figure 1 to Figure 2 The method shown, and Figure 3 to Figure 4 In order to achieve the above-mentioned purpose, the embodiment of the present application further provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2 The method of generating the game level shown.
[0113] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0114] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0115] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0116] Through the description of the above implementation methods, technical personnel in this field can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, and can also be implemented by hardware. When a creation instruction for a game level is received in the game, the preset level generation rule of the game level is obtained through the level identifier of the game level, and a temporary file is generated according to the preset level generation rule. When the game character issues a challenge instruction to any floor in the game level, the corresponding floor level is created using the level template and game elements corresponding to the floor read from the temporary file. Compared with the traditional game level design method in which the content in each level is pre-designed so that the game level is created based on the pre-designed content when the player challenges the game level, the embodiment of the present application generates a temporary file according to the preset level generation rules corresponding to the level each time the player challenges the game level, and creates the corresponding floor level based on the temporary file when the player challenges each floor in the game level. There is no need to save a large number of game level design files. Only the rules of the game level need to be set to generate temporary files based on the rules to create the game level, which reduces the system memory pressure. At the same time, different floor levels can be generated by calling the game element data corresponding to different floors in the temporary file, which reduces the system overhead and improves the system performance. Moreover, the temporary files generated each time the level is challenged are different, so the created floor levels are also different, which ensures the diversity of the game levels, so that the player can experience different game content each time entering the same game level, improves the playability of the game, improves the user's sedimentation rate, enhances the playability of the game, and improves the competitiveness of the game.
[0117] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0118] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A method for generating a game level, characterized in that: include: In response to a game level creation instruction, obtaining a level identifier corresponding to the game level; Generate a temporary file corresponding to the game level according to the preset level generation rule corresponding to the level identifier, wherein the temporary file includes the number of floors corresponding to the game level and the target floor level template and target floor game elements corresponding to each floor, the target floor level template corresponding to each floor is a blank map of the corresponding floor, the blank map includes wall and terrain information, and does not include game element information; the target floor game element includes various in-game elements that the game character should encounter when performing level challenges on the corresponding floor; the preset level generation rule includes designated rules and / or random rules, wherein the designated rule specifically includes at least one designated floor and game elements corresponding to each designated floor, the random rule specifically includes at least one group of random floors and game elements corresponding to each group of the random floors, each group of the random floors includes at least two floors, and the game elements corresponding to any group of random floors are all the game elements included in any group of random floors; When a challenge instruction for any floor is received, the target floor level template and the target floor game element corresponding to the any floor are read from the temporary file and a corresponding floor level is created.
2. The method according to claim 1, characterized in that: The generating of the temporary file corresponding to the game level specifically includes: Determine the number of floors of the game level and the floor identifier corresponding to each floor according to the preset level generation rule; A target floor level template matching the floor identifier is acquired from a preset floor level template library, and the temporary file is generated, wherein the target floor level template includes at least one game room of a specified type.
3. The method according to claim 2, characterized in that When the level generation rule includes the specified rule, generating a temporary file corresponding to the game level specifically includes: According to the game elements corresponding to the designated floors, the game elements in the game room in the target floor level template corresponding to each designated floor are determined respectively, and saved as the temporary file.
4. The method according to claim 2, characterized in that: When the level generation rule includes the random rule, generating a temporary file corresponding to the game level specifically includes: According to the game elements corresponding to each group of the random floors, the corresponding game elements are randomly allocated to the game rooms in the target floor level targets corresponding to each group of the random floors, and saved as the temporary file so that the allocated game elements are consistent with the game elements corresponding to each group of the random floors.
5. The method according to any one of claims 1 to 4, characterized in that When a challenge instruction for any floor is received, the target floor level template and the target floor game element corresponding to the any floor are read from the temporary file and a corresponding floor level is created, specifically including: When the information that the game character enters the game level is received, the first floor level template and the game elements corresponding to the game room in the first floor level template are read from the temporary file, and the first floor level is created.
6. The method according to claim 5, characterized in that The game elements corresponding to any floor at least include a portal; after creating the first floor level, the method further includes: When the game character successfully challenges the current floor level, the collision effect of the portal is turned on; When receiving collision data between the game character and the portal, outputting a level selection interface, wherein the level selection interface at least includes a challenge option for a level below the current floor; If a selection instruction for the challenge option of the next level is received, the next level template and the game elements corresponding to the game room in the next level template are read from the temporary file, and the next level is created.
7. The method according to claim 6, characterized in that After creating the first floor level, the method further includes: When the game character fails in challenging the current floor level, the current floor level is recreated based on a re-challenge instruction for the current floor level.
8. The method according to claim 7, characterized in that The method further comprises: When the game character successfully challenges all floor levels, the temporary file is deleted.
9. A device for generating game levels, characterized in that: include: A creation instruction response module, used to respond to a game level creation instruction and obtain a level identifier corresponding to the game level; A temporary file generation module, configured to generate a temporary file corresponding to the game level according to a preset level generation rule corresponding to the level identifier, wherein the temporary file includes the number of floors corresponding to the game level and a target floor level template and a target floor game element corresponding to each floor, wherein the target floor level template corresponding to each floor is a blank map of the corresponding floor, wherein the blank map includes wall and terrain information but does not include game element information; the target floor game element includes various in-game elements that a game character should encounter when performing a level challenge on the corresponding floor; the preset level generation rule includes a designated rule and / or a random rule, wherein the designated rule specifically includes at least one designated floor and a game element corresponding to each designated floor, and the random rule specifically includes at least one group of random floors and a game element corresponding to each group of the random floors, wherein each group of the random floors includes at least two floors, and the game elements corresponding to any group of random floors are all the game elements included in any group of random floors; The level creation module is used to read the target floor level template and target floor game elements corresponding to any floor in the temporary file and create a corresponding floor level when a challenge instruction for any floor is received.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the game level generation method according to any one of claims 1 to 8 is implemented.
11. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method for generating a game level according to any one of claims 1 to 8 is implemented.
