Music real-time generation method used in game
By analyzing the players' physiological data, behavioral data and game difficulty coefficients in the game, determining the player's status, and adjusting the game music according to the status, the problem that existing games cannot perceive player fatigue is solved, and the effect of adjusting the player's emotions and state through music is achieved, and the game experience is optimized.
Patent Information
- Application Number
- CN202510102060.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-22
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2045-01-22
AI Technical Summary
Existing games cannot perceive or judge the physical fatigue and mental burnout caused by players' long-term games, and cannot help players maintain a sense of pleasure by adjusting game music.
By collecting physiological data, game difficulty coefficient, behavioral data and performance data of the player during the game, the data are analyzed to determine the player's status and generate adaptive game music based on the status. The specific steps include: collecting data, analyzing data to determine the influence weight, classifying the player's status, and adjusting the rhythm, pitch, volume and dynamic range of game music according to the status.
By dynamically adjusting game music, it can effectively reduce player fatigue, relieve tension, maintain the player's normal game state, thereby optimizing the game experience.
Smart Images

Figure CN119559921A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of game music generation, and in particular to a real-time music generation method for games. Background Art
[0002] Electronic games are one of the common means of entertainment for people. In some competitive games, in addition to generating targets to hit and obtaining certain scores based on the player's hitting speed and hitting accuracy, the player is ultimately judged based on the score to determine whether the player has passed the level or received certain rewards. At the same time, the game also has certain game music, which has the function of adjusting the player's emotions, such as adding elements such as horror to the game to create a tense atmosphere.
[0003] When a player is playing a game, his or her score is affected by many factors. One of the factors is that after a certain period of time, the player will feel bored or tired due to the game content, game intensity, game difficulty, etc., which will be reflected in the game and cause the player's game score to decrease. Existing games cannot sense or judge whether a player's long-term gaming leads to physical fatigue and mental burnout, and therefore cannot help players regulate their emotions and maintain pleasure by adjusting the game music.
[0004] The purpose of the present invention is to design a real-time music generation method for games in view of the above-mentioned problems in the prior art. Summary of the invention
[0005] In view of the problems existing in the above-mentioned prior art, the present invention provides a method for real-time generation of music for use in games, which can effectively solve at least one problem existing in the above-mentioned prior art.
[0006] The technical solution of the present invention is: A method for real-time generation of music in a game, comprising the following steps: S1, collects players’ physiological data, game difficulty coefficient, behavior data, and performance data during the game; S2, analyzing the physiological data, the game difficulty coefficient, the behavior data, and the performance data to obtain the influence weights of the physiological data, the behavior data, and the game difficulty coefficient on the performance data; S3, if the influence weight of the physiological data is greater than the influence weight of the behavioral data and the game difficulty coefficient, and the performance data decreases, classifying the player's state into a fatigue state, a nervous state, or a normal state; S4, if the player is in a fatigued state, generate game music with a brisk rhythm; if the player is in a nervous state, generate game music with a slow rhythm; if the player is in a normal state, keep the current game music unchanged.
[0007] Further, the physiological data includes one or more of heart rate, respiratory rate, and breathing depth; The behavior data includes one or more of aiming deviation, aiming time, reaction time, game frequency, and clearance time; The performance data includes one or more of a game score, a target hit number, and a number of achievements achieved.
[0008] Furthermore, analyzing the physiological data, the game difficulty coefficient, the behavioral data, and the performance data to obtain the influence weights of the physiological data, the behavioral data, and the game difficulty coefficient on the performance data includes: establishing a multivariate linear regression algorithm training model, training the multivariate linear regression algorithm training model through the physiological data, the game difficulty coefficient, the behavioral data, and the performance data, and calculating the influence weights of the physiological data, the influence weights of the behavioral data, and the influence weights of the game difficulty coefficient.
[0009] Furthermore, the multivariate linear regression algorithm training model is as follows: ; in is the impact weight of physiological data, is the influence weight of the behavior data, is the influence weight of the game difficulty coefficient, and ε is the error term.
[0010] Furthermore, the player's state is classified into fatigue state, tension state, and normal state, including: If the player's behavioral data decreases, and the physiological data decreases or remains stable, and the game difficulty coefficient is less than the preset threshold, the player is determined to be in a fatigue state; If the player's behavioral data increases, and the physiological data increases, and the game difficulty coefficient is greater than the preset threshold, the player is determined to be in a state of tension; If other than that, the player is considered to be in normal state.
[0011] Furthermore, if the player is in a state of fatigue, one or more of the rhythm, pitch, volume, and dynamic range of the game music will be increased; if the player is in a state of tension, one or more of the rhythm, pitch, volume, and dynamic range of the game music will be reduced; if the player is in a normal state, the game music will remain unchanged.
[0012] Furthermore, before step S4, execute: establish a game music library, classify music with the sound of one or more instruments including guitar, piano, violin, accordion, and harmonica as the main melody as game music with a light rhythm, and classify music with the sound of one or more instruments including drums, cello, flute, harp, environmental sound effects, synthesizer, and glockenspiel as game music with a slow rhythm.
[0013] Furthermore, the physiological data is obtained through a smart bracelet, and the game difficulty coefficient, the behavior data, and the performance data are obtained through a game background or a game log.
[0014] Therefore, the present invention provides the following effects and / or advantages: This application analyzes the player's physiological data, behavioral data, game difficulty coefficient and other multi-dimensional data to determine whether the user's performance data in the game has declined due to the influence of physiological data, thereby dynamically adjusting the rhythm and style of the background music to optimize the player's gaming experience.
[0015] This application trains the model through a multivariate linear regression algorithm, so as to obtain the influence weights of different physiological data, behavioral data, and difficulty coefficients on the player's performance data, so as to analyze whether the poor game performance data is caused by the player's own physiological factors, and then adjust the player through game music in this case to reduce fatigue, relieve tension or maintain a normal gaming experience.
[0016] The present application calculates the weights of various influences on the player's performance data through a multivariate linear regression algorithm training model, and can simply and quickly obtain various weights to determine whether the player's physiological data factors have a major influence.
[0017] The present application outputs corresponding game music by adjusting one or more of the rhythm, pitch, volume, and dynamic change range of the game music.
[0018] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0019] It is to be understood that both the foregoing general description and the following detailed description of the present invention are exemplary and explanatory and are intended to provide further explanation of the invention as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart diagram of one embodiment of the present invention is provided. DETAILED DESCRIPTION
[0021] In order to facilitate understanding by those skilled in the art, the present invention is now described in further detail by way of examples: refer to Figure 1 , a real-time music generation method for a game, comprising the following steps: S1, collects players’ physiological data, game difficulty coefficient, behavior data, and performance data during the game; Further, the physiological data includes one or more of heart rate, respiratory rate, and breathing depth; The behavior data includes one or more of aiming deviation, aiming time, reaction time, game frequency, and clearance time; The performance data includes one or more of a game score, a target hit number, and a number of achievements achieved.
[0022] In this embodiment, physiological data can be obtained by detecting the physiological performance of the user through a smart watch or smart bracelet, among which, when the heart rate, breathing rate, or breathing depth decreases, it can be considered that the user is tired of the game, otherwise, it means that the user is playing the game nervously. In the behavioral data, when the aiming deviation, aiming time, reaction time, game frequency, and clearance time increase, it means that the user is tired of the game, and it is difficult for him to complete the game with a high score. The player's cognitive speed and operating efficiency decrease, the brain processes information slower, and responds to the stimulation of the game more slowly. Otherwise, it means that the player is highly focused on the game and is playing the game nervously. And, the more performance data including game scores, target hits, and achievement achievement numbers, it means that the user maintains interest in the game, otherwise it means that the user is unwilling to complete the tasks to be completed in the game with high quality, and the user clicks at will to complete various simple actions.
[0023] S2, analyzing the physiological data, the game difficulty coefficient, the behavior data, and the performance data to obtain the influence weights of the physiological data, the behavior data, and the game difficulty coefficient on the performance data; Different players have different performances on the game. Some players may have difficulty keeping up with the game rhythm after the game difficulty increases slightly, resulting in a decrease in performance data. Some players may have a significant change in physiological data after playing for a certain period of time, which makes it difficult for them to focus on the game, resulting in a decrease in behavioral data and difficulty focusing on the game. There is a certain weight relationship between the physiological data, the game difficulty coefficient, the behavioral data, and the performance data, and different people show different reactions and weights. This step analyzes these data to obtain the corresponding weight relationship.
[0024] Further, analyzing the physiological data, the game difficulty coefficient, the behavior data, and the performance data to obtain the influence weights of the physiological data, the behavior data, and the game difficulty coefficient on the performance data includes: A multivariate linear regression algorithm training model is established, and the multivariate linear regression algorithm training model is trained through the physiological data, the game difficulty coefficient, the behavioral data, and the performance data to calculate the influence weight of the physiological data, the influence weight of the behavioral data, and the influence weight of the game difficulty coefficient.
[0025] In this step, the game data of a large number of players can be analyzed through the multivariate linear regression algorithm training model, so as to train and output the weights of various factors that affect the performance data of the current game. If the physiological data of the players in the current game have a greater impact on the game, it means that the players of the current game are prone to reduce their game performance data due to their own tension, fatigue, emotions, etc., and multiple or long periods of low game performance data can easily make users lose interest in the game. Therefore, it is necessary to help users relax or stay focused, etc., so as to help users obtain good performance data under the predetermined game difficulty.
[0026] Specifically, the multivariate linear regression algorithm training model is as follows: ; in is the impact weight of physiological data, is the influence weight of the behavior data, is the influence weight of the game difficulty coefficient, and ε is the error term.
[0027] In this step, the game data of a large number of players can be collected to generate a training data set, and the model can be trained using a multivariate linear regression algorithm to calculate the weights of each item. The largest value indicates that physiological data has a greater impact on performance data. Taking physiological data as an example, any one of heart rate, respiratory rate, etc. can be used as the score impact of performance data. It can be understood that for every increase of 1 beat / min in heart rate or respiratory rate, the performance data increases or decreases by a certain number of points.
[0028] S3, if the influence weight of the physiological data is greater than the influence weight of the behavioral data and the game difficulty coefficient, and the performance data decreases, classifying the player's state into a fatigue state, a nervous state, or a normal state; This embodiment only classifies the player's status when the weight of the physiological data is the largest. This is because when the weight of the game difficulty coefficient is the largest, or the weight of the behavioral data is large, the player often cannot reach the required level of the game. At this time, simply reducing the difficulty of the game can generally achieve the goal of maintaining or improving the user's performance data, thereby helping the user maintain or improve interest in the game.
[0029] Furthermore, the player's state is classified into fatigue state, tension state, and normal state, including: If the player's behavioral data decreases, and the physiological data decreases or remains stable, and the game difficulty coefficient is less than the preset threshold, the player is determined to be in a fatigue state; If the player's behavioral data increases, and the physiological data increases, and the game difficulty coefficient is greater than the preset threshold, the player is determined to be in a state of tension; If other than that, the player is considered to be in normal state.
[0030] Specifically, the reasons for the user's fatigue state, tension state, and normal state are as follows: Fatigue state: The player's heart rate, breathing rate and other data gradually slow down or remain at a low level, and the player's operation and score in the game are poor, and the game is in medium-low difficulty mode; Stressful state: The player's heart rate, breathing rate and other data suddenly become faster or remain at a high level, and the player's operation and score in the game are good, and the game is in a high-difficulty mode; Normal state: All data are balanced and the game is in medium difficulty mode.
[0031] Through this quantification, the player's current state can be obtained when the player's physiological data has the greatest weight in affecting the performance data in the game, so that a game music output strategy that matches the player's current state can be made later.
[0032] S4, if the player is in a fatigued state, generate game music with a brisk rhythm; if the player is in a nervous state, generate game music with a slow rhythm; if the player is in a normal state, keep the current game music unchanged.
[0033] In this step, the game music with a brisk rhythm and the game music with a slow rhythm can be music recorded or generated in advance.
[0034] Furthermore, if the player is in a state of fatigue, one or more of the rhythm, pitch, volume, and dynamic range of the game music will be increased; if the player is in a state of tension, one or more of the rhythm, pitch, volume, and dynamic range of the game music will be reduced; if the player is in a normal state, the game music will remain unchanged.
[0035] In this embodiment, by adjusting specific properties of the music, such as rhythm, pitch, volume, dynamic range, etc., adapted music is generated according to the player's state. This method can directly affect the player's emotions and psychological state through music, helping the player to recover or stay focused.
[0036] Specifically, the faster the tempo of the game music, the more energetic it can be, the more lively it can be. The higher the pitch of the game music, the more brisk and bright it can be. The higher the volume of the game music, the more it can enhance the presence of the music and prevent the player from falling into a low-energy state. The greater the dynamic range of the game music, the more it can attract the player's attention, stimulate the senses, and inspire the player to regain vitality and enhance operational efficiency. On the contrary, lowering the tempo, pitch, volume, and dynamic range of the game music can help the player reduce tension and focus more on the current task.
[0037] Specifically, if the player is in a state of fatigue, the beat of the game music can be reduced to 120-140BPM, the volume can be increased by 3dB, raised by 4-6 semitones, and prominent sound changes can be added to expand the dynamic range. If the player is in a state of tension, the beat of the game music can be reduced to 60-80BPM, the volume can be reduced by 3dB, lowered by 4-6 semitones, and the contrast between strong and weak can be reduced to avoid stimulation in order to expand the dynamic range.
[0038] Furthermore, before step S4, execute: establish a game music library, classify music with the sound of one or more instruments including guitar, piano, violin, accordion, and harmonica as the main melody as game music with a light rhythm, and classify music with the sound of one or more instruments including drums, cello, flute, harp, environmental sound effects, synthesizer, and glockenspiel as game music with a slow rhythm.
[0039] This step classifies the music according to the characteristics of the main melody instrument, providing a benchmark for real-time music generation. This method uses the timbre characteristics of different instruments to establish a music library with fast and slow rhythms, ensuring that the generated music matches the player's state. Combined with the changes in rhythm, pitch, volume, and dynamic range mentioned above, more accurate music can be achieved to help players maintain a good state.
[0040] Furthermore, the physiological data is obtained through a smart bracelet, and the game difficulty coefficient, the behavior data, and the performance data are obtained through a game background or a game log.
[0041] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0042] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0043] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0044] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0045] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms should not be understood as necessarily being directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
Claims
1. A method for real-time generation of music in a game, characterized by: The following steps are involved: S1, collects players’ physiological data, game difficulty coefficient, behavior data, and performance data during the game; S2, analyzing the physiological data, the game difficulty coefficient, the behavior data, and the performance data to obtain the influence weights of the physiological data, the behavior data, and the game difficulty coefficient on the performance data; S3, if the influence weight of the physiological data is greater than the influence weight of the behavioral data and the game difficulty coefficient, and the performance data decreases, classifying the player's state into a fatigue state, a nervous state, or a normal state; S4, if the player is in a fatigued state, generate game music with a brisk rhythm; if the player is in a nervous state, generate game music with a slow rhythm; if the player is in a normal state, keep the current game music unchanged.
2. A method for real-time generation of music in a game according to claim 1, characterized in that: The physiological data includes one or more of heart rate, respiratory rate, and breathing depth; The behavior data includes one or more of aiming deviation, aiming time, reaction time, game frequency, and clearance time; The performance data includes one or more of a game score, a target hit number, and a number of achievements achieved.
3. A method for real-time generation of music in a game according to claim 2, characterized in that: Analyzing the physiological data, the game difficulty coefficient, the behavioral data, and the performance data to obtain the influence weights of the physiological data, the behavioral data, and the game difficulty coefficient on the performance data includes: establishing a multivariate linear regression algorithm training model, training the multivariate linear regression algorithm training model through the physiological data, the game difficulty coefficient, the behavioral data, and the performance data, and calculating the influence weight of the physiological data, the influence weight of the behavioral data, and the influence weight of the game difficulty coefficient.
4. The method for real-time generation of music in a game according to claim 3, characterized in that: The multivariate linear regression algorithm training model is as follows: ; in is the impact weight of physiological data, is the influence weight of the behavior data, is the influence weight of the game difficulty coefficient, and ε is the error term.
5. The method for real-time generation of music in a game according to claim 3, characterized in that: The player's status is classified into fatigue state, tension state, and normal state, including: If the player's behavioral data decreases, and the physiological data decreases or remains stable, and the game difficulty coefficient is less than the preset threshold, the player is determined to be in a fatigue state; If the player's behavioral data increases, and the physiological data increases, and the game difficulty coefficient is greater than the preset threshold, the player is determined to be in a state of tension; If other than that, the player is considered to be in normal state.
6. The method for real-time generation of music in a game according to claim 1, characterized in that: If the player is in a state of fatigue, one or more of the rhythm, pitch, volume, and dynamic range of the game music will be increased. If the player is in a state of tension, one or more of the rhythm, pitch, volume, and dynamic range of the game music will be reduced. If the player is in a normal state, the game music will remain unchanged.
7. A method for real-time generation of music in a game according to claim 6, characterized in that: Before step S4, execute: establish a game music library, classify music with the sound of one or more instruments including guitar, piano, violin, accordion, harmonica as the main melody as light-tempo game music, and classify music with the sound of one or more instruments including drum, cello, flute, harp, environmental sound effects, synthesizer, glockenspiel as slow-tempo game music.
8. The method for real-time generation of music in a game according to claim 1, characterized in that: The physiological data is obtained through a smart bracelet, and the game difficulty coefficient, the behavior data, and the performance data are obtained through a game background or a game log.
Citation Information
Patent Citations
User physiological state based method, device and system for adjusting study or entertain projects
CN104898941A
Music rhythm control terminal and method adaptive to user emotion
CN106599057A
Sensory-based dynamic game-state configuration
CN111375196A
Game music generation method and device, equipment and storage medium
CN112915525A
VR game feedback system based on emotion monitoring
CN118846530A
Cited By
Music interaction method used in game, electronic equipment and storage medium
CN120204710A