PowerQuest 0.19.4
Loading...
Searching...
No Matches
Audio System Manual

Sfx / Music

The audio system uses a concept of an AudioCue. The cue is an object where you set up how you’d like a sound to play. Then you can just “play” the cue from a script or animation.

To create a Sound or music cue and play it:

  • Stick your sound files in the Audio/SFX folder, right click it and select Create -> Audio Cue. (or duplicate an existing cue and drag in your audio files)
  • Set the volume, and other settings in the Cue, I like to add a bit of random pitch variation for sounds you hear a lot. And you can include multiple sounds in a single cue to have them play randomly.
  • In a script call Audio.Play(“nameOfTheSFXCue”);
  • Looping sounds:
    • Tick the “Loop” tickbox for looping sounds.
    • Play it like normal. eg. Audio.Play(“FireCrackle”);
    • Call Audio.Stop(“FireCrackle”); to stop it again.
    • You can also call Audio.PlayMusic(...) which handles crossfading.
  • Character Footsteps
    • Set C.Player.Footstep = “MyFootstepSoundName”;
    • Add events to the animation timeline called Footstep (ensure the Add anim prefix box is ticked).
  • Animations
    • You can play sounds from animations too.
    • Drag an audio cue onto the PowerSprite Animator timeline.
    • See Animation Events page for more info on animation events.
  • When you play a sound from a script, an AudioHandle is returned, you can use this to mess with the sound how want, I often do Audio.Play(“FireCrackle”).FadeIn(2); for example.
  • If you want a looping sound to get louder as you get closer, Play it, Then in your room’s update function add an Audio.UpdateCustomFalloff(...) function.
  • See SystemAudio documentation for more info on scripting audio.

Voice / Spoken Dialog

  • Follow the instructions in the Game Text Section to Process your text and generate your script
  • Now you have the HTML of the script for the game (you can print this, save as pdf, whatever)
  • Record your lines, and save the files with the filenames written next to the lines (eg: DAVE1.wav, DAVE2.wav)
  • Add the file to the Audio/Resources/Voice directory. There’s some notes in there about import settings for clips
  • Done!
  • You can also watch a video tutorial of the process here.

Lip Sync

  • To use this you’ll have to install Rhubarb (It’s free!). Get it here: https://github.com/DanielSWolf/rhubarblip-sync
  • Put it under your project folder in folder called ‘Rhubarb’. Eg: \MyProject\Rhubarb\rhubarb.exe
  • Then, once you have dialog recorded you can hit the Tools->Game Text Tools -> Process Lip Sync Data button, that will run an automated tool called Rhubarb to work out which “Frame” of talking animation to play at what time. It’s quick and dirty but kinda cool.
  • Tick Lip Sync Enabled in the Data for Character's you want to use it
  • Those characters need talk anims with frames ABCDEFX in that order, from https://github.com/DanielSWolf/rhubarb-lip-sync
  • If you want to use the G,H frames, go to Tools->Game Text Tools -> and edit the Lip Sync Extended Shapes. GHX for all three, GX for just those two, etc
  • You can also watch a video tutorial of the process here.

Separate Mouth Animation

  • In addition, or alongside lip sync, you animate your character’s mouths separate to their body
  • This means you can change your characters pose and not have to make another set of talk animations where the mouth wobbles
  • To use it:
    • Create an animation for the mouth (eg: named MouthR) with your mouth frames
      • Use the ones mentioned in the LipSync section above for example
      • You can change the name of the mouth animation just like you do for talk animations
    • Set the “Anim Mouth” in your character’s inspector to the name of your anim (eg. “Mouth”)
    • Open your animations in PowerSprite Animator (they don't have to have a Talk anim if you do this) anim)
    • Add a node by double clicking, and move it where the mouth should be for each frame. (See PowerSpriteAnimator documentation for more details) You can set up a preview sprite for the node to see how it’ll look