Game level generation method and device, storage medium and electronic equipment
By randomly selecting the moment when game elements appear according to difficulty level and element density parameters in music games, the problem of too fixed level design in the existing technology is solved, diversified level design is realized, and the game experience is improved.
Patent Information
- Application Number
- CN202510135557.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-04-15
AI Technical Summary
The existing music game level design relies on a fixed music rhythm, which makes players feel less fresh when playing the same level repeatedly, and the game experience is poor.
By determining the difficulty level and element density parameters of the game music, randomly select the moment when the game elements appear, and introduce randomness to generate a diverse game level.
It realizes the generation of diverse game levels under the same game music, enhancing the player's game freshness and experience quality.
Smart Images

Figure CN119818951A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, storage medium and electronic device for generating a game level. Background Art
[0002] The level design of music games is closely integrated with the game music. The time points at which game elements appear in each level need to correspond to the beat of the game music. In the game, players need to control game elements according to the rhythm of the game music.
[0003] In existing music games, the gameplay of a level depends on the rhythm of the game music itself, and the gameplay of the same game level is relatively fixed. To ensure the diversity of gameplay, different levels are usually designed according to different game music. However, when players play the same level repeatedly, because the game elements appear at the same time, the player's game freshness is poor and the game experience is not good.
[0004] Therefore, this specification provides a method for generating a game level. Summary of the invention
[0005] This specification provides a game level generation method, device, storage medium and electronic device to at least partially solve the above-mentioned problems existing in the prior art.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides a game level generation method, including:
[0008] Determine the game music;
[0009] Determining a difficulty level of the game music as a target level, and determining an element density parameter corresponding to the target level;
[0010] Determine the playing time corresponding to each beat included in the game music, and determine each candidate time for generating the game element at each playing time;
[0011] According to the element density parameter, random selection is performed among the candidate moments, and the selected candidate moments are used as target moments;
[0012] A game element is generated at each target moment to obtain a game level corresponding to the game music.
[0013] Optionally, determining the element density parameter corresponding to the difficulty level of the game music specifically includes:
[0014] Determine the lowest difficulty level among the pre-divided difficulty levels; determine the preset lowest element density parameter and density adjustment step size;
[0015] Determining level parameters of the lowest difficulty level and the target level according to the order of the lowest difficulty level and the target level in the difficulty levels respectively;
[0016] Determining a difference between a level parameter of the target level and a level parameter of the lowest difficulty level;
[0017] Determining a density adjustment amplitude according to a product of the difference and the density adjustment step length;
[0018] The sum of the minimum element density parameter and the density adjustment amplitude is used as the element density parameter corresponding to the difficulty level of the game music.
[0019] Optionally, determining the element density parameter corresponding to the target level specifically includes:
[0020] Determine each pre-divided difficulty level and the element density parameter corresponding to each difficulty level;
[0021] Among the element density parameters corresponding to the difficulty levels, the element density parameter corresponding to the target level is determined.
[0022] Optionally, at each playback moment, each candidate moment for generating a game element is determined, specifically including:
[0023] Determining the number of beats contained in a music section of the game music according to the rhythm of the game music;
[0024] Determine the number of samples to be collected;
[0025] For each music section of the game music, the sampled number of playing moments are randomly selected from the playing moments included in the music section as the candidate moments.
[0026] Optionally, determine the number of samples, including:
[0027] Determining a level parameter of the target level according to the order of the target level in the difficulty levels;
[0028] Determining whether the number of pre-divided difficulty levels is not greater than the number of beats;
[0029] If so, use the level parameter of the target level as the sampling number
[0030] If not, when the level parameter of the target level is not greater than the number of beats, the level parameter of the target level is used as the sampling number; when the level parameter of the target level is greater than the number of beats, the number of beats is used as the sampling number.
[0031] Optionally, according to the element density parameter, randomly selecting from the candidate moments, and using the selected candidate moments as the target moments, specifically includes:
[0032] Determining the total number of the alternative time points;
[0033] Determining the number of generated elements according to the product of the total number and the element density parameter of the target level;
[0034] Among the candidate moments, the candidate moments of the number of generated elements are randomly selected as the target moments.
[0035] Optionally, according to the element density parameter, randomly selecting from the candidate moments, and using the selected candidate moments as the target moments, specifically includes:
[0036] For each candidate moment, generating a random number within the numerical range of the element density parameter;
[0037] When the random number is less than the element density parameter, the candidate moment is determined as the target moment at which the game element needs to be generated.
[0038] This specification provides a game level generation device, the device comprising:
[0039] Music determination module, determines the game music;
[0040] A density determination module, which determines the difficulty level of the game music as a target level, and determines an element density parameter corresponding to the target level;
[0041] The candidate time determination module determines the playing time corresponding to each beat included in the game music, and determines each candidate time for generating the game element in each playing time;
[0042] A target time determination module randomly selects among the candidate times according to the element density parameter, and uses the selected candidate times as the target times;
[0043] The level generation module generates game elements at each target moment to obtain the game level corresponding to the game music.
[0044] This specification provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned game level generation method is implemented.
[0045] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned game level generation method when executing the program.
[0046] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0047] In the game level generation method provided in this specification, game music is determined, the difficulty level of the game music is determined as the target level, and the element density parameter corresponding to the target level is determined. The playback time corresponding to each beat contained in the game music is determined, and in each playback time, each alternative time for generating a game element is determined, and a random selection is made among the alternative times according to the element density parameter, and the selected alternative times are used as the target times. Applying this method, according to different difficulty levels, among the playback times corresponding to each beat contained in the game music, the alternative times that may generate the game elements are selected, and randomness is further introduced to determine whether the game elements need to be generated at each alternative time, so that the target time for generating the game elements is uncertain, thereby ensuring the diversity of the game levels. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:
[0049] Figure 1 This is a flowchart of a method for generating a game level in this specification;
[0050] Figure 2 A schematic diagram of a game level generation device provided in this specification;
[0051] Figure 3 The corresponding Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.
[0054] Figure 1 This is a flowchart of a method for generating a game level in this specification, which specifically includes the following steps:
[0055] S100: Determine game music.
[0056] All steps in the game level generation method provided in this specification can be implemented by any electronic device with computing functions, such as a terminal, a server, etc. For ease of description, the game level generation method provided in this specification is described below with the server as the execution subject.
[0057] In music games, the layout design of game elements in the game level depends on the game music used in the game level. During the game, as the game music plays, the game elements appear on the screen at the corresponding playing time of the beat so that players can operate according to the rhythm of the music.
[0058] Because the rhythm of a game music is fixed, in the current game level design, there is a one-to-one relationship between game music and level. When players repeatedly choose the game level corresponding to the same game music to play, because the layout of the elements in the game level is exactly the same, the game level design is relatively monotonous and fixed, and players do not feel fresh during the game process, and the game experience is not good.
[0059] The game levels in this manual introduce randomness in the generation of game elements, so that each game element in the game level is dynamically generated in each game of the player. Even if the player repeatedly selects the same game music, he can get a different game experience due to the different game levels.
[0060] The server first needs to determine the game music. The game music can be a piece of music selected by the player from the music list displayed on the server, or it can be local music imported by the player.
[0061] The rhythm of the game music can be used to determine the moment when each game element appears in the game level to be generated, and is the basis for determining the game level of the music game.
[0062] S102: Determine the difficulty level of the game music as a target level, and determine an element density parameter corresponding to the target level.
[0063] In order to increase the diversity of game levels, the game levels corresponding to the same game music are pre-divided into various difficulty levels in this manual, and the appearance density of game elements in different difficulty levels is different. This manual does not limit the number of difficulty levels, which can be determined according to actual needs.
[0064] The higher the difficulty level, the higher the density of game elements. Players play the game by operating game elements. When the density of game elements is high, players will operate more frequently during the game, and the operation level required of players will also be higher.
[0065] This specification does not limit the specific form of the game elements. Depending on the different game settings of the music game, the game elements can be virtual coins, star props, virtual enemies, rectangular buttons, etc.
[0066] For example, in a falling music game, the game elements are rectangular buttons. Players need to operate the falling rectangular buttons according to the playing time corresponding to the beat of the music game. When the game difficulty level increases, the appearance density of the falling rectangular buttons increases, and the time interval between two adjacent rectangular buttons becomes shorter, requiring players to perform continuous operations in a shorter time, which requires higher operational agility of players.
[0067] For another example, in a parkour music game, the game elements are virtual coins, star props, or virtual enemies. The game elements appear on the screen at the same time as the beat of the game music, and the player needs to operate the game elements according to the beat of the game music. Similarly, in this game scenario, when the game difficulty level increases, the appearance density of the game elements increases, and the operations required by the player become more frequent.
[0068] In this specification, the element density parameter is used to represent the appearance density of game elements. Different difficulty levels correspond to different element density parameters. The element density parameter here can be set to a fixed value or an adjustable value. The element density parameter is positively correlated with the difficulty level. As the difficulty level increases, the element density parameter increases, indicating that the appearance density of elements in the game level of the difficulty level increases.
[0069] The server determines the difficulty level of the game music as the target level. Specifically, the server may select a difficulty level from the pre-divided difficulty levels as the target level in response to the player's selection operation before the game starts. In this embodiment, the difficulty level selected by the player is the difficulty of the game level that the player expects to generate.
[0070] When the element density parameter is set to a fixed value, the element density parameter corresponding to each difficulty level needs to be pre-set. The server can determine the element density parameter corresponding to the target level from the element density parameters corresponding to each difficulty level according to the pre-set correspondence between each difficulty level and the element density parameter.
[0071] S104: Determine the playing time corresponding to each beat included in the game music, and determine each candidate time for generating a game element at each playing time.
[0072] In a music game, the appearance time of an element must correspond to the rhythm of the game music. Therefore, the server can perform rhythm analysis on the game music to determine the corresponding playing time of each beat contained in the game music. The playing time corresponding to a beat is the time when the game music plays to the beat.
[0073] This specification does not limit the specific method of rhythm analysis. The server can use any existing music analysis tool to analyze the game music, such as Aubio, Mixxx, Traktor Pro, etc.
[0074] Because the appearance time of the game element in the music game needs to correspond to the playing time of the beat, that is, the appearance time of the game element needs to be consistent with the playing time of a beat, so that the player can operate the game element according to the rhythm of the game music. Therefore, after determining the playing time of each beat of the game music, the server determines each candidate time for generating the game element in each playing time.
[0075] Specifically, the server can use all the playing moments of each beat as candidate moments for generating game elements. Alternatively, the server can use the playing moments of some beats as candidate moments for generating game elements according to a specified screening method.
[0076] The alternative moments are preliminarily determined time points at which game elements may be generated. In subsequent steps, based on random strategies, it is determined whether game elements need to be generated at each alternative moment to ensure the uncertainty of generating game levels.
[0077] S106: Randomly select from the candidate moments according to the element density parameter, and use the selected candidate moments as the target moments.
[0078] The game levels in this manual must be randomly selected from the candidate moments according to the random strategy and the element density parameters before each player plays the game, and the selected candidate moments are used as the target moments. The target moment is the time point when the game elements need to be generated. Because of the randomness of the target moment, the levels in different play sessions are uncertain, thereby ensuring the diversity of the game levels.
[0079] In the random selection operation in this specification, the probability of the candidate moment being selected as the target moment is related to the element density parameter of the target level. In an ideal situation, the probability of the candidate moment being selected as the target moment is equal to the element density parameter of the target level.
[0080] In one or more embodiments of the present specification, the server may apply a random strategy for each candidate time.
[0081] Specifically, the server generates a random number within the numerical range of the element density parameter for each candidate moment.
[0082] When generating random numbers, any value in the value range of the element density parameter may be randomly selected, that is, the probability of any value in the value range of the element density parameter being the final generated random number is equal. The random numbers generated in this specification conform to the uniform distribution within the value range of the element density parameter.
[0083] Then, the server determines whether the random number is less than the element density parameter of the target level. If so, the candidate moment is determined to be the target moment at which the game element needs to be generated. If not, the candidate moment is determined to be a moment at which the game element does not need to be generated. That is, when the game music is played to the playing moment of the beat equal to the candidate moment, no new game element is generated on the game screen.
[0084] Because the candidate time is the time point at which the game element may be generated, in the game level generation method provided in this specification, "generating a game element" is a random event. Generating a random number in this step is actually simulating the occurrence of the random event "generating a game element".
[0085] Usually, for convenience of calculation, the numerical range of the element density parameter can be set to [0,1], and the range of the random number generated in this step is also [0,1].
[0086] When the value range of the element density parameter is not [0, 1], the server may scale the value range of the element density parameter in proportion so that the value range of the scaled element density parameter is [0, 1], and then generate a random number within the range of [0, 1].
[0087] Alternatively, when the numerical range of the element density parameter is not [0, 1], the server generates a random number within the original numerical range of the element density parameter, and then scales the numerical range of the element density parameter and the generated random number together so that the numerical range of the element density parameter and the numerical range of the generated random number are [0, 1].
[0088] Taking the numerical range of the element density parameter as [0, 1] as an example, the element density parameter of the target level is explained. It serves as a threshold for judging whether to generate game elements and is compared with the generated random number. The element density parameter can be used to control the generation density of elements in the game level of this game music. Also, since the generation moment of elements in a music game needs to correspond to the playing moment of the beat, the element density parameter can be used to determine the number of playing moments at which game elements need to be generated among each playing moment. When the numerical range of the element density parameter takes [0, 1], the element density parameter of the target level can be used as the generation probability p of game elements, indicating that the occurrence probability of the random event "generating game elements" is p.
[0089] Because the probability that the randomly generated value r within the numerical range of the element density parameter falls within [0, p) is also p, therefore, the element density parameter p of the target level can serve as a discrimination threshold. When r < p, game elements are generated at this alternative moment; otherwise, game elements are not generated at this alternative moment. By comparing r with p, the occurrence of the random event "generating game elements" is simulated.
[0090] S108: Generate game elements at each of the target moments to obtain the game level corresponding to the game music.
[0091] In this specification, the target moments at which game elements need to be generated are randomly selected among each alternative moment. The server generates game elements at each target moment to obtain the game level.
[0092] This game level is dynamically generated each time the game is played, ensuring the diversity of the appearance moments of game elements in the game level and increasing the fun of the game. Even when the player selects the same game music to play multiple times, because the appearance moments of game elements in the game level are not fixed each time the game is played, the game levels of the same game music also have diversity, and the player experience is better.
[0093] In this specification, there is a corresponding relationship between the element density parameter and the difficulty level. And the element density parameter of the target level serves as a discrimination threshold and is compared with the random number generated by the server. According to the comparison result, it is decided whether to generate game elements at each alternative moment. Therefore, the random strategy for generating game elements adopted in this specification is associated with the target level.
[0094] The higher the target level, the larger the element density parameter corresponding to the target level, and the corresponding discrimination threshold determined according to the element density parameter is also larger. The discrimination rule in this manual is that when the random number is less than the element density parameter, the game element is generated. Therefore, when the discrimination threshold increases, the value of the element density parameter less than the target level within the value range of the element density parameter increases, that is, the possibility of the generated random number meeting the discrimination condition increases, and more game elements will be generated in the game level.
[0095] Because the more game elements there are, the more difficult it is for players to operate, which matches the condition of increasing difficulty level, indicating that the method in this specification can randomly determine the appearance time of game elements in the game level according to different difficulty levels, thereby obtaining randomized and diverse game levels.
[0096] By applying this method, according to different difficulty levels, among the playback moments corresponding to each beat contained in the game music, alternative moments that may generate game elements are selected, and randomness is further introduced to determine whether a game element needs to be generated at each alternative moment, so that the target moment for generating game elements is uncertain, thereby ensuring the diversity of game levels.
[0097] In the above step S102, the server may also set the element density parameter as an adjustable value, and does not pre-set the element density parameters corresponding to all difficulty levels, but only pre-sets the lowest element density parameter, ie, the element density parameter corresponding to the lowest difficulty level.
[0098] Specifically, the server determines a preset minimum element density parameter and a density adjustment step size.
[0099] Secondly, the server determines the level parameter of the lowest difficulty level and the level parameter of the target level according to the order of the lowest difficulty level and the target level in each difficulty level.
[0100] For example, the difficulty is divided into three difficulty levels in advance, namely high, medium and low, and the level parameters corresponding to the three difficulty levels are 3, 2 and 1 respectively.
[0101] Then, the server determines the difference between the level parameter of the target level and the level parameter of the lowest difficulty level, and determines the density adjustment amplitude according to the product of the difference and the density adjustment step length. The server uses the sum of the lowest element density parameter and the density adjustment amplitude as the element density parameter corresponding to the target level.
[0102] The difference can represent the target level relative to the minimum difficulty level, how many difficulty levels are added. The density adjustment step is used to represent the increment of the element density parameter for each additional difficulty level. The density adjustment range represents the total amount of element density parameters that need to be increased.
[0103] In this way, it can be ensured that as the difficulty level increases, the element density parameter is increased accordingly, thereby generating more game elements.
[0104] In this embodiment, the element density parameter of the target level is dynamically generated by the density adjustment step. The density adjustment step is an adjustable value. The larger the density adjustment step, the greater the difference in the number of game elements between adjacent difficulty levels, and the more obvious the difference in game difficulty.
[0105] By applying this embodiment, the step length can be adjusted by density, and the difficulty difference between different difficulty levels can be flexibly set to meet different game scenarios.
[0106] In the above step S104, the server uses the playing time of some beats as the candidate time for generating the game element according to the specified screening method. There are many ways to determine the specific screening method.
[0107] In one or more embodiments of the present specification, the server may filter each playing time according to the music rhythm.
[0108] Specifically, the server performs rhythm analysis on the game music and divides the game music into different music parts according to the analysis result. This specification does not limit the specific division method, for example, a game music can be divided into a prelude part, a verse part, a chorus part, an interlude part, etc.
[0109] Then, the server selects at least one designated music part from each music part, and uses the playing time of each beat included in the selected at least one designated music part as each candidate time.
[0110] For example, the server uses the playback times corresponding to the beats included in the verse part and the chorus part as the candidate times.
[0111] In this embodiment, when determining each candidate moment, the playback moment corresponding to the beat of the specified music part contained in the game music is used as the candidate moment. By using this embodiment, the candidate moments that match the rhythm of the music can be determined. However, since the determined candidate moments are concentrated in individual continuous playback moments, the final determined candidate moments may not be uniform in each playback moment. As a result, in different parts of a game music, game elements are frequently generated in some time periods, and sparsely generated in other time periods. The game difficulty in the same game music is uneven, and the player experience is not good enough.
[0112] Therefore, in one or more embodiments of the present specification, in order to obtain more evenly distributed candidate moments, the server may screen the candidate moments according to the beats contained in each music measure of the game music.
[0113] First, the server determines the number of beats contained in a music section of the game music according to the rhythm of the game music.
[0114] Specifically, the server can perform rhythm analysis on the game music through the audio analysis tool in step S104 to determine the rhythm pattern of the game music, and determine the number of beats contained in the music section of the game music according to the rhythm pattern.
[0115] Common music rhythm patterns include 2 / 4, 3 / 4, 4 / 4, 6 / 8, etc. Taking the rhythm pattern of 3 / 4 as an example, in the game music, 3 beats are used as a music measure, and the number of beats contained in a music measure is 3.
[0116] Next, the server determines the number of samples.
[0117] The server may determine a preset value as the sampling quantity. For example, if the preset value is 1, the server samples a playing time in each music measure as an alternative time.
[0118] Alternatively, in another embodiment, the server flexibly determines the number of samples according to the target level, and increases the degree of randomness of game levels corresponding to different difficulty levels.
[0119] Specifically, the server determines the level parameter of the target level according to the order of the target level in the difficulty levels. Then, the server determines whether the number of the pre-divided difficulty levels is not greater than the number of beats contained in a music measure.
[0120] If so, the server uses the level parameter of the target level as the number of samples.
[0121] In this case, the greater the difficulty of the target level, the larger the level parameter, and the corresponding number of samples. Taking the three difficulty levels of high, medium, and low as an example, if the target level is high, the level parameter is 3, and the number of samples determined is 3. If the target level is low, the level parameter is 1, and the number of samples determined is 1.
[0122] If not, the server continues to determine whether the level parameter of the target level is not greater than the number of beats contained in a music measure.
[0123] When the level parameter of the target level is not greater than the number of beats contained in a music measure, the server uses the level parameter of the target level as the sampling number. This situation is similar to the method of determining the sampling number when the number of difficulty levels is not greater than the number of beats contained in a music measure.
[0124] When the level parameter of the target level is greater than the number of beats contained in a music measure, the server uses the number of beats contained in a music measure as the sampling number. In this case, it means that the level parameter of the target level exceeds the number of beats contained in a music measure. For the level parameter greater than the number of beats contained in a music measure, the server uses the number of beats contained in the music measure as the sampling number. This is equivalent to not sampling, and directly using the playback time corresponding to all the beats contained in the music measure as the alternative time.
[0125] In the above step S106, the server may also apply a random strategy to all candidate moments as a whole, that is, perform a random selection within the overall range of all candidate moments.
[0126] In one or more embodiments of the present specification, the server filters each playback moment according to an element density parameter of a target level.
[0127] Specifically, the server determines the number of generated elements according to the product of the number of each playback moment and the element density parameter of the target level.
[0128] Then, among the playback moments, playback moments of the generated number of elements are randomly selected as the candidate moments.
[0129] In the above-mentioned embodiment of randomly selecting each candidate moment in S106, the randomness of each target moment determined is more controllable, and the probability of each candidate moment being selected as the target moment is closer to the element density parameter of the target level. However, since the server needs to perform calculations for each candidate moment during the operation, the calculation process of random selection is relatively long and the efficiency is relatively low.
[0130] In this embodiment, random selection is performed for each candidate moment as a whole. Although the controllability of randomness is biased, there may be a deviation between the probability of each candidate moment being selected as the target moment and the element density parameter of the target level. However, compared with the embodiment in which random selection is performed for each candidate moment in step S106, the operation speed of this embodiment is faster. In actual application scenarios, the random strategy to be selected can be determined according to the actual needs of generating levels.
[0131] The target level determined in step S102 above can be determined by the server in response to the player's selection. However, in some cases, the player may select a difficulty level that does not match his or her own ability, resulting in poor performance in the game and reducing the player's gaming experience.
[0132] Therefore, after the player selects the difficulty level, the server can evaluate the difficulty level selected by the player based on the player's game record, and adjust the difficulty level when it is determined that the difficulty level selected by the player is inappropriate.
[0133] The server uses the difficulty level selected by the player as the pending level. When the pending level is the lowest difficulty level, the server cannot lower the difficulty of the game any further, so no adjustment is made and the pending level is directly used as the target level.
[0134] When the pending level is not the lowest difficulty level, the server determines a preset standard behavior score, and determines a real behavior score according to the game record of the player in the game level corresponding to the game music determined in S100.
[0135] Specifically, the server can obtain the game settlement data of each game in the game record, and determine the player's real behavior score according to the game settlement data. The specific type of game settlement data can be set according to the computing requirements. For example, the game settlement data can include the player's score in each historical game session, the number of failures in each historical game session, the number of consecutive wins in each historical game session, etc.
[0136] The server can calculate the statistical value of each type of game settlement data, and the statistical value can be determined based on the mean, median, mode, standard deviation, etc.
[0137] For example, if the server determines the statistical value based on the average, taking the game settlement data of this type as the score in each historical game session, the server calculates the average of the score in each historical game session as the statistical value of the game settlement data of this type.
[0138] After determining the statistical values of various game settlement data, the server integrates the statistical values to determine the real behavior score.
[0139] This specification does not limit the specific method of integration. It can be weighted averaged according to a preset weight value, or directly add up the statistical values, or use machine learning to merge the statistical values.
[0140] It should be noted that when a player first selects a level of game music to play the game, since there is no game record of the player at the level corresponding to the game music, the player's actual behavior score cannot be determined, so the server directly uses the difficulty level selected by the player as the target level.
[0141] Through the method of this embodiment, the server can adjust the inappropriate difficulty level selected by the player, so that the difficulty of the generated game level matches the player's ability, thereby enhancing the player's gaming experience.
[0142] The above is the game level generation method provided in this specification. Based on the same idea, this specification also provides a corresponding game level generation device, such as Figure 2 shown.
[0143] Figure 2 A schematic diagram of a game level generation device provided in this specification specifically includes:
[0144] The music determination module 200 is used to determine the game music;
[0145] The density determination module 202 is used to determine the difficulty level of the game music as a target level, and determine the element density parameter corresponding to the target level;
[0146] The candidate time determination module 204 is used to determine the playing time corresponding to each beat included in the game music, and determine each candidate time for generating the game element in each playing time;
[0147] A target time determination module 206, configured to randomly select from the candidate times according to the element density parameter, and use the selected candidate times as the target times;
[0148] The level generation module 208 is used to generate game elements at each target moment to obtain the game level corresponding to the game music.
[0149] Optionally, the density determination module 202 is specifically used to determine the lowest difficulty level among the pre-divided difficulty levels; determine a preset minimum element density parameter and a density adjustment step, determine the level parameters of the lowest difficulty level and the target level according to the order of the lowest difficulty level and the target level in the difficulty levels, determine the difference between the level parameter of the target level and the level parameter of the lowest difficulty level, determine the density adjustment amplitude according to the product of the difference and the density adjustment step, and use the sum of the lowest element density parameter and the density adjustment amplitude as the element density parameter corresponding to the difficulty level of the game music.
[0150] Optionally, the density determination module 202 is specifically used to determine each pre-divided difficulty level and element density parameters corresponding to each difficulty level, and determine the element density parameters corresponding to the target level among the element density parameters corresponding to each difficulty level.
[0151] Optionally, the alternative moment determination module 204 is specifically used to determine the number of beats contained in a music bar of the game music according to the rhythm of the game music, determine the number of samples, and for each music bar of the game music, randomly select the playback moments of the sampled number from the playback moments contained in the music bar as the alternative moments.
[0152] Optionally, the alternative moment determination module 204 is specifically used to determine the level parameter of the target level according to the order of the target level in the difficulty levels, and judge whether the number of pre-divided difficulty levels is not greater than the number of beats. If so, the level parameter of the target level is used as the sampling number; if not, when the level parameter of the target level is not greater than the number of beats, the level parameter of the target level is used as the sampling number; when the level parameter of the target level is greater than the number of beats, the number of beats is used as the sampling number.
[0153] Optionally, the target moment determination module 206 is specifically used to determine the total number of the alternative moments, determine the number of generated elements according to the product of the total number and the element density parameter of the target level, and randomly select the alternative moments with the number of generated elements from the alternative moments as the target moments.
[0154] Optionally, the target moment determination module 206 is specifically used to generate a random number within the numerical range of the element density parameter for each alternative moment, and when the random number is less than the element density parameter, determine the alternative moment as the target moment for generating the game element.
[0155] This specification also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 Provides game level generation methods.
[0156] This manual also provides Figure 3 The schematic structure diagram of the electronic device shown in FIG. Figure 3 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this specification does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0157] For the improvement of a technology, it can be clearly distinguished whether it is a hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or a software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0158] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0159] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0160] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0161] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0162] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0165] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0166] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0167] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0168] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0169] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0170] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0171] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0172] The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this application.
Claims
1. A method for generating a game level, characterized in that: include: Determine the game music; Determining a difficulty level of the game music as a target level, and determining an element density parameter corresponding to the target level; Determine the playing time corresponding to each beat included in the game music, and determine each candidate time for generating the game element at each playing time; According to the element density parameter, random selection is performed among the candidate moments, and the selected candidate moments are used as target moments; A game element is generated at each target moment to obtain a game level corresponding to the game music.
2. The method according to claim 1, characterized in that Determining the element density parameter corresponding to the difficulty level of the game music specifically includes: Determine the lowest difficulty level among the pre-divided difficulty levels; determine the preset lowest element density parameter and density adjustment step size; Determining level parameters of the lowest difficulty level and the target level according to the order of the lowest difficulty level and the target level in the difficulty levels respectively; Determining a difference between a level parameter of the target level and a level parameter of the lowest difficulty level; Determining a density adjustment amplitude according to a product of the difference and the density adjustment step length; The sum of the minimum element density parameter and the density adjustment amplitude is used as the element density parameter corresponding to the difficulty level of the game music.
3. The method according to claim 1, characterized in that Determine the element density parameters corresponding to the target level, specifically including: Determine each pre-divided difficulty level and the element density parameter corresponding to each difficulty level; Among the element density parameters corresponding to the difficulty levels, the element density parameter corresponding to the target level is determined.
4. The method according to claim 1, characterized in that At each playback moment, determine the candidate moments for generating game elements, including: Determining the number of beats contained in a music section of the game music according to the rhythm of the game music; Determine the number of samples to be collected; For each music section of the game music, the sampled number of playing moments are randomly selected from the playing moments included in the music section as the candidate moments.
5. The method according to claim 4, characterized in that Determine the number of samples to be taken, including: Determining a level parameter of the target level according to the order of the target level in the difficulty levels; Determining whether the number of pre-divided difficulty levels is not greater than the number of beats; If so, use the level parameter of the target level as the sampling number If not, when the level parameter of the target level is not greater than the number of beats, the level parameter of the target level is used as the sampling number; when the level parameter of the target level is greater than the number of beats, the number of beats is used as the sampling number.
6. The method according to claim 1, characterized in that According to the element density parameter, random selection is performed among the candidate moments, and the selected candidate moments are used as target moments, specifically including: Determining the total number of the alternative time points; Determining the number of generated elements according to the product of the total number and the element density parameter of the target level; Among the candidate moments, the candidate moments of the number of generated elements are randomly selected as the target moments.
7. The method according to claim 1, characterized in that According to the element density parameter, random selection is performed among the candidate moments, and the selected candidate moments are used as target moments, specifically including: For each candidate moment, generating a random number within the value range of the element density parameter; When the random number is less than the element density parameter, the candidate moment is determined as the target moment at which the game element needs to be generated.
8. A game level generation device, characterized in that: include: Music determination module, determines the game music; A density determination module, which determines the difficulty level of the game music as a target level, and determines an element density parameter corresponding to the target level; The candidate time determination module determines the playing time corresponding to each beat included in the game music, and determines each candidate time for generating the game element in each playing time; A target time determination module randomly selects among the candidate times according to the element density parameter, and uses the selected candidate times as the target times; The level generation module generates game elements at each target moment to obtain the game level corresponding to the game music.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.