A data processing method and system based on fitness function and storage medium
By using a fitness function-based data processing method and data techniques from the embodiments, the problem of low efficiency in card lineup design in existing card games is solved, and automated lineup configuration and game parameter optimization are achieved.
Patent Information
- Application Number
- CN202111057821.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-09
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2041-09-09
AI Technical Summary
The design of lineup combinations in existing card games is inefficient, requiring a lot of manual adjustments and testing, resulting in wasted resources and low game production efficiency.
A data processing method based on fitness function is adopted, which uses genetic algorithm and fitness function to automatically configure lineup combination. The fitness function is adjusted by lineup combat power and win rate to select reasonable lineup combination.
It improves the rationality and efficiency of card game lineup combinations, reduces the time and resource consumption of manual adjustments, and provides developers with game parameter references.
Smart Images

Figure CN113893547B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a data processing method and system based on fitness function and a storage medium. BACKGROUND
[0002] Card game is the mainstream of domestic mobile game market. It is carried out in rounds and the round is carried out according to a certain architecture. The basic structure includes: restart, making all cards become the state of a new round; draw cards, putting cards in the deck on the hand, which means that these cards may have effects; use, using the cards on the hand to affect the game; conflict, using the resources available to the card hand to fight, generally, winning in the conflict is the main means to win the game; end, generally, in this stage, the effects of the cards used in the round will end, and the card hand will discard the excess cards in their hand to control the number of cards in the hand.
[0003] In the card game, the configuration of the card formation combination determines the difficulty and playability of the whole game. Unreasonable card formation configuration will affect the interest of the players, and too strong formation will make the players feel boring because of the lack of challenge. In addition, different combinations of various card heroes can bring more freshness to the game. Therefore, generating a rich and interesting card formation with moderate difficulty has become a crucial link in card game design.
[0004] At present, the card formation combination generation in the card game is generally generated by manual configuration method. Manual configuration method is that relevant planners and designers with professional knowledge participate, design card formation combination scheme in game level in advance, and continuously debug and modify through manual repeated test and adjust difficulty to achieve the expected effect. This is the most direct card formation combination scheme design method. Because of manual configuration, the formation combination design of traditional card game needs the cooperation of multiple manual workers, and needs repeated adjustment and test by manual. Such design is often inefficient, and the design time of formation combination scheme is often long, which undoubtedly consumes a lot of manpower and other resources, greatly reduces the overall game production efficiency, and the high design cost greatly limits the playable game time of a card game. SUMMARY
[0005] The present application provides a data processing method and system based on fitness function, which improves the rationality of formation combination in card game through fitness function and provides reference for developers to set game parameters.
[0006] The first aspect of the present application provides a data processing method based on fitness function, comprising:
[0007] According to the formation combination rule, a first formation combination set is constructed; wherein the first formation combination set includes a plurality of first formation combinations, and each first formation combination includes a preset number of gene information;
[0008] Each first formation combination of the first formation combination set is interactively processed with the current level to obtain a pass rate of the first formation combination set, and the fitness function to be adjusted is adjusted according to the formation strength of each first formation combination and the pass rate;
[0009] According to the adjusted fitness function, the first formation combination set is subjected to formation screening processing to obtain a second formation combination set; wherein the second formation combination set includes a plurality of second formation combinations, and each second formation combination includes a preset number of gene information.
[0010] Further, the second formation combination set obtained by the first formation combination set according to the adjusted fitness function includes:
[0011] According to the gene information of the first formation combination, a preset number of attribute information is generated;
[0012] Based on a plurality of attribute information, a first generation formation combination set including a plurality of first generation formation combinations is generated;
[0013] The fitness of each first generation formation combination in the first generation formation combination set is calculated;
[0014] The second formation combination set is established based on the first generation formation combination whose fitness meets a preset fitness value.
[0015] Further, after the first formation combination set is constructed, it includes:
[0016] According to the genetic algorithm, the first formation combination set is iteratively updated, and the updated formation combination is used to replace the first formation combination in the first formation combination set.
[0017] Further, the first formation combination set is iteratively updated according to the genetic algorithm, which includes:
[0018] According to the genetic algorithm, the first formation combination is subjected to gene information crossover processing and gene information mutation processing to obtain an updated formation combination;
[0019] It is judged whether the iteration number of the iterative update meets a preset number;
[0020] If not, the first formation combination is iteratively processed according to the genetic algorithm until the iteration number of the iterative processing meets an iteration number threshold;
[0021] If yes, the first lineup combination in the first lineup combination set is replaced by an updated lineup combination.
[0022] Further, the adjusting the fitness function to be adjusted currently according to the lineup strength of the corresponding first lineup and the pass-through winning rate comprises:
[0023] setting an initial value of the fitness function;
[0024] judging the size of the pass-through winning rate and a preset target winning rate;
[0025] if the pass-through winning rate is greater than the preset target winning rate, a fitness function value is calculated according to the lineup strength and the pass-through winning rate of the second lineup combination;
[0026] if the pass-through winning rate is less than or equal to the preset target winning rate, a fitness function value is calculated according to the initial value of the fitness function and the pass-through winning rate.
[0027] Further, the calculating the fitness function value according to the lineup strength and the pass-through winning rate of the second lineup combination is represented by the following formula:
[0028] AG = sorce × (1-CW) ;
[0029] wherein, AG is the fitness function value, sorce is the lineup strength of the second lineup combination, and CW is the pass-through winning rate;
[0030] the calculating the fitness function value according to the initial value of the fitness function and the pass-through winning rate is represented by the following formula:
[0031] AG = AG f × (1-CW) ;
[0032] wherein, AG is the fitness function value, AG f is the initial value of the fitness function, and CW is the pass-through winning rate.
[0033] The second aspect of the present application provides a data processing system based on a fitness function, comprising:
[0034] a first lineup combination set construction module, configured to construct a first lineup combination set according to a lineup combination rule; wherein the first lineup combination set comprises a plurality of first lineup combinations, and each first lineup combination comprises a preset number of gene information;
[0035] a fitness function adjustment module, configured to interact each first lineup in the first lineup combination set with a current level to obtain a pass-through winning rate of the first lineup combination set, and adjust a fitness function to be adjusted currently according to the lineup strength of each first lineup combination and the pass-through winning rate;
[0036] The fitness function operation module is configured to perform lineup screening processing on the first lineup combination set according to the adjusted fitness function, and obtain a second lineup combination set; wherein the second lineup combination set includes a plurality of second lineup combinations, and each second lineup combination includes a preset number of gene information.
[0037] Further, the fitness function operation module is specifically configured to:
[0038] generate a preset number of attribute information according to the gene information of the first lineup combination;
[0039] generate a first-generation lineup combination set including a plurality of first-generation lineup combinations based on the plurality of attribute information;
[0040] calculate the fitness of each first-generation lineup combination in the first-generation lineup combination set;
[0041] establish the second lineup combination set based on the first-generation lineup combination whose fitness meets a preset fitness value.
[0042] The third aspect of the present application provides an electronic device, including a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, when the processor executes the computer program, the data processing method based on the fitness function as described in any one of the first aspect is realized.
[0043] The fourth aspect of the present application provides a computer readable storage medium, characterized in that the computer readable storage medium includes a stored computer program, wherein when the computer program runs, the device where the computer readable storage medium is located is controlled to execute the data processing method based on the fitness function as described in any one of the first aspect.
[0044] Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows:
[0045] The application provides a data processing method and system based on a fitness function and a storage medium, and the method comprises the following steps: constructing a first formation combination set according to a formation combination rule; wherein the first formation combination set comprises a plurality of first formation combinations, and each first formation combination comprises a preset number of gene information; each first formation combination of the first formation combination set is interactively processed with a current level to obtain a pass rate of the first formation combination set, and a fitness function to be adjusted at present is adjusted according to the formation strength of each first formation combination and the pass rate; the first formation combination set is subjected to formation screening processing according to the adjusted fitness function to obtain a second formation combination set; wherein the second formation combination set comprises a plurality of second formation combinations, and each second formation combination comprises a preset number of gene information. The fitness function is adjusted according to the formation strength and the pass rate of the constructed formation, and the appropriate formation is selected through the adjusted fitness function, so that the rationality of the formation combination in the card game can be improved, and the game parameters set by the developer are provided with reference. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0047] Figure 1 is a schematic diagram of an application environment provided by an embodiment of the present application;
[0048] Figure 2 is a flowchart of a data processing method based on a fitness function provided by an embodiment of the present application;
[0049] Figure 3 is a structural diagram of a data processing system based on a fitness function provided by an embodiment of the present application;
[0050] Figure 4 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0052] It is to be understood that the step numbers used herein are for the convenience of description only and are not intended to limit the order in which the steps are performed.
[0053] It is to be understood that the terms used in the present specification are merely for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the specification and the appended claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0054] The terms "comprise" and "include" mean that the described feature, integer, step, operation, element, or component is present, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0055] The term "and / or" means any combination of one or more of the associated listed items and all possible combinations thereof.
[0056] Genetic Algorithm is a computational model simulating the natural selection and genetic mechanism of Darwin's biological evolution process, and is a method of searching for an optimal solution by simulating the natural evolution process. Genetic Algorithm starts from a population representing a set of potential solutions to a problem, and the population is composed of a certain number of individuals encoded by genes. Each individual is actually an entity with characteristics of chromosomes. Chromosomes, as the main carrier of genetic material, are a collection of multiple genes, and their internal performance (i.e. genotype) is a certain combination of genes, which determines the external performance of the individual, such as the characteristic of black hair. Therefore, it is necessary to implement the mapping from phenotype to genotype, i.e. encoding work at the beginning. Since the work of imitating gene coding is complex, it is often simplified, such as using binary coding. After the initial population is generated, the better and better approximate solutions are generated through the evolution of generations according to the principle of survival of the fittest and survival of the fittest. In each generation, individuals are selected according to their fitness in the problem domain, and crossover and mutation are performed by means of genetic operators to generate a population representing a new set of solutions. This process will result in a population that is more adapted to the environment than the previous generation, and the optimal individual in the final population can be decoded to serve as an approximate optimal solution to the problem.
[0057] The fitness function is used to evaluate the ability of individuals to adapt to the environment, and is often used in the selection operation, and whether the selection is appropriate directly affects the performance of the genetic algorithm, so many fitness functions are formed, and the fitness function is improved to make the fitness better reflect the advantages and disadvantages of individuals, so that individuals with low fitness are eliminated and individuals with high fitness are retained. The adaptive fitness function can be adjusted adaptively with the increase of the population algebra. In the initial stage of the algorithm, the fitness difference is large, in order to prevent some individuals with poor fitness from being lost at the beginning, the fitness function can be changed to make them be retained. In addition, when the population converges, the fitness difference is small, at this time, in order to speed up the convergence speed, the fitness should be adjusted to make the individual fitness difference increase, so as to converge to the global optimal solution faster. Common fitness transformation methods include linear transformation, power function transformation and exponential transformation.
[0058] The present application uses genetic algorithm and fitness function to generate formation combination in card game, however, the present application is not only suitable for card game, but also suitable for game needing formation combination configuration.
[0059] Therefore, the present application provides a data processing method based on fitness function, which can automatically configure formation combination, and analyze the formation combination, based on the game analysis result, the developer can adjust the numerical value in the game.
[0060] Please refer to Figure 1 , Figure 1 A schematic diagram of an application environment provided by the embodiment of the present application is shown in Figure 1 The application environment can include a business server 01, a data processing component 02 and a client 03.
[0061] In the embodiment of the present application, the business server 01 can be used to generate a data processing method based on fitness function, and the data processing method includes:
[0062] According to the formation combination rule, a first formation combination set is constructed. The first formation combination set includes a plurality of first formation combinations, and each first formation combination includes a preset number of gene information.
[0063] Each first formation combination of the first formation combination set is interactively processed with the current level, the pass rate of the first formation combination set is obtained, and the fitness function to be adjusted is adjusted according to the formation combat power of each first formation combination and the pass rate.
[0064] According to the adjusted fitness function, lineup screening processing is performed on the first lineup combination set to obtain a second lineup combination set. The second lineup combination set includes a plurality of second lineup combinations, and each second lineup combination includes a preset number of gene information.
[0065] The embodiments of the present application can improve the rationality of lineup combinations in card games by adjusting the fitness function according to the lineup strength and the pass-through win rate of the constructed lineup and selecting a suitable lineup through the adjusted fitness function, thereby providing a reference for developers to set game parameters.
[0066] The server involved in the present application can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal device can be a smartphone, a tablet computer, a notebook computer, a palm computer, a personal computer, a smart television, a smart watch, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application. The number of servers and terminal devices is also not limited.
[0067] In the embodiments of the present application, the data processing component 02 can be used to execute the data processing method. The data processing component 02 can be located in the business server 01 or in another business server. When the data processing component 02 is located in another business server, the business server 01 can access the other business server through a network or the like to obtain the index data corresponding to the field generated by the data processing component 02 in the other business server.
[0068] The following specifically introduces embodiment 1 of the data processing method based on the fitness function. Please refer to Figure 2 , Figure 2 is a flowchart of a data processing method based on a fitness function provided by the present application, comprising:
[0069] S100, according to the lineup combination rule, a first lineup combination set is constructed. The first lineup combination set includes a plurality of first lineup combinations, and each first lineup combination includes a preset number of gene information.
[0070] It should be noted that the lineup combination rule can be different for different test levels, or some test levels can have the same lineup combination rule, or all test levels can have the same lineup combination rule. For example, the lineup combination rule is that 6 heroes form a lineup combination, and each hero has a corresponding configuration.
[0071] The first lineup combination satisfies the lineup combination rule. The gene information includes: a hero and a corresponding configuration of each hero; wherein the corresponding configuration includes: a soul ring, a soul bone, and an attribute. The hero has a corresponding occupation, the soul ring has a corresponding soul ring year / soul ring level, and the soul bone has a corresponding soul bone level. There are 6 gene information in the first lineup combination.
[0072] It can be understood that the number of first lineup combinations in the first lineup combination set varies with the number of heroes in the hero pool and the complexity of the lineup combination rule. Specifically, the more the number of heroes in the hero pool and / or the lower the complexity of the lineup combination rule, the more the number of first lineup combinations that can be generated. Because there are many heroes, there are many first lineup combinations that satisfy the lineup combination rule, so a number of first lineup combinations are screened to find the most suitable lineup combination for passing the current level, wherein the most suitable can be understood as the lineup combination that can pass the level with a certain win rate and the lowest battle force value.
[0073] S200, each first lineup combination of the first lineup combination set is interactively processed with the current level to obtain a pass rate of the first lineup combination set, and the fitness function to be adjusted is adjusted according to the lineup battle force of each first lineup combination and the pass rate.
[0074] It should be noted that the interactive processing means that the mutant gene information lineup combination is used to fight the PVE (Player VS Environment) of the current test level. By fighting each first lineup combination of the first lineup combination set with the current level, the win / loss situation of each first lineup combination is obtained, and the pass rate of each first lineup combination is obtained according to the win / loss situation of all first lineup combinations.
[0075] The lineup battle force is calculated by the combination of heroes and their gene information, and the battle force query result is directly output by the server interface. The calculation method of the lineup battle force is pre-stored on the server side, which includes but is not limited to adding all the gene information of the heroes, assigning different weights to each gene information sum, multiplying the weights and weights, and accumulating.
[0076] S300, lineup screening processing is performed on the first lineup combination set according to the adjusted fitness function, to obtain a second lineup combination set. The second lineup combination set includes a plurality of second lineup combinations, and each second lineup combination includes a preset number of gene information.
[0077] It should be noted that the fitness function is a calculation method for calculating fitness. Specifically:
[0078] The first lineup combination interacts with the current test level, that is, the first lineup combination interacts with the current test level in PVE battle. When the first lineup combination interacts with the current test level in PVE battle, the first lineup combination with a win rate higher than a preset win rate value is recorded as a second lineup combination, and all second lineup combinations are combined to form a second lineup combination set. When the first lineup combination interacts with the current test level in PVE battle, the win rate generated can represent the fitness of the first lineup combination; the higher the win rate, the higher the fitness of the lineup combination.
[0079] It can be understood that each first lineup combination in the first lineup combination set interacts with the current test level in PVE battle. For example, there are 54 card heroes, and each lineup combination has 6 heroes, so that 25827165 first lineup combinations can be formed, and the current test level is 50000. The first lineup combination interacts with the current test level in PVE battle 50000 times, that is, the maximum win is 50000, and the preset win rate value is 10%, that is, the first lineup combination that meets the win rate of 5000 is recorded as a second lineup combination, and all second lineup combinations are combined to form a second lineup combination set.
[0080] The data processing method based on the fitness function provided in embodiment 1 of the application improves the rationality of the lineup combination in the card game, and provides a reference for the developer to set the game parameters.
[0081] In embodiment 2 of the application, steps S100-S300 are the same as steps S100-S300 in embodiment 1, preferably, step S300 includes:
[0082] S310, generating a preset number of attribute information according to the gene information of the first lineup combination.
[0083] It should be noted that the gene information of the first lineup combination includes the hero and the attribute information of each hero; wherein the attribute information includes soul ring, soul bone and attribute. The hero has a corresponding occupation, the soul ring has a corresponding soul ring year / soul ring level, and the soul bone has a corresponding soul bone level. The first lineup combination has 6 gene information.
[0084] It can be understood that the hero's profession includes: defense type hero, strong attack type hero, sensitive attack type hero, control type hero and auxiliary type hero; the attribute information of the hero includes: soul ring, soul bone, attribute, etc.; specifically, the total number of hero cards is 54, the total number of soul rings is 1576, the total number of soul bones is 297, the attribute is divided into basic attribute and special attribute, the basic attribute includes attack, defense value, life value, speed, critical rate and mental force, etc., the special attribute includes damage value and competition damage value. For example, the basic attribute of the hero "Tang San" is: attack 257, defense value 184, life value 2383, speed 116.34, critical rate 10.00% and mental force 108, and its special attribute is: damage value 150.00%, competition damage 0.00%, its first soul bone is winding, and the winding soul ring is 1000 years, and its second soul bone is parasitic, and the parasitic soul ring is 500 years.
[0085] S320, based on a plurality of attribute information, generating a first team combination set containing a plurality of first team combinations.
[0086] It should be noted that the generation of the first team combination is an intermediate step from the generation of the second team combination from the first team combination, the first team combination is contained in the first team combination, and the second team combination is contained in the first team combination.
[0087] It can be understood that each hero is equipped with respective attribute information according to all attribute information, and the equipped hero is composed into a team combination according to the team combination rule, based on which the first team combination is generated.
[0088] S330, calculating the fitness of each first team combination in the first team combination set.
[0089] It can be understood that the method of calculating the fitness is the same as the method of calculating the fitness in embodiment 1. That is, the first team combination is interacted with the current test level, that is, the first team combination is PVE fought with the current test level, wherein the current test level is set by the developer, and the number of current test levels is large. When PVE is fought with the current test level, the first team combination with a win rate higher than a preset win rate value is recorded as a second team combination, and all second team combinations are combined into a second team combination set. When the first team combination fights against the recommended team combination, the generated win rate can represent the fitness of the first team combination; the higher the win rate, the higher the fitness of the team combination.
[0090] S340, establishing a second team combination set based on the first team combination whose fitness meets a preset fitness value.
[0091] It can be understood that each of the first formation combination in the first formation combination set is matched with the current test level for PVE battle. Exemplarily, the card hero is 54, and each formation combination has 6 heroes, so that 25827165 first formation combinations can be formed, and the current test level is 50000, and 25827165 first formation combinations are matched with 50000 current test levels for PVE battle, each first formation combination needs to battle 50000 times, the maximum winning round is 50000, the preset winning rate value is 97.78%, and the first formation combination meeting the battle winning round of 48890 is recorded as a second formation combination, and all the second formation combinations are combined to form a second formation combination set.
[0092] The data processing method based on the fitness function provided in the embodiment 2 of the application improves the rationality of the formation combination in the card game through the fitness function, and provides a reference for the developer to set the game parameters. In the process of generating the second formation combination set from the first formation combination set, the first formation combination set is generated first to improve the balance of the game and improve the complexity of the game and the playability of the user.
[0093] In the embodiment 3 of the application, the steps S100-S300 are the same as the steps S100-S300 in the embodiment 1, and preferably, the step S100 further includes:
[0094] S110, according to the genetic algorithm, iteratively updating the first formation combination set, and replacing the first formation combination in the first formation combination set with the updated formation combination.
[0095] It can be understood that the data obtained by processing the first formation combination through the genetic algorithm will increase with the number of iterations.
[0096] In a specific embodiment of the embodiment 3, the step S110 includes:
[0097] S111, according to the genetic algorithm, performing gene information crossover processing and gene information mutation processing on the first formation combination to obtain an updated formation combination.
[0098] It should be noted that the gene information crossover processing on the first formation combination is to perform crossover processing on the gene information in a plurality of first formation combinations. The gene information mutation processing on the crossover gene information formation combination is to perform mutation processing on the gene information in a plurality of crossover gene information formation combinations. The gene information is the role information configured.
[0099] Exemplarily, taking two first formation combinations for gene information crossover processing as an example:
[0100] The first lineup combination A includes: card 1001, card 1002, card 1003, card 1004, card 1005, card 1006;
[0101] The first lineup combination B includes: card 2001, card 2002, card 2003, card 2004, card 2005, card 2006;
[0102] The first lineup combination A and the first lineup combination B are subjected to genetic information crossover processing to obtain a crossover genetic information lineup combination; wherein the crossover genetic information lineup combination includes: crossover genetic information lineup combinations C and D;
[0103] The crossover genetic information lineup combination C includes: card 1001, card 1002, card 1003, card 2004, card 2005, card 2006;
[0104] The crossover genetic information lineup combination D includes: card 1004, card 1005, card 1006, card 2001, card 2002, card 2003;
[0105] For example, the above-mentioned crossover genetic information lineup combination C is subjected to genetic information mutation processing:
[0106] The crossover genetic information lineup combination C includes: card 1001, card 1002, card 1003, card 2004, card 2005, card 2006;
[0107] The crossover genetic information lineup combination C is subjected to genetic information mutation processing to obtain a mutation genetic information lineup combination E:
[0108] The mutation genetic information lineup combination E includes: card 1001, card 1002, card 1003, card 2004, card 2005, card 3006. Wherein, the card 3006 is a mutant gene.
[0109] S112, judge whether the iteration number of the iteration update meets a preset number.
[0110] S113, if not, continue to perform iteration processing on the first lineup combination according to the genetic algorithm until the number of iteration processing meets an iteration number threshold.
[0111] S114, if yes, replace the first lineup combination in the first lineup combination set with the updated lineup combination.
[0112] It should be noted that the iteration calculation is set to increase the number of processing of the first lineup combination by the genetic algorithm, and the purpose is to expand the data of genetic information and more accurately find the global optimal lineup combination.
[0113] The data processing method based on fitness function provided by the embodiment 3 of the present application uses gene combination and evolution to replace exhaustive search through genetic algorithm, and realizes heuristic search of the first team combination through gene mutation and crossing, and finally can find the global optimal team combination with great convergence, less calculation time and high robustness.
[0114] In the embodiment 4 of the present application, the steps S100-S300 are the same as the steps S100-S300 in the embodiment 1, and preferably, the fitness function adjustment process in the step S200 comprises:
[0115] S510, setting an initial value of the fitness function.
[0116] S520, judging the size of the pass-through win rate and the preset target win rate.
[0117] S530, if the pass-through win rate is greater than the preset target win rate, calculating the fitness function value according to the team strength of the second team combination and the pass-through win rate.
[0118] S540, if the pass-through win rate is less than or equal to the preset target win rate, calculating the fitness function value according to the initial value of the fitness function and the pass-through win rate.
[0119] It should be noted that the preset target win rate is set by the developer and can be adjusted at any time according to the actual situation. The above steps are used to find the lowest strength combination that can achieve a certain win rate. In the Douluo platform, to find the lowest strength combination that can achieve a certain win rate, first set a larger initial value of the fitness function; if the win rate of the team is greater than the target win rate, the fitness function value is the team strength*(1-current team win rate); if the win rate of the team does not reach the target win rate, the fitness function value is the initial value of the fitness function*(1-current team win rate); such fitness function setting can comprehensively consider the factors of strength and win rate.
[0120] Preferably, the calculation of the fitness function value according to the team strength of the second team combination and the pass-through win rate is represented by the following formula:
[0121] AG=sorce*(1-CW);
[0122] Wherein, AG is the fitness function value, sorce is the team strength of the second team combination, and CW is the pass-through win rate.
[0123] The calculation of the fitness function value according to the initial value of the fitness function and the pass-through win rate is represented by the following formula:
[0124] AG=AG fx(1-CW);
[0125] AG is a fitness function value, AG f is an initial value of the fitness function, and CW is a pass rate.
[0126] The data processing method based on a fitness function provided in Embodiment 4 of the present application improves the rationality of formation combination in card games, assists developers in adjusting numerical values in games, and uses genetic combination and evolution to replace exhaustive search through a genetic algorithm and a fitness function, thereby realizing heuristic search on the first formation combination through gene mutation and crossover, and finally finding a globally optimal formation combination with a high probability, good convergence, less calculation time, and high robustness.
[0127] The second aspect.
[0128] Please refer to Figure 3 Embodiment 5 of the present application provides a data processing system based on a fitness function, which comprises:
[0129] A first formation combination set construction module 100 is configured to construct a first formation combination set according to a formation combination rule. The first formation combination set comprises a plurality of first formation combinations, and each first formation combination comprises a preset number of gene information.
[0130] It should be noted that the formation combination rule can be different for different test levels, or can be the same for some test levels, or can be the same for all pass levels. For example, the formation combination rule is that six heroes form a formation combination, and each hero has a corresponding configuration.
[0131] The first formation combination satisfies the formation combination rule. The gene information includes heroes and corresponding configurations of each hero. The corresponding configuration includes a soul ring, a soul bone, and an attribute. A hero has a corresponding occupation, a soul ring has a corresponding soul ring year / soul ring level, and a soul bone has a corresponding soul bone level. There are six gene information in the first formation combination.
[0132] It can be understood that the number of first formation combinations in the first formation combination set changes with the number of heroes in the hero pool and the complexity of the formation combination rule. Specifically, the more the number of heroes in the hero pool and / or the lower the complexity of the formation combination rule, the more the number of first formation combinations that can be generated. Since there are a large number of heroes, there are a large number of first formation combinations that satisfy the formation combination rule. Therefore, the following steps are used to screen a plurality of first formation combinations to find the most suitable formation combination for passing the current level. The most suitable formation combination can be understood as a formation combination that can pass the level with a certain pass rate and has the lowest battle force value.
[0133] The fitness function adjustment module 200 is configured to interact each first lineup combination in the first lineup combination set with the current level to obtain a pass rate of the first lineup combination set, and adjust the fitness function to be adjusted according to the lineup strength of each first lineup combination and the pass rate.
[0134] It should be noted that the interaction processing means that the first lineup combination is used to fight against the current test level in PVE (Player VS Environment). By fighting each first lineup combination in the first lineup combination set against the current level, the win or lose of each first lineup combination is obtained, and the pass rate corresponding to the first lineup is obtained according to the win or lose of all first lineup combinations.
[0135] The lineup strength is calculated by the combination of heroes and their gene information, and the strength query result is directly output by the server interface. The calculation method of the lineup strength is pre-stored on the server side, and the calculation method of the lineup strength includes but is not limited to adding all the gene information of the heroes, assigning different weights to each gene information sum, multiplying the weight and the weight, and accumulating.
[0136] The fitness function operation module 300 is configured to perform lineup screening processing on the first lineup combination set according to the adjusted fitness function to obtain a second lineup combination set; wherein the second lineup combination set includes a plurality of second lineup combinations, and each second lineup combination includes a preset number of gene information.
[0137] It should be noted that the fitness function is a calculation method for calculating fitness. Specifically,
[0138] The first lineup combination is interacted with the current test level, that is, the first lineup combination is fought against the current test level in PVE. When fighting against the current test level in PVE, the first lineup combination with a higher pass rate than the preset pass rate value is recorded as a second lineup combination, and all second lineup combinations are combined to form a second lineup combination set. When the first lineup combination fights against the current test level in PVE, the generated pass rate can represent the fitness of the first lineup combination; if the pass rate is higher, the fitness of the lineup combination is higher.
[0139] It can be understood that each first formation combination in the first formation combination set is matched with the current test level for PVE battle. Exemplarily, the card hero is 54, and each formation combination has 6 heroes, so that 25827165 first formation combinations can be formed, the current test level is 50000, 25827165 first formation combinations are matched with 50000 current test levels respectively for PVE battle, each first formation combination needs to battle 50000 times, the maximum winning round is 50000, the preset winning rate value is 97.78%, that is, the first formation combination meeting the winning round of 48890 for battle is recorded as a second formation combination, and all the second formation combinations are combined to form a second formation combination set.
[0140] The embodiment 5 of the present application provides a data processing system based on fitness function, which improves the rationality of formation combination in card game through fitness function, and provides reference for game parameter setting of developers.
[0141] In the embodiment 6 of the present application, the step modules 100-300 are the same as the modules 100-300 in the embodiment 5, and preferably, the fitness function operation module 300 is specifically used for:
[0142] The preset number of attribute information is generated according to the gene information of the first formation combination.
[0143] It should be noted that the gene information of the first formation combination is the attribute information of the hero and each hero; wherein the attribute information includes soul ring, soul bone and attribute. The hero has a corresponding occupation, the soul ring has a corresponding soul ring year / soul ring level, and the soul bone has a corresponding soul bone level. The first formation combination has 6 gene information.
[0144] It can be understood that the occupation of the hero includes a defense type hero, an attack type hero, a control type hero, a control type hero and an auxiliary type hero; the attribute information of the hero includes a soul ring, a soul bone, an attribute and the like; specifically, the total number of hero cards is 54, the total number of soul rings is 1576, the total number of soul bones is 297, the attribute is divided into basic attribute and special attribute, the basic attribute includes attack, defense, life, speed, critical rate and mental force, and the special attribute includes damage value and competition damage value. Exemplarily, the basic attribute of the hero "Tang San" is: attack 257, defense 184, life 2383, speed 116.34, critical rate 10.00%, and mental force 108, and the special attribute is: damage value 150.00%, competition damage 0.00%, the first soul bone is winding, the winding soul ring is 1000 years, and the second soul bone is parasitic, and the parasitic soul ring is 500 years.
[0145] Based on the attribute information, a set of initial formation combinations is generated, wherein each initial formation combination comprises a plurality of heroes.
[0146] It should be noted that the initial formation combination is an intermediate step for generating a second formation combination from a first formation combination, wherein the initial formation combination is included in the first formation combination, and the second formation combination is included in the initial formation combination.
[0147] It can be understood that each hero is equipped with corresponding attribute information according to all attribute information, and the equipped heroes are combined into a formation combination according to the formation combination rule, and based on this, the initial formation combination is generated.
[0148] The fitness of each initial formation combination in the set of initial formation combinations is calculated.
[0149] It can be understood that the method for calculating the fitness is the same as the method for calculating the fitness in Embodiment 5. That is, the initial formation combination is interacted with the current test level, that is, the initial formation combination is PVE fought with the current test level, wherein the current test level is set by the developer, and the number of current test levels is large. When PVE fighting with the current test level, the initial formation combination with a win rate higher than a preset win rate value is recorded as a second formation combination, and all second formation combinations are combined into a set of second formation combinations. When the initial formation combination fights against the recommended formation combination, the generated win rate can represent the fitness of the initial formation combination; the higher the win rate, the higher the fitness of the formation combination.
[0150] Based on the initial formation combination with a fitness satisfying a preset fitness value, a set of second formation combinations is established.
[0151] It can be understood that each initial formation combination in the set of initial formation combinations is PVE fought with the current test level. For example, there are 54 card heroes, and each formation combination has 6 heroes, so that 25827165 initial formation combinations can be formed, and 50000 current test levels are provided, and 25827165 initial formation combinations are PVE fought with 50000 current test levels, and each initial formation combination needs to fight 50000 times, that is, the maximum win is 50000, and the preset win rate value is 97.78%, that is, the initial formation combination with a win of 48890 is recorded as a second formation combination, and all second formation combinations are combined into a set of second formation combinations.
[0152] The data processing system based on fitness function provided by the embodiment 6 of the present application improves the rationality of the formation combination in the card game through the fitness function, and provides a reference for the game parameter setting of the developer. The first formation combination set is generated to improve the balance of the game and the complexity of the game and the playability of the user in the process of generating the second formation combination set from the first formation combination set.
[0153] In the embodiment 7 of the present application, the modules 100-300 are the same as those in the embodiment 5, and preferably, the system further comprises:
[0154] The iteration updating module is configured to perform iteration updating on the first formation combination set according to the genetic algorithm, and replace the first formation combination in the first formation combination set with the updated formation combination.
[0155] It can be understood that the data obtained by performing the genetic algorithm on the first formation combination increases with the iteration times.
[0156] In a specific embodiment of the embodiment 7, the iteration updating module is specifically configured to:
[0157] According to the genetic algorithm, the first formation combination is subjected to gene information crossover processing and gene information mutation processing to obtain an updated formation combination.
[0158] It should be noted that the gene information crossover processing on the first formation combination is to perform crossover processing on the gene information in the first formation combination. The gene information mutation processing on the crossover gene information formation combination is to perform mutation processing on the gene information in the crossover gene information formation combination. The gene information is the completed role information.
[0159] For example, the gene information crossover processing is performed on two first formation combinations:
[0160] The first formation combination A includes: card 1001, card 1002, card 1003, card 1004, card 1005, and card 1006.
[0161] The first formation combination B includes: card 2001, card 2002, card 2003, card 2004, card 2005, and card 2006.
[0162] The first formation combination A and the first formation combination B are subjected to gene information crossover processing to obtain a crossover gene information formation combination, wherein the crossover gene information formation combination includes: crossover gene information formation combinations C and D.
[0163] The cross gene information lineup combination C includes: card 1001, card 1002, card 1003, card 2004, card 2005, and card 2006.
[0164] The cross gene information lineup combination D includes: card 1004, card 1005, card 1006, card 2001, card 2002, and card 2003.
[0165] An example is that the gene information mutation processing is performed on the cross gene information lineup combination C described above.
[0166] The cross gene information lineup combination C includes: card 1001, card 1002, card 1003, card 2004, card 2005, and card 2006.
[0167] The gene information variation processing is performed on the cross gene information lineup combination C, and a variation gene information lineup combination E is obtained.
[0168] The variation gene information lineup combination E includes: card 1001, card 1002, card 1003, card 2004, card 2005, and card 3006. The card 3006 is a mutation gene.
[0169] It is judged whether the iteration number of the iteration updating meets a preset number.
[0170] If not, the iteration processing is continuously performed on the first lineup combination according to the genetic algorithm, until the iteration number of the iteration processing meets an iteration number threshold.
[0171] If yes, the first lineup combination in the first lineup combination set is replaced by the updated lineup combination.
[0172] It should be noted that the iteration calculation is set, so that the processing number of the genetic algorithm on the first lineup combination is improved, and the purpose is to expand the gene information data and more accurately find the global optimal lineup combination.
[0173] The data processing system based on the fitness function provided in the embodiment 7 replaces the exhaustive search with the genetic algorithm and evolution by using gene combination and evolution, realizes the heuristic search on the first lineup combination through gene variation and cross, and finally can find the global optimal lineup combination with a larger probability, has good convergence, less calculation time, and high robustness.
[0174] In the embodiment 8 of the application, the modules 100-S300 are the same as the modules 100-300 in the embodiment 5, and preferably, the fitness function adjustment module 200 is specifically used for:
[0175] Setting an initial value of the fitness function.
[0176] determining whether the pass success rate is greater than a preset target success rate;
[0177] If the pass success rate is greater than the preset target success rate, a fitness function value is calculated according to the lineup strength of the second lineup combination and the pass success rate.
[0178] If the pass success rate is less than or equal to the preset target success rate, a fitness function value is calculated according to the fitness function initial value and the pass success rate.
[0179] It should be noted that the preset target success rate is set by the developer and can be adjusted at any time according to the actual situation. The above steps are used to find the lowest strength combination that can achieve a certain success rate. In the Douluo platform, to find the lowest strength combination that can achieve a certain success rate, first set a larger fitness function initial value; if the success rate of the lineup is greater than the target success rate, the fitness function value is the lineup strength*(1-current lineup success rate); if the success rate of the lineup does not reach the target success rate, the fitness function value is the fitness function initial value*(1-current lineup success rate); such fitness function setting can comprehensively consider the factors of strength and success rate.
[0180] Preferably, the fitness function value calculated according to the lineup strength of the second lineup combination and the pass success rate is represented by the following formula:
[0181] AG=sorce*(1-CW);
[0182] Wherein, AG is the fitness function value, sorce is the lineup strength of the second lineup combination, and CW is the pass success rate.
[0183] The fitness function value calculated according to the fitness function initial value and the pass success rate is represented by the following formula:
[0184] AG=AG f *(1-CW);
[0185] Wherein, AG is the fitness function value, AG f is the fitness function initial value, and CW is the pass success rate.
[0186] The data processing system based on the fitness function provided by the embodiment 8 improves the rationality of the lineup combination in the card game, assists the developer in adjusting the values in the game, and uses genetic combination and evolution instead of exhaustive search through the genetic algorithm and the fitness function. The heuristic search for the first lineup combination is realized through the mutation and crossover of genes, and finally the global optimal lineup combination can be found with a larger probability, which has good convergence, less calculation time, and high robustness.
[0187] Third aspect.
[0188] The application provides an electronic device, which comprises:
[0189] a processor, a memory and a bus;
[0190] the bus is used for connecting the processor and the memory;
[0191] the memory is used for storing operation instructions;
[0192] the processor is used for executing the operation corresponding to the data processing method based on the fitness function by calling the operation instructions and the executable instructions.
[0193] In an optional embodiment, an electronic device is provided, which comprises: Figure 4 as shown in the figure, Figure 4 The electronic device 5000 shown in the figure comprises a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are connected, for example, through a bus 5002. Optionally, the electronic device 5000 can further comprise a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in actual application, and the structure of the electronic device 5000 does not constitute a limitation on the embodiments of the application.
[0194] The processor 5001 can be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure of the application. The processor 5001 can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.
[0195] The bus 5002 can comprise a channel for transmitting information between the above-mentioned components. The bus 5002 can be a PCI bus or an EISA bus, etc. The bus 5002 can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 4 Figure 4 only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0196] The memory 5003 can be a ROM, or other type of static storage device that can store static information and instructions; a RAM, or other type of dynamic storage device that can store information and instructions; an EEPROM, a CD-ROM or other optical disc storage, a Blu-ray disc storage, a magnetic disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0197] The memory 5003 is configured to store application program codes for implementing the scheme of the present application, and the processor 5001 is configured to control the execution. The processor 5001 is configured to execute the application program codes stored in the memory 5003 to implement the content shown in any of the foregoing method embodiments.
[0198] The electronic device includes, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a car terminal (for example, a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like.
[0199] The fourth aspect.
[0200] The present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the program is executed by a processor to implement the data processing method based on the fitness function shown in the first aspect of the present application.
[0201] Another embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is run on a computer, the computer can execute the corresponding content in the foregoing method embodiments.
Claims
1. A data processing method based on a fitness function, characterized in that, The method comprises the steps of: constructing a first lineup combination set according to a lineup combination rule, wherein the first lineup combination set comprises a plurality of first lineup combinations, and each first lineup combination comprises a preset number of gene information; interact with the current level, obtain a pass rate of the first formation combination set, and adjust the fitness function to be adjusted according to the formation strength of each first formation combination and the pass rate; specifically, setting a fitness function initial value; judging the size of the pass rate and a preset target pass rate; if the pass rate is greater than the preset target pass rate, calculating a fitness function value according to the formation strength and the pass rate of the second formation combination, which is expressed by the following formula: AG=sorce×(1-CW); wherein AG is the fitness function value, sorce is the formation strength of the second formation combination, and CW is the pass rate; if the pass rate is less than or equal to the preset target pass rate, calculating a fitness function value according to the fitness function initial value and the pass rate, which is expressed by the following formula: AG=AG f ×(1-CW); wherein AG is the fitness function value, AG f is the fitness function initial value, and CW is the pass rate. performing lineup screening processing on the first lineup combination set according to an adjusted fitness function to obtain a second lineup combination set, wherein the second lineup combination set comprises a plurality of second lineup combinations, and each second lineup combination comprises a preset number of gene information.
2. A data processing method based on fitness function as claimed in claim 1 wherein, The method further comprises the steps of: generating a preset number of attribute information according to the gene information of the first lineup combination; generating a primary lineup combination set comprising a plurality of primary lineup combinations based on the attribute information; calculating the fitness of each primary lineup combination in the primary lineup combination set; establishing the second lineup combination set based on the primary lineup combination whose fitness meets a preset fitness value.
3. A data processing method based on fitness function as claimed in claim 1 wherein, The method further comprises the steps of: performing iterative updating on the first lineup combination set according to a genetic algorithm, and replacing the first lineup combination in the first lineup combination set with the updated lineup combination.
4. A data processing method based on fitness function as claimed in claim 3 wherein, The method further comprises the steps of: performing gene information crossover processing and gene information mutation processing on the first lineup combination according to the genetic algorithm to obtain an updated lineup combination; determining whether the iteration number of the iterative updating meets a preset number; if not, continuing to perform iterative processing on the first lineup combination according to the genetic algorithm until the iteration number meets an iteration number threshold; if yes, replacing the first lineup combination in the first lineup combination set with the updated lineup combination.
5. A data processing system based on a fitness function, characterized in that, The method comprises the steps of: constructing a first lineup combination set according to a lineup combination rule by using a first lineup combination set construction module, wherein the first lineup combination set comprises a plurality of first lineup combinations, and each first lineup combination comprises a preset number of gene information; The fitness function adjustment module is configured to interact each first formation in the first formation combination set with the current level to obtain a pass rate of the first formation combination set, and adjust the fitness function to be adjusted according to the formation strength of each first formation combination and the pass rate. Specifically, an initial value of the fitness function is set. The size of the pass rate and a preset target pass rate is judged. If the pass rate is greater than the preset target pass rate, a fitness function value is calculated according to the formation strength of the second formation combination and the pass rate, and is expressed by the following formula: AG=sorce×(1-CW); wherein AG is the fitness function value, sorce is the formation strength of the second formation combination, and CW is the pass rate. If the pass rate is less than or equal to the preset target pass rate, a fitness function value is calculated according to the initial value of the fitness function and the pass rate, and is expressed by the following formula: AG=AG f ×(1-CW); wherein AG is the fitness function value, AG f is the initial value of the fitness function, and CW is the pass rate. performing lineup screening processing on the first lineup combination set according to an adjusted fitness function by using a fitness function operation module to obtain a second lineup combination set, wherein the second lineup combination set comprises a plurality of second lineup combinations, and each second lineup combination comprises a preset number of gene information.
6. A fitness function based data processing system as claimed in claim 5, wherein, The fitness function operation module is specifically configured to: generate a preset number of attribute information according to the gene information of the first lineup combination; generate a primary lineup combination set comprising a plurality of primary lineup combinations based on the attribute information; calculate the fitness of each primary lineup combination in the primary lineup combination set; establish the second lineup combination set based on the primary lineup combination whose fitness meets a preset fitness value. 7.An electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the fitness function-based data processing method according to any one of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program, wherein the computer readable storage medium controls a device where the computer readable storage medium is located to execute the data processing method based on the fitness function according to any one of claims 1 to 4 when the computer program is running.
Citation Information
Patent Citations
Game role model determination method and device and server
CN111450537A
Game formation generation method and system, storage medium and server
CN112717420A