Creature SFX Implementation Guide

Preface

This guide was adapted from material by jaegrover on the TESRenewal (now Morroblivion) forums.

The original post can be found here: https://morroblivion.com/forums/music-and-sound/creature-sfx-implementation-guide

Additionally, see this guide: Custom Race Implementation for work that needs to be done prior to SFX implementation.

Introduction

Hi all,

Here is a guide on how to implement sound effects for creatures in Skywind. Please keep in mind the following:

I'm no expert (not yet! :P)

I've only implemented one creature this way so far, so others may require slightly different procedures!

This is a work in progress and its progress depends, in part, on your feedback! Please let me know if anything is not clear, and I will update it accordingly, as well as updating it based on any new knowledge.

- jaegrover

The Process

Part 1: Initial Creation Kit work

  1. Render out your files in 44100, 16-bit .WAV format, and place them in the appropriate subfolder under \Steam\SteamApps\common\Skyrim\Data\Sound\fx\morro\Cr

  2. In the Creation Kit, load up SkyWind. If it's not automatically visible, go to View --> Object Window. Expand Audio and select Sound Descriptors.

  3. In the list of Sound Descriptors in the main panel of the Object Window, right-click and select New, and fill out each parameter accordingly (see screenshot for a quick example):

    • Name: 1[CreatureName][Action]. Example: 1ClannfearAttack. (The 1 isn't entirely necessary, afaik it's used to differentiate from vanilla Skyrim packages)

      • (Note: confirm these prefixes)

    • Descriptor Type: Standard (only option)

    • Sound: Under sound, right-click and press New. Navigate to the sound you wish to use. You can add as many sounds as you like, and they will be selected from randomly when this sound descriptor is used.

    • Category: For now, I'm using AudioCategoryPausedDuringMenu, but feel free to experiment with different ones. This will simply ensure that the sound stops playing if you pause the game or bring up the UI.

    • Output Model: This will determine how far the sound propagates, and whether or not it takes Reverb. I've been using SOMMono03000_verb, which means the sound will play in mono, propagate for 3k game units, and take reverb. Feel free to experiment with different settings to get the proper feel for your creature, but this is a fine default setting.

    • You can ignore the Conditions checkbox unless you want to try out some fancy scripting.

    • Static Attenuation: This is used to reduce the volume by a flat amount. If your sound is too loud, just slide this over and knock it down a little. Use to personal taste.

    • dB variance: This will introduce a random amount of volume difference, between 0 and the number you write in this field, every time the sounds play. It can make your sounds feel a bit more varied. I leave this blank by default.

    • Looping: generally, for one-offs (attacks, idles, deaths), it should be set to None. For Conscious Loop (a persistent sound that plays as long as the creature is alive and awake, e.g. the smouldering fire on a Flame Atronach), you can set it to Loop

    • Frequency Shift: Shifts your sound by a fixed pitch, either up or down. Similar to static attenuation, can be used to tweak your sound.

    • Frequency Variance: Introduces a random pitch change to the sound every time it plays. Useful for adding variation. You can put probably between 5-8% here without it sounding too artificial.

    • All the rest of the fields, I leave blank.

  4. Repeat step 3 for as many actions as you need. For the Clannfear, I used Breathe In, Breathe Out, Death, Aware, Attack, Hit, Idle, Flee. You may need more or less depending on your creature. To make this easy, once you have your first sound set up, you can right click on it and select Duplicate. Right click the duplicate, and click Edit. It will have all the parameters from your previous descriptor set already, so just change the title and the sounds in the playlist, and click OK. It will ask you if you want to create a new form - click NO.

Part 2: Behavior editing

5. Now, things get interesting. First of all, you will need two programs: ConvertUI, and Notepad++. Download these and have them ready.There are guides on how to use each of these programs, so I'll keep my details brief, but if you need more info, let me know.

6. You will now need to edit the behavior graph file of the creature you want to change the sounds for. Unfortunately, the graph files are in .hkx, havok format, which we can't directly access. That's where ConvertUI comes in. First off, navigate to the Skywind creatures folder, e.g. Steam\SteamApps\common\Skyrim\Data\meshes\actors\Morrowind\Clannfear. The Clannfear was based off of the Werewolf skeleton and behavior graph, so we will be working with a few files called 'werewolf.hkx' etc. Don't worry, this won't change the actual behavior of the werewolf, since these files are copies.

7. Navigate to the Behaviors subfolder. Currently, there should be one file in there - werewolf.hkx (or whatever the behavior graph your creature is based off of). Copy the ConvertUI.exe to this folder and double-click to run it. You will notice that two folders, infolder, and outfolder, have been created. Copy and Paste werewolfbehavior.hkx into infolder (you might want to back up werewolfbehavior.hkx, and any other .hkx files you edit, in a folder on your desktop just in case anything goes wrong, to avoid reinstalling skywind :p).

8. In ConvertUI, make sure you're on the tab that says "hkx to XML," and hit convert. A dialogue box will pop-up quickly saying 'Completed.' If you check the outfolder, you will see a file with the same name - werewolfbehavior.hkx. Though it looks the same, if you check the filesize, you'll notice it's a bit bigger than the one in the infolder. ConvertUI has uncompressed the file, and now you can open it in Notepad++. Do so by opening Notepad++ and clicking and dragging your converted file into the window.

9. Now in Notepad++, you're going to want to look for anything that says SoundPlay. If you press Ctrl+F, you can choose to search for all instances of the phrase SoundPlay. They will appear in a subwindow at the bottom of the screen, along with the line in the code in which you can find them. Simply double-click on any of these lines at the bottom, and you'll skip to that line of code in the main window. The sounds should read something like "WerewolfAttackA" or "WerewolfRoar" etc etc. If you happen to look in the CK, you will find sound descriptors from Vanilla Skyrim with the same names. I bet you can tell what's coming next... replace any sounds you want to change with the names of your sound descriptors that you created for your new creature! For example, "PlaySound.WerewolfDeath" becomes "PlaySound.ClannfearDeath." NOTE: There are some sounds you probably don't want to change (e.g. generic sounds like jumping and landing). My general rule is, if it looks suspicious, leave it alone. Just change what you absolutely need and move on.

10. OPTIONAL: CREATING NEW EVENTS. SKIP IF YOU DON'T NEED TO ADD ADDITIONAL SOUNDS, JUST REPLACE

For the Clannfear example, when I was done implementing the Breathe In and Out sound effects, I tested it in game and found that it only worked in combat. This is because, even though I replaced the werewolf sounds, those sounds were actually only triggered for the in-combat animations! So, what do you do if one of your animations isn't supported with a pre-existing sound? This is where things get a little.... interesting.

So the way these behavior files is set up is: At the top, you have a list of events - see the screenshot above. These can be sound, particle effect, anim events, etc. At the very top (line9,) you will see a row that says:

<hkparam name="eventNames" numelements="242">

That means that there are 242 elements in the list of possible events. So, now that you understand the concept of Events, you need to find the Clip Generator, as Bethesda calls it, or Animation Player, as I call it, that plays the animation you want to add sounds to. To do this, preview and find the name of your animation in the CK (open the actor, click the PREVIEW checkbox on the bottom, scroll to the Animations tab at the top and click the animations to see a preview to find one you want), and once you know the name, CTRL-F in Notepad++ to FIND, and search for the name. For ease, select "Find All In This Document." It will give you a list at the bottom, and if you double-click any of the results, it will jump to that position in the file. You want to find something that looks like the screenshot below. In this example, I am adding sounds to the Clip Generator that plays the animation StandingIdle00.

So unless you know code, that's probably going to look like a bunch of nonsense to you. The only thing you need to pay attention to is the hk param triggers field. Notice on line 27869, it says triggers = #0880? Well, this animation is going to use Trigger Array #0880. What's a trigger array? Simple: it's a list of events, from the first list we looked at, that can be triggered from within the animation, and the times at which they can be triggered. Let's take a look at one. (CTRL-F the number you want to work with)

Notice the name at the top: Trigger Array. So, if you read through this array, you'll notice two main things: LocalTime, which just means the time in the animation, and an Event header with, underneat and indented, an ID#. So, remember that long list of events at the top of the page, including our play sound events? Those are all the possible events that can be referenced here, and they each have an ID#, which is simply the order in the list. You can do some simple math to find out what each event's number is. Alternatively, download a program called CondenseBehavior (first result on Google, can upload if you want) from the Nexus, which will take a behavior file and re-arrange everything in a way that makes more sense, and show you the event numbers more clearly (non-destructively). If you need help with that program let me know, but it's very intuitive.

The other parameter to pay attention to here is the 4th line from the top, where it says "numElements." If you add or remove elements from this list, you MUST change the number to reflect exactly how many elements are in the list. Otherwise, you will not be able to convert the file back into HKX and the engine will not recognize it. So, by now, I bet you've figured out what you need to do, but I can bullet-point it for you:

  • Copy and Paste (or write it yourself if you're a programmer and masochistic) one of the Trigger Arrays somewhere else in the document and give it a unique number, in the format #0000 (include 0s always, e.g. #0051) (might have to try a few, if you can't convert back to HKC later it's probably cause there is a duplicate number)

  • Modify the elements in the array list: add or remove as many triggers as you want, making sure to update the numelements parameter at the top to reflect how many elements you have in the list.

  • For each element, specify an event you want to call (your PlaySound, the event number of which is just its position in the list at the very top that we saw before), and the LocalTime, i.e. the time in the animation you want it to play. NB: Make sure the LocalTime you set it to doesn't exceed the time of the animation! Trying to play a sound 5 seconds into a 3 second animation will not end well!

  • Now, find the Clip Generator that corresponds to your animation, and in the Events parameter, change whatever number is there to the new, unique number you created for your trigger array. This should work, but probably won't, so be prepared to make backups of your work and try this over and over again until the engine is like "OK, I'll play nice." Ping me if you have any trouble, this whole process is a PITA.

11. Save and exit. Back in your Behaviors folder, delete the file in the infolder. Move the now-edited werewolfbehavior.hkx from outfolder to infolder. Run ConvertUI again, but this time click the second tab -XML to HKX. You don't need to fill in the filename field, it will detect this automatically. Just press Convert. Next, move it out of the outfolder and back into the main Behaviors folder. It will ask you to replace the current werewolfbehavior.HKX. Back it up first if you wish, then say Yes. IF IT DOESN'T CONVERT, I.E. THERE IS NOTHING IN YOUR OUTFOLDER, you messed up one of the arrays, i.e. the NumElements isn't equal to the actual number of elements in the list. Verify anything you've changed and count to make sure you have the right number of elements specified.

Part 3: Testing

12. Ok, now that you're through that wall of text, open up the CK if it's not already, open the Interiors / Spaces browser, and choose a simple space to test your critter out (I like using ArrowCabin for a tiny space or AldSothaLowerLevel for a bigger space). Click and drag your creature into the level and SAVE. It may ask you to save as a new .esp. Give it an obvious title like CreatureTest.

13. Open Skyrim (you don't need to close the CK). At the launcher screen, click data files, and make sure Skywind, Skywind - Patch (if you have it) and, most importantly, CreatureTest (or whatever you called it) are selected, in that load order.

14. At the title screen, press ~ to bring up the console, then type 'tgm' to activate god mode for ease of testing, 'tcai' if you want the creature to stand around doing nothing, and then 'coc [Name of the Level you're using,' e.g. coc AbandonedShackInterior (it's case sensitive, so make sure you spell it right!).

15. Your creature will now be walking around with the sounds - assuming everything went well. Which it probably won't. It will probably break over and over again until you get it right.

Part 4: Creation Kit work for Hit/Death sounds

So now let's do something else that is likely to cause you to pull your hair out, and put in some Hit and Death sounds. These are implemented using Skyrim's Quest manager. This makes sense, because you want to give priorities to certain lines so that they don't overlap etc, especially for human NPCs.

16. The first thing you will need is a Voice Type. This is super easy - just find the Voice Type category in the left of the Objects Window in the CK, right-click in the list and hit New. There are hardly any options, so just name it CrClannfearVoice or something simple like that.

17. Now open up the actor's properties that you're working with. Look for the Trais tab on the top, and for the Voice Type parameter... you guessed it... set it to CrClannfearVoice (replace the name with your creature of course).

18. Go back to the objects window and click on Quest. Right-click, and do New. Fill out the following forms: ID: CreatureDialogue[YourCreatureName], e.g. CreatureDialogueClannfear. Quest name: same, CreatureDialogueClannfear. Priority: 0. Start Game enabled: CHECK. Run once, warn on alias, blah blah, everything else UNCHECKED/BLANK.

19. We need to assign this dialogue to all Clannfears, and Clannfears only. Right click in the box in the middle that says Quest Dialogue Conditions and hit New. The drop down menu on the left should say GetIsID. Click it and select GetIsVoiceType. Then, notice the box right next to it that says INVALID. Click that until a list appears showing you all voice types. Select the CrClannfearVoice that you created before.

20. Click OK to close this submenu, and then OK to close the quest, then immediately open it again.

21. Notice that there are now a bunch of extra tabs at the top. Click Combat.

22. You will see 3 columns: One greyed out to the left, one which says Subtype with a dropdown menu near the top (sort of in the middle) and a large one with Topic Text at the top, to the right. Right-click in the middle one (Subtype) and choose New Topic. We're working with Death first, so choose death, and in future steps, choose hit, or whatever else you want.

21. A dialogue box will appear with a name in it. Just delete whatever text is in here and hit OK, it doesn't matter for creatures.

22. Now left click once to select your next topic (Death) and then right-click in the big box on the right and say New.

23. This brings up the Response screen. In the very top, under Response Text, just press the spacebar once. You should see the character count move to 1/150 (it's like a in-skyrim twitter! *crickets*) If you don't put one character minimum in here it won't create it at all, but since it's a creature you won't need to respond to it. The only other thing you need to do here is, towards the bottom, where it says Sound File, there is a big button that says Select Sound... yeah. Click it and choose the Sound Descriptor for your creature's Death sound. Click OK when you're done.

23. This brings up the Topic Info screen. Now all you have to do is, under Conditions, do the same thing you did before on the main quest conditions page: Right Click, New, set to GetIsVoiceType, set the voice type to your creature, then hit OK.

24. Congratulations! You've created a Death Sound for your creature! Repeat this process for any other sounds you want to add, like Hit. You can add Stealth Detect responses in another tab. I won't go into it here but if you have any questions let me know.

25. Now... if you try to put this in game, it won't work. This is because you need to create a special file called a .SEQ file for the edited quest. Don't ask why, it's some tech optimization Bethesda apparently sprung on the community with patch 1.6 and had everyone in a tizzy. But it's easy to work around. Download the program TES5Edit from the Nexus. Open it up, and like the CK, it will ask you to choose your ESP. Select Skywind and your modified ESP, then click OK. Even if it looks like it's loaded, it takes a while, so wait until it stops saying "Building reference info" along the bottom of the screen. Now, just right-click your ESP, choose Other, and click Create SEQ file.

26. To double-check that this worked correctly, look in your Data folder. You should now have a folder called SEQ, with a .SEQ file that has the same name as your .ESP in it. Whee! Remember to submit this when you upload for integration.

27. Test your creature in game. Play with it a lot. Most likely, things won't work, unexpected crap will break. You will rage, you will cry, you will begin to doubt the very foundation of your existence. But, in the end, you will get your creature working, and it will fill you with the pride of a thousand suns. And it will mean that I have one less thing to put in the game.

Close

Optional, but highly recommended final step: Drink heavily throughout the entire process.

<3

-JAEG