Sunday, 2 May 2010

2 May 2010 - Your Maxton's on Fire

I was convinced it couldn't be done - but positive procrastination (sick and tired of texturing every day) combined with the functionality breakthrough with the gamepad yesterday pushed me into looking at a very important visual aspect - emissions from the steam vehicle. It's hardly a Steampunk game with no steam, is it?

A carbon footprint belonging to a size 12 Doc Marten boot - The Maxton is no longer shy when it comes to spewing fumes into the skies above

Anyway, the advice given to me on the forums (essentially, "look at the code that comes with the game") proved fruitless in March when I attempted this before - though after a bit of thought I decided I was looking in the wrong place. I looked at the weapon files (as weapons have a 'muzzle flash' that is location-specific - as in, it has to come from a particular place on the model) and they might as well have been written in Egyptian Hieroglyphs for all the good that did me. Then I looked at the Unreal Tournament 3 files - because the Hellbender truck that comes with that version of the game engine has an exhaust stack which is essentially what I want. I managed to find a piece of code that linked to a particle effect in the varios game packages, and using my tried and tested copy and paste skills, I moved the relevant code into the Maxton's content file and adjusted the paths and filenames to link to my own smoke particle emittter (which I created from scratch, specifically for this purpose, following this tutorial).

The three lines of code that have been added to the Maxton's file with the relevant paths - this was mainly logical thinking and linking to directories than actual coding

The material set-up in the tutorial is much more complex than my usual materials

To get the particle emitter to produce smoke or steam from the relevant sections on the vehicle, additional bones had to be made on the vehicle rig in Maya and the Maxton had to be re-imported into UDK - which i'm doing a lot recently anyway with the texture testing.

Additional bones in the Maxton rig for the steam/smoke emitters

These bones formed the foundation for adding 'sockets' in UDK - in much the same way as custom weapons use them - and the sockets are what the code needs to tell the game engine where to produce the smoke from my emitters. So, in that respect, I was on the right track with looking at weapons but I had to make a massive detour to finally arrive at my destination. On the other hand, I worked this out myself, which is really something. It's a much bigger sense of achievement than being told what I have to do (not that I mind being told what to do, because 9 times out of 10 it's quicker).

Creating and positioning sockets in the UDK finally allowed me to make the Maxton a lot less environmentally friendly

I'm really happy that i've made this breakthrough, another that just seemed to happen after I gave up on it weeks ago. I'm sure i'll have to do more tweaking to get it looking a little better (time allowing) but at least now that chimney doesn't just look like an uneccessary decoration.

Player view with the smoke in action - testing will indicate if the smoke affects gameplay and visibility

A steam engine it may be, but it needs no rails.

No comments:

Post a Comment