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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s