Game level designing and creating method
By providing interactive interface for level editing, real-time rendering and testing, data analysis and automatic generation of new levels, the problem of low level design and testing in the existing technology is solved, and the difficulty of not adapting to the player's level is achieved, efficient level design and automatic creation are achieved, and the ability to predict players' purchasing behavior is enhanced.
Patent Information
- Application Number
- CN202510484205.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-04-17
AI Technical Summary
The existing mobile game level design and testing methods are inefficient, the difficulty cannot be effectively adapted to the player's level, and the change of demand depends on the cooperation of R&D personnel, and most level editors can only be used for one game.
Provides a method for designing and creating game levels, including providing level editing interactive interface, rendering and testing levels in real time, obtaining settlement information, analyzing the difficulty of the level, automatically generating new levels, and predicting purchasing behavior through player data analysis.
It improves the efficiency of level design and testing, can better adapt to the player's level, reduces dependence on R&D personnel, realizes cross-platform editing and automatic levels creation, and enhances the ability to predict players' purchasing behavior.
Smart Images

Figure CN120132364A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to a mobile game level editor, and particularly relates to a casual, puzzle-solving, elimination type of level-breaking game. Background Art
[0002] Currently, developers of mobile games usually develop design and editing tools for the PC side by R & D personnel. The planners manually operate to design and edit the level content, and then pack the edited level data into the mobile game. The planners and testers conduct tests, and after the tests are completed, the levels are adjusted according to the difficulty and consumption. When new props or obstacles appear, the R & D personnel need to cooperate to modify the tools.
[0003] The traditional game level design and testing methods are time-consuming and inefficient on the one hand. On the other hand, the difficulty of the levels depends on the experience of the planners and testers and cannot well adapt to the level of players. The third point is that when requirements change, it is very dependent on the cooperation of R & D personnel. Finally, most level editors can only be used for one game. Therefore, it has practical significance to establish a method for editing, testing and automatically creating levels and / or a method for predicting players' purchase behaviors. Summary of the Invention
[0004] The present invention aims to at least partly solve one of the technical problems existing in the prior art. For this purpose, the present invention provides a method for designing and creating game levels, which is characterized by including the following steps: providing a level editing interaction interface, enabling the planners to create, modify, save and synchronize the levels to the terminal for testing and preview through the computer background end; rendering the edited levels in real time on the terminal, enabling the planners to experience the level design effect from the perspective of game players, and optimizing and adjusting the level layout; performing the actions of completing the levels on the terminal from the perspective of players; obtaining the settlement information after completing the levels, and synchronously transmitting the settlement information between the terminal and the background end; storing the settlement information in the background end data pool for analyzing the level difficulty, obstacle effects, and prop consumption, and correcting and optimizing the level data model; automatically generating new levels based on the settlement information, and the new levels include level templates with maps, obstacle layouts and prop distributions matching the specified difficulty.
[0005] Preferably, automatically generating new levels based on the settlement information includes: calculating the difficulty curve of each level based on the settlement information, and the difficulty curve parameters at least include level difficulty, user churn situation, and user potential prop consumption situation; automatically generating new levels according to the difficulty curve.
[0006] Preferably, the calculation of the level difficulty includes: calculating the clearance coefficient of each level according to the user's level settlement information, and the calculation method of the clearance coefficient includes: calculating the average number of game times for clearing each level according to the data of the user's level settlement information; calculating the average usage of items by the cleared users according to the data of the user's level settlement information; calculating the number of game times required for clearance according to the actual data of the player, and the consumption of items, which is the proportion of the usage of items affecting the difficulty among the cleared users.
[0007] Preferably, the calculation of the potential item consumption situation of the user includes: extracting multiple behavioral characteristics from the settlement information, where the behavioral characteristics include the user's game activity status, item purchase behavior, game duration, number of sessions, number of levels completed, acquisition and spending of in-game currency; performing discretization processing on the behavioral characteristics, using a clustering algorithm to group the values of each behavioral characteristic to form a predetermined discrete interval to generate a representative range of the characteristic; detecting and removing outliers in the behavioral characteristics to reduce the influence of extreme values on the discretization process; mapping the discretized behavioral characteristics into a finite set of morphemes, where each morpheme represents a behavioral state, including: (i) an empty morpheme indicating that the player is not active; (ii) morphemes indicating different intervals within the normal range of the characteristic; (iii) special morphemes marking extreme behavioral states; forming a behavioral sequence morpheme by arranging the morphemes generated from the discretized behavioral characteristics in chronological order to construct a sequential representation of the player's behavioral history; calculating the similarity of each morpheme with other morphemes in the sequence based on the self-attention mechanism to capture short-term and long-term dependencies in the player's historical behavior patterns; generating a context vector containing the overall information of the player's history by processing the morphemes in the sequence in parallel through the multi-head attention mechanism; classifying and predicting the item consumption situation of the user using the context vector and outputting the calculation result.
[0008] Preferably, the k-means clustering algorithm is used to group the values of each behavioral characteristic to form a predetermined discrete interval to generate a representative range of the characteristic
[0009] The present invention has the following beneficial effects compared with the prior art: It can be docked with the game operation management system to collect the experience data of users during the actual game process; a level difficulty analysis model is established, and objective scoring and content statistics of the level difficulty are carried out based on the collected data; the computer side supports the editing of levels, the creation and modification of elements; the data processing and storage system ensures that the edited level data can be saved in time and synchronized between the computer side and the mobile side; the mobile side can render and experience the edited level in real time, adjust the obstacles and props in the level on the mobile side, and save and upload the modified content; the planner can specify the level difficulty, and the level model automatically generates new levels, and then experience and modify them. At the same time, according to the method provided by the present invention, a more comprehensive observation of the player's history can provide significant predictive ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The illustrative embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0011] Figure 1 Shows a method for designing and creating a game level according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] According to an embodiment of the present invention, a method for designing and creating a game level is provided, including the following steps: providing a level editing interaction interface, enabling the planner to create, modify, save and synchronize the level to the terminal for testing and preview through the computer background; rendering the edited level in real time on the terminal, enabling the planner to experience the level design effect from the perspective of a game player, and optimize and adjust the level layout; performing the actions of completing the level from the perspective of the player on the terminal; obtaining the settlement information after completing the level, synchronously transmitting the settlement information between the terminal and the background, wherein the settlement information is stored in the background data pool for analyzing the level difficulty, obstacle effect, and prop consumption, and correcting and optimizing the level data model; automatically generating a new level based on the settlement information, and the new level includes a level template with a map, obstacle layout, and prop distribution matching the specified difficulty.
[0013] The editor for designing and creating a game level of the present invention includes a level editing interaction interface, a level data processing module, a real-time rendering module, a data storage module, and a level automatic generation module based on player data analysis. Through the cooperation of these modules, cross-platform editing, testing, and automatic creation of levels are realized.
[0014] Among them, the level editing interaction interface is a graphical level editing interface on the computer side, which is convenient for planners to design complex game scenarios. This interface supports creating new levels and manual editing through operations such as dragging, scaling, and rotating; supports reusing existing levels for modification and editing; supports saving level drafts and clearing the edited content. In addition, the real-time rendering and testing module mainly renders the edited levels in real time on the mobile side, enabling planners to experience the design effects from a game perspective and facilitating the adjustment and optimization of the level layout.
[0015] The level data processing module supports offline real-time local saving of the information data of game levels and uploading to the cloud server for backup; can synchronously transmit the level data between the computer side and the mobile side, and save the modification and submission records; supports permission-based and version control branches to avoid conflicts and confusion.
[0016] The level automatic generation module based on user data analysis includes the following steps:
[0017] Step 1: Obtain the settlement information of each level of the user.
[0018] The user level settlement information includes: level ID, whether the level is passed, the number of attempts at this level, passing score, the number of items used, etc.
[0019] The specific process is as follows: When the user finishes a level each time, a level settlement will be carried out, and the completion status of the current level will be uploaded to the cloud server. The server will match and store the current level settlement information with the user ID.
[0020] For example, (user ID, level ID, whether passed, the number of attempts at this level, passing score, item ID_item usage quantity). When each game level ends, the data of this game of the user is settled. For example, (10001, 25, 1, 3, 3650, item001_0, item002_3, item003_0,...), which means that the user with ID 10001 successfully passed the 25th level on the third attempt, with a score of 3650 points and used 3 item002 items. Through the user ID, the data situation of the user completing each level can be known, and through the level ID, the difficulty level experienced by different users in completing this level can be known.
[0021] Step 2: Calculate the clearance coefficient of each level according to the user level settlement information.
[0022] For casual puzzle elimination games, the difficulty design of levels is very important, which affects the user's game rhythm and experience, and then determines the user's retention and consumption in the game. Therefore, in the game level design, first set a clearance coefficient for each level, which is used as the basis for evaluating the difficulty of the game level. Simply put, it is necessary to calculate the clearance coefficient of the level according to the number of times the user attempts the same level until successful and the number of items used and consumed to successfully pass the level in the user's level clearance settlement information.
[0023] The specific method for calculating the clearance coefficient is as follows:
[0024] 2-1: According to the data in the user's level settlement information, calculate the average number of game attempts for each level to pass.
[0025] In the user game information data backed up to the cloud server, using the level ID as the primary key, select the number of attempts corresponding to successful clearance / failed clearance in the settlement information of the same level ID reported by each player for the last time, and calculate the average number of attempted games a to pass the level and the average number of times b that still failed to pass.
[0026] For example: For users who passed level 25, the average number of times a they played level 25 = 4. For users who did not pass level 25, the average number of times b they played level 25 = 3.
[0027] For each level, the average number of games required for the user to pass can be obtained. And the number of games required for the user to pass the level reflects the difficulty of the level to a certain extent.
[0028] 2-2: According to the data in the user's level settlement information, calculate the average situation of item usage by users who passed the level.
[0029] In the user game information data backed up to the cloud server, using the level ID as the primary key, count the proportion m of users who used items among those who passed the level, and the average number of items used n.
[0030] For example, among the users who have completed level 25, m = 37% of the users chose to use items, and the average number of items used n = 2.
[0031] Users using items to pass the level will affect the game difficulty. At the same time, each user's thinking and strategy for using items are different, so the quantity and proportion of item usage are also a key factor.
[0032] 2-3: Establish a level difficulty curve according to the level difficulty.
[0033] In this embodiment, for each level, the number of game attempts required to clear the level is calculated based on the actual data of the players, as well as the consumption of items that affect the difficulty among the users who cleared the level, which is the proportion of item consumption. A difficulty curve for all levels is established. Game planners and operators can easily see the difficulty distribution for the players. As the number of game levels increases, user feedback will be continuously accumulated, and the accuracy of the curve will be gradually improved, and the evaluation model for the levels will also become more and more accurate.
[0034] 2 - 4: Establish the correlation between difficulty and churn rate according to the user churn situation of each level.
[0035] According to the game statistical operation data, it can be queried how many users have churned and no longer play the game for each level.
[0036] Calculate the churn rate r for each level, and then a relationship curve between the user churn rate r and the level difficulty can be established.
[0037] If the game level is too difficult and users cannot pass it after repeated attempts, it may lead to user churn. If most of the game levels are too easy and lack challenge, it will also lead to user churn. The correlation between user churn and level difficulty is crucial for adjusting the difficulty rhythm when creating levels for subsequent games.
[0038] Step 3: Generate new levels based on the level analysis data.
[0039] After analyzing the data of a large number of users' actual experience of levels, the correlation model between game level difficulty and gameplay content, obstacles, and items will gradually become more perfect and accurate. The editor will support automatically generating new level templates according to the specified difficulty. The generated levels will include game element configurations that match the specified difficulty, such as level maps, obstacle layouts, and item distributions. Game planners and operators can directly experience the newly generated levels and modify them according to the experience to determine whether to release the level content.
[0040] According to another embodiment of the present invention, the revenue of free games mainly comes from advertisements and in - game purchases, and the long - term engagement of users is directly related to higher revenue opportunities. In online games, a small number of users contribute most of the sales, while most non - paying users are usually those who no longer play the game. Therefore, predicting whether players will make purchases in the future is crucial, which helps to formulate effective business policies in the game industry. Developing a prediction model for players' purchase behavior enables game developers to implement personalized marketing strategies, optimize resource allocation, and improve player retention rates. This forward - looking approach can not only maximize revenue but also significantly improve player satisfaction, thus gaining an advantage in the highly competitive game market.
[0041] In the present invention, the calculation of the user's potential consumption of items includes: extracting multiple behavioral characteristics from the settlement information, where the behavioral characteristics include the user's game activity status, item purchase behavior, game duration, number of sessions, number of levels completed, acquisition and consumption of in-game currency; performing discretization processing on the behavioral characteristics, including: using a clustering algorithm to group the values of each behavioral characteristic to form a predetermined discrete interval to generate a representative range for the characteristic; detecting and removing outliers in the behavioral characteristics to reduce the influence of extreme values on the discretization process; mapping the discretized behavioral characteristics to a finite set of morphemes, where each morpheme represents a behavioral state, including: (i) an empty morpheme indicating that the player is inactive; (ii) morphemes indicating different intervals within the normal range of the characteristic; (iii) special morphemes marking extreme behavioral states; arranging the morphemes generated from the discretized behavioral characteristics in chronological order to form a sequence of behavioral morphemes and constructing a sequence representation of the player's behavior history; calculating the similarity between each morpheme and other morphemes in the sequence based on the self-attention mechanism to capture short-term and long-term dependencies in the player's historical behavior patterns; generating a context vector containing the overall information of the player's history by processing the morphemes in the sequence in parallel through the multi-head attention mechanism; using the context vector to classify and predict the user's item consumption situation and outputting the calculation result.
[0042] Group the values of each behavioral characteristic to form a predetermined discrete interval to generate a representative range for the characteristic. The specific implementation method is as follows:
[0043] 1. Data preparation: Input the behavioral history matrix of each player, where each row represents the value of a certain characteristic over all days. Process each characteristic (the iii-th row) separately, only considering the characteristic values within active days (i.e., extracting non-zero value data from the historical matrix), and removing outliers to reduce the influence of extreme values on the clustering result.
[0044] 2. Select the number of clusters: Set the number of clusters K = 2 and divide the values of each characteristic into two main ranges. This division usually corresponds to a low-value range and a high-value range (or other behavioral categories).
[0045] 3. Apply the algorithm to calculate: Randomly select two initial center points, which respectively represent the initial center values of the two ranges, and calculate the distance between each data point and the two center points in the following way:
[0046]
[0047] where m represents a data point. Specifically in the behavioral characteristics, m can be the characteristic value within a certain day (such as the total number of sessions on that day, the amount of gold coins purchased, etc.). If the characteristic is multi-dimensional, m represents a multi-dimensional vector, where the value of the n-th dimension is m n .
[0048] z k represents the center point of the k-th cluster. The center point is a multi-dimensional vector, and the value of each dimension represents the "average behavior" of the cluster in this feature dimension. For example, z k may represent the cluster center of "low gold coin purchases", and its value is the mean of the low value range calculated during the clustering process. m n represents the feature value of the data point m in the n-th dimension. For example, if the behavioral features are "gold coin purchases" and "gold coin spending", then m n represents the specific value of the daily gold coin purchases or gold coin spending respectively. z k,n represents the value of the center point of the k-th cluster in the n-th dimension. It is obtained by taking the mean of the values of all data points belonging to this cluster in the n-th dimension, that is:
[0049]
[0050] where P k is the number of data points in cluster k, and z k is the set of all data points in cluster k. Calculate the mean of each cluster and use it as the new center point. Repeat the steps of "assigning data points to clusters" and "updating center points" until the center points no longer change significantly (i.e., convergence is reached). n represents the dimension (or number of features) of the data points. If the features are multi-dimensional, distance calculations need to be performed for all dimensions. If the features are one-dimensional, n = 1.
[0051] 4. Determine the feature range: After convergence, the center point of each cluster represents the typical value of this range. The two resulting clusters of clustering define two main ranges of feature values: the smaller cluster represents the lower range (such as low-frequency activities, low gold coin usage, etc.). The larger cluster represents the higher range (such as high-frequency activities, high gold coin usage, etc.).
[0052] 5. Map the feature values to discrete ranges
[0053] For each feature value, map it to the nearest range according to the distance from the two cluster centers:
[0054] If the feature value is close to the smaller cluster center, mark it as the "low" range;
[0055] If the feature value is close to the larger cluster center, mark it as the "high" range.
[0056] 6. Output the discretization result
[0057] Each feature is divided into two discrete ranges, which can be used as the discretized input features for subsequent model processing. For example: L4 (total number of conversations on the day): can be divided into two ranges of "low conversation frequency" and "high conversation frequency". L8 (gold coins purchased on the day): can be divided into two ranges of "low purchase volume" and "high purchase volume". Assuming the feature is "gold coin purchase volume", m is the gold coin purchase volume of a player on a certain day, z 1 and z 2 are the central points of two clusters: z 1 = 50 (center of the low purchase volume cluster) z 2 = 200 (center of the high purchase volume cluster). If the gold coin purchase volume of a player on a certain day is m = 120, then: T(m, z 1 ) = |120 - 50| = 70; T(m, z 2 ) = |120 - 200| = 80. m is closer to z 1 , so it is classified into the "low purchase volume" cluster. Each data point is assigned to the cluster where the nearest central point is located in the above way. Through the above content, it is hoped to divide the continuous values of each feature into two discrete ranges, retaining the information of the main behavior patterns while reducing the complexity of the data. This method is applicable to all behavior features, ensuring that the discretization results of each feature can reflect the main trends of player behavior.
[0058] The specific implementation steps for detecting and removing outliers are as follows: The values of behavior features (such as gold coin purchase volume, number of levels passed, etc.) may contain outliers. The goal is to identify and remove outliers so that the subsequent clustering process is not interfered by extreme values. After sorting the data, calculate the following two key statistics: Q1: The position at the 25th percentile in the data, that is, the upper limit of the smaller 25% of the data. Q3: The position at the 75th percentile in the data, that is, the lower limit of the larger 25% of the data. The difference between Q3 and Q1 represents the range of the middle 50% of the data: IQR = Q3 - Q1.
[0059] Calculate the normal data range (upper and lower limits) according to IQR. The specific formula is: Lower Limit: Lower Bound = Q1 - 1.5 × IQR; Upper Limit: Upper Bound = Q3 + 1.5 × IQR. Usually, the values of the data falling outside this range are considered outliers.
[0060] 1.5 × IQR is a statistical empirical value used to balance the boundary between normal values and outliers. If the data point m < Lower Bound or m > Upper Bound, then this point is marked as an outlier. Remove the data marked as outliers from the data set. Return the data set after removing outliers for subsequent steps (such as clustering) to use.
[0061] Suppose the data of a certain feature is: [10, 15, 20, 25, 30, 35, 100] (the data is sorted). Q1 = 17.5 (25th percentile); Q3 = 32.5 (75th percentile). IQR = Q3 - Q1 = 32.5 - 17.5 = 15. Lower Bound: Lower Bound = Q1 - 1.5 × IQR = 17.5 - 1.5 × 15 = -5 Upper Bound: Upper Bound = Q3 + 1.5 × IQR = 32.5 + 1.5 × 15 = 55 Since 100 > 55 in the data, 100 is marked as an outlier. Removing 100, the remaining data is: [10, 15, 20, 25, 30, 35]. Using the above method, outliers in the feature can be effectively detected and removed, ensuring that the mainstream trend of the data distribution is not deviated by extreme values. This step simplifies the data and reduces the interference in the clustering process, providing a more reliable input for subsequent analysis.
[0062] In addition, input the behavioral sequence morphemes into the Transformer neural network, where: (i) The Transformer neural network calculates the similarity between each morpheme and other morphemes in the sequence based on the self-attention mechanism to capture short-term and long-term dependencies in the player's historical behavior patterns; (ii) The Transformer neural network processes the morphemes in the sequence in parallel through the multi-head attention mechanism to generate a context vector containing the overall information of the player's history. Transformer model parameters: Embedding dimension: 512; Number of attention heads: 8; Number of encoder layers: 6; Feed-forward network dimension: 2048; Position encoding: Sine absolute position encoding; Dropout rate: 0.1.
[0063] In the above embodiment, the feature selection process for the purchase prediction task focuses on three groups of predictive variables: player engagement, player skills, and willingness to make in-game purchases. Specifically, features L1, L3, and L4 reflect the player's level of engagement with the game. Features L5, L6, L7, as well as L12 and L13 provide insights into various aspects of the player's skills. At the same time, features L2 and L8 to L11 evaluate the player's overall investment in the game and their possible monetization-related behavior patterns.
[0064] L1: Indicator of whether there are any activities on the day (0 / 1); L2: Indicator of whether there are any purchases on the day (0 / 1); L3: Total time spent in the game since registration; L4: Total number of sessions on the day; L5: Total number of levels passed since registration; L6: Percentage of different levels passed on the day out of the total number of levels; L7: Percentage of levels replayed on the day, out of all the levels played on the day; L8: Gold coins (in-game currency) purchased by the player on the day; L9: Gold coins (in-game currency) obtained as a reward on the day; L10: Gold coins (in-game currency) spent on the day; L11: Gold coins (in-game currency) stored in the inventory on the day; L12: Number of replay times used on the day; L13: Number of booster items used on the day.
[0065] Using the characteristics of player s above, the history of the player is represented as a real number matrix G s . Matrix G s 's rows represent the characteristics, and the columns represent the consecutive days from the registration day t = 1 to the last day t = T s of the player's history, where T s represents the last day of player s' history. Thus, G s is a 13×T s matrix, and h i,t is the value of the i-th characteristic Li on the t-th day, 1 ≤ t ≤ T s . Note that the T s values of different players are different (i.e., different history lengths). The goal is to predict whether a purchase will occur within the next k days. If y s t is the binary value of the characteristic L2 of player s on the t-th day, then the main goal is to find a classification function such that: G s → y s ∈ {0,1}, where y s = 1 indicates that player s will make a purchase within the next k days. To enable G s to be used as the input of a classification model based on the Transformer neural network, matrix G s is converted into a continuous value vector and a discrete value sequence.
[0066] The continuous value vector represents converting G s into a vector m s = (T s , f s , l s 2 , …, l s i , …, l s 13 ,)
[0067] where Ts Denotes the duration of the observed player history, f s Denotes G s The average value of the first row (percentage of days the player s played the game), and for 2 ≤ i ≤ 13, the vector l s i Denoted as
[0068] (min(G s i , →), Q1(G s i , →), Q2(G s i , →), Q3(G s i →), max(G s i , →))
[0069] Where G s i → is the value of the i-th row of G s (i.e., the Li value in the history of s).
[0070] The basic input unit of the Transformer neural network is a categorical value - a word fragment or a complete word. To use this model, the input data in G s must be converted into categorical values. This can be achieved by discretizing the feature values in G s . One day of each player (a column of G s ) is represented by a sequence of 13 morphemes, each morpheme reflecting the value of the corresponding feature on that day. The first two binary features L1 and L2 are represented by one of two morphemes, indicating whether the corresponding feature is 0 or 1. The remaining features Li (2 < i ≤ 13) are represented by one of four morphemes depending on the value of the feature:
[0071] T1 - indicates the absence of the Li value due to the player being inactive on that day;
[0072] T2 - indicates that the value of Li is an outlier;
[0073] T3 and T4 - indicate that the value of Li belongs to one of two feature ranges within the domain of the feature Li.
[0074] The feature range of each feature is found independently by the mean algorithm (K = 2). This algorithm is applied to the actual feature values of all players on all active days (i.e., the i-th row of all historical matrices). Since the mean algorithm is sensitive to outliers, extreme values are first processed for each feature Li. For multi-dimensional data, K-means usually requires normalization or standardization to achieve effective clustering, but these preprocessing steps are not required for one-dimensional data. The original matrix Li will be replaced by the corresponding tokenized historical matrix TG sAlternatively, the tokenization of the values is performed as described above. The history of each player s is represented as a sequence m s , obtained by concatenating the columns of the matrix TG s . That is, the sequence m s is of the form:
[0075] m s = (TG s 1 ,…, TG s t ,…, TG s Ts )
[0076] where TG s t is the column of the matrix TG s representing the morpheme of player s on the t-th day. Note that m s is a sequence of length 13T s , containing no more than 48 morphemes that form the morpheme vocabulary.
[0077] The encoder of the Transformer model can capture the rich context relationships between morphemes, thus obtaining a more comprehensive data representation and revealing short-term and long-term patterns in the player's history. Since the morphemes themselves have no order, they need to be mapped to a certain Euclidean space so that their similarity and distance can be measured in that space while maintaining their mutual characteristics. The embedding space is a vector representation space in a Euclidean space that captures the potential relationships and patterns between morphemes. The process of finding the appropriate embedding space that best describes the morphemes and their associations is completed by training a Transformer classification model. The input data of the Transformer model is the discretized sequence of behavioral feature morphemes. If the lengths of the morpheme sequences are inconsistent, padding techniques are used to extend them to a unified length, and corresponding masks are added to ignore the impact of padding values on the calculation. The discrete morphemes are mapped to a high-dimensional embedding space to generate an embedding vector matrix: E = Embedding(T), where T is the input morpheme sequence and E is the embedding representation matrix of the morphemes, and each morpheme corresponds to an embedding vector. To capture the chronological information of the sequence, positional encoding is added to the embedding matrix. The positional encoding is calculated through sine and cosine functions to provide each morpheme with its relative position in the sequence. The query (Query), key (Key), and value (Value) vectors are generated by linear transformation using the embedding matrix E': Q = E'W q , K = E'W k , V = E'W v , where W q , W k and W vis a learnable weight matrix. The similarity score (dot product) is calculated using the query and key vectors and scaled.
[0078] The self-attention mechanism operates by computing the dot product of each token representation vector e k in the embedding space with the other token representation vectors in the sequence. The dot product measures the similarity between two vectors in the embedding space, enabling the model to evaluate the importance of their relationships by comparing all pairs simultaneously. This process constructs new representation vectors that represent the understanding of the entire token sequence from the perspective of each input token. The encoder output contains the context embeddings of all tokens in the input sequence, so mean pooling is applied to obtain a single embedding vector representing the player's history. This vector is passed through an additional linear layer to output the logits for the buy and not-buy categories. The final category is selected based on the maximum logit score. The Transformer encoder architecture is shown in the figure. The architecture of the model is defined by hyperparameters such as the choice of embedding space size, the number of multi-head attention layers in the encoder, the number of attention heads, the size of the hidden layer in the feed-forward network, as well as the number of training epochs and the learning rate. An encoder structure based on Transformer for processing token sequences. It includes a multi-head attention mechanism, a feed-forward network, normalization layers, and residual connections. This architecture is used to extract the context information of the input token sequence, capturing short-term and long-term dependencies. Tokens are the representations after discretization and tokenization of the original data. Each input token is mapped into a high-dimensional vector space to form its embedding representation. To preserve the sequential order information of the tokens, positional encoding is added to the token embeddings. This step enables the model to distinguish tokens at different positions and capture the temporal characteristics of the sequence. Multiple attention heads are processed in parallel, each attention head focusing on different relationships in the input sequence to capture context information. Residual connections are used to avoid vanishing gradients and stabilize the training process through normalization. The context representation of each token is further processed to enhance the model's non-linear expressive power. Mean pooling is performed on the context embedding vectors of all tokens to generate a global representation of the entire sequence. This step simplifies the representation of multiple tokens into a fixed-size vector. The global sequence representation is input into a linear layer to output two values without being processed by an activation function (such as Softmax), for the categories "buy" and "not buy".
[0079] Based on the output of the linear layer, calculate the final purchase prediction probability. The Transformer encoder architecture supports parallel processing of the entire sequence, significantly improving the processing efficiency. The multi-head attention mechanism can capture long-term and short-term dependencies in the sequence, making the model more expressive in prediction tasks. Through mean pooling and positional encoding, the model can handle morpheme sequences of variable lengths. Through the self-attention mechanism and multi-layer network structure, the model can efficiently extract context information in the sequence and generate classification results. The design of the model emphasizes its flexibility for the input morpheme sequence, its ability to capture context relationships, and its efficient classification ability.
[0080] The performance in the in-game purchase prediction task was evaluated by the above method. The model was tested on the test part of 10 randomly generated training set (80%) - test set (20%) splits. The standard multi-class classification performance metric - macro-average F1 score was used to compare the models. In each iteration, the training and test parts were expanded to enhance the training effect of the model on a larger dataset and to adapt to different lengths of player history. The obtained F1 scores show the excellent performance of the model and self-attention technology over all prediction horizons, indicating that a more comprehensive observation of player history can provide significant predictive power.
[0081] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for designing and creating game levels, characterized in that: The following steps are involved: Provides a level editing interactive interface, allowing planners to create, modify, save and synchronize levels to the terminal for testing and preview through the computer backend; Render the edited levels in real time on the terminal, allowing planners to experience the level design effect from the perspective of game players and optimize and adjust the level layout; Perform actions to complete the level at the terminal from the player's perspective; Acquire settlement information after completing the level, synchronously transmit the settlement information between the terminal and the backend, and store the settlement information in the backend data pool; A new level is automatically generated based on the settlement information, wherein the new level includes a level template matching the specified difficulty.
2. The method according to claim 1, characterized in that Automatically generate a new level based on the settlement information, including: Calculate the difficulty curve of each level based on the settlement information, wherein the difficulty curve parameters at least include level difficulty, user churn, and user potential consumption of props; New levels are automatically generated according to the difficulty curve.
3. The method according to claim 1, characterized in that The calculation of the level difficulty includes: According to the user level settlement information, the communication coefficient of each level is calculated, and the calculation method of the communication coefficient includes: Based on the data of user level settlement information, calculate the average number of games completed for each level; Based on the data of user level settlement information, calculate the average usage of props by users who have completed a level; Based on the actual data of the players, calculate the number of games required to complete a level, as well as the prop consumption ratio of the props used by the users to affect the difficulty of the level.
4. The method according to claim 1, characterized in that: The calculation of the user's potential consumption of props includes: Extracting multiple behavior features from the settlement information, the behavior features including the user's game activity status, item purchase behavior, game time, number of sessions, number of completed levels, and acquisition and spending of in-game currency; Discretizing the behavior feature, using a clustering algorithm to group the value of each behavior feature to form a predetermined discrete interval, so as to generate a representative range of the feature; Detecting and removing outliers in the behavioral characteristics to reduce the impact of extreme values on the discretization process; The discretized behavioral features are mapped into a finite set of morphemes, where each morpheme represents a behavioral state, including: (i) empty morphemes indicating that the player is not active; (ii) morphemes indicating that the features are in different intervals within the normal range; (iii) special morphemes marking extreme behavioral states; The morphemes generated by the discretized behavior features are arranged in chronological order to form behavior sequence morphemes, thereby constructing a sequence representation of the player's behavior history; The similarity of each morpheme to other morphemes in the sequence is calculated based on the self-attention mechanism to capture the short-term and long-term dependencies in the player's historical behavior patterns; The morphemes in the sequence are processed in parallel through a multi-head attention mechanism to generate a context vector containing the overall information of the player's history; The context vector is used to classify and predict the user's item consumption, and the calculation result is output.
5. The method according to claim 4, characterized in that The mean clustering algorithm is used to group the values of each behavioral feature into predetermined discrete intervals to generate a representative range for the feature.
Citation Information
Patent Citations
Game level dynamic generation method and device, equipment and storage medium
CN118491106A
Checkpoint editing method and checkpoint editor
CN118593993A
Game data processing method and device, equipment, storage medium and program product
CN119524406A
Network intrusion detection method based on clustering oversampling and Transform
CN119628943A
Automated game assessment
US20220088481A1