Game card combination generation method, device and equipment based on genetic algorithm

By using a card combination generation method based on genetic algorithms, which calculates card fitness values ​​and adjusts the number of iterations to generate mutated cards, the problem of rationality and diversity of card combinations in the game is solved, thus improving the game effect.

CN120952117APending Publication Date: 2025-11-14广州三七极耀网络科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511003687.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing methods for generating game card combinations suffer from poor rationality and premature convergence.

Method used

The game card set is obtained by using a genetic algorithm, the fitness value of the cards is calculated, recombination is performed and the number of iterations and the target adjustment coefficient are adjusted to generate the mutation range and mutation probability, card mutation is performed, and finally the cards are merged to generate the game card combination.

Benefits of technology

It improves the rationality and diversity of game card combinations, avoids premature convergence, and enhances the game effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952117A_ABST
    Figure CN120952117A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a game card combination generation method, device and equipment based on a genetic algorithm, and the method comprises the steps: calculating a first fitness value of each game card in a game card set according to a target function, and determining a plurality of target cards according to the first fitness values; performing recombination operation on the plurality of target cards to generate a plurality of recombination cards, determining a target adjustment coefficient corresponding to the number of iterations of the recombination operation, adjusting the capability value range of the recombination cards according to the target adjustment coefficient and the minimum capability value range corresponding to the types of the recombination cards, and generating a target variation range, determining a target variation probability associated with the target variation range; according to the method, the recombined cards with the target mutation probability exceeding the mutation probability threshold value are determined as the target recombined cards, mutation operation is performed on the target recombined cards to generate the multiple mutation cards, the multiple mutation cards and the multiple target cards are combined to generate the game card combination, premature convergence is avoided, and the rationality of the game card combination is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus and device for generating game card combinations based on genetic algorithms. Background Technology

[0002] With the booming development of the gaming industry, card games, with their unique strategic elements and collection / development gameplay, occupy an important position in the gaming market. From traditional physical card games to today's digital card games, card games have continuously integrated elements of role-playing, strategic combat, and other technologies, resulting in increasingly diverse gameplay and higher demands from players for the gaming experience. The diversity and rationality of game card combinations directly affect players' strategic choices, game enjoyment, and competitive balance. Therefore, card combination generation methods have become one of the key technologies in card game design.

[0003] In related technologies, during the generation of game card combinations, an enhanced elite retention genetic algorithm is used to directly copy one or more of the best cards in the current card set to the next generation in each generation, ensuring that the best cards are not lost. However, this enhanced elite retention genetic algorithm has problems such as poor rationality of game card combinations and premature convergence. Summary of the Invention

[0004] This application provides a method and apparatus for generating game card combinations based on a genetic algorithm, which solves problems such as poor rationality and premature convergence in game card combinations. It can adaptively adjust the mutation range and mutation probability based on the number of iterations of the real-time recombination operation, avoiding premature convergence and improving the rationality of game card combinations.

[0005] In a first aspect, embodiments of this application provide a method for generating game card combinations based on a genetic algorithm, comprising: Obtain a set of game cards, calculate the first fitness value of each game card in the set according to the constructed objective function, and determine multiple target cards in the set based on the first fitness value; Multiple target cards are recombined to generate multiple recombined cards. The number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations are determined. The ability value range of the recombined cards is adjusted according to the target adjustment coefficient and the minimum ability value range corresponding to the type of the recombined card to generate a target mutation range. The target mutation probability associated with the target mutation range is determined. The recombined cards whose target mutation probability exceeds the preset mutation probability threshold are identified as target recombined cards. Mutation operations are performed on the target recombined cards to generate multiple mutated cards. The multiple mutated cards are then merged with the multiple target cards to generate a game card combination.

[0006] Optionally, adjusting the ability value range of the reconstituted card according to the target adjustment coefficient and the minimum ability value range corresponding to the type of the reconstituted card to generate the target mutation range includes: The range of ability values ​​of the recombined card is narrowed according to the target adjustment coefficient to generate a target range. The minimum ability value range corresponding to the type of the recombined card is compared with the target range. If the target range includes the minimum capability value range, the target range is determined as the target variation range; if the target range does not include the minimum capability value range, the target variation range is generated based on the boundary values ​​of the target range and the boundary values ​​of the minimum capability value range.

[0007] Optionally, after generating multiple mutated cards, the process further includes: The second fitness value of the plurality of mutated cards is calculated according to the objective function, and a plurality of target mutated cards are determined according to the second fitness value and the type of each mutated card; Accordingly, merging the plurality of mutated cards with the plurality of target cards to generate a game card combination includes: The multiple target mutated cards are merged with the multiple target cards to generate a game card combination.

[0008] Optionally, before merging the plurality of target mutated cards with the plurality of target cards, the method further includes: Sort the first fitness values ​​corresponding to the multiple target cards, determine the target cards to be merged based on the sorting results, sort the second fitness values ​​corresponding to the multiple target mutated cards, and determine the target mutated cards to be merged based on the sorting results. Accordingly, the plurality of target mutated cards are merged with the plurality of target cards to generate a game card combination, including: The target cards to be merged are combined with the target mutated cards to be merged to generate game card combinations.

[0009] Optionally, determining multiple target mutant cards based on the second fitness value and the type of each mutant card includes: Multiple first target mutant cards are determined based on the second fitness value and the preset number of mutant cards. Mutant cards are then filtered according to the type of each first target mutant card to obtain multiple second target mutant cards. The types of the multiple second target mutant cards are various.

[0010] Optionally, before acquiring the game card set, the process may also include: Obtain game card information, which includes game card set, game card ability, and card combination constraints; Set the decision variables corresponding to the game card set, determine the target ability value in the game card ability according to the preset game objective, and construct the objective function according to the card combination constraints, the target ability value and the decision variables.

[0011] Optionally, after generating the game card combination, the following steps are also included: Obtain multiple historical game card combinations, calculate the similarity value between each game card combination and each of the historical game card combinations, and compare each of the similarity values ​​with a preset similarity threshold. If all the similarity values ​​are less than the preset similarity threshold, the game card combination is determined to satisfy the diversity strategy; if all the similarity values ​​are greater than or equal to the preset similarity threshold, the game card combination is determined not to satisfy the diversity strategy. If the game card combination does not meet the requirements of a diverse strategy, the game card combination is subjected to iterative reorganization and optimization.

[0012] In a second aspect, embodiments of this application provide a game card combination generation device based on a genetic algorithm, comprising: The target card determination module is used to obtain a set of game cards, calculate the first fitness value of each game card in the set of game cards according to the constructed objective function, and determine multiple target cards in the set of game cards based on the first fitness value. The card recombination module is used to recombine the multiple target cards to generate multiple recombined cards. A capability value range adjustment module is used to determine the number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations, adjust the capability value range of the recombination card according to the target adjustment coefficient and the minimum capability value range corresponding to the type of the recombination card, generate a target mutation range, and determine the target mutation probability associated with the target mutation range; The mutation operation module is used to calculate the degree of mutation of the recombined card based on the target mutation probability and the maximum ability value in the target mutation range, and to perform mutation operation on the recombined card according to the degree of mutation to generate multiple mutated cards; The card combination generation module is used to merge the multiple mutated cards with the multiple target cards to generate game card combinations.

[0013] In a third aspect, embodiments of this application provide an electronic device, the device comprising: one or more processors; and a storage device configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the game card combination generation method based on genetic algorithms described in the first aspect.

[0014] In a fourth aspect, embodiments of this application provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the game card combination generation method based on genetic algorithms as described in the first aspect.

[0015] This application embodiment obtains a set of game cards, calculates the first fitness value of each game card in the set according to a constructed objective function, and determines multiple target cards in the set based on the first fitness value. It then performs a recombination operation on the multiple target cards to generate multiple recombined cards, determines the number of iterations for the recombination operation and the target adjustment coefficient corresponding to the number of iterations, adjusts the capability range of the recombined cards according to the target adjustment coefficient and the minimum capability range corresponding to the type of the recombined card, generates a target mutation range, and determines the target mutation probability associated with the target mutation range. Recombined cards whose target mutation probability exceeds a preset mutation probability threshold are identified as target recombined cards, and mutation operations are performed on these target recombined cards to generate multiple mutated cards. These mutated cards are then merged with the multiple target cards to generate a game card combination. This approach allows for adaptive adjustment of the capability range and mutation probability based on the real-time number of iterations of the recombination operation, avoiding premature convergence and improving the rationality of the game card combination. By merging multiple target cards with multiple mutated cards to generate a game card combination, the diversity and rationality of the card combination are enhanced, thereby improving the game effect. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a method for generating game card combinations based on a genetic algorithm, as provided in an embodiment of this application. Figure 2 This is a schematic diagram illustrating the generation process of game card combinations based on a genetic algorithm, as provided in an embodiment of this application. Figure 3 This is a flowchart of a method for generating a target variation range provided in an embodiment of this application; Figure 4 This is a flowchart of an iterative recombination optimization processing method provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a game card combination generation device based on a genetic algorithm provided in an embodiment of this application; Figure 6This is a schematic diagram of the structure of a game card combination generation device based on a genetic algorithm provided in an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0018] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0019] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0020] The method and apparatus for generating game card combinations based on genetic algorithms provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0021] The game card combination generation method based on genetic algorithms provided in this application can be applied to scenarios where game characters interact with game assistants during gameplay, such as guiding or teaching players through the game assistant, and providing players with game strategies, thereby enhancing the interactivity of the game. Based on the above application scenarios, it is understood that the implementing entity of this solution can be a server.

[0022] Figure 1 This is a flowchart illustrating a method for generating game card combinations based on a genetic algorithm, as provided in an embodiment of this application. Figure 1 As shown, it includes: Step S101: Obtain the game card set, calculate the first fitness value of each game card in the game card set according to the constructed objective function, and determine multiple target cards in the game card set based on the first fitness value.

[0023] In this context, a game card set refers to a collection of cards with different attributes, functions, and characteristics within a specific card game. The objective function is used to calculate the fitness value of each card. Fitness value is a numerical indicator that measures the applicability and effectiveness of a card in a specific game situation or deck construction. It can be used to represent the degree of fit and synergy of the overall card combination strategy. The fitness value can be determined based on the card's attribute values; for example, a card with high attack power will have a higher fitness value. The first fitness value represents the fitness level of each card in the initial game card set. The target card refers to the game card in the game card set with a high fitness value.

[0024] Figure 2 This is a schematic diagram illustrating the generation process of game card combinations based on a genetic algorithm, as provided in an embodiment of this application. Figure 2 As shown, the game card set of the current game is obtained, and the first fitness value of each game card in the game card set is calculated by a pre-constructed objective function. For example, the objective function is defined as: fitness value = total attack power * 0.4 + total defense power * 0.3 + number of control cards * 0.2 + number of feature effect cards * 0.1. The calculated first fitness values ​​are compared with the preset fitness thresholds, and the target cards corresponding to the first fitness values ​​greater than the preset fitness thresholds are selected. There are multiple such target cards.

[0025] Step S102: Perform a recombination operation on the multiple target cards to generate multiple recombination cards, determine the number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations, adjust the capability value range of the recombination cards according to the target adjustment coefficient and the minimum capability value range corresponding to the type of the recombination card, generate a target mutation range, and determine the target mutation probability associated with the target mutation range.

[0026] Recombination refers to combining, adjusting, or transforming cards in a new way to achieve a specific game objective. This could be merging multiple target cards into a single, more powerful card, or recombining card skills to change their effects or combinations. Recombined cards are game cards with new skills or effects generated after recombining the skills or effects of target cards. The iteration count of a recombination operation refers to the number of times the recombination operation is repeated. Each recombination operation adjusts or changes based on the previous result; the iteration count records the frequency of repetition. More iterations may result in a more ideal recombination effect. The target adjustment coefficient is a numerical parameter used to modify the original attribute range of a card. As the number of iterations increases, the target adjustment coefficient can be dynamically adjusted to avoid over-adjustment leading to game imbalance. For example, setting the initial target adjustment coefficient to 0.8, decreasing it by 0.1 every 10 iterations, resulting in a target adjustment coefficient of 0.7 after 10 iterations. Recombined card types can include attack cards, defense cards, spell cards, equipment cards, resource cards, and special cards. Minimum ability value range refers to the minimum numerical range that a card can achieve in various ability attributes in the current game. For example, the minimum attack value range of an attack card is 2-3. The ability value range of a recombined card refers to the numerical range or variation of various attributes and effects of the recombined card. For example, if a character card has an attack power of 5-10 and a defense value of 3-6, then the attack ability value range of that character card is 5-10, and the defense ability value range is 3-6. Target mutation range refers to the range or variation of a card's attribute or effect under certain conditions. Target mutation probability refers to the likelihood of a card mutating under a specific game mechanism, usually expressed as a percentage or decimal, with a value range between 0 and 1. Game card mutation refers to a mechanism in the game where a card's attributes, effects, appearance, etc., change. This includes changes to the card's basic numerical attributes such as attack power, defense power, health points, and mana cost; changes to the card's original skill effects; and changes to the card's image, color, or style.

[0027] In one embodiment, such as Figure 2As shown, multiple selected target cards are recombine with their skills or effects to generate multiple recombined cards. The number of iterations for the current recombination operation is determined. Based on a preset adjustment rule, a target adjustment coefficient is determined. For example, the adjustment rule is that the adjustment coefficient increases by 0.1 every 10 iterations. If the current iteration count is 15, the coefficient is increased by 0.1 from the initial adjustment coefficient. If the initial adjustment coefficient is 0.3, the current target adjustment coefficient is 0.4. The ability value range of the recombined cards is then proportionally increased or decreased based on this target adjustment coefficient. For example, if the ability value range of the recombined cards is 5-15, the range is proportionally decreased by 0.4, resulting in an adjusted range of 7-13. The minimum ability value range of this type of recombined card in the current game is 5-8. The number of iterations determines that the adjusted range is greater than the minimum ability value range. This adjusted range can be directly determined as the target mutation range, and the target mutation probability associated with the target mutation range is determined. In one embodiment, a correlation between the target mutation range and the target mutation probability can be pre-generated; the larger the target mutation range, the smaller the associated target mutation probability.

[0028] Step S103: Determine the recombinant cards whose target mutation probability exceeds the preset mutation probability threshold as target recombinant cards, perform mutation operations on the target recombinant cards to generate multiple mutated cards, and merge the multiple mutated cards with the multiple target cards to generate a game card combination.

[0029] Mutation refers to the act of altering a card's attributes, effects, or appearance through specific methods. A mutated card is a game card created by altering the attributes, effects, or appearance of a reconstituted card. A game card combination refers to pairing different cards together according to game rules and strategies to achieve specific game effects or tactical objectives. Target reconstituted cards can be those with a high probability of mutation and can be created with relatively little mutation energy or mutation feed. Mutation energy or mutation feed are special items or resources used to induce mutations in cards, characters, creatures, etc.

[0030] In one embodiment, after determining the mutation probability of each recombined card, the target mutation probability of each recombined card is compared with a preset mutation probability threshold. Target recombined cards with a target mutation probability exceeding the preset threshold are identified. It is understood that target recombined cards with a target mutation probability exceeding the preset threshold can be mutated with less mutation energy, while recombined cards with a target mutation probability below the preset threshold require more mutation energy to mutate. Therefore, the mutation probability can be increased by iterating through the recombined card multiple times. Mutation is only performed when the mutation probability exceeds the preset threshold. In one embodiment, such as... Figure 2 As shown, after identifying multiple target recombination cards, the corresponding mutation skills are used to mutate these multiple target recombination cards to generate multiple mutated cards. These multiple mutated cards are then combined with the identified multiple target cards to achieve the best game effect or realize the best tactical objective.

[0031] In one possible embodiment, such as Figure 2 As shown, after generating a game card combination, a compliance check is performed on the game card combination according to preset detection conditions. If the compliance check conditions are met, the game card combination is determined as the optimal combination. If the compliance check conditions are not met, the game card combination is treated as a new game card set for iterative optimization.

[0032] This application embodiment obtains a set of game cards, calculates the first fitness value of each game card in the set according to a constructed objective function, and determines multiple target cards in the set based on the first fitness value. Multiple target cards are then recombined to generate multiple recombined cards. The number of iterations for the recombining operation and the target adjustment coefficient corresponding to the number of iterations are determined. The capability range of the recombined cards is adjusted according to the target adjustment coefficient and the minimum capability range corresponding to the type of the recombined card, generating a target mutation range. The target mutation probability associated with the target mutation range is determined. Recombined cards with a target mutation probability exceeding a preset mutation probability threshold are identified as target recombined cards. Mutation operations are performed on the target recombined cards to generate multiple mutated cards. These mutated cards are then merged with the multiple target cards to generate a game card combination. The above scheme can adaptively adjust the range of ability values ​​and mutation probability according to the number of iterations of real-time recombination operations, avoiding premature convergence and improving the rationality of game card combinations. By merging multiple target cards with multiple mutated cards to generate game card combinations, the diversity and rationality of card combinations are improved, thereby enhancing the game effect.

[0033] In one embodiment, before obtaining the game card set, the method further includes: obtaining game card information, which includes the game card set, game card abilities, and card combination constraints; setting decision variables corresponding to the game card set; determining the target ability value in the game card abilities according to a preset game objective; and constructing an objective function based on the card combination constraints, the target ability value, and the decision variables.

[0034] Among these, "game card ability" refers to the various special effects and attributes possessed by a card, such as defensive and offensive capabilities. "Constraints on card combinations" refers to the various rules that restrict the construction of card combinations, such as the maximum number of cards in a combination and the types of cards. "Decision variables corresponding to the game card set" refers to the various variable factors that can influence the decision outcome during the process of constructing a card deck or making game decisions. For example, if the game card set... Where n is the total number of cards, expressed as a binary vector. As decision variables, among them , This indicates selecting the i-th card. This indicates that the i-th card was not selected.

[0035] In one embodiment, a set of game cards, card abilities, and card combination constraints are obtained; decision variables corresponding to the set of game cards are set; and target ability values ​​in the card abilities are determined according to a preset game objective. For example, if the preset game objective is to maximize combat power, the target ability value is determined to be the combat power value of each card. An objective function is then constructed based on the card combination constraints, target ability values, and decision variables. For example, if the constraint on the card combination is the maximum number of cards of a certain type, the objective function can be defined as... M represents the maximum number of cards allowed for this type.

[0036] This application embodiment acquires game card information, including a set of game cards, card abilities, and card combination constraints. It sets decision variables corresponding to the game card set, determines target ability values ​​for the card abilities based on a preset game objective, and constructs an objective function based on the card combination constraints, target ability values, and decision variables. This solution generates an objective function based on the actual game objective and card combination constraints, improving the accuracy of subsequent fitness value calculations based on the objective function, and consequently, enhancing the rationality of the game card combinations.

[0037] Figure 3 This is a flowchart of a method for generating a target variation range provided in an embodiment of this application, such as... Figure 3 As shown, it includes: Step S1021: Narrow down the range of ability values ​​of the recombined cards according to the target adjustment coefficient to generate the target range, and compare the minimum ability value range corresponding to the type of recombined card with the target range.

[0038] Step S1022: If the target range includes the minimum capability value range, determine the target range as the target mutation range; if the target range does not include the minimum capability value range, generate the target mutation range based on the boundary values ​​of the target range and the boundary values ​​of the minimum capability value range.

[0039] In one embodiment, the minimum capability value range corresponding to the type of recombined card is compared with the target range to determine whether the target range includes the minimum capability value range. If the target range includes the minimum capability value range, the target range can be directly determined as the target mutation range. If the target range does not include the minimum capability value range, the first boundary value and the second boundary value of the target range, as well as the third boundary value and the fourth boundary value of the minimum capability value range, are determined respectively. The minimum boundary value and the maximum boundary value among the first boundary value, the second boundary value, the third boundary value and the fourth boundary value are determined, and the range formed by the minimum boundary value and the maximum boundary value is determined as the target mutation range.

[0040] For example, if the current target adjustment coefficient is 0.4, the ability value range of the recombined card is 5-15. If the ability value range is reduced proportionally by 0.4, the target range is 7-13. The minimum ability value range of the recombined card type in the current game is 5-8. The target range does not include the minimum ability value range. The first boundary value of the target range is 7, the second boundary value is 13, the third boundary value of the minimum ability value range is 5, and the fourth boundary value is 8. Therefore, the target mutation range is 5-13.

[0041] This embodiment of the application narrows down the range of ability values ​​for recombined cards based on a target adjustment coefficient to generate a target range. The minimum ability value range corresponding to the type of recombined card is compared with the target range. If the target range includes the minimum ability value range, it is determined as the target mutation range. If the target range does not include the minimum ability value range, the target mutation range is generated based on the boundary values ​​of the target range and the minimum ability value range. This solution avoids the ability values ​​in the target range being too small, thus preventing them from affecting the card's effect. It appropriately adjusts the ability value range while maintaining the card's overall performance, thereby improving the accuracy of the mutation probability.

[0042] In one embodiment, after generating multiple mutated cards, the method further includes: calculating a second fitness value for the multiple mutated cards based on an objective function; determining multiple target mutated cards based on the second fitness value and the type of each mutated card; and correspondingly, merging the multiple mutated cards with the multiple target cards to generate a game card combination, including: merging the multiple target mutated cards with the multiple target cards to generate a game card combination.

[0043] The second fitness value represents the degree of fitness of each mutated card in the game. In one embodiment, after obtaining multiple mutated cards, the second fitness value of each mutated card is calculated using an objective function. A preset number of mutated cards with higher second fitness values ​​are determined. For example, based on the second fitness values ​​of each mutated card, five mutated cards with the highest second fitness values ​​are determined. It is then determined whether the card types of these five mutated cards are consistent. If they are consistent, they are reselected based on the second fitness. If they are all inconsistent or partially inconsistent, these five mutated cards are determined as target mutated cards. These multiple target mutated cards are then combined with the aforementioned multiple target cards to generate a game card combination with the best combination effect.

[0044] Optionally, multiple target mutant cards are determined based on the second fitness value and the type of each mutant card, including: determining multiple first target mutant cards based on the second fitness value and a preset number of mutant cards, and filtering mutant cards according to the type of each first target mutant card to obtain multiple second target mutant cards, wherein the types of the multiple second target mutant cards are various.

[0045] In this embodiment, the first target mutated card is a mutated card with a high fitness value, and the second target mutated card is a card with a high fitness value but different from the other first target mutated cards. In one embodiment, a predetermined number of first target mutated cards with high second fitness values ​​are selected from a plurality of target mutated cards, and cards of different types are selected from the plurality of first target mutated cards, and cards of different types are determined as second target mutated cards.

[0046] This application embodiment calculates the second fitness values ​​of multiple mutated cards according to an objective function, determines multiple target mutated cards based on the second fitness values ​​and the types of each mutated card, and merges the multiple target mutated cards with multiple target cards to generate game card combinations. In the above scheme, by calculating the second fitness values ​​of each mutated card separately, mutated cards with higher second fitness values ​​and different types are selected as target mutated cards, thereby improving the diversity and effectiveness of game card combinations.

[0047] Optionally, before merging multiple target mutated cards with multiple target cards, the method further includes: sorting the first fitness values ​​corresponding to the multiple target cards, determining the target cards to be merged based on the sorting results, sorting the second fitness values ​​corresponding to the multiple target mutated cards, and determining the target mutated cards to be merged based on the sorting results; correspondingly, merging multiple target mutated cards with multiple target cards to generate a game card combination includes: merging the target cards to be merged with the target mutated cards to be merged to generate a game card combination.

[0048] In one embodiment, the first fitness values ​​corresponding to multiple target cards are sorted in descending order. A preset number of target cards to be merged are selected from the sorting results according to a preset selection rule. The target cards to be merged are those with higher first fitness values ​​among the multiple target cards. The second fitness values ​​corresponding to multiple target mutated cards are sorted in descending order. A preset number of target mutated cards to be merged are selected from the sorting results according to a preset selection rule. The target mutated cards to be merged are those with higher second fitness values ​​among the multiple target mutated cards. The target cards to be merged are then merged with the target mutated cards to be merged to generate a game card combination.

[0049] This application embodiment sorts the first fitness values ​​corresponding to multiple target cards, determines the target cards to be merged based on the sorting results, sorts the second fitness values ​​corresponding to multiple target mutated cards, determines the target mutated cards to be merged based on the sorting results, and merges the target cards to be merged with the target mutated cards to generate a game card combination. In the above scheme, target cards and target mutated cards with higher fitness are selected from multiple target cards and multiple target mutated cards for combination, fully ensuring the effectiveness and rationality of the game card combination.

[0050] Figure 4 This is a flowchart of an iterative recombination optimization processing method provided in an embodiment of this application, such as... Figure 4 As shown, it includes: Step S201: Obtain multiple historical game card combinations, calculate the similarity value between each game card combination and each historical game card combination, and compare each similarity value with a preset similarity threshold.

[0051] Step S202: If all similarity values ​​are less than the preset similarity threshold, determine that the game card combination satisfies the diversity strategy; if all similarity values ​​are greater than or equal to the preset similarity threshold, determine that the game card combination does not satisfy the diversity strategy.

[0052] Step S203: If the game card combination does not meet the diversity strategy, perform iterative reorganization and optimization processing on the game card combination.

[0053] In one embodiment, multiple historical game card combinations are obtained. The number, type, and ability value of game cards in each historical game card combination are determined. The similarity of card quantity, card type, and card ability value are calculated respectively. Based on the similarity of card quantity, card type, and card ability value, and a preset weighting coefficient, the similarity value between each game card combination and each historical game card combination is calculated. The calculated similarity values ​​are compared with preset similarity thresholds. If all similarity values ​​are less than the preset similarity threshold, the game card combination is determined to satisfy the diversity strategy. If all similarity values ​​are greater than or equal to the preset similarity threshold, the game card combination is determined to not satisfy the diversity strategy. The game card combinations that do not satisfy the diversity strategy are used as the initial game card set, and the initial game card set is subjected to iterative recombination processing.

[0054] This application embodiment obtains multiple historical game card combinations, calculates the similarity value between the current game card combination and each historical game card combination, and compares each similarity value with a preset similarity threshold. If all similarity values ​​are less than the preset similarity threshold, the game card combination is determined to meet the diversity strategy; if all similarity values ​​are greater than or equal to the preset similarity threshold, the game card combination is determined not to meet the diversity strategy. In cases where the game card combination does not meet the diversity strategy, iterative recombination optimization processing is performed on the game card combination. This scheme avoids situations where the generated game card combination is similar to historical game card combinations, ensuring the diversity of game card combinations and improving the combination effect of game cards.

[0055] Figure 5 This is a schematic diagram of the structure of a game card combination generation device based on a genetic algorithm provided in an embodiment of this application, as shown below. Figure 5 As shown, it includes: The target card determination module 31 is used to obtain a set of game cards, calculate the first fitness value of each game card in the set of game cards according to the constructed objective function, and determine multiple target cards in the set of game cards according to the first fitness value. Card recombination module 32 is used to recombine the multiple target cards to generate multiple recombination cards; The capability value range adjustment module 33 is used to determine the number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations, adjust the capability value range of the recombination card according to the target adjustment coefficient and the minimum capability value range corresponding to the type of the recombination card, generate a target mutation range, and determine the target mutation probability associated with the target mutation range. The mutation operation module 34 is used to identify the recombinant cards whose target mutation probability exceeds the preset mutation probability threshold as target recombinant cards, perform mutation operations on the target recombinant cards, and generate multiple mutated cards. The card combination generation module 35 is used to merge the multiple mutated cards with the multiple target cards to generate game card combinations.

[0056] This application embodiment obtains a set of game cards, calculates the first fitness value of each game card in the set according to a constructed objective function, and determines multiple target cards in the set based on the first fitness value. Multiple target cards are then recombined to generate multiple recombined cards. The number of iterations for the recombining operation and the target adjustment coefficient corresponding to the number of iterations are determined. The capability range of the recombined cards is adjusted according to the target adjustment coefficient and the minimum capability range corresponding to the type of the recombined card, generating a target mutation range. The target mutation probability associated with the target mutation range is determined. Recombined cards with a target mutation probability exceeding a preset mutation probability threshold are identified as target recombined cards. Mutation operations are performed on the target recombined cards to generate multiple mutated cards. These mutated cards are then merged with the multiple target cards to generate a game card combination. The above scheme can adaptively adjust the range of ability values ​​and mutation probability according to the number of iterations of real-time recombination operations, avoiding premature convergence and improving the rationality of game card combinations. By merging multiple target cards with multiple mutated cards to generate game card combinations, the diversity and rationality of card combinations are improved, thereby enhancing the game effect.

[0057] In one possible embodiment, the capability range adjustment module 33 is specifically used for: The range of ability values ​​of the recombined card is narrowed according to the target adjustment coefficient to generate a target range. The minimum ability value range corresponding to the type of the recombined card is compared with the target range. If the target range includes the minimum capability value range, the target range is determined as the target variation range; if the target range does not include the minimum capability value range, the target variation range is generated based on the boundary values ​​of the target range and the boundary values ​​of the minimum capability value range.

[0058] In one possible embodiment, the target variant card determination module is used for: The second fitness value of the plurality of mutated cards is calculated according to the objective function, and a plurality of target mutated cards are determined according to the second fitness value and the type of each mutated card; Card combination generation module 35 is used for: The multiple target mutated cards are merged with the multiple target cards to generate a game card combination.

[0059] In one possible embodiment, the card-to-be-merged determination module is used for: Sort the first fitness values ​​corresponding to the multiple target cards, determine the target cards to be merged based on the sorting results, sort the second fitness values ​​corresponding to the multiple target mutated cards, and determine the target mutated cards to be merged based on the sorting results. Card combination generation module 35 is used for: The target cards to be merged are combined with the target mutated cards to be merged to generate game card combinations.

[0060] In one possible embodiment, the target mutated card determination module is specifically used for: Multiple first target mutant cards are determined based on the second fitness value and the preset number of mutant cards. Mutant cards are then filtered according to the type of each first target mutant card to obtain multiple second target mutant cards. The types of the multiple second target mutant cards are various.

[0061] In one possible embodiment, the objective function building module is used for: Obtain game card information, which includes game card set, game card ability, and card combination constraints; Set the decision variables corresponding to the game card set, determine the target ability value in the game card ability according to the preset game objective, and construct the objective function according to the card combination constraints, the target ability value and the decision variables.

[0062] In one possible embodiment, the diversity detection module is used for: Obtain multiple historical game card combinations, calculate the similarity value between each game card combination and each of the historical game card combinations, and compare each of the similarity values ​​with a preset similarity threshold. If all the similarity values ​​are less than the preset similarity threshold, the game card combination is determined to satisfy the diversity strategy; if all the similarity values ​​are greater than or equal to the preset similarity threshold, the game card combination is determined not to satisfy the diversity strategy. The iterative recombination optimization processing module is used for: If the game card combination does not meet the requirements of a diverse strategy, the game card combination is subjected to iterative reorganization and optimization.

[0063] This application also provides an electronic device, which can integrate a game card combination generation device based on a genetic algorithm provided in this application. Figure 6This is a schematic diagram of the structure of a game card combination generation device based on a genetic algorithm provided in an embodiment of this application. (Refer to...) Figure 6 The device for generating game card combinations based on a genetic algorithm includes: an input device 43, an output device 44, a memory 42, and one or more processors 41; the memory 42 is used to store one or more programs; when one or more programs are executed by one or more processors 41, the one or more processors 41 implement the game card combination generation method based on the genetic algorithm provided in the above embodiment. The input device 43, output device 44, memory 42, and processors 41 can be connected via a bus or other means. Figure 6 Taking the example of a connection between China and Israel via a bus.

[0064] The memory 42, as a computing device readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the game card combination generation method based on genetic algorithms provided in any embodiment of this application. The memory 42 may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the device, etc. Furthermore, the memory 42 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 42 may further include memory remotely located relative to the processor 41, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0065] Input device 43 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 44 may include display devices such as a display screen.

[0066] The processor 41 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 42, thereby realizing the above-mentioned method for generating game card combinations based on genetic algorithms.

[0067] The above-described apparatus, device, and computer for generating game card combinations based on genetic algorithms can be used to execute the method for generating game card combinations based on genetic algorithms provided in any of the above embodiments, and have corresponding functions and beneficial effects.

[0068] This application embodiment also provides a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform the method for generating game card combinations based on a genetic algorithm as provided in the above embodiment. The method for generating game card combinations based on a genetic algorithm includes: Obtain a set of game cards, calculate the first fitness value of each game card in the set according to the constructed objective function, and determine multiple target cards in the set based on the first fitness value; Multiple target cards are recombined to generate multiple recombined cards. The number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations are determined. The ability value range of the recombined cards is adjusted according to the target adjustment coefficient and the minimum ability value range corresponding to the type of the recombined card to generate a target mutation range. The target mutation probability associated with the target mutation range is determined. The recombined cards whose target mutation probability exceeds the preset mutation probability threshold are identified as target recombined cards. Mutation operations are performed on the target recombined cards to generate multiple mutated cards. The multiple mutated cards are then merged with the multiple target cards to generate a game card combination.

[0069] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROMs, floppy disks, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disks or optical storage); registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. Furthermore, storage media may reside in a first computer system in which a program is executed, or may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media that may reside in different locations (e.g., in different computer systems connected via a network). Storage media may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.

[0070] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the method for generating game card combinations based on genetic algorithms as described above, but can also execute related operations in the method for generating game card combinations based on genetic algorithms provided in any embodiment of this application.

[0071] The game card combination generation apparatus, device, and storage medium based on genetic algorithms provided in the above embodiments can execute the game card combination generation method based on genetic algorithms provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the game card combination generation method based on genetic algorithms provided in any embodiment of this application.

[0072] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.

Claims

1. A method for generating game card combinations based on a genetic algorithm, characterized in that, include: Obtain a set of game cards, calculate the first fitness value of each game card in the set according to the constructed objective function, and determine multiple target cards in the set based on the first fitness value; Multiple target cards are recombined to generate multiple recombined cards. The number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations are determined. The ability value range of the recombined cards is adjusted according to the target adjustment coefficient and the minimum ability value range corresponding to the type of the recombined card to generate a target mutation range. The target mutation probability associated with the target mutation range is determined. The recombined cards whose target mutation probability exceeds the preset mutation probability threshold are identified as target recombined cards. Mutation operations are performed on the target recombined cards to generate multiple mutated cards. The multiple mutated cards are then merged with the multiple target cards to generate a game card combination.

2. The game card combination generation method based on genetic algorithm according to claim 1, characterized in that, The step of adjusting the ability value range of the reconstituted card according to the target adjustment coefficient and the minimum ability value range corresponding to the type of the reconstituted card to generate the target mutation range includes: The range of ability values ​​of the recombined card is narrowed according to the target adjustment coefficient to generate a target range. The minimum ability value range corresponding to the type of the recombined card is compared with the target range. If the target range includes the minimum capability value range, the target range is determined as the target variation range; if the target range does not include the minimum capability value range, the target variation range is generated based on the boundary values ​​of the target range and the boundary values ​​of the minimum capability value range.

3. The game card combination generation method based on genetic algorithm according to claim 1, characterized in that, After generating multiple mutated cards, the process also includes: The second fitness value of the plurality of mutated cards is calculated according to the objective function, and a plurality of target mutated cards are determined according to the second fitness value and the type of each mutated card; Accordingly, merging the plurality of mutated cards with the plurality of target cards to generate a game card combination includes: The multiple target mutated cards are merged with the multiple target cards to generate a game card combination.

4. The game card combination generation method based on genetic algorithm according to claim 3, characterized in that, Before merging the populations of the multiple target variant cards with the multiple target cards, the method further includes: Sort the first fitness values ​​corresponding to the multiple target cards, determine the target cards to be merged based on the sorting results, sort the second fitness values ​​corresponding to the multiple target mutated cards, and determine the target mutated cards to be merged based on the sorting results. Accordingly, the plurality of target mutated cards are merged with the plurality of target cards to generate a game card combination, including: The target cards to be merged are combined with the target mutated cards to be merged to generate game card combinations.

5. The game card combination generation method based on genetic algorithm according to claim 3, characterized in that, The step of determining multiple target mutant cards based on the second fitness value and the type of each mutant card includes: Multiple first target mutant cards are determined based on the second fitness value and the preset number of mutant cards. Mutant cards are then filtered according to the type of each first target mutant card to obtain multiple second target mutant cards. The types of the multiple second target mutant cards are various.

6. The game card combination generation method based on genetic algorithm according to claim 1, characterized in that, Before acquiring the game card set, the following is also included: Obtain game card information, which includes game card set, game card ability, and card combination constraints; Set the decision variables corresponding to the game card set, determine the target ability value in the game card ability according to the preset game objective, and construct the objective function according to the card combination constraints, the target ability value and the decision variables.

7. The game card combination generation method based on genetic algorithm according to claim 1, characterized in that, After generating the game card combination, the following is also included: Obtain multiple historical game card combinations, calculate the similarity value between each game card combination and each of the historical game card combinations, and compare each of the similarity values ​​with a preset similarity threshold. If all the similarity values ​​are less than the preset similarity threshold, the game card combination is determined to satisfy the diversity strategy; if all the similarity values ​​are greater than or equal to the preset similarity threshold, the game card combination is determined not to satisfy the diversity strategy. If the game card combination does not meet the requirements of a diverse strategy, the game card combination is subjected to iterative reorganization and optimization.

8. A game card combination generation device based on a genetic algorithm, characterized in that, include: The target card determination module is used to obtain a set of game cards, calculate the first fitness value of each game card in the set of game cards according to the constructed objective function, and determine multiple target cards in the set of game cards based on the first fitness value. The card recombination module is used to recombine the multiple target cards to generate multiple recombined cards. A capability value range adjustment module is used to determine the number of iterations of the recombination operation and the target adjustment coefficient corresponding to the number of iterations, adjust the capability value range of the recombination card according to the target adjustment coefficient and the minimum capability value range corresponding to the type of the recombination card, generate a target mutation range, and determine the target mutation probability associated with the target mutation range; The mutation operation module is used to identify recombinant cards whose target mutation probability exceeds the preset mutation probability threshold as target recombinant cards, perform mutation operations on the target recombinant cards, and generate multiple mutated cards. The card combination generation module is used to merge the multiple mutated cards with the multiple target cards to generate game card combinations.

9. An electronic device, the device comprising: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the game card combination generation method based on genetic algorithms as described in any one of claims 1-7.

10. A storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the game card combination generation method based on a genetic algorithm as described in any one of claims 1-7.