Particle attractors, repellers, and keyframes..

Posted By: Orange Brat

Particle attractors, repellers, and keyframes.. - 09/28/07 05:20

We have a nice particle system when it comes to emitters, but I can't think of an easy way or any way to attract or repel particles. I was looking at TV3D 6.5, and they have a particle feature called an attractor. It can be used to influence particles by either attracting them to this special entity or just the opposite by repelling them. It seems to be a helper object given it depends on the presence of an emitter.

They also have a keyframe feature for emitters which will allow certain events to take place at a pre-determined time during an emitter or particle's lifetime. This would be another cool feature.
Posted By: ello

Re: Particle attractors, repellors, and keyframes. - 09/28/07 06:49

well, you can of course add some code to your particles function make them move towards or away from attractors. its more a question of performance, since i think the particlesystem is not so fast. when i look at demos which use millions of particles in a great manner, it is not possible to do such stuff with 3dgs (ok, it is but its a slideshow)
Posted By: Orange Brat

Re: Particle attractors, repellers, and keyframes. - 09/28/07 17:20

Quote:

well, you can of course add some code to your particles function make them move towards or away from attractors. its more a question of performance, since i think the particlesystem is not so fast.




I'm guessing you mean user created code and not a current feature of the engine. I'm not too sure how one would code (c-script) an attractor into a particle function, though. I'm more interested in the addition of the feature itself so neither myself or anyone else has to worry about creating the code (that's the whole point of what Conitec are ultimately trying to do with this application after all).

If possible, simply using the existing "effect" instruction would be ideal, although a new parameter would need to be added to it which tells the associated particle helper function to behave like one of these three types: Emitter, attractor, repeller.

Yeah, of course speeding up the particle system would be nice, too.
Posted By: Tobias

Re: Particle attractors, repellors, and keyframes. - 09/28/07 17:27

No I dont think I can agree here, it is no good to have an engine cluttered with lots of trivial functions that the user can easily program himself in 2 or 3 lines of code.

vec_diff(temp,target.x,p.x);
vec_normalize(temp,speed*time_step);
vec_add(p.x,temp);

there's your attractor.
Posted By: Orange Brat

Re: Particle attractors, repellors, and keyframes. - 09/28/07 17:43

That's a start. If I ever need the code, then there it is. However, I'm not sure how it would be considered clutter to have it featured in the engine. It would simply be another element of an existing feature. I only suggested the feature given it's part of what I consider Conitec's main competitor in regards to user friendliness. Right now, TV3D has the edge on the feature front, but A7 should close that gap soon enough. Many of the things that give it that edge are in development, so it's just a matter of time.

Most users probably couldn't easily program it themselves. I've been around for almost 10 years (fourth quarter 1999), and I wouldn't have known how to do that, and I've created plenty in my time. When you start getting into using lots of vector instructions this is where I and many others start scratching our heads. This is why an easy to understand feature would be beneficial.
Posted By: Matt_Aufderheide

Re: Particle attractors, repellers, and keyframes. - 09/30/07 11:14

Quote:

I'm more interested in the addition of the feature itself so neither myself or anyone else has to worry about creating the code




Such things are rarely used in my opinion.. i have never wanted a particle attractor before, but if I did i would code it...I don't think Conitec needs to add such little features every time someone requests something or another engine has it.
Posted By: broozar

Re: Particle attractors, repellers, and keyframes. - 09/30/07 13:12

never wanted to have smoke out of a chimney of a house that's blown away by wind?
Posted By: Orange Brat

Re: Particle attractors, repellers, and keyframes. - 09/30/07 16:51

It's quite evident that Conitec wants this engine to be user friendly via either use of their templates or easy to understand instructions. IMHO, perhaps the best solution to adding these features I've requested would be to modify the effect instruction. A new parameter that tells it to create either an emitter, attractor, or a repeller would need to be created. This would be as simple as typing a 0, 1, or a 2 at the end of the instruction. To avoid the annoyance of having to edit all of your existing effect instructions, if there is no new parameter present then it defaults to our standard emitter. That sounds easy enough to implement on paper, but actually doing it may be a different story. Anyway, I've just provided one possible solution/implementation, so there it is.

Quote:

Quote:

I'm more interested in the addition of the feature itself so neither myself or anyone else has to worry about creating the code




Such things are rarely used in my opinion.. i have never wanted a particle attractor before, but if I did i would code it...I don't think Conitec needs to add such little features every time someone requests something or another engine has it.




@Matt:

just because you might never want to do this doesn't mean we all are of the same mindset. And, I don't think you really know if this kind of thing is rarely used or not. I don't see any evidence to back it up. The very fact that another engine has such a feature is a very good reason to consider adding it. Of course, it depends on the engine in question and in this case it is TV3D 6.5. There are some of use that believe it is the #1 competitor to 3DGS, so I think, in this particular case, that borrowing ideas from it is a necessary step to make sure the two pieces of software are at least equal. Finally, Conitec should at least consider "little" features when they are requested. And yes it is a little feature but a very powerful one. It's the small things that make a difference. 3DGS is made up of a lot of small things requested by users, and I bet the small things are a greater portion of the engine than the bigger ones.




Anyway, I can think of more than a few reasons/situations for use of such a feature. Yes, coding it is an option if you are a competent programmer. I do have some skills in this area; however I am not as talented nor skilled as a lot of our professional programmers that frequent this forum. Quite simply, there are things I cannot code; thus I require help when those situations arise.

The whole point of having a built in feature like this that can be activated with a simple line of code or adding a single digit to an already existing instruction (see first paragraph above) is user friendliness. It's something that could benefit all of us, both hardcore programmer, someone like me, or better yet the noob who doesn't know a damn thing, yet but knows enough to add a 0, 1, or a 2 to the end of the effect instruction. What's better....coding it or flipping a pre-existing switch?
Posted By: Matt_Aufderheide

Re: Particle attractors, repellers, and keyframes. - 09/30/07 17:09

Quote:

never wanted to have smoke out of a chimney of a house that's blown away by wind?




I dont think you need anything special to do this..it can be done easily already.

OB: That last post was a bit rambling, but I agree that Conitec should consider adding useful and important features...but not just because another engine has it..
Posted By: Orange Brat

Re: Particle attractors, repellers, and keyframes. - 09/30/07 17:20

Yes, I tend to ramble, but that's how I write (I also ramble when I speak, but I'm a Southern boy...colorful stereotypical sayings and all just like in the movies and it's nothing like my writing style). I'm a writer after all. I want to provide a detailed view of what I'm trying to explain. That tends to bloat a post, but you're going to at least know where I'm coming from hopefully. I cannot stand internet shorthand, and typing complete sentences and paragraphs that hopefully make sense are what you're gonna get. With that said, if one is going to address every point from a post, then the reply is sometimes going to be long winded. It simply can't be helped.

Well, perhaps you're right that they shouldn't add a feature because another engine has it, but it seems to be that almost all of the newer features that have been added are because other engines have them. Is it not a good thing to add a feature that say comes from Unreal3 or whatever the new "big boy" engines happen to be? I believe if we see a feature that we don't have that's cool and....Heaven forbid....is next gen or even an old standard that should have been implemented long ago then Conitec should think about adding it. This same process can be extended to the "little boy" engines like TV3D, as well.
Posted By: TWO

Re: Particle attractors, repellers, and keyframes. - 09/30/07 20:20

This was created with AwakeParticles, which is part of the AwakeLib. I'll release it soon :-)


From right to left: Emitter with circle option; PlaneX emitter and 5 attractors, including a changebmp for the smoke; point emitter with a add_vel attractor on top; point emitter with shield attractor on top

Code:

AP_EmitterCreate( vector(120, 80, 0), AP_EmitterLifetimeInfinite, 20, TestParticleFireRed, AP_EmitterEmitTypeTube, 20, 200, 0, 0 );

AP_EmitterCreate( vector(80, 0, 0), AP_EmitterLifetimeInfinite, 2, TestParticleFireRed, AP_EmitterEmitTypePlaneX, 8, 8, 0, 0 );
AP_EmitterCreate( vector(80, 0, 0), AP_EmitterLifetimeInfinite, 1, TestParticleFireYellow, AP_EmitterEmitTypePlaneX, 8, 8, 0, 0 );

AP_EmitterCreate( vector(0, 0, 0), AP_EmitterLifetimeInfinite, 2, TestParticleFireRed, AP_EmitterEmitTypePoint, 0, 0, 0, 0 );
AP_EmitterCreate( vector(0, 0, 0), AP_EmitterLifetimeInfinite, 1, TestParticleFireYellow, AP_EmitterEmitTypePoint, 0, 0, 0, 0 );

AP_EmitterCreate( vector(-80, 0, 0), AP_EmitterLifetimeInfinite, 2, TestParticleFireRed, AP_EmitterEmitTypePoint, 0, 0, 0, 0 );
AP_EmitterCreate( vector(-80, 0, 0), AP_EmitterLifetimeInfinite, 1, TestParticleFireYellow, AP_EmitterEmitTypePoint, 0, 0, 0, 0 );


AP_AttractorCreate( vector(80, 0, 30), AP_AttractorRangeTypeDistance, vector(20, 0, 0), AP_AttractorEventTypeAddSize, 0, 0.8, 0, 0 );
AP_AttractorCreate( vector(80, 0, 50), AP_AttractorRangeTypeDistance, vector(20, 0, 0), AP_AttractorEventTypeWind, 1, 0, 0, 0 );
AP_AttractorCreate( vector(80, 0, 80), AP_AttractorRangeTypeDistance, vector(20, 0, 0), AP_AttractorEventTypeChangeBmap, AP_AttractorCreateEventBmap("AP_TestParticle3.tga"), 0, 0, 0 );
AP_AttractorCreate( vector(80, 0, 80), AP_AttractorRangeTypeDistance, vector(12, 0, 0), AP_AttractorEventTypeAddAlpha, 2, 0, 0, 0 );
AP_AttractorCreate( vector(80, 0, 80), AP_AttractorRangeTypeDistance, vector(20, 0, 0), AP_AttractorEventTypeAddSize, 0.1, 0.6, 0, 0 );
AP_AttractorCreate( vector(80, 0, 80), AP_AttractorRangeTypeDistance, vector(60, 0, 0), AP_AttractorEventTypeWind, 2, 0.5, 0, 0 );

AP_AttractorCreate( vector(0, 0, 40), AP_AttractorRangeTypeDistance, vector(20, 0, 0), AP_AttractorEventTypeAddVel, -1, 0, 0, 0 );

AP_AttractorCreate( vector(-80, 0, 50), AP_AttractorRangeTypeDistance, vector(20, 0, 0), AP_AttractorEventTypeShield, 20, 20, 0, 0 );


Posted By: HeelX

Re: Particle attractors, repellers, and keyframes. - 09/30/07 21:26

Very nice, thank you.

OrangeBrat:

Its funny how often you say "Conitec should..". Not because I don't agree with you, but how often you say this. I think Conitec should judge what to do next by themselves.

Particles are quiet fast. People arguing that drawing many many many particles at the same time is very fps consuming compared to other engines could be right, but most often people tend to overuse particles or dont know how to decrease particle's without decreasing the actual number of particles or bmap ressources to use them - by keeping up the quality on the same level.

The most common things which affect particles can be done with the current particle system. Things like wind or so are very simple: take a global vector which represents the wind direction and by it's length the strength. Each particle event function which should be affected by this calls a function with a particle parameter (PARTICLE* p) which modifies the particle's velocity parameters, etc. The same for much other things - the benefit you get from touching it by yourself is that you have 100% control over it.

Though, I can understand that an advanced particle system could help modeling better effects and a lot of people don't have the knowledge or the pleasure (like I have) to write it down.

Maybe Bloodline's plugin is able to help the few people which are _really_ in the need for such particle systems.

@Bloodline/TWO

Maybe you can shorten the function names and constants of that plugin. The lines are a bit too long for my taste for such simple instruction. Just as a hint.. I love short lines
Posted By: TWO

Re: Particle attractors, repellers, and keyframes. - 09/30/07 21:35

Hehe, it's part of a huge library with a strict notation. But maybe I can shorten the constants a bit, I'll try

BTW thanks Orange Brat, your idea inspired me to write the code.
Posted By: Orange Brat

Re: Particle attractors, repellers, and keyframes. - 09/30/07 21:39

@TWO: That looks promising. Thanks for posting.

@HeelX: My frequent use of "Conitec should.." should actually be interpreted as "Conitec should consider.." but I'm simply leaving out the "consider." This is what I've always meant when using that phrase. I'll try and remember this in the future. Regardless, Conitec should consider all ideas I throw their way because they're usually good ones.

It seems there have been a rash of users misinterpreting some of the things I say in posts here lately. I'm not sure why, but I'm guessing it's some kind of "lost in translation" type situation given most of those who are slapping me on the wrist are not native English speakers. Just remember that I always tell it like it is and don't care if the person on the receiving end (or the community) likes it or not.
Posted By: Matt_Coles

Re: Particle attractors, repellers, and keyframes. - 09/30/07 22:47

Nice job TWO
© 2024 lite-C Forums