6
\$\begingroup\$

For example, take bullets, sparks, fireballs, light sabers, lightning bolts, any kind of special effect in a game.

Are there various ways to implement these effects in a game. As far as I can see you create either an animation is some modelling package like Maya and then load these animations, you also seem to be able to do these kind of effects using layer upon layer of textures(images).

So where does the particle engine come in in a game, what is the relationship with pre-made animations.

Lets say I wanted to have some custom effect like the player could have a Thor like hammer and smash it on the ground as special power. Now when it hits the ground, everything rumbles and bolts of lightning appear from the hammer which propagate in a every increasing circular motion away from the hammer, like a circular lightning bolt and eventual fade away.

What options do I have to create a special effects like this, is it mainly done in animation software or mainly done in the engines code.

\$\endgroup\$
  • \$\begingroup\$ Do you have any links on the various options? \$\endgroup\$ – user3333072 Apr 5 '14 at 12:11
2
\$\begingroup\$

Particle effects which are procedurally calculated by the game engine have the advantage that they can interact with the world:

  • Particles which collide with objects can either bounce off or disappear. A precalculated animation would just pass through any obstacles
  • Particles emitted by a moving object can stay where they are while the object moves on. This can often look pretty good. A precalculated animation can only be moved as a whole.
  • Particle effects can interact with 3d models. Imagine your game allows to set objects on fire. You could visualize this on-fire status by spawning fire particles from the whole surface of the model. A prerendered effect would have to be done separately for every single model. When the model is animated, you also need to do the fire-effect for every animation-phase. You would practically have to do every object twice - a normal version and an on-fire version. but a procedural effect could just calculate the model surface at runtime, which means it can be applied to any model in the game without any additional work.

Let's take your hammer-effect, for example. You want lightning-bolts which propagate over the ground. You could make these lightning bolts in a 3d animation program. That would likely be a much more comfortable workflow and allow you to do it a lot more resource-friendly. But what if the hammer strikes somewhere where the ground isn't perfectly flat? OK, when it's on a slope, you can just rotate the animation. But what if the ground is uneven? A prerendered effect can not adapt to that. Some bolts would be above or below ground, which might look strange. Also imagine what would happen when the hammer would hit near a wall? The bolts would pass right through the wall and appear on the other side. That would also seem quite glitchy.

A better solution would be to use a particle-engine and make the effect procedural. That way you can have the particles which represent the edges of the bolts check their surronding and have them travel along surfaces. They would then travel organically over uneven ground and up walls.

| improve this answer | |
\$\endgroup\$
0
\$\begingroup\$

Perhaps, some custom animation will require a bit of coding. Usually, particles in engines are physically simulated instances. Wıth this option you have more control over your particles as particles are now dynamic entities that you have direct control over.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.