Final Project

 The goal of this project was to create a more dynamic environment using a variety of different methods in an attempt to make a world feel more alive.

My first approach to this task was to practice and develop a material method that takes the world position and uses it to create variety in a texture, this helps break up repetitiveness in any material especially tiling materials. One example of this method is the roof tiles in this project where I use two similar textures and use a black and white mask to blend between the two.

Using the black and white mask you can easily lerp between two textures and if the majority of the textures match when lerped they will create an effect similar to that of the most right image.

Another way to use this method is with additive settings which create a more subtle variety and really adds to the richness of the overall material.

Above you can see the default texture, in the middle you see a colour map made specifically with colour close to the most prevalent colour in the default texture and on the right you can see textures added together. This works by adding the two colour values togeather to make a new colour, in this example I use black as a base as its number value is 0,0,0 which means it will leave areas of the roof untouched whilst slightly changing the hue of other areas. When scaled up this can make large areas of roofs slightly warmer where the red colour is added in and colder where the light purples are.

This is the final result of combing both techniques discussed above. The most important aspect of this image is that fact that the blending mask between the clean and mossy tiles and the additive colour map are locked to the world position so no matter where you move the roof the texture will change allowing for more organic look overall.

Another fun aspect of the additive colour technique is that you can use it to add dirt onto any texture with ease adding to that dynamic feel with random dirty foot prints light hues of greens and browns as well as scuffs and scratches, this method is used through out my work on this project.


With this concept down I then set out to expand on it to create a rather ambitious weather system, this idea revolves around the fact that you can create panning textures within materials so if you where to take one of the blending masks I talked about earlier and make it slowly pan across the world it would make a constantly changing material.

Much like with the roof texture I started by creating two different variants of one material, one dry and one wet. This can be seen in the image above, just below the walk way you can see a white and black bar which is a visual representation of the mask being used to blend between the two materials. At the moment there is a solid line between both texture but by simply creating a gradient for the mask can create a subtle fade into the wet variation of the material.

So now that we know we can pan a gradient texture to smoothly transition between a dry and wet material we can now expanded on this. My initial idea was to create a large texture map with white spot dotted randomly on and where ever the white areas are the materials in them would appear wet, and ever since there moving the user would see a gradual fade between an object getting wet then drying again.

Now as the texture pans across the world any material with the mask set up will look wetter when in the white spots and dry in the black, but this blending technique can still be pushed further thanks to the “simplegrasswind” node in the Unreal Engine.

Here you can see the basic code idea by using a lerp to blend between the value 1 and 3 it will change the intensity of the simple grass wind node make it seem more or less windy. However its not always raining when its windy so I decide to create a second mask thats would complement the wetness mask but not be the same. This is where I also took advantage of colour channels by combining both the wind and wetness map together into one texture but on diffrent channels.

ExampleImage13.png

Using this method of texture combing means that I can get 4 different mask into one texture if I use the Red, Green, Blue and Alpha channel and allow for a little bit of optimization and makes it much easier to manage on the material code side of things. With this method in mind I decided to take this into the post processing material side of things in an attempt to create clouds however after a good amount of testing it ended up more like a rolling fog than clouds. This can be seen in the video below.

But this is where I stumbled app on the biggest issue with this system which was the lack of ability to get this information out of the material, which would make it hard to do anything that is not material based like control how fast a wind mill spins, turn on/off particle effects, trigger events like storms or control sound effects based on weather. Now you could connect a rain particle effect and control its alpha using the methods above to make it look like its raining but this style of weather system has to many limiting facts when used in a game environment to be considered usable. However it could prove rather beneficial in cut scenes or pre-rendered animation where things like sound can be edited in later.

But that’s not the only system that was worked on in an attempt to create a dynamic world, the next feature I started to focus on was the nature side of world building. This started with trees, as you saw in the video at the top of this page or if you’ve played the game demo yourself is that you can cut down trees and use there logs for varies things, but whats important about these trees is the way they’ve been designed as every tree in the game can be cut down. Now normally having hundreds of actors that can all be interacted with can cause significant lag but threw the use of line traces that fire whenever the axe is swung you can get the “Instanced Static Mesh Component“ of the foliage mesh it hit and replace it with an actor that looks exactly the same but can be cut down.

But with this addition came probably the biggest chunk of code which is the save system that tracks of all the information on things like trees cut down, where items are dropped, which rocks have been destroyed, current weather conditions and many other things, in hindsight I spent way to much time working on this save system but it ended up being the core component to a lot of features in the game. For example going back to the trees another important aspect of trees is that they grow and although I never found the time to get them to grow randomly I did make it so that cut down trees re-grow after a set amount of time(this meant that I had to make a visual representation of time but I’ll talk about that later) that time being 3-5 days or more specifically after 3-5 midnight have passed. As every midnight an event is called which runs threw certain aspects of the save data that has a time element involved in the case of trees once the days passed hits a certain fresh hold it removes itself from the save data meaning once the game is reloaded the tree is no longer consider cut down and will not be removed in the loading sequence, which hopefully adds to the dynamic effect I’m going for in this project.

The next aspect I’m going to go into is time as time is a rather is key component in the changing of worlds, much like I mentioned above time controls the regrowth of trees but more importantly in this game it controls the lighting(both colour and angle), weather and dirt build up. Every half and hour that passes there’s a random change that it will start raining or thundering and once its raining every half and hour there’s a chance it will stop this can all be seen in game but given the random element it may only rain once every 3 days. I also added more subtle elements to time like changing moon phases making the time aspect one of the biggest element of change in the game.

The next aspect I worked on as a part of the changing world idea is the ability to rebuild aspects of the environment such as walls and bridges which can be repaired with the logs cut from trees to give the sense of progression in the world where I had enough time to finish this project its would have been an entire fixer upper for the whole town but given the point of this project it doesn’t really matter. But the walls and bridges aren’t the only thing that can be rebuilt, in the video you can see me press 3 buttons that all change the visuals of the house.

Now unfortunately for me those 3 buttons don’t just switch out to one of three models because in reality there’s an entire back end of Item structures, various arrays and child actors all working together to allow for a large range of customization from window types, wall materials, chimney location and much more. But given everything going on that back end never got a front end beyond those 3 buttons but I did some how find time to add the state of the windows being open or shut to the save system so there is that.

This about sums up a lot of the dynamic aspects that went into this game of course there are a lot of features in the game that aren’t talked about such as modeling, rigging, animations, character creation and all the logic that went into the inventory system that allowed you to equip and unequipped back pack and equipment with out deleting anything, merge stack, split stacks, drop items and much more. But as far as getting the dynamic aspect of world creation in the project I got the core of what I wanted to get done even if I didn’t get to refine it to the level I wanted thanks to world events but overall I believe it shows a wide range of the skill I’ve picked up.