« Posts tagged Unreal Development Kit

[Game] Unreal Tournament Blockout

As a lot of you may know Epic Games announced that they are working on a new Unreal Tournament title. They’ve been doing weekly updates through twitch to keep the development community involved. You can check them out here: http://www.twitch.tv/epicgames (http://www NULL.twitch NULL.tv/epicgames). Having been a big fan of the old Unreal titles I’ve decided to create a level to be released with the launch of the game. I signed up with Epic so I could download the new Unreal Engine and check it out. Wow is it great. I can’t believe how much the UDK evolved since its last release. It finally feels like a full-blown 3D app. Each week I’m going to post an update of the project through all it’s stages. First I have to finish blocking out the level. Then it’s onto simple meshes and lighting. I’m excited about this project because I think it’s a good chance to gain exposure in the development community.

The blockout is being done with the BSP volumes in the editor. They’re super fast and easy to work with. The “Geometry Mode” works the same as in the old UDK letting you edit the polygons that comprise the BSP volumes on the fly. I should mention that while the editor was stable most of the time it was very unstable while working in geometry mode. I crashed once for about every 3 edits I tried to make. In this particular stage my main concern is getting the spacing right between all the elements that will comprise the arena. I’m working with an early alpha so the only movement the player has is walking and dodging. While placing all the shapes around I’m trying to think of paths the player will take through the environment.
arenaBlock001 (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2014/05/arenaBlock001 NULL.jpg)
The flow of the map is the single most important factor so I don’t want to create any dead ends where the player feels cornered. There should always be at least one other path they can use to escape an engagement. After the general layout is in place I’ll start to adjust volumes along the Z-Axis (Y-Axis in Maya) a little more. The player moves largely on a Horizontal plane so creating platforms at different heights and depressions in large flat expanses can help break up the monotony of that very planar movement.

I’m super pumped and I think this is going to turn out great so stay tuned for updates :)

[Game] Snowy Turn Table Final

Freshly fallen snow on a grave

Another day and another piece done :) I had a great time putting together this snowy turn table and trying out all sorts of different methods in ZBrush for creating snowy surfaces. For some extra fun I even threw in some “Matinee” animations using Unreal’s animation system.

The snow covered assets in the scene use what is basically a layered material to map the snow, ice, and base materials over their surface. This is done through using the “Lerp” node in the material editor. If you’ve ever tried to create a layered material in Mental Ray you will appreciate what the lerp node does. Using an 8 bit (gray scale) map the Lerp node transitions values. Think of it like a mask. You can use a bunch of these Lerp nodes in a single material to create a layered shader. There are other ways of getting more than one material on an asset in the UDK though.

When exporting your assets as “FBX” files in Maya you can assign up to six (as of Unreal Engine 3.0) different materials per mesh. This is done through simply creating up to six different Lambert materials and applying them on a per face basis. This is a very convenient way to assign materials to your meshes, but it does have it’s downsides. Firstly, you are adding extra draw calls for each new material you assign your asset. This differs from using the Lerp node because with Lerp method all your different surface types are constructed within a single Unreal material and consequentially, a single draw call. Secondly, the borders of your materials must lye along the edges of their assigned faces. This can end up giving you abrupt transitions that won’t look as smooth as painting a mask for a Lerp node. Going forward I would like to expand on what I’ve done in Matinee and produce an animated character with some dynamically driven accessories.

Oh yeah, I almost forgot to mention that I’m moving to Montreal Canada. I’ll be heading out November 5th and my first stop will be their Independent Game Developers Association. I’m super excited to meet fellow developers and check out all the wonderful studios in Montreal.

 

 

[Game] Snowy Turn Table WIP 2

Freshly fallen snow on a grave

Here is an update on my snowy turn table I’ve been putting togeather. I’ve added some animated lighting and given most of the meshes another iteration of detailing and fixes. The next thing I have to do is finish the snowy bushes and make the ice on all the meshes more obvious. As a final touch I might at a sun and a moon togeather with the proper positioning of those respective lights. So have a look :)

Graveyard Scene WIP 1

Scene Snippet

Just before I left for Montreal I was able to snap some pics of my graveyard scene. I’ve got most of the modeling done, as well as the sky and rain systems. The Ivy on the foreground grave still needs to be skin weighted for wind movement, whereas the Ivy on the background grave is using a vertex offset to animate the ivy.

Scene Snippet (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/06/SceneSnippet NULL.jpg)

I’m quite happy with the look of my high detail tree, but I still have to tweak the leaf cards a little as some of them don’t line up with the branches I’ve painted on the branch cards. Speaking of vertex weights the trees also need this. I’m going to use the same material wind network the grass uses so they move together. Painting up the trunk and branches in Zbrush was fun and eventually I saved out a surface noise setting for the bark so that I could apply the same look across the entire tree without having to sculpt each notch in the bark. This setting can also be loaded up for any other trees I might create to help things look consistent from tree to tree.

High Detail Tree for UDK (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/06/mayaTree NULL.jpg)

Sky Material Network (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/06/skysetup NULL.jpg)Vertex Ivy Material Network (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/06/ivySetup NULL.jpg)Vertex Coloured Ivy (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/06/vertexIvy NULL.jpg)Graveyard WIP paintover (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/06/paintover NULL.jpg)The material networks are purposefully obscured as they aren’t final and I wouldn’t want anyone to follow them as they are not yet complete. When I’m done I’ll post a better breakdown of the these. I’ve also included a quick Maya shot of the foreground tomb’s ivy and it’s vertex weighting. The base of the leaves are black to keep them from shifting and the weight falls off to red towards the edges of the leaves. You don’t have to be too meticulous with the weights as you can manipulate them in the UDK treating them just like any other RGB value.

After all is said and done I think I’m the most excited about implementing torches on the fence in the background. I apologize for the crushed levels in the video. When I get back to Winnipeg I’ll re-compress it with adjusted settings. If you visit my Youtube (http://www NULL.youtube NULL.com/user/DelightningVFX/videos) channel you’ll see the pyre tests (http://www NULL.youtube NULL.com/watch?v=w2k-J_Bhme4) I’ve made in the past and I’m going to turn these into “flipbook textures” (video game GIFs) to be used in conjunction with particles to make a really believable torch. I’ll post more towards the end of next week.

 

 

Wish me luck fellas, I’m really happy with how everything is coming together and I can’t wait to show everyone the scene when it’s complete.

[R&D] Grey Packing

Grey Packing Method

Whaa, hugh? What the heck is it? Well grey packing refers to creating textures in photoshop that in and of themselves are not particularly useful, but each channel of colour, and possibly even an extra alpha channel contain useful grey-scale textures.

Think of the complete texture as a container or vehicle for getting as many materials as you can into your game or application as efficiently as possible.

A lot of materials use grey-scale textures for values. If you create a 32 bit image (targa for UDK) you can stack 4 grey-scale images into your file and that’s decreasing your memory usage by 300%! and using one quarter of the draw calls for those materials.

Grey Packing Method (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/04/graypacking2 NULL.jpg)

To do this just go into your channel tab (next to layer) in Photoshop and you’ll see your four channels and their composite channel at the top. This is where you are going to copy and paste your grey images into. If you want another channel just create one with the new layer button. By default this channel is called “Alpha”.

Don’t forget to export as 32bit otherwise you’ll lose that extra alpha channel.

Cheers

[Game] UDK Windy Grass

Windy Grassy Plain

Windy Grassy Plain (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/03/windyplain NULL.jpg)Making grass move in the UDK isn’t overly complex but it does requite a decent handle on Maya and the Unreal Development Kit’s material editor. The concept at it’s core is to use the Material Property “world offset position” to make your grass wave. Control of the grass is split between three different systems: the “wind directional actor”, the material network we create for the grass, and our grass mesh’s vertex colours.

Maya

Our verdant journey starts here. I’m not going to go over modeling a grass plane, but if you have any trouble you can just take a look at the one I made here to see the relative complexity of the mesh.

Maya Grass Plain Mesh (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/03/grassmesh NULL.jpg)

After you have created your planar mesh you’re going to need to jump into painting “vertex colours”. Vertex colours are literally just RGB values you’re painting on your mesh’s vertices through Maya’s vertex painting system. Before you go all nuts painting up your mesh you’re going to have to change a few of Maya’s options to ensure that vertex colours will appear properly in your viewport. The steps for enabling vertex painting can be found on Autodesk’s help site here (http://download NULL.autodesk NULL.com/us/maya/2010help/index NULL.html?url=Coloring_polygons_Make_vertex_colors_visible NULL.htm,topicNumber=d0e213327). After you get vertex colours working you can move on to the next step which is painting (http://download NULL.autodesk NULL.com/us/maya/2010help/index NULL.html?url=Coloring_polygons_Assign_colors_to_polygon_vertices_by_painting NULL.htm,topicNumber=d0e213575) a red gradient from the bottom of your mesh to the top. Lower red values will cause the vertex to be less affected by wind. Below I’ve placed a couple more grass planes along with the original.

 Vertex Painted Grass Meshes (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/03/vertexColors NULL.jpg)

After your painting is complete you are ready to export your mesh for the UDK. You don’t have to do anything special on export in Maya to carry your vertex colours into the UDK just export your grass plain as a standard FBX.

Unreal Development Kit

Our mesh is done and it has all the properties it needs to accept directions from the “world offset position” in the material node we’re going to create. The first thing to do is start a new map and import your materials and models for your grass. After everything is imported create a new material.

In this material up with whatever diffuse, normal, and specular etc. that you need and then clear a fair amount of space in your material editor because node network we are going to create for wind is going to take up a bit of space.

Before we create the windy section of the material I wanted to break down the core of the wind network. I mentioned earlier we are using the “world offset position” attribute in our material  to animate the grass. As you can imagine, feeding the world offset position a constant value would yield no animation. We need some way to animate the actual value we are sending to the world offset position.

To accomplish this we are going to use two nodes. The “Sine” node and the “Time” node. The time node will give us the changing value we need. Plugged into the sine node we can create a continually oscillating value between 0 and 1. This is the same principal I used to animate optical flares in my previous post (http://www NULL.terrymatthes NULL.com/unreal-2/materials/sprite-channel-controller/).

Next we need a way of incorporating the red values of our vertices to control the wind falloff on our grass mesh.

The wind instructions to affect the grass are going to come from a “Wind Direction” actor. Your going to need to put on in your scene and they are located in the classes hierarchy tab. When you bring up it’s properties you’ll see that there are a few different controls that we can use to affect the wind. Be sure to play around with these so you can get a good idea of how you’ve weighted your vertices after the network is complete. Beyond the diffue map, there isn’t anything in the network that you can’t grab directly from the right click menu in the material editor. Go ahead an copy the network below, then assign it to your mesh.UDK Windy Grass Material Network (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/03/windyGrassNetwork NULL.jpg)

After updating your material network you should see the grass now waving at a constant rate in the wind. After this it’s up to you to discover some more interesting ways to make your grass move. Also take a minute or two and think about all the implications of this technique. There are a lot of things in video games you could apply this type of procedural animation to.

Conclusion

If you have more than one mesh that will use wind you should really look at setting up your material so it can be used for instancing. This material network can get large and loading it in for each plant is going to cause you some performance loss.

I hope this gave you a good understanding of wind principles and showed you a new way to spice up your Unreal Development Kit environments.

If you’re stuck on a particular step or want to know more about creating material instances ask away and I’ll do by best to help :)

[Game] A Grave Affair

Grave Texture Mapped UV Islands

I’m creating a cemetery scene so you can imagine that I’m going to need some tombstones. I have sculpted another since my last WIP and thought I would share it. As I was breaking down the scene I was trying to think of ways I could maximize my work time. I wanted to make sure I wasn’t sculpting more assets than I needed to make the scene look full. From that point on I decided that all the tombstones were going to have a different design on each side. This would let me cut the number of tombstones that needed to be created in half.

Just like the last mesh I started in ZBrush my sculpting the general shape. With hard objects like this I like to start by smashing together basic geometric shapes with Dynamesh. After I have the basic shape it’s time to save a copy and start sculpting wear and tear. I was able to use the noise profile that I saved from my last sculpt to break up the noise on this one as well. Saving out the noise and other commonly used elements will also help me to keep things artistically cohesive throughout the production of the scene.

(http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/01/gravesculptL NULL.jpg)

Dynamesh is your best friend in ZBrush while creating game assets! Maybe it’s because I started working with 3D before ZBrush was around, but I just love the ability to kit bash with ZBrush while staying largely ignorant of topology. Gone are the days of matching up verts and integrating meshes before they can be treated as a single surface. With  the tombstone here I was able to take a human skull I had modeled for a previous project and insert it into the top of the grave. The book sculpted the same way, but I created the book within ZBrush as a separate subtool. If you’ve never merged dynamesh objects before it’s actually quite simple. Start by making sure both objects are dynameshes themselves and then use subtool master to merge all visible subtools. They aren’t quite the same yet though. They should be one sub tool, but you’re going to have to ctrl drag and empty marquee selection to have ZBrush retopologize your dynamesh subtool once more. Bam! It should be all one surface now. If the objects look to crude then you need to turn up your dynamesh resolution before dragging to retopologize.

Like most of the assets in the scene I’m trying to keep the poly count around 1K. And speaking of polygons I wanted to address a common misconception about them. A lot of people fret about poly count in-game design. Whether its triangles or quads less is not always better. We’ve gotten to the point on mid level hardware where poly count isn’t the limiting factor it used to be. “I spent a solid few months of optimizing polys, lightmap UV channels, collision meshs for everything in UT and the act of stripping 2million polys out of a level generally improved the FPS by 2 or 3 frames.” – Kevin Johnstone (http://www NULL.polycount NULL.com/forum/showthread NULL.php?t=50588). Texture maps represent modern geometry more than polygons do at levels of high frequency detail. We are using lots of texture memory to affect and displace geometry. Stripping down the polygons to an absolute minimum is going to cripple the ability of a normal/displacement map to affect the perceived detail of your asset. If you need a few more verts to make an edge look better just do it!

If textures are the new limiting factor then what you should be aware of is “draw calls“. Your video card can only do so many of these per rendered frame and keeping this low is going to have a big impact on performance. A draw call is done for each material on a mesh every frame.  One mesh doesn’t equal one draw call. A lot of engines will actually limit the number of materials you can put on a single mesh.  The 600 series Nvidia cards can do roughly 600 draw calls per frame and that’s pretty good. When you think about how many textures that is you might that’s a lot, but each of those calls is slowing down performance.  One last thing worth mentioning is that even instanced meshes with the exact same materials will require separate draw calls. This means that if you have a metropolitan city full of instanced buildings each individual building is adding another draw call. If you have more than one material on heavily instanced assets you can see how this would start to adversely affect your frame rates. Just try and keep the number of materials on each mesh as low as possible :)

Just like our last tombstone mesh I broke out the damaged bits and strong surface changes into their own “UV Islands”. These islands are keeping xNormal from casting seams along the edges of those areas. The key is to break out UVs where the geometry sharply differs from the continuity of the surface around it. In the following diagram I’ve outlined the UV islands in blue on both the mesh and UV editor. You can see how these areas differ from the geometry surrounding them. Doing this with your light map UVs as well as your texture UVs will help shadow fall across your object with less error.

(http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/01/GraveUVL NULL.png)

During the initial baking of normals I produced two errors outlined in below. These particular errors were not from UV mapping, but from floating vertices that weren’t connected with an edge. Retopologizing in ZBrush is awesome, but now without its downside. I find the vertices you lay down quite hard to see and the cursor snapping can give you errors if you’re backed to far out by not connecting your edges. On closer inspection of the erroneous areas I was able to find the floating geometry and correct it. Now you can see how this got rid of those errors on the updated normal map texture. Always inspect your errors thoroughly. Chances are your error is coming from errant geometry at the site or flipped normals. If your normal map comes out looking like details are being projected on from the front to the back or vise versa you’re having scale issues. Your models scale is too small for xNormal to properly bake the texture map.  The UDK’s native scale in Maya is too small so you’re going to have to scale up your geometry 20-50 times its actual size to get proper normal map bakes.

Normal Map Errors on UVs (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2013/01/UVerrorL NULL.jpg)

The job I’m working has the potential for me to work on some “magic” type effects so I am going to post a couple R&D clips this weekend. These will be geared more towards film although I will try to explain the fundamentals well enough so that you may apply it to Cascade in the UDK. If your still  feeling confused about baking normals? Check out Tombstone WIP2 (http://www NULL.terrymatthes NULL.com/unreal-2/materials/tombstone-wip-2/) to learn more about game asset creation with the UDK in mind. Until then Cheers,

Terry

Material Editor Keyboard Shortcuts

Unreal Development Kit User Interface Diagram

Posted these shortcuts a while ago at Eat3D (http://www NULL.eat3d NULL.com). I though I would repost them here to share with anyone who doesn’t frequent that site. If you aren’t though you should. They have amazing video tutorials.

Material Editor Shortcut Keys

Num Key 1 1 variable constant

Num Key 2 2 variable constant

Num Key 3 3 variable constant

Num Key 4 4 variable constant

E key Power node

R key Reflection Vector

T key Texture Sample

U key TexCoord

I key If node

O key 1-x node

P key Panner node

A key Add node

S key Param ‘None’ (0) node

D key Divide node

L key Lerp node

C key Mask (R G) node

V key Param ‘None” (0,1,2,3)

B key BumpOffset node

N key Normalize node

M key Multiply node

Unreal Unit Meshes – “UBlocks”

Unreal Block Meshes

After digging into the 2DPlatformerStarterKit (http://udn NULL.epicgames NULL.com/Three/DevelopmentKitGemsPlatformerStarterKit NULL.html) I began thinking about how I should go about creating my 2D test level. This level would be a staging ground for all sorts of pre-production tests. Things like lightning, particle systems, and mesh design would all be roughed out here. I always find if hard to visualize what sizes my meshes should be while working in Maya.  I was thinking that a quick way to rough out the size of a level and it’s meshes would be to use pre sized blocks like LEGO (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/08/legos NULL.jpg).

I’ve made several different sizes of cube type meshes that area all using the same parent material. Each square on the grid texture represents 64 units in the Unreal engine. If your Maya grid isn’t setup  to work with the UDK change your grid settings to match these values…

Maya to UDK Grid Settings – Length and Width:2000 Grid Lines Every:64 Subdivisions:8

(http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/08/ublocksweb NULL.jpg)

UBlocks in default UDK Scene

The material network is pretty self explanatory, but I’ll go over it quick. There is a texture coordinate node that is being multiplied my a custom parameter node. This lets you control the parameter node’s value separately in all instances of this material. The “U” and “V” coordinates in the “Texture Coordinate” node are represented in the texture by red and green. Multiplying this node’s output will multiply each color channel in the texture. Increasing the value of red and green will tile the material. The new multiplied red and green values are then plugged into the grid texture’s UV input.

Shader network for UBlock parent material (http://www NULL.terrymatthes NULL.com/wp-content/uploads/2011/08/ublocks_mat NULL.jpg)

Shader network for UBlock parent material

Download UBlocks (http://www NULL.terrymatthes NULL.com/public/UBlocks NULL.zip) – I don’t mind if you redistribute the meshes with your projects, but please link this post or include the original ZIP file in your download.