Monday, February 28, 2011

Level streaming tutorial

Here I'll explain how level streaming works and will be used in Aron.  Level streaming works by dynamically loading/unloading content using Kismet scripting.  The master level, or "persistent level", is constantly loaded at all times, and all other level files are streamed into that persistent level.  For example, I will be using the persistent level (AR-Training) for geometry, and we will have a separate level file (AR-Training_Sound) which will be streamed into the persistent level during the game.  If we want to, we could have separate level files for particle effects, lighting, etc.  It's very powerful and easy to use.  I'll go through the basics here for the audio team so they can start implementing audio into the training level while I'm working on geometry with the artists at the same time.

1. In Unreal Editor, open "AR-Training.udk"
2. Open the content browser
3. Click the "levels" tab.  You'll notice that we have two levels here, AR-Training and AR-Training_Sound.
4. Double-click AR-Training_Sound to make it the current level. 

You can now begin placing content into the sound level while viewing the persistent level at the same time, so that you can accurately place all sound actors where they belong. All of the sound actors you place are simply streamed into the persistent level in the exact same location where you put them, but since it's a separate map file, you can work on it while I'm working on the geometry in the persistent level file.

Example: Here I have the persistent level, AR-Training, with 1284 actors.  This is the "current level", which you don't want to modify. 




Double-click on AR-Training_Sound to make it the current level.  Then add whatever you want to it.  I'm going to add 3 static mesh actors to the sound level.




If you want to hide the persistent level to only view your sound actors, click the eyeball icon next to the level name to toggle its visibility on/off.



Notice that AR-Training_Sound now has 3 actors, and has an asterisk next to it.  That means that you need to save the level, so click the save icon to the left.  This is the only map you should be modifying or saving.  When you're done, you'll need to commit the map to SVN.  NOTE: Always update your SVN before committing any work!  This will ensure you have the latest map file, and you'll avoid overwriting anything currently being worked on by somebody else.

I've already added the maps to the correct location in SVN, so all you need to do is open your Aron UDK directory (C:\UDK\UDK-2010-12\UDKGame\Content\Maps), right-click AR-Training_Sound, and click "Commit".  Add a brief description of the changes you made to the level, then click OK.  I'll handle the actual level streaming in the persistent level file using Kismet.

Hope this helps.  Let me know if you have any questions.

1 comment:

RishiDani said...

Thanks Matt for the detailed tutorial. I will give it a try by placing some dummy sound actors and will let you know how it goes.