x


smoke, fire, flame thrower no particle

It seems too be very popular to use particles with smoke and flame thrower effects. we are trying to run our game on ios (eventually) and that means its best avoid particles. I understand you can get away with small particles, but:

A. this not the effect we want, particles have a fuzzy cotton candy look to it, we are doing a cartoon style 2d side scroller. Particles would clash with this style terribly.

B. the game will have high physics demmands on it, so we are looking to chop out any cpu processors wherever we can.

So we are looking for a script that can take an animated sprite,

duplicate several times, have them start from one point and have them slowly spray out while rotating and scaling up the sprites as they get farther away from the emiting point. I need it to have a the flame or smoke trail be able to "whip" eg. changing the direction of the emiting point will only effect the direction of newly created sprites. just like smoke and fire, the sprites should very slowly go up or start to slowly go up a certain distance from the emiting point.

I know this is a long list of needs, but suggestions on any of these behaviors would (few or many) will be appreciated.

I am no stranger to javascript, so links to help me write a script on this are also welcome.

Thanks for your help

more ▼

asked Jun 15 '12 at 10:18 PM

surreal5335 gravatar image

surreal5335
2 1 1 1

What you are describing is still basically a system of particles. Particles are not necessarily fuzzy-looking; if you want you could use them to draw an animated sprite from a sprite sheet without any translucency, even using the default (and legacy) particle emitters/renderers and no scripts.

Personally I've found that on some mobile devices, dynamic geometry can be pretty slow in Unity (which makes dynamic batching and Unity's built-in particle renderers and most sprite frameworks too slow), at least as of Unity 3.5. And moving and rotating and (especially) scaling many separate game objects with meshes attached is even more expensive on mobile.

So far, the most efficient alternative I've found is actually to call Graphics.DrawMeshNow with a 4-vertex plane mesh once per particle (where each particle is simply a Vector3 and/or a matrix that I update in a loop) inside the OnRenderObject of a game object. It sounds like it should be slower, but it avoids a lot of the CPU overhead that's usually part of Unity's rendering pipeline, and it gives you full control over the particles. But it's kind of advanced stuff to get it right, and regular particle systems are fast enough for many situations even on mobile as long as you take care to minimize the particle count and overdraw (which btw should be done either way).

Jun 15 '12 at 11:07 PM jspease

Right, particles only have a "fuzzy cotton candy look" if you make them that way.

Jun 15 '12 at 11:10 PM Eric5h5
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I did a test of my own with a particle system I was able to achieve a decent flame thrower effect while only emitting 30 particles at any given time. It was pretty simple, by just adding a particle system component to my Gun Then using a Sprite sheet I found online as a texture. I messed with some of the emitter options and put in some very basic code to get it going. Below is a link to a video I recorded of the effect and some coding I used.

http://www.youtube.com/watch?v=Fru0H8ruTGI

more ▼

answered Jun 16 '12 at 07:35 AM

VictoryX gravatar image

VictoryX
28 3 3 6

link not working, can you share again? I want to do exactly what u describe.Thanks

Dec 05 '12 at 01:42 PM Heav3n
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x152
x23
x13

asked: Jun 15 '12 at 10:18 PM

Seen: 1170 times

Last Updated: Dec 05 '12 at 01:42 PM