Wednesday, March 16, 2011

Learning UDK (Unreal Development Kit)

I have been learning the Unreal Development Kit (UDK) in my spare time.


HeavyDemon_UDK_StaticMeshTestScene_001

I was having one heck of a time figuring out how to not have horrible normal map seams every where on my model. So I thought I would give a real quick run down of some of the pitfalls that I have learned to avoid. (If you have any further tips for static meshes in UDK it would be awesome to hear them!)

Here are the first steps that I have taken, importing in static meshes from Maya (Using Actor X, type in axmesh; in the command line or the script editor.)

I'm exporting my models with all soft edges, normal maps generated in Maya, Green channel on normal map is flipped, then export with default settings.

Now make sure when you import your normal maps into UDK to choose a compression type of normal map or uncompressed normal map, other wise you will get really bad normal map seams.

Also if your static mesh is going to have a lightmap baked using lightmass make sure to add a second UV set in Maya for the light map. Make sure that all UV's are in the 0-1 space, all UV shells can be pushed to the border edge of the 0-1 space, but you must give a large pixel padding around all of your UV islands.

Another thing to watch out for is to make sure none of your UV's are backwards (they make sense in terms of where they are in the world space, left has to be left, right has to be right and up and down has to be up and down.)

Also make sure you have no overlapping UV's. Hope these little tips helps you out, because I was banning my head for about 2 weeks trying to get rid of really bad normal map seams.

I recorded the video above of me running around in my little test level. (Just trying to learn editor concepts right now before I move onto the real deal.)

Sorry for the frame rate, my computer wasn't liking me running the game and recording the screen at the same time. It's time for a new computer, I think I have pushed this one to the limit!


The latest thing I am trying to learn is how to add my characters as SkeletalMeshes and have morph targets/blend shapes drive the facial animations.



If you would like to download the latest Maya and UDK example files then please visit this link at ShareCG.com

I have added a thread on the UDK forums to somewhat document what I am trying to create. You can follow this link to see this thread.

Edit 3-18-2011: I have created about a 30 minute best practices video for moving your work from Maya into UDK.


NickZ HeavyDemon UDK Tips- N- Tricks Video 001

The topics covered int the video are:

Maya Grid Set Up

Clean Geo For Export

UV Tips

2nd UV Layout (Lightmass) Tips

Loading Actor X

Moveable Dynamic Shadows

Setting Up Morph Targets For Kismet

6 comments:

Warai Otoko said...

hi nick,

I have a question about your normal map. Why did you flip the green channel exactly ?

cheers

NickZ. said...

Not exactly sure what the reason is, but this is what UDK expects. If you import in your meshes with materials as an FBX there is an option that will flip your normal maps automatically for you.

NickZ. said...

Wari Otoko, Someone has explained to me that UDK and 3D studio have Z up and Maya has a Y up coordinate system. So normal maps represent a direction from the normal of the surface of the object. So in order to get all coordinate systems to line up (Map wise) you need to flip the channel that represents the change in Y and Z. To be honest the whole thing just hurts my brain! :) Just flip it and it works....see doesn't hurt your brain at all! :)

Seth said...

Hey,
I'm baffled with how to configure the Skeletal system for my character in Maya so UDK will recognize it and possibly animate it. How do you animate your characters in UDK?

NickZ. said...

Seth, download this file: http://www.sharecg.com/v/49629/view/3D-Model/UDK-HeavyDemon-Static/Skeletal-Mesh-Example-Files

In there you will find a file in this structure Content\NickZGame\Content\Characters\HeavyDemon\Maya called HeavyDemon_UDK_Meshes.mb You can see how I structured my Maya file to export out animation using FBX. If you only want to export animation only then select your root bone and export FBX with animation turned on. Make sure that your timeline in Maya is only set to the frame range that you wish to export out. Also make sure that there are NO keys on anything before or after your allocated animation time. Other wise you will get dead frames in UDK. This is very annoying, I'm still trying to figure out why this is happening. Hope this helps. Let me know if you have any more questions. Peace-NickZ. :)

Seth said...

Hi Nick,Everything has gone well since I last commented, partly in thanks to you! My new skeletal mesh looks great, but I had forgotten to make my normal map in z brush before i separated my mesh into several sub-tools. Now i have some horrible seams. How can I fix the seams? I tried merging the mesh back together with the sub-tool master, but then the lower subdivisions don't transfer over, so i cant bake a new Normal map. Is there another way to get rid of the creases such as with Photoshop or do i have to start again? And thanks again for your earlier help and this awesome blog!