Category Archives: UDK

Kismet console commands and remote events

I have been working on exterior lampposts. All the lampposts should be controlled (on/off) by the same trigger-button  However I want the lamps to be used as a reusable asset and not directly be connected to the trigger button.

Remote Events

Remote Events are used to access Kismet subsequences. To successfully use Remote Events you need a “Remote Event” node and a corresponding “Activate Remote Event” node.

  1. RMB anywhere in Kismet and select new Sequence, name it lampost_Kismet
  2. RMB > New Event > Remote Event
  3. The Event name has to be unique and meaningful (so something like “toggle_ext_lights“) Notice that the Event has a red X in it (It turns green as soons as the corresponding Activate Remote Event gets created). 
  4. After setting up the rest of your Kismetsequence (In my case I am using a Toggle with Looping activated to Toggle my light to go on and off with Matinee). Return to your original Kismet Sequence
  5. RMB > Action > Event > Activate Remote Event – Make sure that the Event name is identical to the Remote Event name. The node should have a green check on it.

ConsoleEvents

The Console Event is a nice way of creating Testing nodes in your scene (instead of creating a Trigger and connecting it etc.)

In Kismet simply create the node with New Event > Console Event or by Keyboard shortcut E + LMB, and give it a unique name (something like ext_lights)  and connect it to your Kismet sequence.

  1. Preview in Game Mode (Press F8)
  2. Open the console by pressing the Key ^ (next to the No1 – key)
  3. Enter the command “CauseEvent ext_lights”

Notes

The Kismet Sequence can be embedded in a Prefab object.

To quickly create a Remote Event and the Activate Remote Event Node press LMB-Shift-R.

 

Kismet Level Streaming

What is level streaming?

In essence you split up your entire level into smaller parts that can be loaded and unloaded when you require to load the different parts. In essence it is memory-management and can improve performance. This is especially important when working with consoles/mobile devices.

However beyond its basic memory management it also allows greater control over Asset Management. Allowing multiple people work on the same area. However level streaming only applies ingame, to change the visability of parts of the level in the editor you must use the level manager.

Setting up initial level streaming

My setup uses its own file for the persistent Level, Kismet scripting, Audio and multiple files for the geometry.

  1. First open the Level Manger (Open the Content Browser and select the Tab Levels)
  2. Select Level > New Level
  3. Name the Level in a meaningful way like <Levelname>_kismet
  4. Use streaming method Kismet (It provides the greatest control)
  5. For the persistent Level open the Kismet script (by clicking on the Kismet Icon in the Level manager)
  6. Add New Event > Level Loaded
  7. Add New Action > Level > Stream Levels- in the properties enter the levels you want to want to stream at the beginning of the level. (so something like, <Levelname>_kismet, <Levelname>_audio and <Levelname>_level_geo_part1) Notice that if the node is not correctly set up a red X appears in the Kismet node.

    Initial levelstreaming set up

Using trigger volumes to stream additional levels

Level streaming should be set up in a way that the player does not notice that the computer is loading and unloading levels. The streaming process should be triggered by an event like opening a door.

It is more practical however to use trigger volumes. The player simply has to reach this part of the level so the new part of the level can be loaded.

  1. Use a big builder brush. The brush should be placed at a point in the level where the player cannot avoid it.
  2. Add a TriggerVolume 
  3. Set up a Kismet with the Event TriggerVolume Touched > load Levels (to mark unneeded parts of the level to unload) > load Levels (to load the new part of the level)

What about existing maps?

You can cut up your level into smaller parts.

  1. Create the levels in the level manager
  2. Select the Actors you want to have in a separate Level. (The easiest way to select the right Actors is with the scene manager)
  3. in the level manager, right-click on the level you want to add the actors and select “Make Level Current Move Selected Actors To it

Notes

Now that you are working with several different level files you always have to select a “current level” in the level manager. All new Actors will automatically be added to the “current level”

The different files all have to be saved on their own. Beware of always saving all files.

Other types of Level Streaming:

http://udn.epicgames.com/Three/LevelStreamingVolumes.html

Neals UDK Toolbox 0.2

Ok this is my work in progress toolbox for exporting to UDK.

Changelog:

Version 0.2 includes FBX  and T3D Export features

Running the script

  1. Download the Script from here
  2. Extract to your User\Documents\Maya\scripts directory
  3. Start Maya, open the script editor and type or copy the following text into the Python window:
    import UDKToolBox
    
  4. Use the “Execute All” button in the script editor OR make a shelf button by selecting the text in the Python window and going to File -> Save Script to Shelf

Optimized Pillar for UDK: Part 3 – Maya Export/ UDK Material Settings

Collision Model

  1. Create > Polygon Primitives > Cylinder(Subdivisions Axis = 8)
  2. Scale it to be used as a collision object for the column
  3. Rename it with the prefix “UCX_” (e.g. “UCX_pillar_column”)
  4. Repeat for the “pillar_base”

    Finished simple collision models

Export to UDK

Select “pillar_base”, “pillar_column”, ”UCX_pillar_base”, “UCX_pillar_column”
File > Export Selected (FileType FBX Export)

Import UDK

Simply drag and drop the resulting .fbx file into the “Content Browser” (make sure import textures/

Create Height Map

  1. In Photoshop open the normal map of the column.
  2. Open the Channel view and copy the Red channel to the Alpha Channel

    Copied Red Channel

  3. (optional) Add effects like noise or texture overlays to this channel
  4. Save it
  5. Repeat for the base

Modify UDK Material

  1. Open the  mat_column material from the Content Browser
  2. Create a Bump Offset Node and duplicate the Texture Sample Node for the Normal Map
  3. Connect the nodes in this way:

 Create a Prefab

  1. Place the base and as many pillars as you need
  2. For the top modify the Movement > Rotation > Roll attribute to 180

    Fake top part

  3. Select all parts of the Pillar, RMB > Create Prefab

Conclusion

Final pillar in UDK

Creating a simple collision object allows UDK to automatically create the collision model. With the Prefab its easy to create multiple pillars.

Important Note: If in the Material a Texture is applied , the Bump Offset must be connected to that Texture

Optimized Pillar for UDK: Part 2 – Normal Maps

General Tips:

Using the Layer Editor

In maya to organize your screen create 3 Layers (“high”, “low”, “collision”) to better organize your screne

Add all the geometry created in the last tutorial to the “high” Layer by first selecting all objects and then RMB on the layer “high” > “Add selected Objects”

Select the Layer “low”, so that the new Objects created are created in that Layer.

Using Gridsnapping

Using the same grid size as in UDK allows you to create modular assets that can be easily placed into a Level.

I adjusted my base to be 16 UnrealUnit (uu) high.

Low Poly Model

Column

  1. Create > Polygon Primitives > Cylinder(Subdivisions Axis = 16)
  2. Rename it to ”pillar_column”
  3. Scale the cylinder to fit the base mesh
  4. RMB on the cylinder > Assign Favorite Material > Blinn (rename it to “mat_column”)

    correctly scaled Cylinder

Head/Base:

  1. Duplicate the “pillar_column” (Ctrl-D)
  2. Rename it to ”pillar_base”
  3. In the side view, move the vertex points on the y-axis to fit the base mesh.
  4. Mesh > Insert Edge Loopand then scale the loop to create a simpler model (repeat as few times as possible but still retaining the original silhouette of the object)

    Finished Model, after adding several edge loops and proper scaling

UV-Layout

In many cases a new UV-Mapping has to be created with the UV-Layout tools. In this case by using the Edge Loop tool I tried to avoid that for this tutorial.

UV-Texture Layout

  1. Window > UV-Texture Editor

    Default UV-Layout for a Cylinder

  2. Select the “pillar_base”
  3. Use the “Move-UV Shell Tool” to change the position of the UV-Shells. Pressing R switches to the scale tool.
  4. Arrange the UVs into a similar way as in this image:

    optimized UV-Layout

  5. Repeat for “pillar_column”

Light Map

  1. Window > UV-Layout
  2. select the “pillar_base” (in Object mode)
  3. (UV-Layout) Polygons > Copy UVs to UV-Set > Copy UVs into new UV set (options) (name it lightmap)
  4. Repeat for “pillar_column”

 Create Normal Map

Theory

A normal map is similar to a bump map, however the amount of displacement information is stored for each axis. Like a bump map the height displacement is stored in  grayscale. The x,y,z information is mapped to the r, g, b channels of an image.

Generate Normal Map

1. Switch to the Rendering view

Switch to Rendering -View

2. Lighting/Shading > Transfer Maps… Change following values in the tabs:

  • Target Meshes: Select the Low Poly Object (“pillar_base”) and press the button “Add Selected”
  • Source Meshes: Select the High Poly Object (“pillar_base_high”) and press the button “Add Selected”
  • Output Maps: Select your output directory, change the Fileformat to Targa, the Mapspace to “Tangent Space”
  • Connect Output Maps: Connect Maps to: Assigned shader (easier for the export to UDK late
  • Maya Common Output:Adjust the Map width for your puropses, Sampling Quality 8×8 for final export

    Transfer Maps Settings Part 1

Transfer Maps Settings Part 2

3. Save your scene file

4. Click on Bake and wait while the normal map is generated

Testing and adjusting Normal Maps

Simply press render to view the generated Normal map

If the map looks wrong. In the Transfer Maps tool, Target Meshes > Display Both to preview what maya takes all into account when calculating the normal map.

Dealing with normal Map errors

Adjust the Search envelope to include objects that are further away.

Conclusion:

Finished ColumnNormal Map

Finished Base Normal Map

To create a normal map a low poly and a high poly object is needed. This method reduced the original tris count from 10526 to 400 for the object.

In the next part we will look at how to use the map correctly in UDK.

Important Note:

While generating Normal Maps it many errors can occur (and it takes a lot of time). Before changing the Sampling quality always test it by doing a test render in low sampling quality.

The Lightmaps created in this tutorial are not adjusted properly and only serve to prevent UDK errors.