Method, device and electronic device for playing impact sound effects
By obtaining impact incident angle, type information and material information in the game, and determining and playing the target jump sound effect, the problem of poor realism of jump sound effect in the existing technology is solved, and a more realistic jump sound effect and an improved user experience is achieved.
Patent Information
- Application Number
- CN202210671367.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-14
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-06-14
AI Technical Summary
The existing technology cannot fully restore the conditions for generating jump sounds in reality, resulting in poor realism of jump sound effects and affecting the player's gaming experience.
The terminal device provides a graphical user interface, responds to the target object hitting the hit object in the virtual scene, obtains the impact incident angle, the target object type information and the material information of the hit object, and determines the target jump sound effect based on this information, and plays it.
It makes the trigger logic and listening experience of the jump sound effect more realistic, taking into account the impact incident angle and the impact material, and improving the user experience.
Smart Images

Figure CN115300906B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of game interaction design, and in particular to a method, device and electronic equipment for playing impact sound effects. Background Art
[0002] A ricochet is a type of "stray bullet" that occurs when a bullet hits a smooth, hard object at a certain angle. The bullet has a certain chance of bouncing back, which causes the bullet's physical shape, flight trajectory, and stability to change before continuing to fly. In shooting games, although there are no visible ricochets, and no actual ricochet damage, we can simulate them in terms of hearing, making the game sound richer and more realistic, and further enhancing the excitement and tension that players get through hearing.
[0003] In the related art, a ricochet sound effect is usually achieved by superimposing a layer of ricochet sound on the sound of an object being hit in a fixed direction. However, the ricochet sound effects usually vary depending on the hit objects. Implementing the ricochet sound effect in a unified manner will result in poor realism of the ricochet sound effect, affecting the player's gaming experience. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and electronic device for playing impact sound effects, so as to improve the realism of the sound effects emitted when an object being hit is hit in a game, thereby enhancing the game experience of players.
[0005] In a first aspect, the present invention provides a method for playing impact sound effects, providing a graphical user interface through a terminal device, and displaying a virtual picture of a virtual scene in the graphical user interface; the method includes: in response to a target object in the virtual scene hitting a hit object, obtaining the impact incident angle, type information of the target object and material information of the hit object when the target object hits the hit object; determining a target ricochet sound effect when the target object hits the hit object based on the impact incident angle, type information and material information; and playing the target ricochet sound effect.
[0006] In an optional embodiment, the above step of determining the target ricochet sound effect of the target object hitting the hit object based on the impact incident angle, type information and material information includes: determining the ricochet trigger probability based on the impact incident angle and material information; determining the target playback source from multiple sound effect playback sources of the target object corresponding to the type information based on the ricochet trigger probability; and determining the target playback source as the target ricochet sound effect.
[0007] In an optional embodiment, the step of determining the ricochet trigger probability based on the impact incident angle and the material information includes: determining the ricochet trigger probability corresponding to the impact incident angle and the material information according to a preset ricochet trigger relationship; wherein the ricochet trigger relationship includes: the ricochet trigger probability of each preset angle interval in a plurality of preset angle intervals under each preset impact material.
[0008] In an optional embodiment, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or an audible playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the number of silent playback sources and the number of audible playback sources are determined according to the ricochet trigger probability; the above-mentioned step of determining the target playback source from the multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability includes: randomly selecting a sound effect playback source as the target playback source from the multiple sound effect playback sources corresponding to the target object corresponding to the type information under the ricochet trigger probability; wherein the target playback source is a silent playback source or an audible playback source.
[0009] In an optional embodiment, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the weight corresponding to the silent playback source and the weight corresponding to the sound playback source are determined according to the ricochet trigger probability; the above-mentioned step of determining the target playback source from the multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability includes: determining the target playback source from the silent playback source and the sound playback source corresponding to the target object corresponding to the type information under the ricochet trigger probability based on the weight corresponding to the silent playback source and the weight corresponding to the sound playback source under the ricochet trigger probability.
[0010] In an optional implementation, the above-mentioned sound playback source stores sound effects that decay and change with time; when the multiple sound effect playback sources include multiple sound playback sources, the sound effects stored in the sound playback sources are different.
[0011] In an optional embodiment, before the step of playing the target ricochet sound effect, the method further includes: selecting a target path from a plurality of preset playback paths, so that the target ricochet sound effect is played in the direction of the target path.
[0012] In an optional embodiment, the step of playing the target ricochet sound effect includes: starting from the impact point of the hit object, playing the target ricochet sound effect along the direction of the target path.
[0013] In an optional embodiment, the method further includes: if the impact incident angle of the hit object is not obtained, determining a preset incident angle as the impact incident angle.
[0014] In an optional embodiment, the step of playing the target ricochet sound effect includes: in response to the target object moving in the virtual scene, playing the target ricochet sound effect according to a preset attenuation curve corresponding to the moving direction.
[0015] In an optional embodiment, after the step of determining the target ricochet sound effect of the target object hitting the target object based on the impact incident angle, type information and material information, the method further includes: playing the hit sound effect of the target object while playing the target ricochet sound effect.
[0016] In an optional embodiment, before the step of playing the hit sound effect of the hit object while playing the target ricochet sound effect, the method further includes: determining at least one preset hit sound effect corresponding to the hit object based on the type information of the target object; and extracting one preset hit sound effect from the at least one preset hit sound effect as the hit sound effect of the hit object.
[0017] In a second aspect, the present invention provides a device for playing impact sound effects, which provides a graphical user interface through a terminal device, and displays a virtual picture of a virtual scene in the graphical user interface; the device includes: an information acquisition module, which is used to respond to the target object in the virtual scene hitting the hit object, and obtain the impact incident angle, type information of the target object and material information of the hit object when the target object hits the hit object; a sound effect determination module, which is used to determine the target ricochet sound effect of the target object hitting the hit object based on the impact incident angle, type information and material information; and a sound effect playback module, which is used to play the target ricochet sound effect.
[0018] In a third aspect, the present invention provides an electronic device, which includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for playing the impact sound effect.
[0019] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for playing the impact sound effect.
[0020] The embodiments of the present invention bring the following beneficial effects:
[0021] The present invention provides a method, device and electronic device for playing impact sound effects. First, in response to a target object hitting a hit object in a virtual scene, the impact incident angle, type information of the target object and material information of the hit object are obtained; then, according to the impact incident angle, type information and material information, a target ricochet sound effect of the target object hitting the hit object is determined; and then the target ricochet sound effect is played. In this method, the ricochet sound effect is jointly determined according to the impact incident angle, type of the target object and material of the hit object when the target object hits the hit object, so that the ricochet sound effects of different types of target objects can be differentiated, and the determination of the ricochet sound effect can take into account the impact incident angle and the impact material, so that the triggering logic and hearing sense of the ricochet sound effect are more realistic, which is conducive to improving the user experience.
[0022] Other features and advantages of the present invention will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present invention.
[0023] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are specifically listed below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0025] Figure 1 A flowchart of a method for playing impact sound effects provided by an embodiment of the present invention;
[0026] Figure 2 A flowchart of another method for playing impact sound effects provided by an embodiment of the present invention;
[0027] Figure 3 A logic diagram for implementing impact sound effect playback provided by an embodiment of the present invention;
[0028] Figure 4 An Audio object hierarchical structure diagram provided by an embodiment of the present invention;
[0029] Figure 5 A flowchart of another method for playing impact sound effects provided by an embodiment of the present invention;
[0030] Figure 6 A schematic diagram of a playback path provided by an embodiment of the present invention;
[0031] Figure 7 A schematic diagram of the structure of a device for playing impact sound effects provided by an embodiment of the present invention;
[0032] Figure 8 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0034] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] In virtual scenes, ricochets usually occur when a bullet hits a smooth hard object at a certain angle, and the bullet has a certain chance of being rebounded, which causes the bullet's physical shape, flight trajectory, and stability to change before continuing to fly. This phenomenon is a type of "stray bullet." For example, in shooting games, although there are no visible ricochets, and no actual ricochet damage, we can simulate them in terms of hearing, making the game sound richer and more realistic, and further enhancing the excitement and tension that players get through hearing.
[0036] In related technologies, the ricochet sound effect is generally achieved through the following solutions:
[0037] Solution 1: The ricochet sound as a point sound source can be heard only when the listener is close to the object being hit. This is achieved by "adding a layer of ricochet sound to the sound of the object being hit and ending the attenuation curve of the ricochet sound earlier."
[0038] Option 2 is to add a layer of ricochet sound to materials that are relatively hard in reality, such as cement, metal, stone, etc. This layer of ricochet sound may be triggered 100% or with a certain probability.
[0039] The ricochet sound of the above solutions is a point sound source with a fixed position, that is, the position of the ricochet sound is exactly the same as the position of the impact point between the bullet and the object from beginning to end. Therefore, the solutions provided in the related art have the following deficiencies:
[0040] (1) The existing technology cannot fully restore the conditions for the generation of ricochet sounds in reality. In reality, whether a ricochet occurs depends not only on the hardness of the material, but also has a direct relationship with the angle at which the bullet hits the surface of the object being hit. The ricochet sound effect achieved by the existing technology cannot associate the generation of the ricochet sound effect with the incident angle, so that the trigger logic of the existing technology makes the sound triggering lack of realism.
[0041] (2) Existing technologies cannot achieve richer and more realistic spatial changes. Once a ricochet is generated in reality, it will continue to fly. Although the flying speed is very fast, the azimuth change of the sound still exists objectively. However, existing technologies can only generate sound at the point where the bullet hits the object. Once the sound is generated, it will not continue to change in space, which will make players feel that the ricochet is stationary, and the pleasantness and realism are both insufficient.
[0042] (3) The existing technology cannot distinguish the type of bullet or firearm that produces the ricochet. In reality, different types of bullets have different properties such as shape, size, and structure, and the ricochet sounds they produce are also different. For example, special bullets such as anti-armor bullets have a greatly reduced possibility of producing ricochets. These differences can all be summarized as differences in bullets or firearms that produce ricochets. These differences cannot be reflected in the sound through the existing technology. The ricochet sound effect is realized in a unified manner, so that the ricochet sound effect can neither achieve better artistic expression nor serve as a functional prompt sound, resulting in poor realism of the ricochet sound effect, affecting the player's gaming experience.
[0043] Based on the above description, the embodiments of the present invention provide a method, device and electronic device for playing impact sound effects. The technology can be applied to scenes where objects collide with each other in virtual scenes, especially scenes where bullets hit objects in shooting games.
[0044] In one embodiment of the present disclosure, the method for playing the impact sound effect can be run on a terminal device or a server. The terminal device can be a local terminal device. When the method for playing the impact sound effect is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0045] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated, the storage and operation of the information interaction method are completed on the cloud game server, and the role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0046] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0047] In a possible implementation, an embodiment of the present invention provides a method for playing impact sound effects, wherein a terminal device provides a graphical user interface, and a virtual screen of a virtual scene is displayed in the graphical user interface; Figure 1 As shown, the method comprises the following specific steps:
[0048] Step S102, in response to the target object in the virtual scene hitting the hit object, obtaining the impact incident angle when the target object hits the hit object, the type information of the target object and the material information of the hit object.
[0049] The above-mentioned target objects are usually attacking equipment, which can be darts, various types of virtual firearms (for example, pistols, sniper rifles, shotguns, rifles, heavy machine guns, submachine guns, etc.) or flying saucers, etc. The above-mentioned hit objects are usually objects that can be hit, such as walls, ground, big trees, iron plates, sand, etc. Each hit object has its own corresponding material, and the material corresponding to each hit object is pre-set in the virtual scene, and is set according to R&D needs. For example, the material of the ground is cement, the material of the big tree is wood, and the material of the iron plate is metal, etc.
[0050] If the player controls the target object in the virtual scene to hit the hit object, the impact incident angle, the type of the target object and the material of the hit object are immediately obtained. Specifically, if the target object is a virtual firearm, the impact incident angle is the minimum angle between the trajectory of the bullet fired by the virtual firearm and the surface of the hit object; if the target object is a dart, the impact incident angle is the minimum angle between the launch trajectory of the dart and the surface of the hit object.
[0051] For example, when a player uses a pistol to shoot at a wooden object at an angle of 45 degrees, the obtained impact incident angle is 45 degrees, the type information of the target object is a pistol, and the material information of the hit object is a wooden material.
[0052] Step S104, determining the target ricochet sound effect of the target object hitting the hit object according to the above-mentioned impact incident angle, type information and material information.
[0053] In specific implementation, different types of target objects make different sounds when hitting the hit object, and each type of target object makes different sounds when hitting the hit object of different materials. In addition, when the target object hits the hit object at different incident angles, the probability of ricocheting is different, and when the target object hits the hit object of different materials at the same incident angle, the probability of ricocheting is also different. Therefore, in order to make the target ricochet sound effect emitted when the target object hits the hit object more realistic, it is necessary to jointly determine the target ricochet sound effect based on the type information of the target object, as well as the impact incident angle and the material of the hit object that affect the probability of ricocheting triggering.
[0054] In specific implementation, the above-mentioned target ricochet sound effect can be audible or silent, wherein the case where the target ricochet sound effect is silent means that: when the target object hits the hit object of a certain material at a certain incident angle, no ricochet occurs (that is, the probability of ricochet is 0); or, when the target object hits the hit object of a certain material at a certain incident angle, the probability of ricochet is greater than 0 and less than 1, and the silent playback source is extracted as the target ricochet sound effect. For example, when a pistol is shot at a wooden object at a 90-degree angle, no ricochet occurs; when a pistol is shot at a wooden object at a 45-degree angle, the probability of ricochet is 13%.
[0055] The case where the target ricochet sound effect is audible means that: when the target object hits the object of a certain material at a certain incident angle, a ricochet will definitely occur (that is, the probability of a ricochet is 1); or, when the target object hits the object of a certain material at a certain incident angle, the probability of a ricochet is greater than 0 and less than 1, and the sound source is extracted as the target ricochet sound effect. For example, when a pistol is fired at a metal object at an angle of 10 degrees, the probability of a ricochet is 100%, and the target ricochet sound effect must be audible.
[0056] In actual applications, the corresponding ricochet sound effect for each type of target object and each impact angle when hitting the target object of each material is set in advance. When the impact incident angle when the target object hits the target object, the type information of the target object and the material information of the target object are received, the target ricochet sound effect can be determined in real time.
[0057] Step S106, playing the target ricochet sound effect.
[0058] In specific implementation, after the target ricochet sound effect is determined, the hit sound effect of the hit object and the target ricochet sound effect can be played at the same time; since the determined target ricochet sound effect may be silent, only the hit sound effect of the hit object can be played at this time. The hit sound effect of the hit object is usually determined by the material of the hit object and the type of the target object, and the hit sound effect emitted by each type of target object hitting a hit object of a certain material is set in advance.
[0059] A method for playing an impact sound effect provided by an embodiment of the present invention first obtains the impact incident angle, type information of the target object, and material information of the hit object when the target object hits the hit object in a virtual scene in response to the target object hitting the hit object; then determines the target ricochet sound effect when the target object hits the hit object based on the impact incident angle, type information, and material information; and then plays the target ricochet sound effect. In this method, the ricochet sound effect is jointly determined based on the impact incident angle, type of the target object, and material of the hit object when the target object hits the hit object, so that the ricochet sound effects of different types of target objects can be differentiated, and the determination of the ricochet sound effect can take into account the impact incident angle and the hit material, so that the triggering logic and hearing of the ricochet sound effect are more realistic, which is conducive to improving the user experience.
[0060] The embodiment of the present invention further provides another method for playing impact sound effects, which is implemented on the basis of the above embodiment. The method focuses on describing the specific process of determining the target ricochet sound effect of the target object hitting the hit object according to the impact incident angle, type information and material information (implemented by the following steps S204-S208), such as Figure 2 As shown, the method comprises the following specific steps:
[0061] Step S202 , in response to the target object in the virtual scene hitting the hit object, obtaining the impact incident angle when the target object hits the hit object, the type information of the target object and the material information of the hit object.
[0062] Step S204, determining the ricochet trigger probability based on the above-mentioned impact incident angle and material information.
[0063] In specific implementation, the type information of the target object can determine the sound effect content of the ricochet sound effect, while the impact incident angle and the material of the hit object are factors affecting whether the ricochet sound effect is triggered, that is, different impact incident angles have different ricochet trigger probabilities for different hit object materials. Therefore, the ricochet trigger probability corresponding to the impact incident angle and material information can be determined according to the preset ricochet trigger relationship.
[0064] The above ricochet trigger relationship can be set according to the actual situation of ricochets occurring on different types of target objects, and the ricochet trigger relationship may include: the ricochet trigger probability of each preset angle interval in each preset hit material (equivalent to the material of the hit object) in a plurality of preset angle intervals. For example, Table 1 shows the relationship between the pre-designed ricochet trigger probability and the material and angle (equivalent to the above ricochet trigger relationship).
[0065] Table 1
[0066]
[0067] In specific implementation, the above preset angle interval can be determined according to research and development requirements. The angle range in Table 1 is 0 to 90 degrees, and an angle interval is divided every 10 degrees. Specifically, the angle range can also be 0 to 180 degrees, or 0 to 60 degrees, etc., which are not specifically limited here. Similarly, the division interval can also be set according to research and development requirements. The division interval can be 10 degrees, 5 degrees, or 7 degrees, etc. The smaller the division interval, the smaller the range of each angle interval, and the more refined the division will be.
[0068] In actual applications, the probability of ricocheting can be determined based on the angle range of the impact incident angle and the material of the object being hit. For example, if the impact incident angle is 43 degrees and the material being hit is metal, the probability of ricocheting is 63%.
[0069] Step S206: determining a target playback source from a plurality of sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability.
[0070] In specific implementation, each type of target object corresponds to multiple audio playback sources related to ricochets, and the audio playback sources are silent playback sources or sound playback sources. The setting of silent playback sources and sound templates in multiple audio playback sources is related to the ricochet trigger probability. Specifically, the audio playback source corresponding to each type of target object under each ricochet trigger probability can be set in the following two ways:
[0071] Method 1: For each type of target object, under each ricochet trigger probability, there are multiple sound effect playback sources corresponding to each sound effect playback source, and the sound effect playback source is a silent playback source or a sound playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the number of silent playback sources and the number of sound playback sources are determined according to the ricochet trigger probability; generally, the greater the ricochet trigger probability, the greater the number of sound playback sources among the multiple sound effect playback sources. If the ricochet trigger probability is 100%, then all of the multiple sound effect playback sources are sound playback sources. If the ricochet trigger probability is 0, then all of the multiple sound effect playback sources are silent playback sources. If the ricochet trigger probability is 25%, then the multiple sound effect playback sources may include 2 sound playback sources and 6 silent playback sources.
[0072] Based on the first method, the above step S206 can be implemented in the following ways:
[0073] From the multiple sound effect playback sources corresponding to the target object corresponding to the above type information under the ricochet trigger probability, randomly select a sound effect playback source as the target playback source; wherein the target playback source is a silent playback source or a sound playback source. Specifically, among the multiple ricochet trigger probabilities, determine the probability that matches the ricochet trigger probability, determine the multiple sound effect playback sources corresponding to the matched probability as the multiple sound effect playback sources corresponding to the ricochet trigger probability, and then randomly extract a sound effect playback source from the multiple sound effect playback sources, and determine the extracted sound effect playback source as the target playback source. Since the number of sound playback sources and the number of silent playback sources contained in the multiple sound effect playback sources match the corresponding ricochet trigger probability, the process of randomly extracting a playback source from multiple audio playback sources satisfies the process of triggering a ricochet according to the ricochet trigger probability.
[0074] Method 2: For each type of target object, there are multiple sound effect playback sources corresponding to each ricochet trigger probability, and the sound effect playback sources are silent playback sources or sound playback sources; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the weight corresponding to the silent playback source and the weight corresponding to the sound playback source are determined according to the ricochet trigger probability; generally, the greater the ricochet trigger probability, the greater the weight of the sound playback source, and the smaller the weight corresponding to the silent playback source. If the ricochet trigger probability is 100%, then the weight corresponding to the sound playback source among the multiple sound effect playback sources is 1, and the weight corresponding to the silent playback source is 0; if the ricochet trigger probability is 0, then the weight corresponding to the silent playback source among the multiple sound effect playback sources is 1, and the weight corresponding to the sound playback source is 0; if the ricochet trigger probability is 25%, then the weight corresponding to the sound playback source among the multiple sound effect playback sources may be 0.25, and the weight corresponding to the silent playback source may be 0.75.
[0075] Based on method 2, the above step S206 can be implemented in the following way: based on the weight corresponding to the silent playback source and the weight corresponding to the sound playback source under the ricochet trigger probability, determine the target playback source from the silent playback source and the sound playback source corresponding to the target object corresponding to the type information under the ricochet trigger probability.
[0076] In actual applications, the above-mentioned sound source stores sound effects that decay over time; the silent source stores silent sound effects. In some embodiments, when the multiple sound sources under a certain preset probability include multiple sound sources, each sound source stores different sound effects, so that the ricochet sound effects triggered each time are different, making the ricochet sound effects more realistic; at the same time, for the convenience of setting, multiple sound sources can also be set to the same sound effect.
[0077] Step S208: determining the target playback source as the target ricochet sound effect.
[0078] Step S210: determining at least one preset hitting sound effect corresponding to the hit object according to the type information of the target object.
[0079] In a specific implementation, in order to make the hit sound effect of the hit object more realistic, multiple preset hit sound effects may be set for the hit object when it is hit by the same target object, so that the hit sound effect triggered each time may be different.
[0080] Step S212: extracting a preset hitting sound effect from the at least one preset hitting sound effect as the hit sound effect of the hit object.
[0081] Step S214, while playing the target ricochet sound effect, play the hit sound effect of the hit object.
[0082] In the specific implementation, the game engine and the audio engine are required to jointly complete the determination of the ricochet sound effect. First, when the target object in the virtual scene hits the hit object, the impact incident angle when the target object hits the hit object, the type information of the target object (the type information can be XX type of target object attacking or firing, etc.) and the material information of the hit object are obtained. The game engine sends the acquired impact incident angle, type information and material information to the audio engine, and then the audio engine determines the target ricochet sound effect and the hit sound effect of the hit object based on the received information, and returns the determined sound effect to the game engine so that the game engine plays the received audio.
[0083] In order to implement the above-mentioned collision sound effect playback method, it is necessary to design it in the game engine and audio engine in advance. The following is the design of the implementation scheme using UE4 as the game engine and Wwise as the audio engine. For ease of understanding, first introduce the objects in the audio engine, as follows:
[0084] Audio object: A general term for objects that can be played in Wwise, such as random containers, mixed containers, switch containers, etc.
[0085] Random container: An Audio object in Wwise that plays its sub-objects randomly when played.
[0086] Random samples: Some sounds in the game are triggered continuously and frequently. In order to make the sound more realistic and reduce repetitiveness, multiple very similar sound samples (equivalent to audio playback sources) are often combined into a set, and one of them is randomly triggered each time.
[0087] Mixing container: An Audio object in Wwise. When a mixing container is played, all sub-objects within the mixing container are played simultaneously.
[0088] RTPC: A type of control information used in Wwise to transmit continuous numerical changes. It is generally converted in real time from a numerical parameter in the game. For example, this information, such as the angle of incidence, number of bullets, speed, etc., is more suitable for transmission to Wwise via RTPC, and then the designer decides how to use it.
[0089] Switch: Control information used in Wwise to switch between subsets in the Switch container. It can be initiated by the game engine or controlled by RTPC.
[0090] Switch group: The parent of Switch, which represents the class of this collection. For example, the Switch group is called material, and the group contains specific switches such as cement, metal, and wood.
[0091] Switch container: An Audio object in Wwise that, when played, selects and plays sub-objects in the container according to the rules of the set Switch and switch group.
[0092] Event: An object in Wwise that receives calls from the game engine. Sound designers set which audio-related actions to execute in the Event. For example, the most commonly used actions include playing an audio, stopping an audio, resetting certain parameters, etc.
[0093] Action: Add and configure in each Event. After calling the Event, each specific behavior to be executed is called an Action.
[0094] Wwise Silence: A sound source plug-in integrated in Wwise that acts as a silent Audio object (equivalent to the silent playback source mentioned above). It is often used as a placeholder or to create sound intervals.
[0095] Attenuation curve: A function curve used in Wwise to set the numerical change of the attenuation law of a point sound source in 3D space.
[0096] Here is a supplementary explanation of the operation between the Wwise audio engine and the UE4 game engine. In UE4, programmers can use certain timing, values, directions, etc. as data sources or conditions, and trigger or convert them into instructions in a special format recognized by Wwise through program means, such as RTPC, Event, Switch and other specified formats. After sending this instruction to Wwise, if Wwise has already created an object with the same name and type to receive this instruction, then Wwise can use this instruction to trigger the sound or affect the sound according to the method set and configured by the sound designer.
[0097] like Figure 3 The figure shows a logic diagram of the implementation of a collision sound effect playback provided by the present invention in real time. In the design stage, the programmer needs to send the type of target object, the material of the hit object and the incident angle range (equivalent to the above-mentioned preset angle range) that may be used in the virtual scene to the audio engine, so that the sound effect designer can set it on the audio engine according to the sent information. Figure 3 As shown in the figure, the types of target objects include pistols, sniper rifles, shotguns, rifles, heavy machine guns and submachine guns. The incident angle ranges from 0 degrees to 90 degrees. Different types of target objects are distinguished by different Events. Figure 3There are 4 types of events in the game, namely Event 1-Pistol hits an object, Event 2-Sniper hits an object, Event 3-Shotgun hits an object, Event 4-Rifle\Heavy machine gun\Submachine gun hits an object. You can flexibly design it according to your own project, such as bullets of different specifications hitting an object, darts hitting an object, etc. Figure 3 The different materials in are divided by Switch, and can include the hit materials shown in Table 1.
[0098] according to Figure 3 It can be seen that the game engine needs to provide the following three pieces of information to the audio engine:
[0099] (1) Send the RTPC representing the impact angle to Wwise. When the target object's bullet hits the target object, obtain the minimum angle data between the trajectory and the surface of the target object (equivalent to the impact angle), convert this data into RTPC, and synchronously provide the RTPC name to the audio engine Wwise, for example, "BulletImpact_Angle". When the game is running, the target object shoots at the target object at an angle of 30 degrees. Each time a bullet hits the target object, it returns an RTPC value "BulletImpact_Angle = 30", and the game engine sends this RTPC value to Wwise.
[0100] (2) Send the Switch representing the material of the hit object to Wwise. When the target object's bullet hits the hit object, the material information of the hit object is obtained, and the material information is converted into a Switch. The Switch name and the corresponding Switch group name are simultaneously provided to the audio engine. For example, the Switch group is "Switch_Impact_Material", and the Switches contained in the Switch group are named according to the specific material, such as Concrete, Metal, Wood, etc., depending on which materials are in the project scene. After the function is completed, if the game character shoots at a wooden board, then each bullet hits and returns the Switch information of "Switch to Wood", and the game engine will send the Switch information to Wwise.
[0101] (3) When different types of target objects (e.g., guns) hit the hit object, different Events are called respectively. Figure 3 It contains 4 Events), that is, it is necessary to obtain the type information of the target object and send the type information to Wwise so that Wwise can use the Event of the target object corresponding to the type information.
[0102] It should be noted that the implementation methods of the above points (2) and (3) can be handled flexibly, depending on the current development status of the project and which method is more convenient for subsequent configuration in Wwise. For example, as shown in Table 2 below, the material of the hit object can also be distinguished by different events instead of by Switch, as in point (3). Similarly, the type of the target object can also be distinguished by Switch instead of by Event, as in (2). However, one thing to note is that there is only one way to distinguish by events, that is, both cannot be distinguished by events. The reason is that when configuring in Wwise later, the two must be nested together in a parent-child manner. If both are distinguished by events, then the two cannot be nested. Of course, if they must be distinguished by events, it is not impossible to achieve it, that is, to make all possibilities into separate events, but this may greatly increase the workload of programmers and communication costs as well as the flexibility of subsequent configuration, that is, this will reduce the efficiency of the overall game sound effect work.
[0103] Table 2
[0104]
[0105]
[0106] refer to Figure 3 , and introduce the setting scheme in the audio engine Wwise in detail. Create an incident angle RTPC in Wwise. For example, create an RTPC in Wwise and name it BulletImpact_Angle (the same as the name in the game engine), set the Min value to 0 and the Max value to 90 in the property editor, which means that the incident angle range is 0 to 90 degrees.
[0107] In some embodiments, the Default value can also be set to a preset angle in the property editor, so that when the impact incident angle of the hit object is not obtained later, the preset incident angle is determined as the impact incident angle. Specifically, the preset angle corresponding to the Default is customized by the sound designer. This Default means that when the RTPC does not receive any value, it is executed according to the value of the Default. Taking Default = 90 as an example, if due to some bug or other reasons, UE4 does not send the RTPC of the impact incident angle to Wwise, then no matter from which angle you shoot, Wwise will think that the value of this RTPC is 90. Among them, setting Default to 90 is more common because the probability of ricocheting when shooting at 90 degrees is the lowest. In case the above bug occurs, a large number of ricochet sounds will not be generated when shooting at any angle to interfere with the player.
[0108] After creating the incident angle RTPC in Wwise, you need to convert it into a switch representing a preset angle range. For example, create a switch group and name it Bullet_Ricochet (the same name as provided by the game engine), check "Use Game Parameter" in its property editor, and select the control source as the newly created BulletImpact_Angle RTPC, then create 9 switches in this switch group (because Figure 3There are 9 angle intervals in the logic, so here the number of Switches is set to 9 for example, and the corresponding relationship between each Switch and the RTPC value is configured, where the 9 Switches can be: BulletImpact_Angle_00_10 (Switch corresponding to 0 degrees to 10 degrees), BulletImpact_Angle_10_20 (Switch corresponding to 10 degrees to 20 degrees), BulletImpact_Angle_20_30 (Switch corresponding to 20 degrees to 30 degrees), BulletImpact_Angle_30_40 (Switch corresponding to 30 degrees to 40 degrees), BulletImpact_Angle_41_50 (Switch corresponding to 40 degrees to 50 degrees), BulletImpact_Angle_51_52 (Switch corresponding to 40 degrees to 50 degrees), BulletImpact_Angle_61_62 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_63_70 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_71_72 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_73_80 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_74_81 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_75_90 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_86_91 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_87_101 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle_88_102 (Switch corresponding to 40 degrees to 60 degrees), BulletImpact_Angle =Switch corresponding to the angle range of 40 to 50 degrees), BulletImpact_Angle_50_60 (indicates the Switch corresponding to the angle range of 50 to 60 degrees), BulletImpact_Angle_60_70 (indicates the Switch corresponding to the angle range of 60 to 70 degrees), BulletImpact_Angle_70_80 (indicates the Switch corresponding to the angle range of 70 to 80 degrees), BulletImpact_Angle_80_90 (indicates the Switch corresponding to the angle range of 80 to 90 degrees).
[0109] For example, taking the Switch "BulletImpact_Angle_20_30" as an example, the actual effect is that when the RTPC value received by BulletImpact_Angle is between 20 and 30, the Switch group Bullet_Ricochet will switch to the Switch BulletImpact_Angle_20_30. At this time, the conversion from RTPC to Switch is completed. Here is an explanation of why such a conversion is needed: due to the limitation of Wwise functions, there is no RTPC function to directly control the probability of ricochet triggering. A similar effect can be achieved through such a conversion. In addition, 9 Switches are created in this example, but in fact, there can be more or less. The more there are, the finer the granularity. In theory, this Switch can also be called directly by the program instead of converting through RTPC, but in fact it is still out of consideration of flexibility and difficulty of requirements, such as this incident angle RTPC will be used in other modules in the future.
[0110] Next, you need to create a Switch in Wwise to switch the material of the impacted object. For example, create a Switch group named "Switch_Impact_Material" (the same as the naming in the game engine), and add impacted materials such as Metal, Wood, and Concrete to the Switch group. The naming of the impacted materials here is also consistent with that in the game engine.
[0111] In Wwise, you also need to create events that represent different types of target objects hitting the hit object. Figure 3 The target objects in the example are various types of firearms. In Wwise, they can be created with the same name as the Event accessed by the program, such as Figure 3 As shown, 4 Events need to be created.
[0112] The following mainly describes the process of creating and configuring the Audio object (equivalent to the audio playback source) for Event playback in the audio engine, and setting how these Audio objects are affected by control information. First, it is necessary to pre-design and plan the ricochet trigger probability relationship, for example, it can be the ricochet trigger probability relationship shown in Table 1. Figure 4 The example shown provides an Audio object hierarchy diagram. Figure 4 You can decide whether to create the "Work Uit" layer and "Actor Mixer" layer as needed. Usually, the attenuation curve of a bullet hitting an object (this attenuation curve is usually related to the direction of movement of the bullet after hitting the object) can be configured in the "Actor Mixer" layer. If the Actor-Mixer is not created, it can also be configured in the next layer.
[0113] Figure 4 The "Switch container" layer in the above example is used to play the events of the hit object when it is hit by different types of target objects. Each event plays the corresponding Switch container. Figure 4 Take "Switch container - material: bullet hits object - pistol" as an example. When entering its attribute editor interface for configuration, you can select "Switch_Impact_Material" as the Switch group. The default Switch can be selected as needed, and then the Switch of each material is associated with the object in the Switch container. The other three Switch containers are also operated in the same way. There is no difference at this level. So far, when the target object hits the object, it can logically judge both the target object type and the material of the hit.
[0114] Next, enter the next layer of the "Switch container" (that is, Figure 4This layer can be divided into two cases. One is the material that can trigger ricochets, such as Figure 4 In the "Mixed Container: Bullet Hitting Metal" and "Mixed Container: Bullet Hitting Cement", a mixed container is used to play both "Bullet Hitting Object" (equivalent to the sound effect of being hit) and "Bounce" (equivalent to the sound effect of ricochet) at the same time. The other is a material that cannot trigger ricochets, such as Figure 4 In the "Random container: bullet hits sand" and "Random container: bullet hits snow", in this case, the corresponding "bullet hits object" sound effect can be played directly through the random container.
[0115] Enter the next level of configuration (that is, Figure 4 5 columns in ). Since the case where ricochets cannot be triggered does not involve additional configuration, and the "bullet hits the object" part of the material that can trigger ricochets ( Figure 4 The "Random Container: Bullet Hit Cement" and the two "Random Containers: Bullet Hit Metal" do not involve additional configuration, so the following mainly focuses on Figure 4 In the following sections, we will take the three Switch containers related to ricochets, namely “Switch container - probability: bullet ricochet - metal - pistol”, “Switch container - probability: bullet ricochet - cement - pistol”, and “Switch container - probability: bullet ricochet - metal - sniper rifle” as examples to explain.
[0116] by Figure 4 Take the "Switch container - probability: bullet ricochet - metal - pistol" as an example. First, set its Switch group to the previously configured "Bullet_Ricochet". The default Switch is recommended to be set to the angle range with a relatively small probability of ricochet triggering. In this example, it is set to 70 to 80. Eight switches have been created in the Switch group Bullet_Ricochet. Now, similarly associate the eight random containers in this Switch container with these eight switches one by one according to the corresponding relationship in Table 1. When the incident angle is 0 to 10 degrees and 10 to 20 degrees, the "random container with a ricochet trigger probability of 8 out of 8" is triggered; when the incident angle is 20 to 30 degrees, the "random container with a ricochet trigger probability of 7 out of 8" is triggered; when the incident angle is 30 to 40 degrees, the "random container with a ricochet trigger probability of 6 out of 8" is triggered, and so on. The same is true for other materials except metal. You can correspond according to Table 1. At this point, the configuration of the Switch-related parameters of "Switch Container-Probability: Bullet Ricochet-Metal-Pistol" is completed. Now, different "Random Container" objects can be matched according to different incident angles. Later, the "Ricochet Trigger Probability" of the ricochet sound effects in these random containers will be configured.
[0117] Next, Figure 4 Configure the ricochet trigger probability of the audio source in the random container. There may be many ways to do this, but the key is to make each random container trigger the sound source according to the set probability. For example, if you put 2 sound sources and 6 silent sources (WwiseSilence can be used here) in the multiple sound sources corresponding to the random container, you can get a random container with a 2 / 8 ricochet trigger probability. Similarly, 3 sound sources and 5 silent sources have a 3 / 8 ricochet trigger probability, and so on. If you use multiple sound sources for random triggering, the number of silent sources should also increase proportionally.
[0118] Here you can also try another method, which is to achieve the same effect by adjusting the weight parameters of each sound effect playback source in the random container.
[0119] Specifically, any angle interval Switch can be freely associated with any random container of ricochet trigger probability, combined with Figure 3 This can be seen intuitively from the difference between metal and cement in the 7th row of the figure. Therefore, this method enables the ricochet sound effect trigger logic to simultaneously and rationally take into account the impact of the incident angle and the material being hit. In addition, since the top-level Audio objects of different target object types are independent, we can of course use different ricochet sound effect playback sources for different types, and we can also configure different ricochet trigger probabilities and other parameters separately, so that the ricochet sound effects of different target object types can be differentiated. The differentiation of sound playback sources in the sound effect playback source can not only enhance the artistic performance, but experienced players can also infer the type of target object used by the enemy based on the surrounding ricochet sound effects. This is an optimization of the sound function performance.
[0120] The above-mentioned method for playing the impact sound effect can make the triggering logic and the listening experience of the ricochet sound effect more realistic, ultimately achieving better artistic performance, while also slightly optimizing the functional performance. At the same time, this method enables the triggering logic of the ricochet sound effect to simultaneously and reasonably take into account the influence of the incident angle and the material being hit, and enables the ricochet sound effects of different types of target objects to be differentiated.
[0121] The embodiment of the present invention further provides another method for playing impact sound effects, which is implemented on the basis of the above embodiment. The method focuses on describing the specific process of playing the hit sound effect of the hit object and the target ricochet sound effect (implemented by the following steps S506-S508), such as Figure 5 As shown, the method comprises the following specific steps:
[0122] Step S502 , in response to the target object in the virtual scene hitting the hit object, obtaining the impact incident angle when the target object hits the hit object, the type information of the target object and the material information of the hit object.
[0123] Step S504, determining the target ricochet sound effect of the target object hitting the hit object according to the above-mentioned impact incident angle, type information and material information.
[0124] Step S506, selecting a target path from a plurality of preset playback paths, so that the target ricochet sound effect is played in the direction of the target path.
[0125] In the specific implementation, in order to make the ricochet sound effect sound like it is moving randomly in all directions, it is necessary to set multiple playback paths in the audio engine. When the game is running, a playback path can be randomly selected from the multiple playback paths as the target path, or a playback path can be selected as the target path by the program.
[0126] Specifically, the following configuration can be performed in the audio engine: Enter the Positioning tab of the Switch container corresponding to the playback path, check Override parent, and configure it in the conventional way of "object hit sound effect". The Speaker Panning / 3D Spatialization Mix can be configured as needed, but the value should not be too low; the attenuation curve can continue to reuse the "object hit sound effect" here, or you can create a dedicated one for ricochet. Click the Automation button to enter the 3DAutomation configuration, where you need to create multiple new playback paths. The only difference between these playback paths is the direction of the trajectory Automation segments. These segments should all start from the center of the circle and end at a point far away from the center of the circle. Finally, the Automation segments of each path should end in different directions. If these segments are put together, it should be a roughly uniform radial shape, such as Figure 6 Shown is a schematic diagram of the playback path.
[0127] In the specific implementation, when the ricochet audio is triggered, its spatial orientation starts playing from the collision point between the bullet and the object (equivalent to the impact point of the hit object), and a random Automation is selected here. During the playback, the space is changed according to the trajectory of this Automation. Note that the length of the line segment here is not absolute, and it is also necessary to find a suitable degree based on the listening experience. Too short or too long will make the effect unclear or strange.
[0128] Step S508, starting from the impact point of the hit object, playing the hit sound effect of the hit object and the target ricochet sound effect along the direction of the target path.
[0129] In a specific implementation, when playing the hit sound effect of the hit object and the target ricochet sound effect, in response to the target object moving in the virtual scene, the hit sound effect of the hit object and the target ricochet sound effect are played according to a preset attenuation curve corresponding to the moving direction.
[0130] In specific implementation, the preset attenuation curve corresponding to each moving direction is different. For example, when the target object moves toward the hit object, the sound may become slightly louder; when the target object moves away from the hit object, the sound may become weaker and weaker.
[0131] The above-mentioned method for playing the impact sound effect enables the triggering logic of the ricochet sound effect to simultaneously and reasonably take into account the influence of the incident angle and the impacted material, so that the ricochet sound can sound like it is moving randomly in all directions, and also enables the ricochet sound effects of different target object types to be differentiated. The above three effects cannot be achieved by the previous ricochet sound effect solutions, but more importantly, some designs at different levels will cause implementation conflicts and increase the difficulty of implementation when they are combined at the same time, and the present invention can meet the above demands at the same time and achieve the preset effect.
[0132] Corresponding to the above method embodiment, the embodiment of the present invention further provides a device for playing impact sound effects, which provides a graphical user interface through a terminal device, and the graphical user interface displays a virtual picture of a virtual scene; Figure 7 As shown, the device comprises:
[0133] The information acquisition module 70 is used to acquire the impact incident angle when the target object hits the hit object, the type information of the target object and the material information of the hit object in response to the target object hitting the hit object in the virtual scene.
[0134] The sound effect determination module 71 is used to determine the target ricochet sound effect when the target object hits the hit object according to the impact incident angle, type information and material information.
[0135] The sound effect playing module 72 is used to play the target ricochet sound effect.
[0136] The above-mentioned impact sound effect playback device first responds to the target object hitting the hit object in the virtual scene, obtains the impact incident angle when the target object hits the hit object, the type information of the target object, and the material information of the hit object; then determines the target ricochet sound effect when the target object hits the hit object based on the impact incident angle, type information, and material information; and then plays the target ricochet sound effect. In this method, the ricochet sound effect is jointly determined based on the impact incident angle when the target object hits the hit object, the type of the target object, and the material of the hit object, so that the ricochet sound effects of different types of target objects can be differentiated, and the determination of the ricochet sound effect can take into account the impact incident angle and the impact material, so that the triggering logic and hearing of the ricochet sound effect are more realistic, which is conducive to improving the user experience.
[0137] Specifically, the above-mentioned sound effect determination module 71 includes: a ricochet probability determination unit, which is used to determine the ricochet trigger probability based on the impact incident angle and material information; a ricochet sound effect determination unit, which is used to determine the target playback source from multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability; and determine the target playback source as the target ricochet sound effect.
[0138] In a specific implementation, the ricochet probability determination unit is further used to determine the ricochet trigger probability corresponding to the impact incident angle and the material information according to a preset ricochet trigger relationship; wherein the ricochet trigger relationship includes: the ricochet trigger probability of each preset angle interval in a plurality of preset angle intervals under each preset impact material.
[0139] Optionally, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the number of silent playback sources and the number of sound playback sources are determined according to the ricochet trigger probability; the above-mentioned ricochet sound effect determination unit is also used to: randomly select a sound effect playback source as a target playback source from the multiple sound effect playback sources corresponding to the target object corresponding to the type information under the ricochet trigger probability; wherein the target playback source is a silent playback source or a sound playback source.
[0140] Optionally, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the weight corresponding to the silent playback source and the weight corresponding to the sound playback source are determined according to the ricochet trigger probability; the above-mentioned ricochet sound effect determination unit is also used to: based on the weight corresponding to the silent playback source and the weight corresponding to the sound playback source under the ricochet trigger probability, determine the target playback source from the silent playback source and the sound playback source corresponding to the target object corresponding to the type information under the ricochet trigger probability.
[0141] In some embodiments, the above-mentioned sound playback source stores sound effects that decay and change with time; when the multiple sound effect playback sources include multiple sound playback sources, the sound effects stored in the sound playback sources are different.
[0142] Furthermore, the above-mentioned device also includes a playback path determination module, which is used to: before playing the target ricochet sound effect, select a target path from multiple preset playback paths, so that the target ricochet sound effect is played in the direction of the target path.
[0143] Based on this, the above-mentioned sound effect playing module 72 is used to: start from the impact point of the hit object and play the target ricochet sound effect along the direction of the target path.
[0144] In a specific implementation, the above-mentioned device also includes an angle determination module, which is used to: if the impact incident angle hitting the hit object is not obtained, determine the preset incident angle as the impact incident angle.
[0145] In some embodiments, the sound effect playing module 72 is used to: in response to the target object moving in the virtual scene, play the target ricochet sound effect according to a preset attenuation curve corresponding to the moving direction.
[0146] In a specific implementation, the above-mentioned device also includes a hitting sound effect playing module, which is used to: after determining the target ricochet sound effect of the target object hitting the hit object based on the impact incident angle, type information and material information, play the hit sound effect of the hit object while playing the target ricochet sound effect.
[0147] Furthermore, the above-mentioned device also includes a hit sound effect determination module, which is used to: before playing the hit sound effect of the hit object and the target ricochet sound effect, determine at least one preset hit sound effect corresponding to the hit object according to the type information of the target object; and extract a preset hit sound effect from at least one preset hit sound effect as the hit sound effect of the hit object.
[0148] The implementation principle and technical effects of the impact sound effect playback device provided in the embodiment of the present invention are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0149] The embodiment of the present invention further provides an electronic device, such as Figure 8 As shown, the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned method for playing the impact sound effect.
[0150] Specifically, a graphical user interface is provided through an electronic device, and a virtual picture of a virtual scene is displayed in the graphical user interface; the method for playing the impact sound effect includes: in response to a target object in the virtual scene hitting a hit object, obtaining an impact incident angle, type information of the target object, and material information of the hit object when the target object hits the hit object; determining a target ricochet sound effect when the target object hits the hit object according to the impact incident angle, type information, and material information; and playing the target ricochet sound effect.
[0151] The above-mentioned method for playing the impact sound effect can jointly determine the ricochet sound effect according to the impact incident angle when the target object hits the hit object, the type of the target object and the material of the hit object, so that the ricochet sound effects of different types of target objects can be differentiated, and the determination of the ricochet sound effect can take into account the influence of the impact incident angle and the hit material, so that the triggering logic and listening experience of the ricochet sound effect are more realistic, which is conducive to improving the user experience.
[0152] In an optional embodiment, the above step of determining the target ricochet sound effect of the target object hitting the hit object based on the impact incident angle, type information and material information includes: determining the ricochet trigger probability based on the impact incident angle and material information; determining the target playback source from multiple sound effect playback sources of the target object corresponding to the type information based on the ricochet trigger probability; and determining the target playback source as the target ricochet sound effect.
[0153] In an optional embodiment, the step of determining the ricochet trigger probability based on the impact incident angle and the material information includes: determining the ricochet trigger probability corresponding to the impact incident angle and the material information according to a preset ricochet trigger relationship; wherein the ricochet trigger relationship includes: the ricochet trigger probability of each preset angle interval in a plurality of preset angle intervals under each preset impact material.
[0154] In an optional implementation, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or an audible playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the number of silent playback sources and the number of audible playback sources are determined according to the ricochet trigger probability; the above-mentioned step of determining the target playback source from the multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability includes: randomly selecting a sound effect playback source as the target playback source from the multiple sound effect playback sources corresponding to the target object corresponding to the type information under the ricochet trigger probability; wherein the target playback source is a silent playback source or an audible playback source.
[0155] In an optional implementation, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the weight corresponding to the silent playback source and the weight corresponding to the sound playback source are determined according to the ricochet trigger probability; the above-mentioned step of determining the target playback source from the multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability includes: determining the target playback source from the silent playback source and the sound playback source corresponding to the target object corresponding to the type information under the ricochet trigger probability based on the weight corresponding to the silent playback source and the weight corresponding to the sound playback source under the ricochet trigger probability.
[0156] In an optional implementation, the above-mentioned sound playback source stores sound effects that decay and change with time; when the multiple sound effect playback sources include multiple sound playback sources, the sound effects stored in the sound playback sources are different.
[0157] In an optional implementation, before the step of playing the target ricochet sound effect, the method further includes: selecting a target path from a plurality of preset playback paths, so that the target ricochet sound effect is played in the direction of the target path.
[0158] In an optional embodiment, the step of playing the target ricochet sound effect includes: starting from the impact point of the hit object, playing the target ricochet sound effect along the direction of the target path.
[0159] In an optional embodiment, the method further includes: if the impact incident angle of the hit object is not obtained, determining a preset incident angle as the impact incident angle.
[0160] In an optional embodiment, the step of playing the target ricochet sound effect includes: in response to the target object moving in the virtual scene, playing the target ricochet sound effect according to a preset attenuation curve corresponding to the moving direction.
[0161] In an optional embodiment, after the step of determining the target ricochet sound effect of the target object hitting the target object based on the impact incident angle, type information and material information, the method further includes: playing the hit sound effect of the target object while playing the target ricochet sound effect.
[0162] In an optional embodiment, before the step of playing the hit sound effect of the hit object while playing the target ricochet sound effect, the method further includes: determining at least one preset hit sound effect corresponding to the hit object based on the type information of the target object; and extracting one preset hit sound effect from the at least one preset hit sound effect as the hit sound effect of the hit object.
[0163] Further, Figure 8The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .
[0164] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0165] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.
[0166] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method for playing the impact sound effect. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0167] Specifically, a graphical user interface is provided through an electronic device, and a virtual picture of a virtual scene is displayed in the graphical user interface; the method for playing the impact sound effect includes: in response to a target object in the virtual scene hitting a hit object, obtaining an impact incident angle, type information of the target object, and material information of the hit object when the target object hits the hit object; determining a target ricochet sound effect when the target object hits the hit object according to the impact incident angle, type information, and material information; and playing the target ricochet sound effect.
[0168] The above-mentioned method for playing the impact sound effect can jointly determine the ricochet sound effect according to the impact incident angle when the target object hits the hit object, the type of the target object and the material of the hit object, so that the ricochet sound effects of different types of target objects can be differentiated, and the determination of the ricochet sound effect can take into account the influence of the impact incident angle and the hit material, so that the triggering logic and listening experience of the ricochet sound effect are more realistic, which is conducive to improving the user experience.
[0169] In an optional embodiment, the above step of determining the target ricochet sound effect of the target object hitting the hit object based on the impact incident angle, type information and material information includes: determining the ricochet trigger probability based on the impact incident angle and material information; determining the target playback source from multiple sound effect playback sources of the target object corresponding to the type information based on the ricochet trigger probability; and determining the target playback source as the target ricochet sound effect.
[0170] In an optional embodiment, the step of determining the ricochet trigger probability based on the impact incident angle and the material information includes: determining the ricochet trigger probability corresponding to the impact incident angle and the material information according to a preset ricochet trigger relationship; wherein the ricochet trigger relationship includes: the ricochet trigger probability of each preset angle interval in a plurality of preset angle intervals under each preset impact material.
[0171] In an optional implementation, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or an audible playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the number of silent playback sources and the number of audible playback sources are determined according to the ricochet trigger probability; the above-mentioned step of determining the target playback source from the multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability includes: randomly selecting a sound effect playback source as the target playback source from the multiple sound effect playback sources corresponding to the target object corresponding to the type information under the ricochet trigger probability; wherein the target playback source is a silent playback source or an audible playback source.
[0172] In an optional implementation, each type of target object corresponds to multiple sound effect playback sources under each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the multiple sound effect playback sources corresponding to each ricochet trigger probability, the weight corresponding to the silent playback source and the weight corresponding to the sound playback source are determined according to the ricochet trigger probability; the above-mentioned step of determining the target playback source from the multiple sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability includes: determining the target playback source from the silent playback source and the sound playback source corresponding to the target object corresponding to the type information under the ricochet trigger probability based on the weight corresponding to the silent playback source and the weight corresponding to the sound playback source under the ricochet trigger probability.
[0173] In an optional implementation, the above-mentioned sound playback source stores sound effects that decay and change with time; when the multiple sound effect playback sources include multiple sound playback sources, the sound effects stored in the sound playback sources are different.
[0174] In an optional implementation, before the step of playing the target ricochet sound effect, the method further includes: selecting a target path from a plurality of preset playback paths, so that the target ricochet sound effect is played in the direction of the target path.
[0175] In an optional embodiment, the step of playing the target ricochet sound effect includes: starting from the impact point of the hit object, playing the target ricochet sound effect along the direction of the target path.
[0176] In an optional embodiment, the method further includes: if the impact incident angle of the hit object is not obtained, determining a preset incident angle as the impact incident angle.
[0177] In an optional embodiment, the step of playing the hit sound effect of the hit object and the target ricochet sound effect includes: in response to the target object moving in the virtual scene, playing the target ricochet sound effect according to a preset attenuation curve corresponding to the moving direction.
[0178] In an optional embodiment, after the step of determining the target ricochet sound effect of the target object hitting the target object based on the impact incident angle, type information and material information, the method further includes: playing the hit sound effect of the target object while playing the target ricochet sound effect.
[0179] In an optional embodiment, before the step of playing the hit sound effect of the hit object while playing the target ricochet sound effect, the method further includes: determining at least one preset hit sound effect corresponding to the hit object based on the type information of the target object; and extracting one preset hit sound effect from the at least one preset hit sound effect as the hit sound effect of the hit object.
[0180] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0181] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0182] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for playing impact sound effects, characterized in that: A graphical user interface is provided through a terminal device, wherein a virtual screen of a virtual scene is displayed in the graphical user interface; the method comprises: In response to a target object in the virtual scene hitting a hit object, acquiring an impact incident angle when the target object hits the hit object, type information of the target object, and material information of the hit object; Determine a target ricochet sound effect of the target object hitting the hit object according to the impact incident angle, the type information and the material information; Play the target ricochet sound effect; The step of determining a target ricochet sound effect of the target object hitting the hit object according to the impact incident angle, the type information and the material information comprises: determining a ricochet trigger probability based on the impact incident angle and the material information; determining a target playback source from a plurality of sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability; and determining the target playback source as the target ricochet sound effect; The step of determining the ricochet trigger probability based on the impact incident angle and the material information includes: determining the ricochet trigger probability corresponding to the impact incident angle and the material information according to a preset ricochet trigger relationship; wherein the ricochet trigger relationship includes: the ricochet trigger probability of each of the preset angle intervals in a plurality of preset angle intervals under each preset impact material.
2. The method according to claim 1, characterized in that Each type of target object has a plurality of sound effect playback sources corresponding to each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the plurality of sound effect playback sources corresponding to each ricochet trigger probability, the number of the silent playback sources and the number of the sound playback sources are determined according to the ricochet trigger probability; The step of determining a target playback source from a plurality of sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability comprises: From the multiple sound effect playback sources corresponding to the target object corresponding to the type information under the ricochet trigger probability, randomly select a sound effect playback source as the target playback source; wherein the target playback source is a silent playback source or a sound playback source.
3. The method according to claim 1, characterized in that Each type of target object has a plurality of sound effect playback sources corresponding to each ricochet trigger probability, and the sound effect playback source is a silent playback source or a sound playback source; among the plurality of sound effect playback sources corresponding to each ricochet trigger probability, the weight corresponding to the silent playback source and the weight corresponding to the sound playback source are determined according to the ricochet trigger probability; The step of determining a target playback source from a plurality of sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability comprises: Based on the weight corresponding to the silent playback source and the weight corresponding to the sound playback source under the ricochet trigger probability, the target playback source is determined from the silent playback source and the sound playback source corresponding to the target object corresponding to the type information under the ricochet trigger probability.
4. The method according to claim 2 or 3, characterized in that: The sound playback source stores sound effects that decay and change over time; when the multiple sound effect playback sources include multiple sound playback sources, the sound playback sources store different sound effects.
5. The method according to claim 1, characterized in that Before the step of playing the target ricochet sound effect, the method further includes: A target path is selected from a plurality of preset playback paths so that the target ricochet sound effect is played in the direction of the target path.
6. The method according to claim 5, characterized in that The step of playing the target ricochet sound effect comprises: Starting from the impact point of the hit object, the target ricochet sound effect is played along the direction of the target path.
7. The method according to claim 1, characterized in that The method further comprises: If the impact incident angle hitting the hit object is not obtained, a preset incident angle is determined as the impact incident angle.
8. The method according to claim 1, characterized in that The step of playing the target ricochet sound effect comprises: In response to the target object moving in the virtual scene, the target ricochet sound effect is played according to a preset attenuation curve corresponding to the moving direction.
9. The method according to claim 1, characterized in that: After the step of determining the target ricochet sound effect of the target object hitting the hit object according to the impact incident angle, the type information and the material information, the method further includes: While playing the target ricochet sound effect, the hit sound effect of the hit object is played.
10. The method according to claim 9, characterized in that Before the step of playing the target ricochet sound effect and the step of playing the hit sound effect of the hit object at the same time, the method further includes: Determining at least one preset hitting sound effect corresponding to the hit object according to the type information of the target object; From the at least one preset hitting sound effect, one preset hitting sound effect is extracted as the hitting sound effect of the hit object.
11. A device for playing impact sound effects, characterized in that: A graphical user interface is provided through a terminal device, wherein a virtual screen of a virtual scene is displayed in the graphical user interface; the device comprises: an information acquisition module, configured to acquire, in response to a target object in the virtual scene hitting a hit object, an impact incident angle when the target object hits the hit object, type information of the target object, and material information of the hit object; A sound effect determination module, used to determine a target ricochet sound effect of the target object hitting the hit object according to the impact incident angle, the type information and the material information; A sound effect playing module, used to play the target ricochet sound effect; The sound effect determination module includes: a ricochet probability determination unit, configured to determine a ricochet trigger probability based on the impact incident angle and the material information; a ricochet sound effect determination unit, configured to determine a target playback source from a plurality of sound effect playback sources of the target object corresponding to the type information according to the ricochet trigger probability, and determine the target playback source as the target ricochet sound effect; The ricochet probability determination unit is further used to: determine the ricochet trigger probability corresponding to the impact incident angle and the material information according to a preset ricochet trigger relationship; wherein the ricochet trigger relationship includes: the ricochet trigger probability of each of the preset angle intervals in a plurality of preset angle intervals under each preset impact material.
12. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the method for playing the impact sound effect as described in any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the method for playing the impact sound effect according to any one of claims 1 to 10.
Citation Information
Patent Citations
Sound effect playing method and related device
CN109857363A
Virtual object attack prompt method and device, terminal and storage medium
CN110548288A