Reward weight distribution method and system
By dividing a mahjong game into four stages, and using preset functions and event reward functions to analyze the potential of the situation and the types of events, a target reward model is trained. This solves the problem of a single reward signal in existing technologies, and achieves a reasonable allocation of reward weights and effective guidance for model learning.
Patent Information
- Application Number
- CN202511574436.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-01-30
AI Technical Summary
Existing reward distribution methods for mahjong games lack consideration of key factors such as differences in game stages, global allocation of wild cards, and the number of cards drawn, resulting in a single reward signal that is difficult to effectively guide model learning.
The game is divided into four stages. The potential of the situation and the type of events are analyzed using a preset potential function and event reward function. The target reward model is trained by the Decision Transformer model and the reward weight is dynamically adjusted.
It achieves a reasonable allocation of reward weights, improves allocation efficiency, and can effectively guide model learning and decision-making.
Smart Images

Figure CN121422474A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, in particular to a reward weight distribution method and system. BACKGROUND
[0002] Mahjong is a complex game of games, and the agent needs to make reasonable decisions according to the hand, the opponent's exposure, the opponent's exposure and discard, the dealer position and other information. However, the existing method generally has the problems of sparse reward and difficult credit distribution. The existing reward construction is mostly based on the reduction of the number of listens, and lacks consideration of key factors such as the difference between the game stages, the global distribution of the remaining tiles, and the number of advances, resulting in a single reward signal and difficulty in effectively guiding model learning.
[0003] Therefore, in view of the deficiencies of the prior art, it is necessary to provide a method capable of reasonably distributing reward decisions. SUMMARY
[0004] Based on this, the purpose of the present application is to provide a reward weight distribution method and system to provide a method capable of reasonably distributing reward weights.
[0005] The first aspect of the embodiment of the present application provides: A reward weight distribution method, specifically comprising the following steps: Collecting actual game logs corresponding to online players, and dividing the entire game into four game stages according to the actual game logs; Assigning an initial reward weight to each game stage, and detecting the game events corresponding to each game stage in real time; Training a preset initial reward model according to the initial reward weight and the game events to generate a corresponding target reward model; Dynamically adjusting the initial reward weight of each game stage through the target reward model to correspondingly output a target reward weight adapted to each game stage.
[0006] The beneficial effects of the present application are: by collecting actual game logs corresponding to players, the entire game can be detected, based on which, in order to facilitate subsequent weight distribution, the game is divided into four game stages at this time, and an initial reward weight is assigned to each game stage, and the corresponding events are monitored, so that the required target reward model can be finally trained, and the target reward weight of each stage can be reasonably distributed through the target reward model, thereby effectively improving the weight distribution efficiency.
[0007] Further, the step of dividing the entire game into four game stages according to the actual game logs comprises: When the player is in each of the aforementioned game phases, the preset potential function is invoked; The system analyzes the potential of the player's hand in each game phase using the preset potential function, and sets the corresponding reward type based on the changing trend of the potential.
[0008] Furthermore, the expression for the preset latent function is: Φ(𝑠) = 𝑤1(𝑠𝑡𝑎𝑔𝑒) •𝐹1(𝑠) + 𝑤2(𝑠𝑡𝑎𝑔𝑒) •𝐹2(𝑠) + 𝑤3(𝑠𝑡𝑎𝑔𝑒) •𝐹3(𝑠) Among them, 𝐹1(𝑠): Meat completion degree, including the number of exposed melds and the number of melds in the hand; 𝐹2(𝑠): Number of usable melds, including pairs and sequences, with sequences counted with a certain weight; 𝐹3(𝑠): Number of effective cards, measuring the potential of pairs and sequences in the hand. 𝑤1, 𝑤2, 𝑤3: Stage weight.
[0009] Furthermore, the step of detecting the corresponding game events generated within each game stage includes: During each of the game phases, a preset event reward function is invoked. The preset event reward function monitors the types of events generated by the player in each game phase and determines the corresponding event reward size based on the event type.
[0010] Furthermore, the expression for the preset event reward function is: 𝑟 t 𝑒𝑣𝑡 = 1 ↓𝑋 + 𝛽2𝕀 ↑𝐹1 + 𝛽3𝕀 ↑𝑈 -4k badsplit + 51 {Self-draw} + 61 {Big Win} Among them, 𝕀 ↓𝑋 This indicates a decrease in the number of listeners, 𝕀 ↑𝐹1 This indicates the formation of a new face, 𝕀 ↑𝑈 This indicates an increase in the number of sheets fed, 𝕀 badsplit The first indicates an invalid tile, the second indicates a winning hand, the third indicates a hand with 3 or more points, and the fourth, fifth, and sixth indicate different weights.
[0011] Furthermore, the step of training the preset initial reward model based on the initial reward weights and the game events to generate the corresponding target reward model includes: During the training of the preset initial reward model, the preset DT model is invoked; Based on the initial reward weights and the game events, a reward prediction head loss function, an event prediction head loss function, and a backtracking reward loss function are generated to adapt to the preset DT model. The preset DT model is then trained based on the reward prediction head loss function, the event prediction head loss function, and the backtracking reward loss function to generate the target reward model.
[0012] Furthermore, the expression for the joint loss function used to complete the training of the preset DT model is: 𝐿= 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 + 1k 𝑟𝑒𝑤𝑎𝑟d + K2 𝑒𝑣𝑒𝑛𝑡 + K3 𝑏𝑎𝑐k Among them, 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 This represents the core loss of the preset DT model, 𝐿 𝑟𝑒𝑤𝑎𝑟d Let represent the reward prediction head loss function, 𝐿 𝑒𝑣𝑒𝑛𝑡 Let represent the event prediction head loss function, 𝐿 𝑏𝑎𝑐k Let represent the backtracking reward loss function, and let 𝜆1, 𝜆2, and 𝜆3 represent the weight hyperparameters.
[0013] The second aspect of the present invention proposes: A reward weighting allocation system, wherein the system includes: The data collection module is used to collect the actual game logs generated by online players and divide the entire game into four game stages based on the actual game logs. The allocation module is used to assign an initial reward weight to each game stage and to detect the corresponding game events generated in each game stage in real time. The training module is used to train the preset initial reward model based on the initial reward weights and the game events to generate the corresponding target reward model. The adjustment module is used to dynamically adjust the initial reward weight of each game stage through the target reward model, so as to output a target reward weight that is adapted to each game stage.
[0014] Furthermore, the acquisition module is specifically used for: When the player is in each of the aforementioned game phases, the preset potential function is invoked; The system analyzes the potential of the player's hand in each game phase using the preset potential function, and sets the corresponding reward type based on the changing trend of the potential.
[0015] Furthermore, the expression for the preset latent function is: Φ(𝑠) = 𝑤1(𝑠𝑡𝑎𝑔𝑒) •𝐹1(𝑠) + 𝑤2(𝑠𝑡𝑎𝑔𝑒) •𝐹2(𝑠) + 𝑤3(𝑠𝑡𝑎𝑔𝑒) •𝐹3(𝑠) Among them, 𝐹1(𝑠): Meat completion degree, including the number of exposed melds and the number of melds in the hand; 𝐹2(𝑠): Number of usable melds, including pairs and sequences, with sequences counted with a certain weight; 𝐹3(𝑠): Number of effective cards, measuring the potential of pairs and sequences in the hand. 𝑤1, 𝑤2, 𝑤3: Stage weight.
[0016] Furthermore, the allocation module is specifically used for: During each of the game phases, a preset event reward function is invoked. The preset event reward function monitors the types of events generated by the player in each game phase and determines the corresponding event reward size based on the event type.
[0017] Furthermore, the expression for the preset event reward function is: 𝑟 t 𝑒𝑣𝑡 = 1 ↓𝑋 + 𝛽2𝕀 ↑𝐹1 + 𝛽3𝕀 ↑𝑈 -4k badsplit + 51 {Self-draw} + 61 {Big Win} Among them, 𝕀 ↓𝑋 This indicates a decrease in the number of listeners, 𝕀 ↑𝐹1 This indicates the formation of a new face, 𝕀 ↑𝑈 This indicates an increase in the number of sheets fed, 𝕀 badsplit The first indicates an invalid tile, the second indicates a winning hand, the third indicates a hand with 3 or more points, and the fourth, fifth, and sixth indicate different weights.
[0018] Furthermore, the training module is specifically used for: During the training of the preset initial reward model, the preset DT model is invoked; Based on the initial reward weights and the game events, a reward prediction head loss function, an event prediction head loss function, and a backtracking reward loss function are generated to adapt to the preset DT model. The preset DT model is then trained based on the reward prediction head loss function, the event prediction head loss function, and the backtracking reward loss function to generate the target reward model.
[0019] Furthermore, the expression for the joint loss function used to complete the training of the preset DT model is: 𝐿= 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 + 1k 𝑟𝑒𝑤𝑎𝑟d + K2 𝑒𝑣𝑒𝑛𝑡 + K3 𝑏𝑎𝑐k Among them, 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 This represents the core loss of the preset DT model, 𝐿 𝑟𝑒𝑤𝑎𝑟d Let represent the reward prediction head loss function, 𝐿 𝑒𝑣𝑒𝑛𝑡 Let represent the event prediction head loss function, 𝐿 𝑏𝑎𝑐k Let represent the backtracking reward loss function, and let 𝜆1, 𝜆2, and 𝜆3 represent the weight hyperparameters.
[0020] The third aspect of the present invention proposes: A computer includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the reward weight allocation method as described above.
[0021] The fourth aspect of the present invention proposes: A readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the reward weight allocation method as described above.
[0022] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0023] Figure 1 A flowchart of the reward weight allocation method provided in the first embodiment of the present invention; Figure 2 This is a structural block diagram of the reward weight allocation system provided in the third embodiment of the present invention.
[0024] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0025] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0026] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0027] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0028] Please see Figure 1 The figure shows the reward weight allocation method provided in the first embodiment of the present invention. The reward weight allocation method provided in this embodiment can reasonably allocate the reward weight of each stage, thereby improving the allocation efficiency of the weight.
[0029] Specifically, this embodiment provides: A reward weighting allocation method specifically includes the following steps: Step S10: Collect the actual game logs generated by the online players, and divide the entire game into four game stages based on the actual game logs; Step S20: Assign an initial reward weight to each game stage and detect the corresponding game events generated in each game stage in real time; Step S30: Train the preset initial reward model according to the initial reward weight and the game event to generate the corresponding target reward model; Step S40: The initial reward weight of each game stage is dynamically adjusted using the target reward model to output a target reward weight that is adapted to each game stage.
[0030] Second Embodiment Furthermore, the step of dividing the entire game into four stages based on the actual game log includes: When the player is in each of the aforementioned game phases, the preset potential function is invoked; The system analyzes the potential of the player's hand in each game phase using the preset potential function, and sets the corresponding reward type based on the changing trend of the potential.
[0031] It should be noted that in practical applications, players will experience different stages from the start of the game to winning, and different events will occur in each stage. Based on this, in order to reasonably train the target reward model so that the target reward model can reasonably and automatically complete the subsequent weight allocation, this invention divides the entire game into four stages: the initial drawing stage, the hand arrangement stage, the closing stage, and the final winning stage. At the start of the game, an initial reward weight is set for each stage by default. During each game stage, the following preset potential function is invoked. Specifically, this preset potential function can measure the "goodness" of the situation and analyze the potential of the situation corresponding to the hand. Specifically, if the potential of the situation increases, a positive reward is given; if the potential of the situation decreases, a negative reward is given. This ensures that the subsequently trained model can receive feedback at each stage for subsequent processing.
[0032] Furthermore, the expression for the preset latent function is: Φ(𝑠) = 𝑤1(𝑠𝑡𝑎𝑔𝑒) •𝐹1(𝑠) + 𝑤2(𝑠𝑡𝑎𝑔𝑒) •𝐹2(𝑠) + 𝑤3(𝑠𝑡𝑎𝑔𝑒) •𝐹3(𝑠) Among them, 𝐹1(𝑠): Meat completion degree, including the number of exposed melds and the number of melds in the hand; 𝐹2(𝑠): Number of usable melds, including pairs and sequences, with sequences counted with a certain weight; 𝐹3(𝑠): Number of effective cards, measuring the potential of pairs and sequences in the hand. 𝑤1, 𝑤2, 𝑤3: Stage weight.
[0033] Furthermore, the step of detecting the corresponding game events generated within each game stage includes: During each of the game phases, a preset event reward function is invoked. The preset event reward function monitors the types of events generated by the player in each game phase and determines the corresponding event reward size based on the event type.
[0034] It should be noted that in practical applications, events will occur during each stage of the game. Specifically, these events may include the formation of new melds, an increase in the number of cards drawn, and invalid card splitting. By setting event-based rewards and latent function rewards, all situations that occur throughout the game can be covered. This allows for the comprehensive allocation of reward weights appropriate for each stage and enables the comprehensive and effective training of subsequent target reward models for later processing.
[0035] Furthermore, the expression for the preset event reward function is: 𝑟 t 𝑒𝑣𝑡 = 1 ↓𝑋 + 𝛽2𝕀 ↑𝐹1 + 𝛽3𝕀 ↑𝑈 -4k badsplit + 51 {Self-draw} + 61 {Big Win} Among them, 𝕀 ↓𝑋 This indicates a decrease in the number of listeners, 𝕀 ↑𝐹1 This indicates the formation of a new face, 𝕀 ↑𝑈 This indicates an increase in the number of sheets fed, 𝕀 badsplit The first indicates an invalid tile, the second indicates a winning hand, the third indicates a hand with 3 or more points, and the fourth, fifth, and sixth indicate different weights.
[0036] Furthermore, the step of training the preset initial reward model based on the initial reward weights and the game events to generate the corresponding target reward model includes: During the training of the preset initial reward model, the preset DT model is invoked; Based on the initial reward weights and the game events, a reward prediction head loss function, an event prediction head loss function, and a backtracking reward loss function are generated to adapt to the preset DT model. The preset DT model is then trained based on the reward prediction head loss function, the event prediction head loss function, and the backtracking reward loss function to generate the target reward model.
[0037] It should be noted that, in order to complete the final model training, this invention combines the aforementioned reward function with the Decision Transformer. Specifically, the DT model is used to train the desired target reward model. In the actual training process, adapted training, validation, and test sets are generated based on the initial reward weights and game events. Furthermore, a specific loss function is generated during training to complete the final training. 1. Reward Head While DT outputs the action, predict the reward for that step.
[0038] Loss function:
[0039] 2. Event Header Predict six types of event tags (reduced number of tiles to be played, new face tiles, increased number of tiles to be drawn, invalid tile breaking, self-draw, big hand).
[0040] Loss function:
[0041] 3. Retrospective Reward After the trajectory is completed, the final result is smoothly distributed among the previous steps:
[0042] Key moments (eating, ponging, konging, waiting for a winning hand, and the last N steps of the game) are given higher weight. t Loss function: By constructing the above loss function, we can finally obtain the required joint loss function. This joint loss function enables us to complete the model training comprehensively and effectively, and allows the trained target reward model to not only predict actions but also learn rewards and events simultaneously for subsequent processing.
[0043] Furthermore, the expression for the joint loss function used to complete the training of the preset DT model is: 𝐿= 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 + 1k 𝑟𝑒𝑤𝑎𝑟d + K2 𝑒𝑣𝑒𝑛𝑡 + K3 𝑏𝑎𝑐k Among them, 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 This represents the core loss of the preset DT model, 𝐿 𝑟𝑒𝑤𝑎𝑟d Let represent the reward prediction head loss function, 𝐿 𝑒𝑣𝑒𝑛𝑡 Let represent the event prediction head loss function, 𝐿 𝑏𝑎𝑐k Let represent the backtracking reward loss function, and let 𝜆1, 𝜆2, and 𝜆3 represent the weight hyperparameters.
[0044] Please see Figure 2 The third embodiment of the present invention provides: A reward weighting allocation system, wherein the system includes: The data collection module is used to collect the actual game logs generated by online players and divide the entire game into four game stages based on the actual game logs. The allocation module is used to assign an initial reward weight to each game stage and to detect the corresponding game events generated in each game stage in real time. The training module is used to train the preset initial reward model based on the initial reward weights and the game events to generate the corresponding target reward model. The adjustment module is used to dynamically adjust the initial reward weight of each game stage through the target reward model, so as to output a target reward weight that is adapted to each game stage.
[0045] Furthermore, the acquisition module is specifically used for: When the player is in each of the aforementioned game phases, the preset potential function is invoked; The system analyzes the potential of the player's hand in each game phase using the preset potential function, and sets the corresponding reward type based on the changing trend of the potential.
[0046] Furthermore, the expression for the preset latent function is: Φ(𝑠) = 𝑤1(𝑠𝑡𝑎𝑔𝑒) •𝐹1(𝑠) + 𝑤2(𝑠𝑡𝑎𝑔𝑒) •𝐹2(𝑠) + 𝑤3(𝑠𝑡𝑎𝑔𝑒) •𝐹3(𝑠) Among them, 𝐹1(𝑠): Meat completion degree, including the number of exposed melds and the number of melds in the hand; 𝐹2(𝑠): Number of usable melds, including pairs and sequences, with sequences counted with a certain weight; 𝐹3(𝑠): Number of effective cards, measuring the potential of pairs and sequences in the hand. 𝑤1, 𝑤2, 𝑤3: Stage weight.
[0047] Furthermore, the allocation module is specifically used for: During each of the game phases, a preset event reward function is invoked. The preset event reward function monitors the types of events generated by the player in each game phase and determines the corresponding event reward size based on the event type.
[0048] Furthermore, the expression for the preset event reward function is: 𝑟 t 𝑒𝑣𝑡 = 1 ↓𝑋 + 𝛽2𝕀 ↑𝐹1 + 𝛽3𝕀 ↑𝑈 -4k badsplit + 51 {Self-draw} + 61 {Big Win} Among them, 𝕀 ↓𝑋 This indicates a decrease in the number of listeners, 𝕀 ↑𝐹1 This indicates the formation of a new face, 𝕀 ↑𝑈 This indicates an increase in the number of sheets fed, 𝕀 badsplit The first indicates an invalid tile, the second indicates a winning hand, the third indicates a hand with 3 or more points, and the fourth, fifth, and sixth indicate different weights.
[0049] Furthermore, the training module is specifically used for: During the training of the preset initial reward model, the preset DT model is invoked; Based on the initial reward weights and the game events, a reward prediction head loss function, an event prediction head loss function, and a backtracking reward loss function are generated to adapt to the preset DT model. The preset DT model is then trained based on the reward prediction head loss function, the event prediction head loss function, and the backtracking reward loss function to generate the target reward model.
[0050] Furthermore, the expression for the joint loss function used to complete the training of the preset DT model is: 𝐿= 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 + 1k 𝑟𝑒𝑤𝑎𝑟d + K2 𝑒𝑣𝑒𝑛𝑡 + K3 𝑏𝑎𝑐k Among them, 𝐿 𝐷𝑇-𝑐𝑜𝑟𝑒 This represents the core loss of the preset DT model, 𝐿 𝑟𝑒𝑤𝑎𝑟d Let represent the reward prediction head loss function, 𝐿 𝑒𝑣𝑒𝑛𝑡 Let represent the event prediction head loss function, 𝐿 𝑏𝑎𝑐k Let represent the backtracking reward loss function, and let 𝜆1, 𝜆2, and 𝜆3 represent the weight hyperparameters.
[0051] The fourth embodiment of the present invention provides a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the reward weight allocation method as described above.
[0052] The fifth embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the reward weight allocation method as described above.
[0053] In summary, the reward weight allocation method and system provided by the above embodiments of the present invention can reasonably allocate the reward weight of each stage, thereby improving the allocation efficiency.
[0054] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0055] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-including system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0056] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0057] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0058] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0059] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method of awarding weight distribution, characterized by, The method comprises: collecting actual game logs corresponding to online players, and dividing the entire game session into four game stages according to the actual game logs; allocating an initial reward weight to each game stage, and detecting game events corresponding to each game stage in real time; training a preset initial reward model according to the initial reward weight and the game events to generate a corresponding target reward model; dynamically adjusting the initial reward weight of each game stage through the target reward model to correspondingly output a target reward weight adapted to each game stage.
2. The method of claim 1, wherein, The step of dividing the entire game session into four game stages according to the actual game logs comprises: calling a preset potential function when the player is in each game stage; analyzing the potential of the player's card group in each game stage through the preset potential function, and setting a corresponding reward type according to the trend of the potential.
3. The method of claim 2, wherein, The expression of the preset potential function is: Φ(𝑠) = 𝑤1(𝑠𝑡𝑎𝑔𝑒) •𝐹1(𝑠) + 𝑤2(𝑠𝑡𝑎𝑔𝑒) •𝐹2(𝑠) + 𝑤3(𝑠𝑡𝑎𝑔𝑒) •𝐹3(𝑠) Wherein, F1(s): face completion degree, including the number of exposed cards and the number of face cards in hand, F2(s): available face number, including pairs and pairs, and pairs are counted according to a certain weight, F3(s): effective card number, which measures the potential of pairs and sequences in the hand. w1, w2, w3: stage weight.
4. The method of claim 1, wherein, The step of detecting game events corresponding to each game stage comprises: calling a preset event reward function during each game stage; monitoring the type of events corresponding to the player in each game stage through the preset event reward function, and marking the corresponding event reward size according to the event type.
5. The method of claim 4, wherein, The expression of the preset event reward function is: r t 𝑒𝑣𝑡 = β1I ↓𝑋 + β2I ↑𝐹1 + β3I ↑𝑈 - β4I badsplit + β5T{self-touch} + β6T{large-banhu} wherein, I ↓𝑋 represents a decrease in the number of listens, I ↑𝐹1 represents the formation of a new face, I ↑𝑈 represents an increase in the number of advances, I badsplit represents invalid disassembly, 1{self-touch} represents a winning hand, 1{big fan} represents a fan number greater than or equal to 3, β1, β2, β3, β4, β5, β6 respectively represent different weights.
6. The method of claim 1, wherein, The step of training a preset initial reward model according to the initial reward weight and the game events to generate a corresponding target reward model comprises: calling a preset DT model during the training of the preset initial reward model; generating a reward prediction head loss function, an event prediction head loss function and a backtracking reward loss function adapted to the preset DT model according to the initial reward weight and the game events, and completing the training of the preset DT model based on the reward prediction head loss function, the event prediction head loss function and the backtracking reward loss function to correspondingly generate the target reward model.
7. The method of claim 6, wherein, The expression of the joint loss function for completing the preset DT model training is: L = L 𝐷𝑇-𝑐𝑜𝑟𝑒 + λ1L 𝑟𝑒𝑤𝑎𝑟d + λ2L 𝑒𝑣𝑒𝑛𝑡 + λ3L 𝑏𝑎𝑐k wherein, L 𝐷𝑇-𝑐𝑜𝑟𝑒 represents the core loss of the preset DT model, L 𝑟𝑒𝑤𝑎𝑟d represents the reward prediction head loss function, L 𝑒𝑣𝑒𝑛𝑡 represents the event prediction head loss function, L 𝑏𝑎𝑐k represents the backtracking reward loss function, λ1, λ2, λ3 represent weight hyperparameters.
8. A reward weight allocation system characterized by, The system comprises: a collection module for collecting actual game logs corresponding to online players, and dividing the entire game session into four game stages according to the actual game logs; an allocation module, configured to allocate an initial reward weight to each of the game stages, and to detect a corresponding generated game event in each of the game stages in real time; a training module, configured to train a preset initial reward model according to the initial reward weight and the game event, to generate a corresponding target reward model; an adjustment module, configured to dynamically adjust the initial reward weight of each of the game stages by the target reward model, to correspondingly output a target reward weight adapted to each of the game stages.
9. A computer comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the reward weight allocation method in any one of claims 1 to 7.
10. A readable storage medium, having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the reward weight allocation method in any one of claims 1 to 7.
Citation Information
Patent Citations
Video game gaming system
CN107667393A
Game reward implementation method and device
CN110732140A
Intelligent decision-making method and system for mahjong, storage medium and equipment
CN115708951A
Automatic game playing method, system and equipment for egg fling game and storage medium
CN116099204A
Game content dynamic adjustment method, electronic equipment and storage medium
CN116650973A