Tuesday, June 3, 2014

Manipulating Force and Impulse Actors with Unreal Engine

  For those who have used Unreal Engine whether it's the current engine, being Unreal Engine 4 or any previous engines, may be familiar with the fracture tool in the static mesh editor. The fracture tool is something I find very fascinating because of the amount of things you can do with it, especially if you have a creative mind. So you may be asking yourself, what is this fracture tool and what does it do? Well for those that may not be familiar with it, the fracture tool is a tool that basically fractures your mesh. To put it in more simpler words, if you have a model such as a statue, the fracture tool can allow you to break pieces off of the model. In the occurrence where we do have a fracture mesh, whether it was a tree or statue, you could have it fracture in multiple ways to where it fits your game.

  As you could see above with the fracture tool found under Tool>Fracture Tool you get these different color polygons in a form of a bounding box which represent fractures of your model that you can manipulate. Through clicking these "chunks" your allowed to say which chunk can be destroyed upon fracturing or even what chunk doesn't become destroyed. If you wanted to you could even re generate the chunks on the fracture model, adding more chunks or even depleting chunks off the model. So after actually creating a fracture mesh using the fracture tool you might ask yourself... how do we get this model to fracture? Well now here comes to cool part.

 In the Static mesh Editor you have properties that you can manipulate, a few now being available to you after creating a fracture mesh which is the fragment min health and max health. With these properties you can basically set the health of your fracture mesh, so upon health being depleted, the model actually fractures. But this...This isn't. With a fracture mesh you can do much more than this and get a lot more created upon fracturing meshes. In the content browser actor classes tab, theres actually physics actors such as force actors and impulse actors that you can manipulate. With the impulse actor, we can actually make the fracture occurrence happen to the best of your liking. Upon development of my level called "Harmony" for my assignment in school, I actually manipulate two impulse actors such as the RadialImpulseActor and LineImpulseActor.


With the RadialImpulseActor, we can basically have a fracture mesh "fracture" upon an impulse that occurs spherically. As you can see above, the very middle red icon by the big tree is the RadialImpulseActor that actually intersects with all trees. So all trees will fracture due to that. Now the LineImpulseActor which is the red arrow icon all over the smaller tree actually shoot out an impulse that causes fracturing in a single line. So it's pretty cool because with that you can get very specific and break off certain pieces of a model. In my level Harmony, I actually use these actors to my advantage. My goal with these actors were to make it seem like the trees were slowing falling apart due to a fire...After a certain time passing, an explosion occurs where all trees eventually blow up the rest of the fractures left. Which causes the blue icon being the force actor to initiate. So after actually placing these into the level what happens? Well these actors are technically considered toggled on. So upon Level loaded, these meshes will fracture. Thats not what you want, or atleast what I wanted for this level. The great thing about these actors is you can actually toggle them off upon Level loaded in kismet. Upon hitting a trigger, you can toggle them back on. What I did with my level was upon Level loaded I set these actors to toggled off. Upon hitting the trigger I set one or even two LineImpulseActors to toggle, setting them off. Delaying a few seconds, toggling other LineImpulseActors, and continuing the process till I got to toggling the RadialImpulseActor. Upon toggling the RadialImpulseActor, I toggle the ForceActor which I'll be getting in to. The cool thing about going this route is being able to spawn particles like fire or even an explosion to make things more realistic.


    The force actor is something a little different that actually doesn't apply to a fracture mesh. The force actor is an actor that manipulates Kactors through force. Kactors can be seen as dynamic static meshes that can be moved through physics. To create a Kactor is simple, all you have to do is right click the static mesh in your level and hit Convet>Kactor. So what I did with this RadialForceActor was actually upon my RadialImpulseActor becoming toggled, I toggled the RadialForceActor to actually have my Kactor Sign be thrown like if an explosion had occurred to create more realism.
  So as you can see with it, you can get pretty creative when manipulating fracture meshes into your level, it just depends what fits your level best.

No comments:

Post a Comment