Wednesday 12 December 2018

Creating a flamming barrel - from Maya to Unreal

I decided that I would try and create a simple flaming barrel to add to my game level, just using what I had learnt so far, and a test run before importing my gun model into Unreal.

Firstly, in Maya 2017, I went to the create tab > polygon primitives and turned interactive creation on. Next, I selected the pipe shape from the polygon shelf, and dragged out the base, height and thickness to create a barrel type shape.



Now I wanted to add a little detail, and metal barrels generally have several ringed ridges. To do this, I added in several edge loops (mesh tools > insert edge loop) by clicking on an edge and dragging the loop into place. Six edge loops were created to make three bands, I then selected face mode and selected all the faces in each band, next I used extrude (Ctrl+E) to pull these faces out slightly. Lastly, I used the bevel tool (edit mesh > bevel) to round the extruded faces.


I just needed to give the barrel a base now, this was done by adding another edge loop on the inside bottom of the barrel. I selected the newly created faces, and went to edit mesh > merge to centre to form the bottom of the barrel. Now the shape was finished, I wanted to add a material. Holding the right mouse button and selecting object mode, I had my barrel selected with a green outline. Pressing the right mouse button again, I now selected assign new material. There are various material types available that represent different material effects, I wanted a metal finish, so I chose blinn. This brings a panel up on the right of the screen where various material attributes can be set. I set the colour to a darkish red, and turned down the reflectivity. My barrel model was now complete.


 The last step in Maya was to export my model for use in Unreal. Before exporting, I went to edit > delete all by type > history to reduce any risk of errors. With my model selected, I then went to file > send to Unreal > selection, and I chose the directory where my Unreal project was located. Next was the export selection settings. I made sure the file type was to FBX export, and importantly for exporting models with materials, I checked the box for embed media in the options. You can also check geometry > smoothing groups to stop Unreal throwing a warning when importing, but found it makes no real difference if I didn't.



Moving into Unreal, I used the import button in the content browser to find my barrel in the import folder, it imported the model and material fine. Next, I created an actor blueprint called 'flaming barrel'. I added a static mesh component and selected the barrel model in the details panel. The model was small, so I scaled it up a little (R). I then added a particle system component, and added the 'P_fire' effect from the engine starter content.



The model was now ready to add to the level. I decided to duplicate it a couple of times, and have a group of three in the corner. I added a point light with an orange glow to give it a little more atmosphere. The finishing touch was a sound effect, this again came from the starter content. I wanted the sound to only play when the player was close to the barrels, to do this I used sound attenuation. This allows a sound to activate and play at different volumes depending on how close the player is to the source. This was achieved by adding the sound directly to where the barrels were, then in the details panel for the sound, override attenuation must be checked. Finally, to adjust the distance the sound travels, the falloff distance can be adjusted, and is represented by a sphere in the editor window.




I'm quite pleased with the overall effect this adds to the game, it just adds to the atmosphere. It was also it was fairly quick to do, in fact it took less time than this blog post!



No comments:

Post a Comment