Judith on 6/12/2008 at 16:14
A 4mb movie to download: (
http://www.sendspace.com/file/1x4n99)
Or to view in a player: (
http://media.putfile.com/Snow4)
(
http://www.masterbuilderstore.com/tut_snow/FallingSnow2.avi) A falling snow - the movie (3.6 mb).
(
http://www.masterbuilderstore.com/tut_snow/Snowstorm.avi) A snowstorm (5 mb)
[Edit]
(
http://www.masterbuilderstore.com/tut_snow/Snow - new material category.doc) Beta version of a tutorial in a .doc file, with better formatting.
-----------------------------------------------------
In this tutorial you'll learn how to create your own material category and how to assign a set of sound schemas to a new surface type. You'll need 3dsmax 5.1 (properly set up to work with T3ed) to create a new material, and you should know how to do it in a first place. You might also need a Gimp or Photoshop for making textures, and some sound processing software, if you don't want to rely on my little package.
Advice: you'll be working with schema browser for most of the time. As you know, it takes forever to load and you'll need to restart it several times... Fortunately, you can vastly shorten its loading time! Go to your “\...\CONTENT\T3\Sounds\schemas” folder and select all items you have there. There should be “conversations” folder here, unselect it. You probably have some archiving software already installed on your system (e.g. WinRar or 7zip), so right-click the rest of the files and choose to rar/zip them from the Windows context menu. After you create the archive, DELETE all the content except “conversations” folder. You have it all backed up in the archive, so there's nothing to worry about. When you restart T3ed and launch the schema browser, you'll see that there are about 1 700 schemas loading, instead of 16 000. Those schemas you deleted are the all the one-liners for the AI while patrolling, searching, alarming others, etc. They're already in .csc file so the only consequence of that action might be the absence of the subtitles while you're in a test mode, nothing more than that.
1) Preparing the soundsFirst of all you'll need the sounds. You can use free sound repositories, like Soundsnap to download and prepare the files (with software like Audacity or CoolEdit Pro). In our example you'll need 4 different footstep sounds in the snow and a jump sound. Use following guidelines as a rule of thumb:
- All the sounds should start at more or less the same point in time (e.g. 0,02 sec.).
- All sounds should have a similar, short length (e.g. 0,3-0,5 sec.).
- Remember to normalize all your sounds at the same high level before saving, making them as loud as possible without being distorted.
If you don't have a sound processing software or don't know how to prepare such sounds, you can use (
http://www.masterbuilderstore.com/tut_snow/footsteps_snow.rar) my package:
Put those files in “\...\CONTENT\T3\Sounds\schemas_sfx” folder.
2) Creating a new material category for 3dsmaxThis is a pretty easy task. Go to your “\...\CONTENT\T3\MatLib” folder and open categories.txt file. Add a snow category at the very end of the list. Now open the DynamicallyLoaded folder and do the same in txt file you see there.
If you start 3dsmax and try to create a new material via Ion Shader, you'll see a new category in the dropdown list. First of all, you'll need to create a snow diffuse and normalmap. You can use your own textures or (
http://www.masterbuilderstore.com/tut_snow/snowtex.rar) try out mine, if you don't have that much time. After you finish, put those .dds files in your “Textures” and “PCTextures” folder.
I use a small, plain white (128 x 128) texture plus a tiling normalmap based on the photo of the snow (1024). I think it looks more “pure“ than a photo of snow + normalmap (and it takes up less space ;)). Anyway, the choice is yours. There are more complicated things to do after you save the material library and export it to .mlb file.
3) Creating new tag valuesSounds a bit exotic, does it? For now you have a new material category, recognized by 3dsmax. T3ed also recognizes it as new thing, but you'll need to assign new sounds to it somehow.
If you open the schema browser and look at some files in schemas_sfx, you'll notice those with “ft_materialtype_pc_movementtype” name pattern. “Ft” refers to footsteps, material type is an obvious thing, “pc” stands for player character (notice that there's also the “ai”) and movement type is pretty self-explanatory as well. Now if you select for example ft_veg_pc_walk and take a look at “Tags” field, you'll see four of them:
+footstep: - a tag without any value, probably indicating that this is a surface on which characters can walk.
+charactertype:player - this, in connection with AI noise type field is probably the information for AI that this sound is generated by Garrett and it should pay attention to it. Notice that ft_veg_ai_walk sound doesn't use this tag and “AI noise type” is set to “unassigned”.
+movementstate:walk - this is pretty self-explanatory, it defines the movement type needed to hear this schema.
+groundmaterial:vegetation - this tag is the most important thing here. I guess that it is responsible for associating the sound schema set up here with material category defined in “categories.txt” and in 3dsmax via Ion Shader. If you click “Modify tags” button, a new window will appear. On the right there is a list of tags currently assigned to this schema. If you select groundmaterial:vegetation and press “Edit value” button you'll see that you cannot choose the new “snow” value here. That's because it wasn't defined yet.
The next logical step would be to open the Tag Database (View -> Tag Database -> Sounds), but after the new window appears you'll see that it's completely useless, you cannot add new values here at all...
Fortunately, there's a workaround for that. If you ever tried nosing around in your editor install, you probably saw a “\...\CONTENT\T3\TagDatabase” folder. There are three subfolders there. You cannot do much about first two, but “Vocabularies” folder is what you need. Use Notepad to open “PhysicsSounds.vcb” file. You'll notice 2 particular tags in there one starting with “+PO1Material” and the second with “+PO2Material”. You'll see some familiar material categories in each. Put colons at the end of both and add snow category there. Both tags should look like this:
+PO1Material|bitfield|unassigned:carpet:ceramic:earth:flesh:glass:gravel:metal:moss:puddle:stone:tile:vegetation:wood:stoneclimb:ShallowWater:DeathWater:snow
+PO2Material|bitfield|unassigned:carpet:ceramic:earth:flesh:glass:gravel:metal:moss:puddle:stone:tile:vegetation:wood:stoneclimb:snow
Save the file, close it and open “sounds.vcb”. You'll see sound tags here, sorted by categories. Scroll down to “SFX TAGS”, find the +groundmaterial tag along with its values. Again, put a colon right after “stoneclimb” value and add snow category. The tag should look like this:
+groundmaterial|bitfield|unassigned:carpet:ceramic:earth:flesh:glass:gravel:metal:moss:puddle:stone:tile:vegetation:wood:stoneclimb:snow
Save and close the file. Now after restarting T3Ed and schema browser you should see a new value that can be assigned to +groundmaterial: - a snow category.
4) Creating a set of schemas for new material categoryNow comes the most tedious part. Actually it would be much faster, if you did by copying and editing .sch files in Notepad, than using schema browser, but I'll use schema browser for a first time.
First, put all the four sounds in your “\...\CONTENT\T3\Sounds\schemas_sfx” folder. You could make a separate folder for it too, or use any naming convention you want, but you'll be comparing a lot of things with what developers did.
Ok, (re)start T3ed, open schema browser and right-click “schemas_sfx”, choose “add schema to this folder”. Name it according to the convention, so you won't have to scroll the list down too much while comparing it to other surface schemas, i.e. ft_snow_pc_walk.
Add 4 more metasounds to it, name those with numbers, from 1 to 4 and delete the “meta1” entry. Select the first metasound go to the “WAV” field on the right, click “Change” button. Choose the first file from the package you put in “schemas_sfx” folder, i.e. ftsnow_p1.wav. repeat the process for metasounds 2-4, assigning the rest of the files (except the ftsnow_pj.wav, which is a sound of jumping).
Now you'll have to set values in “Parameter ranges” field. In order to do that properly, I looked for the values for the similar sound set, i.e. sounds assigned to “vegetation” category. Click the ft_veg_pc_walk schema to see it's parameters. You'll see that the volume range is set to -27, -27; pitch range is set to 0 in both boxes; pan range is also 0, while inner & outer radius is 5 and 75 respectively. Put those values in your ft_snow_pc_walk schema.
Ok, now it's time to tell the game that you want those sounds to be assigned to a surface and recognized by AI. Click the AI noise type rollout menu and choose footstep_normal. This should be enough for the AI, as walking on a snow isn't as loud as walking on metal or tile, while it's louder than walking on carpets, for example. Then set metafile storage to memory and move onto Tags field.
Click “Modify tags” button. You have to select four tags and assign them to the schema using “Add” button. You can select them one by one, or all at once, using LCtrl-click. Those tags are: +footstep, +charactertype, +groundmaterial and +movementstate. You already know what they do, so let's just choose the proper values. +footstep doesn't require anything, for +charactertype choose player (obviously), for +groundmaterial select snow, and for +movementstate pick walk. Now use “Save this schema” or “Save all” button to finish making the first set of sounds needed for the snow to “work”.
Whew, not bad but you'll have to repeat this process a few times. The good thing is, you can copy this .sch file in your folder and just rename it and change some values with a Notepad. So duplicate your ft_snow_pc_walk schema and rename it to ft_snow_pc_run. When you compare it to ft_veg_pc_run, you'll see that only a few things changed: the sound is obviously louder (volume range set to -21, -21); there's a slight change in a pitch range (2 to 2); and the tag +movementstate has run value (self-explanatory). After you finish making changes, save this schema and prepare for the next set to be done.
So, you got sounds for walking and running Garrett, now it's time for sneaking Garrett. This is where I was stunned by a brutal truth: the game doesn't actually play any footstep sounds when Garret's crouching! How come I haven't noticed that before! Yes that's quite embarrassing, really, but it doesn't mean that game can do without crouching sounds schema. On higher difficulty levels AI with better “sensory model” can hear Garrett if he's sneaking too close to them, so the next schema will serve as a guideline for our little guards and some other adversaries.
Again, duplicate one of your .sch files (ft_snow_pc_walk preferably), rename it to ft_snow_pc_crouch. Compare it with ft_veg_pc_crouch and change “parameter ranges” to those values (volume range to -33,-33, pitch range to -2,-2, etc). In “tags” field there's only one thing to change: +movementstate to crouch. Good, now it's time for the last sound schema for the player.
You won't be duplicating anything, so create a new schema with your browser. Set its name to ft_snow_pc_jump. Create a metasound and name it 1, delete “meta1” entry. Press “change” button in “WAV file” section, choose ftsnow_pj.wav. Select ft_veg_pc_jump schema and put its values in your schema. Notice that this time AI noise type changes to landing_normal. Also remember about setting metafile storage to memory and +movementstate to jump.
Ok, I guess you have enough of it and finally you'd like to see some results! I assume you already have some test map for such things. If not, just make a simple cube, add a Light, PlayerStart and paint the “ground” surface with your new snow texture. Also, make a separate room, far away from your test area and put four empty AmbientSound markers there (Actor browser -> Marker -> Keypoint -> AmbientSound).
Select all of them and open their properties window. Add Sound -> SoundAmbient property. Now add the four schemas you created (ft_snow_pc_walk, ft_snow_pc_run, ft_snow_pc_crouch and ft_snow_pc_jump). Rebuild your level and use “send to xbox” command to launch the test mode with sounds playing (if you don't have your xbreboot.bat file, search the Fleshworks Wiki). Notice how the sounds change when you run, walk or jump!
4a) Creating a set of schemas for walking AIYou already achieved a lot, but you'd want to hear AI's footsteps too, right? Fortunately, you can still copy your .sch files to make your task easier. As you see in the other examples there are only 3 schemas for the AI per material. Thus you'll need to create ft_snow_ai_walk, ft_snow_ai_run and ft_snow_ai_jump. I won't go on about that in detail, because you already know the drill: you need the same 4 sounds for walking and running schemas and one file for jumps. The sound volume will be different, however. Search for the values in ft_veg_ai_walk, ft_veg_ai_run and ft_veg_ai_jump schemas, then use them in yours.
You should also notice and remember about a few things. First of all, set AI noise type to unassigned. Second thing, delete the +charactertype:player tag. This way you make sure that AI won't alarm itself with its own footsteps (that would be silly, right?). Also, there's no separate schema for crouching. Most AI's are poor at sneaking so they make the same sounds while
When you finish adjusting/saving your schemas, remember about putting them in your level as well (place another three AmbientSound markers in that room, or maybe make a separate one for the AI to keep things in order).
Finally, put some (preferably friendly or neutral) AI in your test map, make patrol points and connect it. Change its MovementType in a few spots to see whether you can hear running sounds too. If you were careful enough, you should have a fully working (or rather sounding) snow material! Good job!
5) Sticking arrowsThis is really simple. You want your arrows to stick in the snow? No problem, just open Actor browser, select MetaData -> Materials. You'll see Earth, Stone and WoodMaterial there. Right-click the Materials, choose “New”, name it SnowMaterial. Go to it's properties on the right, again right-click and “Add property”. Select MaterialArch from the list on the left, then choose both bObjectsStickIn and MaterialCategory. The first must be set to True and the second to snow, of course. Save the Gamesys, add some broadhead arrows to your map, rebuild it and test it. Now you should be able to take out your arrows both from brushes and static meshes. Have fun!