Monday, 3 June 2013


The level is now finished. I say "finished", but really what I mean is: I'm handing it in.

Did i finish the level? Well examining my brief, I did meet all of the basic requirements, more or less. Regrettably, so much got rushed towards the end. I'd say my goals were ambitious, and due to external factors I spent about 70% of the time I thought I'd be able to on it, so it's not too surprising the level of polish is not quite as hoped.

Let's examine the successes and failures of the project.

Day/Night and Lighting
Success! I'm pretty happy with the result here. After much wrestling with the cascading shadow maps, I feel I've got pretty solid shadows. Regrettably, the global illumination approximations are extremely ghetto, relying on custom lighting, tweaked via matinee across a whole range of "ambient light" parameters (one for each material), with no occlusion approximations, except those painted by hand in the cave and a couple of other spots.

Certainly, this is an area which would have hugely benefitted both in production time and final result, by using a more modern game engine with GI approximation (CryEngine and Unreal Engine 4 would have been excellent in this regard).

Moderate failure. Although I do have rain particles and snow particles and the clouds and lighting and snow accumulation to support them, there were so many features of the weather that were not completed. Also, I wasn't able to drive the weather through parametric randomness, instead relying on the easy-to-implement fixed-matinee sequence. This means the weather is entirely predictable and consistent year-on-year, rather than being random.

The rain does not feature puddles, splashes, ripples, wetness or speculars on surfaces as hoped. There simply wasn't time. I also really wanted to have lit-rain surrounding the torches, which I didn't get time for. The rain effect itself is nothing special, either, and would have been nice to create driving rain, and a greater sense of wind affecting the rain. Also, the lightning doesn't illuminate the sky, which would have been a really great effect.

I'm very pleased with the accumulation and melt of snow, which accumulates evenly and melts in well-lit and well-walked areas first. The snow particles themselves are pretty generic, and I went with the easiest snowfall to do: the gentle drifting snow. It might have been nice to get a real blizzard going.

The fog is also super-simple. It would have been nice to do a bit more fantastical mist drifting about, and also slightly stylized fog, and had more effective sunlight through the fog.

Success! I'm happy enough with the seasons, though I noticed pretty late on that the snow sticks around far too late into spring, but the leaf colour changes, fall and regrowth work really well. The grass size changing is actually pretty unnoticeable, although in the snow it does look like the snow is covering the shortest grass, which is a nice little effect.

Looking back at my reference, I don't feel I exaggerated the seasons as much as perhaps I should have. It would have been nice to do blossom, and I also didn't get time to do the leaves accumulating on the ground and drifting down-river, which would have really completed the autumnal feel, but generally, the seasons are working pretty well.

Moderate success. I think in the end, the trees turned out okay. They're horrifically expensive right now (I'm in the process of optimising them for the degree show, but this won't make the hand-in date)... but they look pretty good. I'm happy with the way the leaves move gently in the breeze, though I wasn't able to get a convincing gale-force wind.

The grass worked out alright in the end too, though it looks a bit well-kept. It could really have benefitted from other small plants like dandelions and daisies. The same is true for a medium-sized plant - this would really have helped bridge the horticultural gap between the small grass and the large trees. I ended up using scaled-down branches clipping through the ground... which is a bit cheap and naff really.

Success! The rocks were probably the biggest soul-drainer, meeting artistic problems at every step. However, in the end (and with a lot of lost time), they worked out pretty well, I think.

The moss and snow both work very nicely with the rocks (though at time the snow does appear to be a different brightness on rocks than on the ground, but its a pretty minor thing).

The overall style of the rocks seems realistic and is fairly readbale and undistracting. There are a few cases that the rocks are a bit blobby and/or a bit  uniform in their scale and arrangement, but this would be easily rectified with a bit better placement.

The distant rocks aren't so strong. Scaling them up to be massive looks a bit cheap and really I should have spent more time creating another, very large rock asset, and worked the terrain into the rocks in the distance much better.

Moderate success. The architecture was very rushed, leaving in placeholder assets that I didn't have time to create properly. I also wanted to include tesselation to bring the silhouette of the stone blocks to life, but directx 11 (required for tesselation) hurt my frame rate too much before I even introduced the tesselation, so I had to abandon this hope.

I was very pleased with the way the torches illuminated the architecture, and worked well with the baked-normals of the stone wall. Also the copper roofs, which were something of a gamble which looked to be a mistake for a long time, actually turned out pretty well once I'd done the vertex painting to get the balance between oxidised and clean copper.

Misc Effects
Success! The river turned out great, with believable reflections and the illusion of depth with fresnel and the ebbing froth as the water travelled down. Although I didn't get to do the flow map, which would have enhanced the water further, I think I got away without it, and generally it isn't noticeable that the water sometimes flows from or into a hard surface.

The waterfalls also came out well, despite not being as strong as I was originally planning (though this better matches the throughput of the river). The large waterfalls in the vista could have used their own shader and textures, but I didn't really get time for them, so they ended up looking a bit rushed (along with most stuff in the vista really).

The torches didn't use a flipbook as I'd have liked, but I think I got away with it. The licks of flame work particularly well, though the stacking one-on-top-another looks very "computer game" and not realistic. I would have really liked a glow effect around them, and also lit rain when it's raining, but (for probably the hundredth time in this post) I ran out of time.

Failure. The biggest failure of the project was undoubtedly the sky. What's there doesn't look bad, but I didn't set out to make a project that "isn't bad", so my disappointment only really makes sense in the context of my hopes for the sky.

Hope: Thunderous stormclouds, crowning over the horizon, bringing with them a deluge of rain and hurricane wind.

Achieved: The entire sky fades linearly to overcast all at once, rain piddles down. the wind speed is unaffected.

Hope: Procedural clouds, drifting softly, delicately layered and beautifully illuminated by the the moving and colour-changing sun.

Achieved: Dotty-looking clouds, seemingly evenly lit and white at all times, irrespective of the light direction or colour.

Hope: Moonlight dancing between the clouds; a striking visual landmark in the night sky.

Achieved: I don't even have a moon. And the sun always draws in front of the clouds. get the idea. The saving grace really, what I have is only bad in the context of my ambitions, it's little worse than most skies we see in games.

Final Thoughts
I'm really pleased with my choice for a final major project. It gave me heaps to do and challenges at every step. I regret I don't have any individually nice assets (plans for the statue by the waterfall were abandoned early on), but as a complete piece I'm pretty happy with the result. For a long time I was seriously worried that what I would finish with would actually be something of an embarrassment, but I'm delighted to say that I'm vaguely proud of it. ish.

I'll probably do it all over again when a free Unreal Engine 4 developer kit is out. And I'll probably spend a year doing it. Then I'll have scratched my itch and finally be able to say: THIS is what I want a dynamic fantasy environment to look like!

Please take a look at the flythrough video, showcasing the full environment and... most... of the season/weather/time of day combinations. :)

Saturday, 1 June 2013


I had been putting off the sky because I really had no idea how long I would have available to work on it. It actually was at the point where I thought I would have to settle for entirely cloudless sky, but I really couldn't stand just relying on fog when it rained, So I had a quick go to see what I could do in a couple of days.

I started by doing "dotty" clouds. I knew these wouldn't need clever lighting to look believable, and I had a few pictures which I could use for this purpose.

By using two different sets of UV coordinates, I was able to use top-down style mapping for overhead clouds, as well as ring-style cylindrical mapping for horizon clouds. One of the channels was used to break up the obviousness of the repetition by tiling at a different amount. Combined with the existing fog, the result was pretty satisfying and much nicer than just a plain sky, albeit nothing fancy:

For the overcast texture, I slapped and stitched together many different stormy and overcast cloud pictures. The fade in for this is simply linear, which is not very realistic, but I was in a bit of a rush at this point, so it had to do. I generated a normal map, which is mostly ineffective, but again... it had to do.

I would have loved the lightning to light up the sky, and I had the normal map to do that, but UDK wasn't immediately playing ball and I didn't any longer have the time to wrestle with it, so i just rolled over and let UDK win that round.

At night, the clouds are very hard to make out (which is about right), and they block the stars (also, about right). I would have really loved to add a moon which lit up the clouds, but given my failure with getting the sun to light up the sky, I didn't even try for the moon.

I set up a light function to give the appearance of the sun casting the shadows of clouds on the ground. The effect is very subtle (perhaps unnoticable? :S) but hopefully it gives that can't-put-a-finger-on-it extra dynamic "alive" feel to the lighting. This actually introduced an unexpected problem - because I had now started using the sun to light up the clouds, I was now casting the shadow of overhead clouds onto the clouds, which of course was nonsense. This actually meant I ended up duplicating the sun light without the cloud-shadow function and using that to light the sky instead.

Wednesday, 29 May 2013


The waterfalls needed to conform to the underlying rock, so I decided to rely on vertex painting to "stream" the water flow, and also to push it outward around the rocks as it cascaded down.

The mesh for the waterfall was therefore fairly dense, and the vertex colours allowed me to paint in opacity and position offset.

Although this worked okay for rolling down rocks, getting a natural looking curve where the water was seeming to bounce off the rock and then arc downward was a bit tricky using vertex painting, so I made a second, thinner mesh which was already arced.

The overall effect ended up much less dense-flowing water than I had planned, but I actually think this is a little more practical, and I've warmed to the way it looks now.

In the case of the enourmous waterfalls in the vista, I felt I needed them to block light to the rocks behind them, so I made a material which allowed me to paint blackness, which looked like moderately convincing soft shadows.

At the bottom and top of the waterfall, a cloudy mist of water is created using a particle emitter. This was particularly hard to tone-adjust for night because the particle system was already adjusting the vertex colour in order to fade each particle over time, and UDK's material instance control through matinee (which is what I've been using to adjust the amount of light on materials so far) doesn't seem to play nice with emitters.

I was able to find a workaround by allowing matinee to control a variable on an actor (i happened to use the brightness of a tiny out-of-level light, but I could have used anything). This is read ten times per second using kismet, and applied to all emitters. This was a pain to set up and is messy and probably highly non-optimal, but I really couldn't stand such bright water mist at night!

Friday, 24 May 2013

Grass Performance

My level was really starting to run slowly. It was a real inconvenience to accurately measure the effect of objects on performance, but after installing FRAPS, I was able to see the framerate as I made adjustments to the level without having to jump in-game.

It wasn't long before I had identified that in areas of poorest performance, the grass was taking about half the render time, which is far, far more than it should have been. I wasn't sure if it was getting drawn behind terrain which would later draw on top of it (overdraw). At this time the grass wasn't getting culled, so I figured I'd experiment a little there.

What I noticed, however, was that changing the draw distance on the grass was not actually culling the grass. It turns out this is because UDK was clumping together the grass actors into batches in their hundreds, and wouldn't cull them unless none of these actors could be seen. With such enourmous clumps, this meant almost no culling, and almost guaranteed maximum overdraw. After adjusting the clump sizes to be in small clumps no wider than a dozen meters or so, my framerate improved from a low of 17 FPS to a low of 30FPS... a huge and really pleasing improvement in performance!

Thursday, 23 May 2013

Effects pt 2

I've now modelled a torch bracket and done a flickering flame visual effect. It would have been nice to use a "proper" fire flipbook (series of images, like a 2d animation), but it wasn't practical to find time to record that for myself, so instead I photoshopped four photos of fire and used some shader trickery to make them look "alive".

The flame effect is missing a couple of things, which I may get time to add later: it needs a glow effect (ideally one which has lit rain on it when its raining to give the impression the fire is lighting the rain drops), it needs a distortion effect, and also smoke.

Since it featured heavily in my brief, I decided to rush together the rain and sky and drop much of the polish time I had allocated. This means that the rain will most likely be little more than clouds and rain particles, and I probably won't get time to do puddles, wet rocks or splashes. But I think its absence would have hurt the ambition of this project more than a little less polish.

Here's what I've got so far for the rain. You'll notice I'm also reducing the direct light whenever its overcast. The sharp shadows during rain obviously weren't right, but this introduced the problem of a darker scene, so I decided to use postprocessing to compensate. I also introduce more fog during rain.

I experimented with a ring around the player with rain falling on it, but I abandoned this in the end because it was too obvious that the rain moved with the player whenever the player strafed. It occurs to me now that I may be able to scroll the texture with the player strafing, but this may prove fiddly so I'll leave it for now.

I tried out a really quick lightning system which basically just enables a light very briefly intermittently during a storm. This looks okay, though it is noticably absent in lighting up the sky at this time.

Snow works in much the same way as the rain, creating an overcast effect, reducing the direct light and generating particles. The fog is a little bit lighter and denser while snowing though.

The snow particles drift down in a natural-looking manner, which I'm fairly pleased with. I would have liked to have gone for a stronger blizzard, but this would have required me fixing up something clever with the precipitation ring mentioned above, and/or using a lot, lot more particles, which I'm reluctant to do given the strain my level is already putting on the performance.

Friday, 17 May 2013

Effects pt 1

There a lot of different effects and things, and the quick ones I tend not to type up, but here are a few that I’ve done over the past couple of weeks.

I’ve added leaves falling from trees. This uses a mesh-emitter. I was not able to control the fall of the leaves as I would have liked using UDK’s Cascade editor, so instead I made the material offset the leaf as it falls.

I’ve tone-balanced all the shaders to look correct during the day and night. I also started work on the postprocessing effect. It colourises the scene slightly based on time of day and time of year so that day is warmer, night is colder, spring is greener, summer is yellower, autumn is oranger and winter is bluer. These are obviously “fakes”, but help to give a bit of atmosphere.

The postprocessing effect also now adds fog in the morning, which is particularly dense during winter. For the moment this effect is entirely in postprocessing, but I’d like to add ground mist throughout the level to compliment the depth-based whiting.

Also in postprocessing now is heat haze. This essentially offsets the position of pixels based on depth and height. Although I couldn’t get actual world height, I’m using screen position to fudge it, and I don’t think most people will notice. To get the rippling effect I’m just using the same normal map as my water texture, panning upwards, and it is the red and green channels which drive the offset.

Relying entirely on the sun to cast the light makes interesting lighting quite difficult, so I decided to add torches to the level. I’m partway through making the torch and bracket model, but I’ve started placing warm, flickering lights throughout the level and they really help to add interest, particularly at night, and they contrast nicely with the cool night-time tones. I’ll obviously need to make a flame visual effect, which I’m looking forward to. I’m hoping to add a cool visual effect for the torchlight bouncing off the rain if I have time to add rain, but rain is starting to look like a low priority with all the stuff that *needs* to be done.

Friday, 10 May 2013

Grass revisited

I had another go at the grass. Last time it ended up very “crazy” looking. It was doing lots of different things, in lots of different colours, pointing lots of ways and generally being a real mess and bizarre. I fell into this trap by trying to make a very small amount of grass look interesting, and repeating it a lot. I also fell victim to trying to make something as efficient as possible by prioritising performance bang-for-buck with artistic decision-making. I therefore made patches too dense and just generally tried to do too much with too little.

So this time around, my bakes were much simpler, and the textures much less complicated – it doesn’t even have a normal texture. The result is a much less remarkable-looking set of grass patches.

I set about scattering them throughout the level by painting them onto the landscape. By controlling their size and the density of placement, I was able to make interesting patches of grass without them looking quite so nuts as before.

I added a gentle wind to the grass without the use of texture lookups. Although it uses a lot of nodes, the instruction count isn’t too high and it’s a lot cheaper than using a texture lookup. (incidentally, the tree wind is done in a similar textureless way).

The grass also grows and shrinks with the seasons. This is done by making the grass both thinner and shorter using the texture.

It’s not the best grass in the world, but at least it isn’t an eyesore any longer. If I get time, I’d like to add some more plants: daisies and dandelions which will be most visible during spring and summer, but also medium-sized plants to fill the size gap between the tiny grass and the large trees. Edit: not going to have time :(