Portfolio Project (TGA 2022)




Breakdown



My main project during the advanced specialisation course at the Game Assembly was to create an immersive open world environment. I wanted to deep dive into Unreal Engine and learn all the processes from procedural terrain and foliage to dynamic interactions with shaders, blueprints, light and sound.

The project started initially in Houdini where I generated the terrain and texture masks but after this I moved on to Unreal 4.27 tools. I set up the master material system for the terrain, including the implimentation of Runtime Virtual Textures to allow for blending between assets and the heightfield.


The setup of Runtime Virtual Textures was one of the more technically advanced parts of the project as it required the blending of the albedo/roughness/normals from the master material of the heightfield, with the albedo/roughness/normals of megascans assets. The albedo and roughness was straight forward but the blending the normals required transforming the heightfield normals from world space to tangent space and back to world space again. You can see it working in the gif below (a normal debug view showing a megascans asset being lifted and the normals blending dynamically).

Other systems developed for this project included a footprint system which differentiated between physics materials of the master material - mud, grass and stone - best represented by the audio of the footsteps, the footprints themselves were simple footprint indent normals from decals that spawned from a raycast every step from the animations. Another system I was proud of was a very subtle object space interior mapping shader for the reflection in the windows.

Other than these systems I implemented I spent a lot of time tuning and tweaking the procedural grass/tree/rock spawning systems,  global lighting, dynamic shadow quality, the raymarched cloud systems, cubemaps verses scene capture cubes and tuning the LODs when I pushed one or two of these systems too far.




Wind Shader



I wanted to capture the movement of wind in a rolling wheatfield and initially started with two world-sized noise-textures panning over each other to oscillate the vertices on the X and the Y channels, I later added a third to randomise the magnitude.
While creating the wind shader I encountered the problem that some grass assets had painted vertex colours while others didnt, so I made the gradient by dividing the Z of the object-position which saved time and allowed me to make a material function for global control.

The trees are not included in the shader since some had rigs and some were pivot-painted, if I was to approach this effect again I’d probably create a global source with a direction with minor randomisation - then use that an input for all the assets in the scene. At the point when I made this I didn’t know how to bridge the gap between applying the wind I made with world position noise for the wheat to all the diverse assets pivot-painted, rigged and particle assets like smoke.




Foliage Interaction


It is quite a subtle effect in the environment but one that I’m proud to have achieved. I created the render target system for capturing the character movement from a birds-eye view, a camera that is looking down on the character from 20 meters above. Using particles with a simple vector field RGB texture and projecting it to a blank motion vector render target underneath. The resulting texture created with the particles trailing is used to bend the grass and foliage underneath the character based on the direction, basically painting onto the field.

One problem I encountered was while setting the particles to be invisible meant they were being culled during gameplay, so I spawned the particles beneath the terrain map instead.

Campfire effects



The campfire started as simple fire particle textures from Houdini and EmbergGen but eventually spread into being an interactive blueprint and shader, where once the fire starts it grows in intensity when the player adds logs to the fire.  The logs have a mesh shader on them meaning they start to smoulder after the fire has been growing a while. There is some simple heathaze noisey displacement, and even some depth stencil hack so that the fire doesn’t clip through the pot. The actual fire particles are really simple texture atlas shapes of real fire but simulated in niagara, I used the ones from Houdini and EmberGen for the smoke and steam. The twigs that are used as kindling have a very subtle vertex shader to collapse them when they are burning. 


Dynamic Sound & Music


I used FMOD to create dynamic sound effects, like the fire effect where it transforms from a small fire starting to a roaring hearth with boiling soup. The sound is spatialized so it sits well in the scene, with the birdsong and ambient wind. The footsteps change depending on which surface and have a degree of randomisation so occassionally the character will step on a twig, or a particularly rocky patch. The ambient soundscape is also interspersed with randomized bird-whistles, wind generation and crickets.

The music was created specifically for the project by composer Andrew Cowan based on appalachian folk music.  We spoke some time about vertical layering and hybrid dynamic composition. In the end it is somewhat hybrid where the music becomes more gentle while the character is in the field and it transforms and loops differently while the Portal Effect is being experienced.


Portal Effect



I wanted to create contrast in the scene with a supernatural event and had a few options I was inspired by.  Specifically this portal from season 3 of Twin Peaks:



I created a few iterations inspired by the Twin peaks warping of spacetime, using a spiral normal particle suspended in the air but I was not satisfied with how two-dimensional it looked in the world - specifically when walking around it. It works so well in Twin Peaks because of the almost static camera shot, I wanted interaction with the playable character so I changed to a different style.

I used math from actual black holes in the resulting shader, and mixed it with some noises and flowing textures that warp the world around it and pulses like it can inhale and exhale.

Once settled on the type of spacetime deformation I started work on the atmosphere around it. While creating the dynamic sound I made a parameter for changing the daytime ambient sounds to night-time crickets and owls, which I found use for in the portal area. In the level blueprints I triggered a change from day to night-time and some strange perspective shifting for the boom of the camera. A hazey screen space distortion begins which ended up like a subtle chromatic aberration and weird bends to the hues. The music loops here to create the sense of time-stopping, and there are swells of synthesizers both in FMOD and in Unreal Engine.

There is a dark buildup of volumetric fog when you enter the stone circle and the fog rotates around which gives a dangerous aura to the portal - there is also a build up of fireflies or strange fairy lights which seem more friendly. Each stone in the stone circle triggers a point-light and a musical note but thats as deep as the mystery goes.



Animal AI


I added in simple AI state system for a small deer which eats, sleeps and wanders around - it also uses Unreal AI Perception system to react to the sight of the player.

Final Thoughts


The project has been a huge learning experience, not only the tools and techniques but learning how to push myself to make big changes to the project, or to move on from a implementation that isn’t working out as planned. 

If I was to start the project from the beginning it would have been good to use the portal to teleport the player to another biome, this would have created many opportunities for impactful visuals of the transformation too.