A sound processing method and device in a game, electronic equipment and storage medium

By dividing the attenuation parameter adjustment range according to the type of game object in the game, the problem of lack of personalization in sound processing in interactive terminals is solved, the sound source attenuation effect that adapts to complex scenes is realized, and the quality of game sound rendering is improved.

CN117654023BActive Publication Date: 2026-07-31NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2023-12-26
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, sound processing in interactive terminals lacks personalization and cannot adapt to complex scenarios, resulting in poor sound rendering effects.

Method used

By dividing the game into different types of game objects, determining the target adjustment range of the attenuation parameter based on the object type of the target game object, and obtaining the corresponding adjustment value, the sound generated by the sound source is processed.

Benefits of technology

It enables personalized sound processing for different types of game objects, adapts to sound source attenuation effects in complex scenes, and improves the sound rendering quality in games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117654023B_ABST
    Figure CN117654023B_ABST
Patent Text Reader

Abstract

This application provides a sound processing method, apparatus, electronic device, and storage medium for games. It provides a graphical user interface (GUI) via a terminal device, displaying at least a portion of a game scene. The at least portion of the game scene includes a target game character and at least one game object. The method includes: responding to the target game character triggering a sound processing task; determining the target game object where the sound source is located; determining an attenuation parameter for the sound generated by the sound source based on target obstacle information in the sound propagation path from the target game object to the target game character; determining a target adjustment range corresponding to the attenuation parameter based on the object type of the target game object; obtaining a target adjustment value for the attenuation parameter within the target adjustment range; and processing the sound generated by the sound source based on the target adjustment value. This application can provide personalized processing strategies for different game objects and can adapt to complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of audio processing technology, and in particular to a sound processing method, apparatus, electronic device and storage medium for games. Background Technology

[0002] In real life, when sound encounters a medium, it undergoes physical changes such as reflection, diffraction, and transmission. Consequently, the sound we hear is a mixture of sound reflected from, bypassing, or transmitted through buildings. In interactive terminals, to enhance the user's realistic experience, the sound emitted by the sound source needs to be rendered accordingly.

[0003] However, in the interactive terminal, all sounds use the Obstruction / Occlusion curves in Wwise Project Settings, and the sound barriers / cages are calculated according to generic settings. This means that all sounds will use the same curves to calculate sound barrier / cage effects, regardless of their position in the scene or their relationship to other objects. However, this setting lacks personalization and cannot adapt to complex scenes. Summary of the Invention

[0004] In view of this, embodiments of this application provide a sound processing method, apparatus, electronic device, and storage medium for games, which can provide personalized processing strategies for different game objects, thereby adapting to complex scenarios.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] In a first aspect, embodiments of this application provide a sound processing method for games, which provides a graphical user interface through a terminal device and displays at least a portion of a game scene on the graphical user interface, wherein the at least a portion of the game scene includes a target game character and at least one game object, the method comprising:

[0007] In response to the target game character triggering a sound processing task, the target game object where the sound source is located is determined, and the attenuation parameter of the sound source is determined based on the target obstacle information in the sound propagation path from the target game object to the target game character;

[0008] Based on the object type of the target game object, the target adjustment range corresponding to the attenuation parameter is determined; the adjustment value of the attenuation parameter is different in different adjustment ranges.

[0009] Obtain the target adjustment value of the attenuation parameter within the target adjustment range, and process the sound generated by the sound source based on the target adjustment value.

[0010] Secondly, embodiments of this application also provide a sound processing device for a game, which provides a graphical user interface through a terminal device and displays at least a portion of a game scene on the graphical user interface. The at least a portion of the game scene includes a target game character and at least one game object. The device includes:

[0011] The first determining module is used to respond to the target game character triggering a sound processing task, determine the target game object where the sound source is located, and determine the attenuation parameter of the sound source based on the target obstacle information in the sound propagation path from the target game object to the target game character;

[0012] The second determining module is used to determine the target adjustment range corresponding to the attenuation parameter based on the object type of the target game object; the adjustment value of the attenuation parameter is different in different adjustment ranges;

[0013] The processing module is used to obtain the target adjustment value of the attenuation parameter within the target adjustment range, and to process the sound generated by the sound source based on the target adjustment value.

[0014] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the sound processing method in the game as described in any of the first aspects.

[0015] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the sound processing method in a game as described in any one of the first aspects.

[0016] The embodiments of this application have the following beneficial effects:

[0017] When a sound processing task is triggered in response to a target game character, the target game object where the sound source is located is identified. Based on the target obstacle information in the sound propagation path from the target game object to the target game character, the attenuation parameter of the sound source is determined. To avoid using the same curve to calculate the attenuation effect for all sounds, different game objects in the game are divided into multiple types. Then, based on the object type of the target game object, the target adjustment range corresponding to the attenuation parameter is determined. In this way, the obtained target adjustment range is applicable to specific types of game objects, realizing personalized sound processing for different types of game objects. Finally, the target adjustment value of the attenuation parameter within the target adjustment range is obtained, and the sound source is processed based on the target adjustment value, enabling sound processing to adapt to complex scenes. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart illustrating steps S101-S103 provided in the embodiments of this application;

[0020] Figure 1a This is an Obstruction curve diagram from the existing technology;

[0021] Figure 1b This is a two-segment Obstruction curve provided in the embodiments of this application;

[0022] Figure 2 This is a flowchart illustrating steps S201-S203 provided in the embodiments of this application;

[0023] Figure 3 This is a flowchart illustrating steps S301-S302 provided in the embodiments of this application;

[0024] Figure 4 This is a flowchart illustrating steps S401-S403 provided in the embodiments of this application;

[0025] Figure 5 This is a flowchart illustrating steps S501-S503 provided in the embodiments of this application;

[0026] Figure 6 This is a flowchart illustrating steps S601-S602 provided in the embodiments of this application;

[0027] Figure 6a This is a schematic diagram of a fixed X-ray machine provided in an embodiment of this application;

[0028] Figure 7 This is a schematic diagram of the structure of the sound processing device in the game provided in the embodiments of this application;

[0029] Figure 8 This is a schematic diagram of the composition structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0031] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0032] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0033] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0034] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.

[0035] 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 application belongs. The terminology used herein is for the purpose of describing embodiments of this application and is not intended to limit this application.

[0036] In Wwise, the values ​​for sound barrier and sound cage can be defined using custom curves. In the game, the sound engine calculates the minimum LPF (low-pass filter) and maximum volume based on the positions of game objects and listeners. Then, according to the defined curves, the sound engine applies appropriate volume controls and LPF to achieve the sound barrier and sound cage effects. We can also enable or disable curves as needed to balance performance and realism. The game engine is responsible for determining the sound barrier and sound cage values, using the positions of objects and listeners within the game geometry.

[0037] Sound designers can use curves in the design tools to determine how volume and LPF respond to sound barrier and cage values. Additionally, curves can be enabled or disabled to fully meet performance and realism requirements.

[0038] By default, all sounds use the curves in the Obstruction / Occlusion tab of Wwise Project Settings. This means that all sounds will use the same curves to calculate sound barrier / sound cage effects, regardless of their position in the scene or their relationship to other objects. However, this setting may have some drawbacks:

[0039] (1) Lack of personalization: The default Obstruction / Occlusion curves are general settings that apply to the entire project. This may not be suitable for specific scenes or game objects. If a specific sound barrier / occlusion effect is required, a custom curve may be needed to meet the specific requirements.

[0040] (2) Not suitable for complex scenarios: The default curve may not meet the needs of complex scenarios. In some cases, more precise control may be required to ensure accurate sound transmission and masking effects.

[0041] (3) Performance and Realism Balance: The default curve may not be the optimal choice for balancing performance and realism. Depending on the project requirements, the curve may need to be adjusted to achieve the desired balance. This may require more testing and optimization.

[0042] To resolve the above issues, please refer to [link / reference]. Figure 1 , Figure 1 This is a flowchart illustrating steps S101-S103 of the sound processing method in a game provided in this application embodiment, which will be combined with... Figure 1 Steps S101-S103 shown will be explained.

[0043] Step S101: Respond to the target game character triggering the sound processing task, determine the target game object where the sound source is located, and determine the attenuation parameter of the sound source based on the target obstacle information in the sound propagation path from the target game object to the target game character;

[0044] Step S102: Determine the target adjustment range corresponding to the attenuation parameter based on the object type of the target game object; the adjustment value of the attenuation parameter is different in different adjustment ranges.

[0045] Step S103: Obtain the target adjustment value of the attenuation parameter within the target adjustment range, and process the sound generated by the sound source based on the target adjustment value.

[0046] The sound processing method in the aforementioned game determines the target game object where the sound source is located when the target game character triggers a sound processing task. Based on the information of target obstacles in the sound propagation path from the target game object to the target game character, the attenuation parameter of the sound source is determined. To avoid using the same curve to calculate the attenuation effect for all sounds, different game objects are divided into multiple types. Then, based on the object type of the target game object, a target adjustment range corresponding to the attenuation parameter is determined. This target adjustment range is applicable to specific types of game objects, achieving personalized sound processing for different types of game objects. Finally, the target adjustment value of the attenuation parameter within the target adjustment range is obtained, and the sound source is processed based on this target adjustment value, enabling sound processing to adapt to complex scenes.

[0047] The exemplary steps described above in the embodiments of this application will be explained below.

[0048] In step S101, in response to the target game character triggering the sound processing task, the target game object where the sound source is located is determined, and the attenuation parameter of the sound source is determined based on the target obstacle information in the sound propagation path from the target game object to the target game character.

[0049] In some embodiments, when a target game object emits a sound that can travel to the target game character, the target game character is considered to have triggered a sound processing task. In a game scene, there may be obstacles between the target game object and the target game character, such as buildings, trees, walls, terrain, or media (e.g., the target game character is in water). Therefore, it is necessary to determine the attenuation parameter of the sound source based on the obstacle information. This attenuation parameter allows us to determine the amount of attenuation from the sound source to the target game character.

[0050] It should be noted that, in the embodiments of this application, the attenuation parameter can be the sound barrier (OB) / sound barrier (OC) value corresponding to the Obstruction / Occlusion curve.

[0051] For example, in this embodiment of the application, the OC / OB value is obtained by ray casting. The program randomly emits n rays from the hemisphere at the listener position every frame and uses the surrounding collision system to determine whether the sound source is blocked (if an accurate degree of occlusion is to be obtained every frame, a large number of rays need to be emitted). If there is obstruction, the obstruction distance and volume can be calculated by changing the rays, and the OC / OB value is returned.

[0052] In step S102, the target adjustment range corresponding to the attenuation parameter is determined according to the object type of the target game object; the adjustment value of the attenuation parameter is different in different adjustment ranges.

[0053] In some embodiments, object types are categorized based on the characteristics and functions of the target game object. The target game object can have multiple object types, such as players and monsters (elite monsters, regular monsters). Different object types correspond to independent target adjustment ranges. For example, elite monsters have a smaller target adjustment range slope (smaller attenuation), while regular monsters have a larger target adjustment range slope (larger attenuation). This simulates the impact of target obstacles on elite and regular monsters in the scene. Specifically, elite monsters have higher combat intensity, emit less attenuated sound, and receive a louder sound from the target game character, thus reflecting the higher combat intensity of elite monsters.

[0054] For an example, please see Figure 1a and Figure 1b , Figure 1a This is an Obstruction curve diagram from existing technology. Figure 1b This is a two-segment Obstruction curve provided in the embodiments of this application, such as... Figure 1a As shown, Figure 1 The Obstruction curve in the figure is a global setting, with the horizontal axis representing the OB value and the vertical axis representing the adjustment value (a negative sign indicates attenuation). By obtaining the OB value in step S101, the corresponding vertical axis can be found in the curve, thus obtaining the target adjustment value applied globally. However, this approach obviously cannot meet the requirements of this application.

[0055] To solve the above problems, such as Figure 1bAs shown, a two-segment Obstruction curve is used. The first segment is an adjustment range with the horizontal axis at [0, 50], and the second segment is an adjustment range with the horizontal axis at [50, 100]. The first segment is applied to the target game character with the object type "player", and the second segment is applied to the target game character with the object type "monster".

[0056] However, without changing the processing mechanism for obtaining OC / OB values ​​through raycasting, the obtained OB values ​​will not accurately fall within the corresponding adjustment range. For example, the detected OB value for a target game character of the "player" type might be 25 or 75, in which case the OB values ​​would fall on two separate curves, which obviously does not meet the actual requirements.

[0057] To solve this problem, a continuous function can be constructed using interpolation, passing through all known points. These known points can be viewed as the OB values ​​of a certain type of target game character, and the function is the corresponding curve. In this application, the following formula is used:

[0058] new_v = ratio * v + offset;

[0059] v represents the attenuation parameter, ratio represents the scaling ratio, offset represents the offset, and new v represents the attenuation parameter that is within the target adjustment range after adjustment.

[0060] For the player: new_v = 0.5 * v + 0;

[0061] For the monster: new v = 0.5 * v + 50;

[0062] For the player, the scaling factor here is 0.5, in order to halve the value of v. Since the two jump curves are separated from the middle position (50) of the horizontal coordinate, the actual detected OB value can be scaled proportionally to the first curve. For the monster, the value of v is also halved, plus the offset value of 50, so that the monster's v value will definitely fall on the second curve.

[0063] The essence of the above processing is proportional scaling, creating two (or more) curves so that the actual detected attenuation parameter v can fall on the corresponding curve after the above processing.

[0064] The above method, without changing the software's processing mechanism, can divide the global curve into multiple target adjustment intervals, even when Wwise's Obstruction / Occlusion curve can only provide one global setting. It also ensures that the decay parameters of target game objects of different object types can accurately fall into the corresponding type of curve, achieving proportional scaling. This enables the division of different objects and provides technical support for personalized processing strategies for target game objects of different object types.

[0065] In step S103, the target adjustment value of the attenuation parameter within the target adjustment range is obtained, and the sound generated by the sound source is processed based on the target adjustment value.

[0066] Here, after obtaining the target adjustment range, the target adjustment range where the attenuation parameter is located can be obtained through the embodiment corresponding to step S102. Then, the target adjustment value (y value) can be obtained, and the sound generated by the sound source can be processed according to the target adjustment value.

[0067] In some embodiments, see Figure 2 , Figure 2 This is a flowchart illustrating steps S201-S203 provided in the embodiments of this application. The sound processing task triggered by the target game character and the determination of the target game object where the sound source is located can be achieved through steps S201-S203, which will be explained in conjunction with each step.

[0068] In step S201, a sound processing task is triggered in response to the target game character to determine multiple candidate game objects where the sound source is located.

[0069] In step S202, the priority of the multiple candidate objects is determined according to their object types; the types are determined based on the characteristics and functions of the game objects.

[0070] In step S203, one or more candidate objects are selected as target game objects in sequence from the multiple candidate objects according to their priority, until there are no remaining candidate objects.

[0071] Combining steps S201-S203, the object types of candidate objects include: players, elite monsters, and ordinary monsters. Candidate objects have certain priorities. For example, in first-person shooter (FPS) games, users need to control a target game character to fight against other players and pre-set monsters. When there is a conflict between player and monster sound processing, player sound processing should be prioritized. Similarly, for elite monsters and ordinary monsters, elite monster sound processing should be prioritized. Therefore, in terms of priority, player > elite monster > ordinary monster.

[0072] In this way, when determining the target game object, candidate objects of the player type can be identified first, followed by candidate objects of the elite monster type, and finally candidate objects of the ordinary monster type. There may be multiple players or monsters; for example, there may be multiple candidate objects of the player type in the game scene. In this case, since multiple candidate objects have the same type and corresponding priority, priority can be reassigned to these candidate objects with the same priority. For example, candidate objects that are closer together can be given higher priority.

[0073] In some embodiments, selecting one or more candidate objects as target game objects from the plurality of candidate objects according to their priority includes:

[0074] Based on the priority of the plurality of candidate objects and the device performance of the terminal device, one or more candidate objects are selected sequentially from the plurality of candidate objects as target game objects.

[0075] Here, there are usually multiple game objects that serve as sound sources. If the performance of the terminal device is sufficient (high-performance terminal device), multiple game objects can be used as the target game object. However, if the performance of the terminal device is insufficient (low-performance terminal device), using multiple game objects as the target game object may cause game lag. In this case, multiple game objects can be used as multiple candidate objects, and the target game object is determined according to the priority of the multiple candidate objects.

[0076] For example, due to performance limitations, terminal devices may experience lag when processing more than N candidate objects at once. In a game scenario, there are Player 1 (10m from the target character), Player 2 (15m from the target character), Player 3 (20m from the target character), Player 4 (20m from the target character), Elite Monster 1 (20m from the target character), Elite Monster 2 (25m from the target character), Normal Monster 1 (20m from the target character), and Normal Monster 2 (25m from the target character). If N=1, the target game object is determined in the following order: Player 1, Player 2, Player 3, Player 4 (the order of Player 3 and Player 4 can be interchanged because they have the same priority and distance; Player 3 or Player 4 can be randomly selected), Elite Monster 1, Elite Monster 2, Normal Monster 1, Normal Monster 2. If N=2, the target game object is determined in the following order: [Player 1, Player 2], [Player 3, Player 4], [Elite Monster 1, Elite Monster 2], [Normal Monster 1, Normal Monster 2].

[0077] In some embodiments, see Figure 3 , Figure 3 This is a flowchart illustrating steps S301-S302 provided in the embodiments of this application. Obstacle information is detected through steps S301-S302, and the explanation will be based on each step.

[0078] In step S301, detection resources are allocated to the target game object according to its priority. The higher the priority of the target game object, the more detection resources are allocated.

[0079] In step S302, based on the detection resources of the target game object, obstacle information in the sound propagation path from the target game object to the target game character is detected.

[0080] Combining steps S301-S302, the method for detecting obstacle information in the game is usually to allocate detection resources to the target game object. These detection resources can be detection rays, which are generated each frame by randomly emitting n rays from the hemisphere at the listener's location to detect obstacle information. To ensure sound processing for high-priority target game objects, more resources can be allocated to them based on their priority; for example, the number of detection rays allocated to players is greater than the number allocated to monsters.

[0081] In addition, this method can also solve the problem of insufficient terminal device performance. For example, due to performance limitations, the terminal device can emit a maximum of 10 (n=10) detection rays in sequence. At this time, 8 detection rays can be allocated to high-priority players, and 2 detection rays can be allocated to low-priority monsters.

[0082] In some embodiments, see Figure 4 , Figure 4 This is a flowchart illustrating steps S401-S403 provided in the embodiments of this application. Obstacle information can also be detected through steps S401-S403, and will be explained in conjunction with each step.

[0083] In step S401, multiple detection frames matching the target game object are determined based on the performance of the terminal device and the fixed number of detections of the target game object; wherein, the multiple detection frames have a preset detection order, and each detection frame corresponds to a preset number of detections.

[0084] In step S402, each detection frame is used to detect the first obstacle information in the sound propagation path from the target game object to the target game character according to a preset detection order and a preset number of detections.

[0085] In step S403, the target obstacle information is determined based on the first obstacle information obtained from the plurality of detection frames and the sum of the preset number of detections corresponding to the plurality of detection frames.

[0086] Combining steps S401-S403, real-time ray detection requires consideration of terminal device performance. To prevent stuttering on low-performance terminals, frame-splitting technology can be used to limit the computational load per frame, achieving a stable frame rate. Games typically run at a fixed number of frames per second (60fps). If a major computational task (such as performing sonic cage and sound barrier calculations for all players and monsters) is completed all at once in the same frame, it will cause that frame to run for too long, resulting in dropped frames and a poor player experience. Frame-splitting technology breaks down large tasks into multiple smaller tasks (such as performing a certain number of ray detections, or integrating the ray detection calculation results and setting the sonic cage and sound barrier effects), and then distributes them across each frame, ensuring that the workload of each frame is controllable.

[0087] For example, the target game object needs to be probed 10 times to improve the detection accuracy. This process is regarded as a task. Due to the limitations of the terminal device, performing 10 probes in one frame will cause screen stuttering. The task can be divided into 10 sub-tasks, with each sub-task performing one probe. The 10 sub-tasks are distributed across 10 frames to prevent screen stuttering.

[0088] There can be multiple target game objects. When there are multiple target game objects, for example, target game object 1 needs to be probed 4 times and target game object 2 needs to be probed 6 times, the probes of target game objects 1 and 2 can be completed through 10 sub-tasks. In this case, the 10 sub-tasks can be arranged and executed sequentially according to the priority of target game objects 1 and 2. In one optional way, target game object 1 has a higher priority than target game object 2, so the 4 sub-tasks for target game object 1 can be executed first, followed by the 6 sub-tasks for target game object 2. In another optional way, target game object 1 can be probed once (execute one sub-task). Since target game object 1 has already been probed, subsequent probes of target game object 1 are performed to improve accuracy, so target game object 2 can be probed again (execute one sub-task) to obtain probe data for target game object 2, and so on, alternating between the two.

[0089] Finally, the results of the 10 detections can be integrated to determine the target obstacle information.

[0090] In some embodiments, see Figure 5 , Figure 5 This is a flowchart illustrating steps S501-S503 provided in the embodiments of this application. Obstacle information can also be detected through steps S501-S503, and will be explained in conjunction with each step.

[0091] In step S501, detection resources are allocated to the target game object, and the number of detections for the target game object is determined.

[0092] In step S502, according to the detection order of the target game objects, the detection resources are used to detect the second obstacle information in the sound propagation path from the target game object to the target game character according to the number of detections; wherein, the detection order is determined according to the priority of the target game objects or is a specified order.

[0093] In step S503, the target obstacle information is determined based on the number of detections and the second obstacle information.

[0094] Combining steps S501-S503, in the game, since the importance of target game objects varies, detection resources can be allocated to target game objects according to their type, and the number of detections for each target game object can be determined. For example, if a player-type target game character is more important, more detection resources can be allocated to it, and the number of detections can also be more. If a monster-type target game character is less important than a player-type target game character, less detection resources can be allocated to it, and the number of detections can also be less.

[0095] For example, by default, the system assigns 5 detection rays to any target game object and performs 3 detections. For player-type target game objects, the number of detection rays can be increased to 8, and the number of detections can be increased to 5; for monster-type target game objects, the number of detection rays can be reduced to 3, and the number of detections can be reduced to 2.

[0096] In some embodiments, the detection resource is a detection ray; detecting obstacle information in the sound propagation path from the target game object to the target game character includes:

[0097] When the performance of the terminal device is lower than a preset performance threshold and / or the target game character stops moving, a preset number of detection rays are emitted towards the target game object to detect the target obstacle information; wherein, the preset number is set based on the performance of the terminal device and / or the distance between the target game character and the target game object.

[0098] Here, when the target game character stops moving, the traditional method of detecting by randomly firing rays may result in errors in the two detections due to accuracy issues (random ray firing may result in different numbers of rays in the two detections) when both the target game character and the target game object are stationary. This would cause the sound heard by the target game character to fluctuate when stationary (assuming the sound source remains unchanged), which is not in accordance with natural laws. Therefore, this problem can be solved by fixing the ray firing method.

[0099] For example, see Figure 6a , Figure 6a This is a schematic diagram of a fixed X-ray machine provided in an embodiment of this application, as shown below. Figure 6 As shown, when the target game character 6001 is stationary, x rays can be fired at the target game object 6002 and y rays can be fired at the target game object 6003 simultaneously. Before the target game character 6001 moves, the fixed ray firing method is always maintained to detect the target game objects 6002 and 6003.

[0100] The aforementioned methods are usually limited by the performance of the terminal device. Since low-performance devices can only fire a limited number of rays, the random ray firing method may fluctuate. This can be resolved by improving device performance or by using the methods described above. Additionally, it should be noted that in the above embodiments, the target game character stopping moving, and both the target game character and the target game object being stationary, can be understood as the relative position of the target game character and the target game object being less than a change threshold. Small movements of the target game character or the target game object are also applicable to the above methods.

[0101] In some embodiments, see Figure 6 , Figure 6 This is a flowchart illustrating steps S601-S602 provided in the embodiments of this application. The detection resource is a detection ray. The detection of target obstacle information can also be achieved through steps S601-S602, which will be explained in conjunction with each step.

[0102] In step S601, a emitting plane is set near the head of the target game character, and a reflecting plane is set near the target game object, wherein the emitting plane and the reflecting plane are parallel to each other, and the emitting plane is perpendicular to the sound propagation path of the target game object.

[0103] In step S602, a preset number of detection rays are emitted from the emitting plane to the reflecting plane to detect target obstacle information in the sound propagation path from the target game object to the target game character.

[0104] For examples, please continue to see Figure 6a The above-mentioned fixed-point X-ray method can be implemented in the following way:

[0105] A circular emitting plane 1 and a circular emitting plane 2 are set at the head of the target game character 6001. Correspondingly, a circular reflecting plane 6004 is set at the target game object 6002, and a circular reflecting plane 6005 can also be set at the target game object 6003. X rays are fixedly emitted from the circular emitting plane 1 towards the circular reflecting plane 6004, and y rays are fixedly emitted from the circular emitting plane 2 towards the circular reflecting plane 6005. Since the circular emitting planes 1 and 2 overlap, they are represented by a circular emitting plane 6006. Furthermore, the circular emitting plane 6006 is parallel to both the circular reflecting planes 6004 and 6005, allowing the rays to be emitted perpendicularly, thus improving detection efficiency and accuracy.

[0106] In some embodiments, the method further includes:

[0107] When the target character is in a moving state, the currently detected attenuation parameter is smoothed by a smoothing function, wherein the smoothing function is constructed based on the currently detected attenuation parameter, the previously detected attenuation parameter, and the smoothing ratio.

[0108] Here, the random ray-shooting method used by low-performance terminal devices can lead to poor sound effect stability of the target game character during movement. Smoothing can be performed to ensure the stability of the sound effect during movement.

[0109] A smoothing formula is used: new_v = step_ratio * v + (1.0 - step_ratio) * old_v, where v refers to the currently detected attenuation parameter, old_v refers to the previously detected attenuation parameter, step_ratio is the smoothing ratio, the larger the ratio, the smaller the proportion of the previously detected attenuation parameter, and the more easily the sound coefficient changes. Usually 0.7 is used. new_v refers to the smoothed attenuation parameter, part of which comes from the latest calculated value and part of which comes from the previously calculated value, so as to ensure the stability of the sound effect under movement.

[0110] In some embodiments, the detection resource is a detection ray; detecting the target obstacle information includes:

[0111] When the distance between the target game character and the target game object is less than a preset proximity detection value, a single detection ray is emitted from the ray emission source at the target game character toward the target game object.

[0112] Here, when the target game character and the target game object are too close, the sound propagation is less affected by the sound cage / sound barrier. Therefore, when acquiring target obstacle information, the accuracy requirement for detection is relatively low, and less detection resources can be invested to detect target obstacle information.

[0113] For example, it can be enabled when the distance between the listener and the target is less than the proximity detection value, that is, only one ray is used for detection. If the ray detection passes, it means that there is no obstacle between the two, the sound cage / sound barrier calculation value is 0, the player threshold is 200 units of distance, and the monster threshold is 100 units of distance.

[0114] In some embodiments, the object type includes a first type and a second type, and the target game character triggering the sound processing task includes:

[0115] When the distance between the target game character and any of the at least one game objects is less than a preset first distance threshold;

[0116] And / or the distance between the target game character and the first type of game object is less than a preset second distance threshold;

[0117] And / or the distance between the target game character and the second type of game object is less than a preset third distance threshold, wherein the second distance threshold is greater than the third distance threshold.

[0118] In some embodiments, in order to reduce resource consumption, detection may not be performed when "no sound can be heard" (the sound source is far away). That is, the sound processing task will only be triggered when the distance condition is met.

[0119] For example, for game objects, the default sound propagation range can be 500 units, and the sound cage / sound barrier will only be calculated when they enter this distance; in addition, the distance can be subdivided according to the type of game object, for example, 500 units for players (type 1) and 200 units for monsters (type 2); the same configuration applies to monsters, but for ordinary monsters, which generally do not have special sounds and behaviors, the sensing distance can be smaller, such as 100.

[0120] In summary, the embodiments of this application have the following beneficial effects:

[0121] When a sound processing task is triggered in response to a target game character, the target game object where the sound source is located is identified. Based on the target obstacle information in the sound propagation path from the target game object to the target game character, the attenuation parameter of the sound source is determined. To avoid using the same curve to calculate the attenuation effect for all sounds, different game objects in the game are divided into multiple types. Then, based on the object type of the target game object, the target adjustment range corresponding to the attenuation parameter is determined. In this way, the obtained target adjustment range is applicable to specific types of game objects, realizing personalized sound processing for different types of game objects. Finally, the target adjustment value of the attenuation parameter within the target adjustment range is obtained, and the sound source is processed based on the target adjustment value, enabling sound processing to adapt to complex scenes.

[0122] Based on the same inventive concept, this application also provides a game sound processing device corresponding to the game sound processing method in the first embodiment. Since the principle of the device in this application is similar to the above-mentioned game sound processing method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0123] like Figure 7 As shown, Figure 7 This is a schematic diagram of the structure of the sound processing device 700 in a game provided in an embodiment of this application. The sound processing device 700 in the game includes:

[0124] The first determining module 701 is used to respond to the target game character triggering a sound processing task, determine the target game object where the sound source is located, and determine the attenuation parameter of the sound source based on the target obstacle information in the sound propagation path from the target game object to the target game character;

[0125] The second determining module 702 is used to determine the target adjustment range corresponding to the attenuation parameter based on the object type of the target game object; the adjustment value of the attenuation parameter is different in different adjustment ranges.

[0126] The processing module 703 is used to obtain the target adjustment value of the attenuation parameter within the target adjustment range, and to process the sound generated by the sound source based on the target adjustment value.

[0127] Those skilled in the art should understand that Figure 7 The functions of each unit in the sound processing device 700 shown in the game can be understood by referring to the relevant description of the sound processing method in the aforementioned game. Figure 7 The functions of each unit in the sound processing device 700 shown in the game can be implemented by a program running on the processor or by specific logic circuits.

[0128] In one possible implementation, the first determining module 701 responds to the target game character triggering a sound processing task to determine the target game object where the sound source is located, including:

[0129] In response to the target game character triggering a sound processing task, multiple candidate game objects are identified as the sound source.

[0130] The priority of the multiple candidate objects is determined based on their object types; the types are determined based on the characteristics and functions of the game objects.

[0131] Based on the priority of the multiple candidate objects, one or more candidate objects are selected as the target game object in turn until there are no remaining candidate objects.

[0132] In one possible implementation, the first determining module 701 selects one or more candidate objects as target game objects from the plurality of candidate objects according to their priorities, including:

[0133] Based on the priority of the plurality of candidate objects and the device performance of the terminal device, one or more candidate objects are selected sequentially from the plurality of candidate objects as target game objects.

[0134] In one possible implementation, the first determining module 701 detects obstacle information in the following manner:

[0135] The detection resources are allocated to the target game object according to its priority. The higher the priority of the target game object, the more detection resources are allocated.

[0136] Based on the detection resources of the target game object, detect obstacle information in the sound propagation path from the target game object to the target game character.

[0137] In one possible implementation, the first determining module 701 detects obstacle information in the following manner:

[0138] Based on the performance of the terminal device and the fixed number of detections for the target game object, multiple detection frames are determined to match the target game object; wherein, the multiple detection frames have a preset detection order, and each detection frame corresponds to a preset number of detections;

[0139] Using each detection frame, in a preset detection order and with a preset number of detections, the information of the first obstacle in the sound propagation path from the target game object to the target game character is detected;

[0140] The target obstacle information is determined based on the first obstacle information obtained from the multiple detection frames and the total number of preset detections corresponding to the multiple detection frames.

[0141] In one possible implementation, the first determining module 701 detects obstacle information in the following manner:

[0142] Allocate detection resources to the target game object and determine the number of times the target game object will be detected;

[0143] According to the detection order of the target game objects, the detection resources are used to detect the second obstacle information in the sound propagation path from the target game object to the target game character according to the number of detections; wherein, the detection order is determined according to the priority of the target game objects or is a specified order;

[0144] The target obstacle information is determined based on the number of detections and the second obstacle information.

[0145] In one possible implementation, the detection resource is a detection ray; the first determining module 701 detects obstacle information in the sound propagation path from the target game object to the target game character, including:

[0146] When the performance of the terminal device is lower than a preset performance threshold and / or the target game character stops moving, a preset number of detection rays are emitted towards the target game object to detect the target obstacle information; wherein, the preset number is set based on the performance of the terminal device and / or the distance between the target game character and the target game object.

[0147] In one possible implementation, the detection resource is a detection ray; the first determining module 701 detects the target obstacle information, including:

[0148] A emitting plane is set near the head of the target game character, and a reflecting plane is set near the target game object, wherein the emitting plane and the reflecting plane are parallel to each other, and the emitting plane is perpendicular to the sound propagation path of the target game object;

[0149] A predetermined number of detection rays are emitted from the emitting plane toward the reflecting plane to detect target obstacle information in the sound propagation path from the target game object to the target game character.

[0150] In one possible implementation, the first determining module 701 further includes:

[0151] When the target character is in a moving state, the currently detected attenuation parameter is smoothed by a smoothing function, wherein the smoothing function is constructed based on the currently detected attenuation parameter, the previously detected attenuation parameter, and the smoothing ratio.

[0152] In one possible implementation, the detection resource is a detection ray; the first determining module 701 detects the target obstacle information, including:

[0153] When the distance between the target game character and the target game object is less than a preset proximity detection value, a single detection ray is emitted from the ray emission source at the target game character toward the target game object.

[0154] In one possible implementation, the object type includes a first type and a second type, and the target game character triggers the sound processing task including:

[0155] When the distance between the target game character and any of the at least one game objects is less than a preset first distance threshold;

[0156] And / or the distance between the target game character and the first type of game object is less than a preset second distance threshold;

[0157] And / or the distance between the target game character and the second type of game object is less than a preset third distance threshold, wherein the second distance threshold is greater than the third distance threshold.

[0158] The sound processing device in the aforementioned game determines the target game object where the sound source is located when the target game character triggers a sound processing task. Based on the information of target obstacles in the sound propagation path from the target game object to the target game character, it determines the attenuation parameters of the sound generated by the sound source. To avoid using the same curve to calculate the attenuation effect for all sounds, different game objects within the game are divided into multiple types. Then, based on the object type of the target game object, a target adjustment range corresponding to the attenuation parameters is determined. This means that the obtained target adjustment range is applicable to specific types of game objects, achieving personalized sound processing for different types of game objects. Finally, the target adjustment value of the attenuation parameters within the target adjustment range is obtained, and the sound generated by the sound source is processed based on the target adjustment value, enabling sound processing to adapt to complex scenes.

[0159] like Figure 8 As shown, Figure 8 This is a schematic diagram of the composition structure of the electronic device 800 provided in the embodiments of this application. The electronic device 800 includes:

[0160] The electronic device 800 comprises a processor 801, a storage medium 802, and a bus 803. The storage medium 802 stores machine-readable instructions executable by the processor 801. When the electronic device 800 is running, the processor 801 communicates with the storage medium 802 via the bus 803. The processor 801 executes the machine-readable instructions to perform the following steps:

[0161] In response to the target game character triggering a sound processing task, the target game object where the sound source is located is determined, and the attenuation parameter of the sound source is determined based on the target obstacle information in the sound propagation path from the target game object to the target game character;

[0162] Based on the object type of the target game object, the target adjustment range corresponding to the attenuation parameter is determined; the adjustment value of the attenuation parameter is different in different adjustment ranges.

[0163] Obtain the target adjustment value of the attenuation parameter within the target adjustment range, and process the sound generated by the sound source based on the target adjustment value.

[0164] In one possible implementation, the processor 801 responds to the target game character triggering a sound processing task, determining the target game object where the sound source is located, including:

[0165] In response to the target game character triggering a sound processing task, multiple candidate game objects are identified as the sound source.

[0166] The priority of the multiple candidate objects is determined based on their object types; the types are determined based on the characteristics and functions of the game objects.

[0167] Based on the priority of the multiple candidate objects, one or more candidate objects are selected as the target game object in turn until there are no remaining candidate objects.

[0168] In one possible implementation, the processor 801 selects one or more candidate objects as target game objects sequentially from the plurality of candidate objects according to their priorities, including:

[0169] Based on the priority of the plurality of candidate objects and the device performance of the terminal device, one or more candidate objects are selected sequentially from the plurality of candidate objects as target game objects.

[0170] In one possible implementation, the processor 801 detects obstacle information by:

[0171] The detection resources are allocated to the target game object according to its priority. The higher the priority of the target game object, the more detection resources are allocated.

[0172] Based on the detection resources of the target game object, detect obstacle information in the sound propagation path from the target game object to the target game character.

[0173] In one possible implementation, the processor 801 detects obstacle information by:

[0174] Based on the performance of the terminal device and the fixed number of detections for the target game object, multiple detection frames are determined to match the target game object; wherein, the multiple detection frames have a preset detection order, and each detection frame corresponds to a preset number of detections;

[0175] Using each detection frame, in a preset detection order and with a preset number of detections, the information of the first obstacle in the sound propagation path from the target game object to the target game character is detected;

[0176] The target obstacle information is determined based on the first obstacle information obtained from the multiple detection frames and the total number of preset detections corresponding to the multiple detection frames.

[0177] In one possible implementation, the processor 801 detects obstacle information by:

[0178] Allocate detection resources to the target game object and determine the number of times the target game object will be detected;

[0179] According to the detection order of the target game objects, the detection resources are used to detect the second obstacle information in the sound propagation path from the target game object to the target game character according to the number of detections; wherein, the detection order is determined according to the priority of the target game objects or is a specified order;

[0180] The target obstacle information is determined based on the number of detections and the second obstacle information.

[0181] In one possible implementation, the detection resource is a detection ray; the processor 801 detects obstacle information in the sound propagation path from the target game object to the target game character, including:

[0182] When the performance of the terminal device is lower than a preset performance threshold and / or the target game character stops moving, a preset number of detection rays are emitted towards the target game object to detect the target obstacle information; wherein, the preset number is set based on the performance of the terminal device and / or the distance between the target game character and the target game object.

[0183] In one possible implementation, the detection resource is a detection ray; the processor 801 detects the target obstacle information, including:

[0184] A emitting plane is set near the head of the target game character, and a reflecting plane is set near the target game object, wherein the emitting plane and the reflecting plane are parallel to each other, and the emitting plane is perpendicular to the sound propagation path of the target game object;

[0185] A predetermined number of detection rays are emitted from the emitting plane toward the reflecting plane to detect target obstacle information in the sound propagation path from the target game object to the target game character.

[0186] In one possible implementation, the processor 801 further includes:

[0187] When the target character is in a moving state, the currently detected attenuation parameter is smoothed by a smoothing function, wherein the smoothing function is constructed based on the currently detected attenuation parameter, the previously detected attenuation parameter, and the smoothing ratio.

[0188] In one possible implementation, the detection resource is a detection ray; the processor 801 detects the target obstacle information, including:

[0189] When the distance between the target game character and the target game object is less than a preset proximity detection value, a single detection ray is emitted from the ray emission source at the target game character toward the target game object.

[0190] In one possible implementation, the object type includes a first type and a second type, and the target game character triggering the sound processing task includes:

[0191] When the distance between the target game character and any of the at least one game objects is less than a preset first distance threshold;

[0192] And / or the distance between the target game character and the first type of game object is less than a preset second distance threshold;

[0193] And / or the distance between the target game character and the second type of game object is less than a preset third distance threshold, wherein the second distance threshold is greater than the third distance threshold.

[0194] In practical applications, the various components in the electronic device 800 are coupled together via bus 803. It can be understood that bus 803 is used to achieve communication between these components. In addition to a data bus, bus 803 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 8 The general labeled all buses as Bus 803.

[0195] The aforementioned electronic device determines the target game object where the sound source is located when responding to a sound processing task triggered by a target game character. Based on information about target obstacles in the sound propagation path from the target game object to the target game character, it determines the attenuation parameters of the sound generated by the sound source. To avoid using the same curve to calculate the attenuation effect for all sounds, it categorizes different game objects into multiple types. Then, based on the object type of the target game object, it determines the target adjustment range corresponding to the attenuation parameters. This results in a target adjustment range applicable to specific types of game objects, achieving personalized sound processing for different types of game objects. Finally, it obtains the target adjustment value of the attenuation parameters within the target adjustment range and processes the sound generated by the sound source based on this target adjustment value, enabling sound processing to adapt to complex scenarios.

[0196] This application embodiment also provides a computer-readable storage medium storing executable instructions, which, when executed by at least one processor 801, perform the following steps:

[0197] In response to the target game character triggering a sound processing task, the target game object where the sound source is located is determined, and the attenuation parameter of the sound source is determined based on the target obstacle information in the sound propagation path from the target game object to the target game character;

[0198] Based on the object type of the target game object, the target adjustment range corresponding to the attenuation parameter is determined; the adjustment value of the attenuation parameter is different in different adjustment ranges.

[0199] Obtain the target adjustment value of the attenuation parameter within the target adjustment range, and process the sound generated by the sound source based on the target adjustment value.

[0200] In one possible implementation, responding to the target game character triggering a sound processing task, determining the target game object where the sound source is located includes:

[0201] In response to the target game character triggering a sound processing task, multiple candidate game objects are identified as the sound source.

[0202] The priority of the multiple candidate objects is determined based on their object types; the types are determined based on the characteristics and functions of the game objects.

[0203] Based on the priority of the multiple candidate objects, one or more candidate objects are selected as the target game object in turn until there are no remaining candidate objects.

[0204] In one possible implementation, selecting one or more candidate objects as the target game object sequentially from the plurality of candidate objects according to their priority includes:

[0205] Based on the priority of the plurality of candidate objects and the device performance of the terminal device, one or more candidate objects are selected sequentially from the plurality of candidate objects as target game objects.

[0206] In one possible implementation, obstacle information is detected by means of:

[0207] The detection resources are allocated to the target game object according to its priority. The higher the priority of the target game object, the more detection resources are allocated.

[0208] Based on the detection resources of the target game object, detect obstacle information in the sound propagation path from the target game object to the target game character.

[0209] In one possible implementation, obstacle information is detected by means of:

[0210] Based on the performance of the terminal device and the fixed number of detections for the target game object, multiple detection frames are determined to match the target game object; wherein, the multiple detection frames have a preset detection order, and each detection frame corresponds to a preset number of detections;

[0211] Using each detection frame, in a preset detection order and with a preset number of detections, the information of the first obstacle in the sound propagation path from the target game object to the target game character is detected;

[0212] The target obstacle information is determined based on the first obstacle information obtained from the multiple detection frames and the total number of preset detections corresponding to the multiple detection frames.

[0213] In one possible implementation, obstacle information is detected by means of:

[0214] Allocate detection resources to the target game object and determine the number of times the target game object will be detected;

[0215] According to the detection order of the target game objects, the detection resources are used to detect the second obstacle information in the sound propagation path from the target game object to the target game character according to the number of detections; wherein, the detection order is determined according to the priority of the target game objects or is a specified order;

[0216] The target obstacle information is determined based on the number of detections and the second obstacle information.

[0217] In one possible implementation, the detection resource is a detection ray; the detection of obstacle information in the sound propagation path from the target game object to the target game character includes:

[0218] When the performance of the terminal device is lower than a preset performance threshold and / or the target game character stops moving, a preset number of detection rays are emitted towards the target game object to detect the target obstacle information; wherein, the preset number is set based on the performance of the terminal device and / or the distance between the target game character and the target game object.

[0219] In one possible implementation, the detection resource is a detection ray; detecting the target obstacle information includes:

[0220] A emitting plane is set near the head of the target game character, and a reflecting plane is set near the target game object, wherein the emitting plane and the reflecting plane are parallel to each other, and the emitting plane is perpendicular to the sound propagation path of the target game object;

[0221] A predetermined number of detection rays are emitted from the emitting plane toward the reflecting plane to detect target obstacle information in the sound propagation path from the target game object to the target game character.

[0222] In one possible implementation, the computer program, when run by the processor, further performs the following steps:

[0223] When the target character is in a moving state, the currently detected attenuation parameter is smoothed by a smoothing function, wherein the smoothing function is constructed based on the currently detected attenuation parameter, the previously detected attenuation parameter, and the smoothing ratio.

[0224] In one possible implementation, the detection resource is a detection ray; detecting the target obstacle information includes:

[0225] When the distance between the target game character and the target game object is less than a preset proximity detection value, a single detection ray is emitted from the ray emission source at the target game character toward the target game object.

[0226] In one possible implementation, the object type includes a first type and a second type, and the target game character triggering the sound processing task includes:

[0227] When the distance between the target game character and any of the at least one game objects is less than a preset first distance threshold;

[0228] And / or the distance between the target game character and the first type of game object is less than a preset second distance threshold;

[0229] And / or the distance between the target game character and the second type of game object is less than a preset third distance threshold, wherein the second distance threshold is greater than the third distance threshold.

[0230] In some embodiments, the storage medium may be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD ROM), etc.; or it may be a device that includes one or any combination of the above-mentioned memories.

[0231] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

[0232] As an example, executable instructions may, but do not necessarily, correspond to files in the file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).

[0233] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.

[0234] The aforementioned computer-readable storage medium, upon responding to a target game character triggering a sound processing task, determines the target game object where the sound source is located, and determines the attenuation parameter of the sound generated by the sound source based on the target obstacle information in the sound propagation path from the target game object to the target game character. To avoid using the same curve to calculate the attenuation effect for all sounds, different game objects within the game are divided into multiple types, and then the target adjustment range corresponding to the attenuation parameter is determined based on the object type of the target game object. In this way, the obtained target adjustment range is applicable to specific types of game objects, realizing personalized sound processing for different types of game objects. Finally, the target adjustment value of the attenuation parameter within the target adjustment range is obtained, and the sound generated by the sound source is processed based on the target adjustment value, enabling sound processing to adapt to complex scenes.

[0235] In the several embodiments provided in this application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0236] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0237] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0238] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a platform server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0239] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for processing sound in a game, characterized by, The method includes providing a graphical user interface (GUI) via a terminal device and displaying at least a portion of a game scene on the GUI, wherein the at least portion of the game scene includes a target game character and at least one game object. In response to the target game character triggering a sound processing task, the target game object where the sound source is located is determined, and the attenuation parameter of the sound source is determined based on the target obstacle information in the sound propagation path from the target game object to the target game character; Based on the object type of the target game object, the target adjustment range corresponding to the attenuation parameter is determined; the adjustment value of the attenuation parameter is different in different adjustment ranges. Obtain the target adjustment value of the attenuation parameter within the target adjustment range, and process the sound generated by the sound source based on the target adjustment value.

2. The method of claim 1, wherein, The response to the target game character triggering the sound processing task, determining the target game object where the sound source is located, includes: In response to the target game character triggering a sound processing task, multiple candidate objects of the sound source are identified; The priority of the multiple candidate objects is determined based on their object types; the types are determined based on the characteristics and functions of the game objects. Based on the priority of the multiple candidate objects, one or more candidate objects are selected as the target game object in turn until there are no remaining candidate objects.

3. The method of claim 2, wherein, The step of selecting one or more candidate objects as target game objects from the plurality of candidate objects according to their priority includes: Based on the priority of the plurality of candidate objects and the device performance of the terminal device, one or more candidate objects are selected sequentially from the plurality of candidate objects as target game objects.

4. The method of claim 1, wherein, Obstacle information is detected in the following ways: The detection resources are allocated to the target game object according to its priority. The higher the priority of the target game object, the more detection resources are allocated. Based on the detection resources of the target game object, detect obstacle information in the sound propagation path from the target game object to the target game character.

5. The method of claim 1, wherein, Obstacle information is detected in the following ways: Based on the performance of the terminal device and the fixed number of detections for the target game object, multiple detection frames are determined to match the target game object; wherein, the multiple detection frames have a preset detection order, and each detection frame corresponds to a preset number of detections; Using each detection frame, in a preset detection order and with a preset number of detections, the information of the first obstacle in the sound propagation path from the target game object to the target game character is detected; The target obstacle information is determined based on the first obstacle information obtained from the multiple detection frames and the total number of preset detections corresponding to the multiple detection frames.

6. The method according to claim 1, characterized in that, Obstacle information is detected in the following ways: Allocate detection resources to the target game object and determine the number of times the target game object will be detected; According to the detection order of the target game objects, the detection resources are used to detect the second obstacle information in the sound propagation path from the target game object to the target game character according to the number of detections; wherein, the detection order is determined according to the priority of the target game objects or is a specified order; The target obstacle information is determined based on the number of detections and the second obstacle information.

7. The method of claim 4, wherein, The detection resource is a detection ray; the detection of obstacle information in the sound propagation path from the target game object to the target game character includes: When the performance of the terminal device is lower than a preset performance threshold and / or the target game character stops moving, a preset number of detection rays are emitted towards the target game object to detect the target obstacle information; wherein, the preset number is set based on the performance of the terminal device and / or the distance between the target game character and the target game object.

8. The method according to claim 4 or 6, characterized in that, The detection resource is a detection ray; detecting the target obstacle information includes: A emitting plane is set near the head of the target game character, and a reflecting plane is set near the target game object, wherein the emitting plane and the reflecting plane are parallel to each other, and the emitting plane is perpendicular to the sound propagation path of the target game object; A predetermined number of detection rays are emitted from the emitting plane toward the reflecting plane to detect target obstacle information in the sound propagation path from the target game object to the target game character.

9. The method of claim 1, wherein, The method further includes: When the target game character is in a moving state, the currently detected decay parameter is smoothed by a smoothing function, wherein the smoothing function is constructed based on the currently detected decay parameter, the previously detected decay parameter, and the smoothing ratio.

10. The method of claim 4, wherein, The detection resource is a detection ray; Detecting the target obstacle information includes: When the distance between the target game character and the target game object is less than a preset proximity detection value, a single detection ray is emitted from the ray emission source at the target game character toward the target game object.

11. The method of claim 1, wherein, The object type includes a first type and a second type, and the target game character triggers the sound processing task including: When the distance between the target game character and any of the at least one game objects is less than a preset first distance threshold; And / or the distance between the target game character and the first type of game object is less than a preset second distance threshold; And / or the distance between the target game character and the second type of game object is less than a preset third distance threshold, wherein the second distance threshold is greater than the third distance threshold.

12. A sound processing apparatus in a game, characterized by comprising: The device provides a graphical user interface (GUI) via a terminal device, and displays at least a portion of a game scene on the GUI, wherein the at least portion of the game scene includes a target game character and at least one game object, the device comprising: The first determining module is used to respond to the target game character triggering a sound processing task, determine the target game object where the sound source is located, and determine the attenuation parameter of the sound source based on the target obstacle information in the sound propagation path from the target game object to the target game character; The second determining module is used to determine the target adjustment range corresponding to the attenuation parameter based on the object type of the target game object; the adjustment value of the attenuation parameter is different in different adjustment ranges; The processing module is used to obtain the target adjustment value of the attenuation parameter within the target adjustment range, and to process the sound generated by the sound source based on the target adjustment value.

13. An electronic device, comprising: include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the sound processing method in a game as described in any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the sound processing method in a game as described in any one of claims 1 to 11.