Froyok
Léna Piquet
unfurl

Movable Ledges and Specific AO Maps

Exil Dev-Blog 3

June 22, 2012



Part 3, yeah !

Movable Ledges

I have finally managed how to stuck the player while he is climbing a ledge to move them together. It took me a while to figure out how to solve a teleport problem when I was trying to climb this movable ledge. Simply, what my system do is :

1-Check for a ledge
2-Ledge found then Trace (raytrace) the wall behind to get his rotation
(I don’t trust the ledge which could have a funky collision box or whatever, following the wall is more sure)
3-Go to the climbing mode with the informations gotten before.

My teleport problem was caused by the step 2#. Since this type of ledge (like a platform) doesn’t have a wall, my check was false. I have quickly fixed this with an other platform (like in the video). For the future test I will do more checks with an other manner (more simple, and without the need of a wall behind). after that, when the player reach the climbing state, I update his distance with ledge rotation and location. When the player move along the ledge, I disable the update of the player position and only update the distance between the player and the ledge. Then I only move the player when this distance is different, which mean that the player follow the ledge movement.

AO from Lightmap UVs

During one of my school work I tested a new technique which is working really well.
My main concern on this project was to use mainly tiled textures for saving some work and time. Unfortunately, this way of working doesn’t allow me to have an ambient occlusion map on my mesh. Well that’s what I was thinking of before I get a little idea in my mind.

Since I need to create specific UVs for the UDK (for baking lightmaps), I have an UVset ready to be used. Lightmap UVs doesn’t allow overlapping faces (of course, otherwise you will get artifacts while baking your lighting). This mean that I can use this Uv to bake a specific AO mpa based on the mesh.

In UDK you can apply a texture specifically on an UV channel (or Uvset) that you wish, like this :

Now, my problem was : "How to make this AO map ?"
Of course I can’t generate this AO from a High Poly mesh because this mesh doesn’t exist (since I only use tiling texture, no sculpted mesh). I have tried to use the transfer map in Maya to make this AO but the result was crappy as hell (bad projections, weird shadows and very long time to create the map itself). Fortunately, xNormal exists and have some awesome tools. One of them is called "Simple Ambient Occlusion generation". This tool can generate AO based on the mesh itself (and bake it to an UV or directly to the Vertex colors).

(Only one problem : this xNormal tool only read the first UV channel (if you use an FBX for example, OBJ file only allow on UVset). I quickly created a little tool for my Maya script (froTools) for exporting a specific Uvset to an OBJ file. This tool will be available in a future update.)

Of course it’s a simple AO but the creation of this map is very, very fast : only 2 seconds for a 1024² map with a mesh of 5000 triangles (and more) ! This is a very great tool because it allow me to quickly change the map when I update my mesh and its UVs. In UDK I just need to do : "right click > re-import texture".

Simple and fast workflow for a good result, here is a comparison :

However I still need to do some search regarding the performances : loading new texture on top of other add a memory footprint and some texture calls. The other problem is that you need a specific material for each mesh since you use a specific AO map. It’s even worse when you have multiple materials assigned to the mesh. Sometimes I had like 6 different materials on my big mesh.
My solution was to make a base materials with some setup to allow modification. Then for each mesh I make a material instance which is derivative from these base materials with the custom AO maps. At the end I get a lot of duplicated materials derivative from only 3 or 4 base materials. It’s a good optimization but I’m wondering if it’s the best one.

Anyway, this technique can be also used to highlight some edges (like a cavity map). On this screenshot you can see at left an AO map applied which an Edge highlight maps (it’s simply a wireframe texture) :

Unfortunately, I don’t know any tool that can create highlight edges form the hard edges on a mesh. That’s could be a huge time saver because for the moment I need to paint these highlight by myself. These mesh can be very big and then take a lot of time.

Merge, Merge and Sync

Even if like a lot the UDK, I’m not convinced at all by the tools inside it to move/rotate/scale an object. They are very approximative and buggy (who never raged against the move tool which decided after a translation to go selecting an object behind ?). They don’t allow you to work fast.
So I prefer to merge my mesh into big ones, it saves my time and the performance cost is not so high (if you don’t merge everything of course). Some tools for Maya and Max allow you to take your mesh in you scene and export their locations/rotations to the UDK, so you can still work with modularity but still stay inside you 3D Modeling Application. For Maya I use this one : Maya T3D exporter.

That’s all for now. 🙂