Height Based Fog

I decided that my rain needed some fog to be more realistic and ambient, so added a height based fog component to my scene.

fog1

I changed the colour to match the teal of the water and the night sky and added some more fog for increased ambience.

fog2

I liked the way this looked, however there was a transparency sorting issue where the water was not being affected by the fog. Answerhub suggested that this might be to do with the plane’s tesselation, so I smoothed out one of the planes. This didn’t do anything though.

fog4

fog5

In the end, I deleted the atmospheric fog, as the two don’t work well together and this elivated some of the issues. Its still not fantastic, but it looks ok.

fog3

New Godrays

Since I had flickering problems with my godrays, I decided to make them again. I decided to go for a less code driven solution here and create a conical model to that I could place manually.

god1

I had a go at painting some god rays in here, but there was a really obvious seam and the brushstrokes were too clear. There was too much colour coming from the brush and making the texture less transparent than I wanted.

god2 god3

A better solution was to block out areas of solid colour and then apply a motion blur to it, negating the effects of the brushstrokes. I plugged this into an emissive material and then multiplied its opacity with a grey shade in order to make it less obvious.

god4 god5 god6

I then placed these by adding lots of them to the lighting blueprint and giving them the same transforms as the spotlights in the scene. At first, I thought it wasn’t working, then I realised I hadn’t zeroed out the transform for the blueprint in general, so their transforms were being offset.

god7 god8

Once they were clearly placed correctly I put the material back to its original state.

god9

Updated Fire FX

With the night time lighting done, I needed to change my fire effect to be bigger, brighter and louder. I started off by going into the system and multiplying all the values by 10. Suffice to say, this might have been overkill…

fire]

I took the velocity down, but left the particle size, as I really liked the big wide base of the fire.

fire2

I then scaled the particle size over life, getting the nice big flames at the bottom and some smaller ones fading away at the top.

fire3

I then took out the light module, as I had plans for a scripted light, and turned down the rate and emissive slightly, as it was way too bright.

fire4

I then popped my other emitters back in. I didn’t want to change the shape of the smoke or the embers, so I just upped the values slightly.

fire6

I then started scripting a light that would flicker on and off, to create that sort of random lighting that a fire gives off. My first step was to create a custom event, much like I did with the rain.

flicker1

After that, I created a while loop that toggled the visability of the light after a random delay while a boolean that I set called light flicker exists was true. This turned out to be problematic, as it was an infinite loop and the game was unable to progress. I tried setting the value to false in another event, but it couldn’t get to this event due to being stuck in the loop.

flicker2

flicker3 flicker4

flicker5

flicker6

I ended up trying a completley different tactic after messing with this for a while and getting nowhere. I took out the loop and used the event tick instead. At first this didn’t want to work, but after changing retriggerable delay to just a normal delay it worked fine. This turned the light on and off at random intervals.

flicker7 flicker8

This did the job, but definitely didn’t look natural or beautiful. I wanted the light to fade in and out more naturally. I was wondering if maybe I should have just animated it by hand here, but managed to find a solution. My first idea was to interpolate between two random values. This was a lot less jittery than the first version, and setting the delay to very quick and the range for the intensity value fairly low (well, compared to the original value of 0 – 100000), I got a nice quickly flickering light.

flicker9

There was still an issue in the sort of “on, off” look that it had. Whist it didn’t just go on and off statically as before, the transition still felt very sharp and jagged. To fix this, I replaced one of the random values with the previous intensity, so that the intensity will interpolate between the old one and the new one. This gave a softer, glowing effect, just what I wanted.

flicker10

Its possible that this would have looked better as a hand animated piece, however, what I have created here could be applied to lights throughout the game if I had a large game to work with, and was a quicker solution.

Night Sky Colours, Clouds and Code Tidy Up

I was having trouble getting the night sky to work at first, as I couldn’t switch off the clouds – turned out to be a similar problem to changing sky colours in that I was trying to use a float value with the sky bp when I should have actually been altering the material. I went into the material to look at the parameters, and found that cloud opacity was a scalar value.

night1 night2

Looking at what’s going on in my blueprints is getting difficult, so I orginised it into nice little comment boxes, which made things much easier to look it! It also means that I can more quickly isolate which parts are working and not working.

night3

With this sorted I could go in and define values for my night sky. I had a go at making it more blue, but I didn’t think this fitted nicley with my art style. Leaving it to derrive from the light angle made it very purple, which again wasn’t quite what I was looking for.

night4

night4

In the end, I tried to match the water colour so that I could tighten my colour scheme up a bit. This looked really nice and was a good constrast against the bright greens of the grass.

night5

Overcast Lighting

I’ve been working the lighting some more to create a more overcast looking day. Changing the sky colour based on the light angle seemed like the most natural option, but was very limiting. What I needed to do here was to be able to change the zenith colour to grey for the overcast light, but needed to derivative the darkness and stars from the light angle for the night time scene.

In order to change wether or not colour is being derrived from the light angle in bp_sky_sphere I had to cast to the sky sphere – essentially letting the level bp act as the sky sphere bp. This took me a while to figure out!

light1

It didn’t work at first, before I realised that I needed to expose the dynamic material in the sky bp and make it a public variable.

lighting3 lighting4

I then added some additional lights in order to increase visability. I took care to add these in gaps between the trees, to make it seem as if the light is coming from the sky. Ambiance can be broken by lighting without a clear source, so I needed to be careful here.

lighting5overcast

LIGHTING6

Rain Toggle Script

Had a really pleasant surprise this morning when the rain code that I thought would be very difficult was pretty easy! I’ve been learning about casting whist doing my lighting, and thought this would be the way to go with the rain, but you can’t cast to the level blueprint (one answerhub user described the level bp as the director and the other bps as actors). The new thing I looked at this morning was custom events, meaning I can do things the other way around – I can define a set of actions in a blueprint and then call the custom event I attached to them in the level bp.

code1

I set up a custom event, and the used emmiter enabling to set the emmiters on and off. It took me a while to realize that this needs to be done within the bp – turning off emitters in the particle effect itself will leave them off permanently. Once sorted, this worked nicely, however there was a second between the event and the emitters switching off.

code2

Luckly, when looking for prewarm options, I found an emitter enable toggle – this is what I needed! I redid the bp so it was even simpler with this.

code5

I called the overcast event as part of the lighting code, and then called the night event when the player touches the gate to go to the hub. Putting this in the lighting code means that the player will get rained on in the hub – not what I want!

code4

I then added and took away the ripple effect on the water, just using spawn emitter at location and then destroy actor.

code3

Map Check Errors

I wanted to get going with looking at fps and scripting my rain fx but I’ve ran into a massive problem with my map check. After building lighting, it still claims that 78 objects are unbuilt. At first, I had lots of NULL staticMesh property issues. After spending quite a while googing, I went though and found that these were duplicates of objects that had no static mesh assigned and were just empty. I had hoped that getting rid of them would fix it, but it didn’t do the trick.

mapcheck1

After this, I still had a world settings rebuild error and an error to do with a sky sphere that, to my knowledge, doesn’t actually exist. Not good.

mapcheck2

One solution offered online was that having lights in blueprints caused this. As a test, I deleted the light from MyCharacter, but it didn’t change anything. I added a lightmass importance volume, but this didn’t fix the issue either. I then found that it could possibly be that meshes being called from blueprints weren’t set to movable, but looking though, all of my objects were. This led me to wonder if maybe something that I was changing about the lighting in my level blueprint was the issue. I unhooked the work I’d done on the overcast level and rebuilt the lighting.

This got rid of the error – so I isolated the problem to this part of the level blueprint. What I did then was disconnect each node to find out which was causing the issues. I didn’t expect to find that actually it was none of them, and this part of the script just needed to be recompiled. It works now, but I’ve lost about 2 hours on something that wasn’t even an issue…