バージョン
menu_open
警告:あなたのメジャーリリース ( 2022.1.16.8522 ) に該当する最新ドキュメンテーションが表示されています。特定バージョンのドキュメンテーションにアクセスするには、Audiokinetic Launcherでオフラインドキュメンテーションをダウンロードし、Wwise AuthoringのOffline Documentationオプションにチェックを入れてください。

Understanding the Sound Engine Integration into Cube

The following tasks were involved when integrating the Wwise sound engine into Cube:

Preparing Cube for Wwise

Cube, originally developed by Wouter van Oortmerssen, is an open-source single or multi-player first person shooter game that is readily available from the Cube web site (http://cube.sourceforge.net/). To accommodate the integration of Wwise, the following modifications were made to the version downloaded from the Cube website:

  • The existing sound code was rewritten to use the Wwise sound engine.

  • The audio content was moved into a Wwise project.

  • Dependencies on other libraries (SDL, SDL_image, libpng) were removed.

  • Extra audio (footsteps, rocket thrust sound) was added.

  • Some game config and content files were modified to accommodate the above changes.

Registering Game Objects

Two kinds of game objects were registered in the sound engine:

  • Pointers to the baseent struct. These are the moving entities of the game world: players, monsters, and projectiles.

  • Dummy game objects, numbered 64-127. These are used for 3D sounds that are not attached to a moving entity (for example, items spawning).

Integrating Audio

The core of the audio integration code is located in the <WwiseRoot>/Cube Demo/cube_source/src folder in the following files:

  • Sound.cpp—includes all code that accesses the sound engine.

  • Sound section of Protos.h—includes the declared public functions.

The following types of sounds were involved in the integration process:

  • Monster Play Sounds:

    • Each character has associated pain, die, and footstep events. (See monstertypes[] in monster.cpp.)

    • Footstep events are posted from the monsterfootstep() function, which also sets the 'Material' switch corresponding to the texture underneath the character, to drive the footstep switch container.

    • Items have associated pickup events. (See itemstats[] in entities.cpp)

  • Weapon Sounds:

    • Each weapon has an associated event. (See guns[] in weapon.cpp)

    • Projectiles have a splashing event (S_FEXPLODE, S_RLHIT).

    • The rocket has a continuous thrust sound (played by the event S_RLTHRUST). Velocity in baseent is boosted to enhance Doppler effect. The sound is stopped by the rocket splash event (S_RLHIT).

    • Shooting while quad damage is enabled also posts the event S_ITEMPUP.

  • Network Sounds:

    • Certain events also need to go to the server for network play; this is handled by snd_clientevent().

  • Miscellaneous Sounds:

    • To find all other sound events occurring during game play, search for snd_event() calls in the code base.

Adding New Scripting Commands

The following new sound-related commands were created to help you manage the sounds. These can be used in the '.cfg' script files:

  • akevent <string>: post an event (by name) on the local player game object (player1).

  • soundvol <int>: to set the sound volume (0-255).

  • musicvol <int>: to set the music volume (0-255).

  • voicevol <int>: to set the voice volume (0-255).

  • texturematerial <int> <string1> <string2>: this is essentially the same command as 'texture', but with an added parameter which is the associated material for footsteps.


このページはお役に立ちましたか?

サポートは必要ですか?

ご質問や問題、ご不明点はございますか?お気軽にお問い合わせください。

サポートページをご確認ください

あなたのプロジェクトについて教えてください。ご不明な点はありませんか。

プロジェクトを登録していただくことで、ご利用開始のサポートをいたします。

Wwiseからはじめよう