Version
menu_open
Warning: you were redirected to the latest documentation corresponding to your major release ( 2023.1.8.8601 ). Should you wish to access your specific version's documentation, please download the offline documentation from the Audiokinetic Launcher and check the Offline Documentation option in Wwise Authoring.

Minigun

The Minigun example demonstrates how the sounds of a complex firearm can be simulated in a game by using Wwise.

To listen to the Minigun example:

  1. In the Sessions tab of the Project Explorer, go in the Soundcaster Sessions section, expand the Minigun Work Unit and double-click the Minigun Soundcaster session.

    The session is loaded into the Soundcaster.

  2. You can then do any of the following:

    • Play the “Play_Minigun” Event.

    • Play the “Stop_Minigun” Event.

    • Select a material from the list to hear the shells falling on different materials.

Minigun Details: Events

To understand the construction of the Minigun example, take some time to examine the Play and Stop Minigun Events. Look at the delays that have been inserted on the different Actions. Don’t hesitate to unselect the platform (PF) check boxes on both Events to be able to listen to the three different stems (barrel, fire, and shells) independently.

For the Stop_Minigun Event, the Break action has been used to stop the “Fire” and “Shells” random continuous containers that use the “trigger rate” transition type. The Break actions stop the containers to trigger new fire or shell sounds without cutting the tail of the sounds that have already been triggered.

[Note]Note

The Events in the Minigun example have been simplified for this sample project. In a real game, refinements would be made to produce a more realistic simulation. For example, the Play_Minigun Event would be split into two separate Events for the barrel and fire sounds, so that each could be controlled more closely.

Minigun Details: Sounds

The minigun sounds are divided into three categories:

  • Barrel sounds: The minigun barrel movements are represented by three sounds: “Up”, “Loop,” and “Down”. The “Up” and “Loop” sounds have been integrated into the “Minigun_Barrel_Start” sequence container using a sample accurate transition. The “Down” sound is played when the “Stop_Minigun” Event is triggered.

  • Fire sounds: The minigun discharge sounds are included in the “Fire” Random Container. This container is set to trigger a new fire sound every 0.05 seconds in an infinite loop. The Trigger rate transition option ensures that a new sound is triggered at the frequency defined in the Duration field without interrupting the previously played sounds. A limit of five instances per game object has been set in the Fire sounds Advanced Settings to restrict CPU usage.

    [Note]Note

    When the “Fire” container is played back in Wwise Authoring, and the Transport Control is set to Play Originals, the timing of each fire sound might not perfectly match the frequency defined in the Duration field. This is because original audio files are streamed from the hard drive. This is a playback limitation in Wwise Authoring only; when played back in game, the fire sounds are triggered at the exact frequency defined in the Duration field.

    You can get better timing in Wwise Authoring by selecting Play Converted from the transport play options. Beforehand, make sure you select Convert All Audio Files from the Project menu. Otherwise, you'll hear nothing.

  • Shell sounds: The sounds of the minigun’s brass hitting the ground is simulated by five Random Containers set to infinitely trigger a new shell sound every 0.1 seconds. These objects are inserted into a Switch Container to play the right Random Container based on the actual material onto which the shells will fall.

    Note that the frequency of the trigger rate for the shells is slower than the fire rate. This decision was made simply because the slower rate sounded better.

    A limit of five instances per game object has been set in the Shells sounds Advanced Settings to restrict CPU usage.

[Tip]Tip

For optimal precision, you can use MIDI to achieve a sample-accurate trigger rate. However, this is an advanced option and requires use of the SDK. For more information, refer to Simulating Rapid Gunfire.


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise