Monday 26 August 2013

UDK Audio Tutorial: Introduction + Basic Level Design

Introduction: For me, there is nothing more fun and rewarding than creating interactive audio. Not only are you making something sound good, but you're allowing others to take this and make it their own - something that other mediums of sound simply can't achieve. From recording, to editing, to mixing and finally building systems, the process is varied and satisfying. Here, I'll be going through everything you need to know about creating simple sound systems in UDK.

Before I get straight into it, I've detailed below a list of the kinds of things I'll be covering, from the basics on to more advanced subjects:
  1. Getting to know UDK: Basic Level Design - In this first post, I'll be covering the basics of the Unreal Development Kit and tools to create simple levels using the builder brush.
  2. Getting to know UDK: Soundcues, Kismet and the rest -  In the content browser, we'll go into setting up internal sound systems that act independently, and why they're important for workflow. Also using kismet, I'll implement some simple systems, while explaining some key modules that are useful for all aspects of interactive sound design.
  3. Setting the Scene - the most basic use of sound in games is ambiance, or setting a 'sound background' for all other sounds to sit on. I'll explain how to create them and best practices for volume, frequency and content.
  4. Music - Another key element of a games sound is it's soundtrack. The way in which this is implemented varies from game to game, so I'll cover a few instances.
  5. Foley - The little details certainly create a bigger picture, especially in audio. I'll create some systems and discuss audio file creation, lengths and frequency to help make the most of your recordings while making it appropriate during gameplay.
  6. An Interactive Environment - Using everything detailed in previous posts, I'll create an interactive environment that I'll make available for download so you can interact with it too!
As I write these posts, they'll probably evolve and more things will be covered than first planned, so expect to see more than just 6 posts. I could do 6 posts alone on foley!

Getting to know UDK

Before you can create your soundscapes, it's good to get to know your tools. One of the things I love about UDK is that it's relatively simple to create block worlds quickly with playable results without a huge amount of prior training. You can also work out systems that would otherwise entail coding, instead using object based design in 'Kismet' (which I'll be using for our sound systems). All in all, it's very user friendly and is completely free to design games in, so it's a sure fire for any beginner in whatever aspect of game design you'd like to persue.

Installing UDK: In order to download and install UDK, simply go to the UDK Download Page and get the July beta (I'll be using July through these tutorials as it was the latest at the time of writing). The process of installing is as you might expect; the only questionable section is the perforce installation. You can go ahead with this if you choose, but I won't be using this in the tutorials. For more information on Perforce, check out their website.

Opening UDK and Creating a New Level: When you first open UDK, you'll be greated with 3 windows:

What you'll be greeted with when UDK loads up.

The main window at the back is used for the level design and physical placement of items. The second window from the front is the Content Browser: this contains all of your assets, such as meshes (items that can be placed in the world), textures, animations and sounds. Finally in the foreground, we have the start up window. this gives you quick access to the creation of new levels, opening existing levels, video tutorials and more.

The other important window that we'll be using quite a lot is the Kismet window. As discussed, this is used for creating reasonably complicated systems using object oriented programming. An example of this is shown below:

An example of a kismet system. This particular one reduces your health by 5 every second if you're within a set radius of an object.

So why cover level design tips for an Audio Tutorial? The thing that sets game audio apart from creating a song or designing sound for film is that, if you don't have an environment to work with, you can't really create the systems necessary. Now you may say that without film, you can't create film sound, which is a valid point. But it's so easy to create a simple game level, that it's not worth overlooking. When I started my interactive audio module at university, the first thing we were taught was basic level design, as it gave us much more freedom and flexibility over the systems we designed. The other advantage to knowing these techniques is the breadth of tools it introduces you to, which gives a much broader picture of game design as a whole. If you're already adept with level design, you can of course skip this post and go straight onto the next one, detailing kismet and other elements.

For this tutorial, we're going to start by creating a new map. You'll be greeted with a choice of new maps, 4 of which include a basic floor and static-mesh block with a different time of day for each, with the last being a blank canvas. To make things easier (as I'm not covering much level design), we'll just go straight into a pre-built one.

Here, you can choose a pre-made level, or start with nothing.

The first thing you'll see is the 3D view. This is used to view a close representation of what your final level will look like, including any invisible volume and nodes. We can hide and show a plethora of different features so you can find exactly what you need.

The main editor window, with a pre-made level loaded.

However, to really help with workflow, were going to show the other views. By clicking on the button in the top right corner (shown below) 3 other views will be shown. These provide a texture-less perspective from the top, front and left side of your level.

With this view, you can see a 3D adaptation of the level, as well as 3 perspectives with texture-less models.

Creating a Simple Block Level: The best tool for the job in creating a level is the builder brush. This is used simply to create blocks of varying sizes and shapes, and can be manipulated using various methods. For our level, the builder brush is currently on the cube in the middle. Clicking on the Go To Builder Brush button (shown right, right button) will take you to it (no matter where in the level) and will automatically select it.

The Builder Brush can be changed into many shapes. You can see these on the middle-left (turquoise coloured buttons).
Here, I've simply moved the builder brush out of the cube. As you can see, it's a texture-less entity which gives an outline as to the shape it will create; you'll also see some controls in the centre. For everything you select in the editor, a set of controls will appear to allow manipulation, for which there are 3 kinds available - Displacement, Angular and Scaling. A forth is available, which allows you to scale an object separately in the x, y and z axis.


Have a mess around with these tools to see what kinds of cuboids you can get. There are also preset shapes you can use, detailed in buttons on the left-side toolbar, such as spheres, cylinders and stairs. Once you have a shape you'd like, you can then create a static object. The quickest way to do this is by pressing Ctrl + A. As you'll see, the area is filled with a blue and white checkered block.

The builder brush defaults the created object to have this texture and stretch it across each plane. You can however change these textures and methods of application in the texture properties window.

You can now move the builder brush around and create more blocks the same way. Another great feature is the ability to cut out holes in these blocks. In the below screenshot, you'll see I've simply changed the angle of the builder brush and 'subtracted' this area from the one created previously. You can achieve this by pressing Ctrl + S.


I use this feature a lot for creating doorways and windows, but as you might imagine, it can be used very creatively even for such a basic element of the engine. It's a very quick and easy way for drafting a level which will aid in the design and implementation of systems.  Below is an example of something we can use for a building with exterior and interior walls, an entrance and an exit.

Of course, you can intersect these blocks if you wish. This makes it easier to prevent unwanted light leakage or stopping the player from becoming stuck in gaps.

When you're happy with the layout of your blocks and want to have a play-test, all you have to do is press the green play button at the top of the editor window and you're in. You can run around and view what is the start of your creation!

This particular screen has had a full lighting refresh - a process of rendering which you can do in the 'Build' menu. By doing so, the engine reads the lights refraction's, giving a much more realistic look to your level.

More uses of the Builder Brush: It's great fun to create these levels with the builder brush. However, it's much more powerful than this, and you'll find yourself using it for much more than physically building blocks. A lot of the use will be for volumes: trigger volumes, water volumes, reverb volumes and many more. Each of these have a distinct function to help you design systems and gameplay. Particularly though, trigger volumes will be used more than most for setting off the sound systems I'll detail in coming posts.

This is what a trigger volume looks like. In a later post, I'll be hooking this up to a system in kismet as the start point, or trigger as such.

Static Meshes from the Content Browser: Another way of 'furnishing' your level is with the use of static meshes: these are complicated textured 3D models that are anything from a door, window, table, engine, car; basically any object that isn't created with the Builder Brush. These are stored in the content browser, and can be found by using a filter tick-box at the top. To put them in your level, you can either select the object (which will stay selected even if you close the content browser) and right-click in the level to add it, or you can simply drag it in from the content browser.

In the content browser, clicking on the 'static meshes' tick box reveals all the static mesh files available.

Here, I've added 3 of the same static meshes; barrels in this instance. The medium sized one is the original, with the other 2 scaled appropriately and angled slightly. 

Conclusions: So that just about covers basic level design without getting too much into more complicated systems. I will carry on level design slightly in the next post, covering matinee (the tool used to animate objects) and integrating it into Kismet. Mostly though, I'll be going over Kismets many different modules and how I've used them in the past to overcome certain challenges (namely footsteps!).

Please don't forget to contact if you have any questions or would like to add anything; I very much appreciate your feedback!

Alex.

No comments:

Post a Comment