Particle states

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Particle states

Post by Pancho » 10 Oct 2012, 17:03

So, first steps with particle animation.

Probably a simple thing, but too new for me to get it yet.

I want particles falling down from the emitter towards an collision object. If the particle collides I want it either to bounce off or stick to the surface. If the speed is too high it should bounce, if the speed is too low it should stick. I would like to make the state in a way "if" dependend. If collision "yes" and speed too high "yes" than bounce, else stick.

Later on I also need a collision test with sticking particle (if a falling one hits a sticky one) which kills one particle and increases the size/mass of the other one and an unstick test if the mass is getting higher than "something". Than the particle should slide off the surface or drop of the surface.

What's the proper way to do this? So far it doesn't work properly.

Cheers
Thomas
You do not have the required permissions to view the files attached to this post.

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Particle states

Post by gustavoeb » 10 Oct 2012, 18:19

Hi Pancho, you got the basic idea right, but there are some things you might be doing wrong... and they may even not be visible through your screencapture. First i must say I normally use the state machine embedded in the Simulation Root, so I hope I am not giving you bad tips here... Also I must ad I dont know the simptoms, or what is "not working properly" as you say. Here are some thoughts:
  • Are your particles being emmited at State0, and is the State where you have the triggers connected also State0? If not you are missing a simulate node for your particles
    I dont know if this happens only when one uses Simulation Root, but in theory you would have to add forces for each state...
    You might have your "StateIDs" and "switch to state" or whatever is it called set up incorrectly
Generally I would test for collisions slightly different. I would use the output in that test that saves the location of the collision, and then get at those locations the velocity of my particles... I dont know if it is only a matter of personal preference, but it works, and you can further extract data from that location. You can also use that location to set the sticky location when you enter State2, and then at each frame, you keep it stuck in there...
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 14:00

Re: Particle states

Post by TwinSnakes007 » 10 Oct 2012, 22:24

Tree looks good, but like Gusta said, you need something to simulate the particles, usually a SimluateParticles node as the last port in the ICE Tree.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 11 Oct 2012, 10:13

I managed to make the parcticles either jump or stick. I guess the usage of two collision test might have been the reason for it to not work properly.

But when I exchange the stick comound with the slide one, the particles just disappear instantly. No sliding, no color change. Just gone.

I want to use several states in my simulation. Falling, bouncing, sticking and sliding. THere should be a trigger for each state. Only the bounce state will directly jump back to the falling state.

Just wonder why the sliding doesn't work.

Cheers
You do not have the required permissions to view the files attached to this post.

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 11 Oct 2012, 12:21

Would love to upload the scene, but the 256kb limit is a bit of a problem ...

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 11 Oct 2012, 13:18

If I unplug the collision detection in State 0 and trigger the event manually particles will turn directly into state 2 (slide) as their speed is still not in the bounce threshold. THis way the particles slide turn directly into state 2 and slide upon collision.

My guess: The two collision detections (test collision as trigger in state 0 node and test collision inside the slide node) somehow don't work together.

Anybody an idea? Seems like the logic behind my set up doesn't work so nicely with the way the compounds do work.

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Particle states

Post by gustavoeb » 11 Oct 2012, 13:33

I guess uploads here are more for images... there is always dropbox.

it seems to work here. aparently it is important to give use a fairly big collision offset in the first collision test, that happends because internaly most surface interaction compounds (stick, bounce, slide, etc...) store the position in the frame that precedes the collision and have simulation nodes inside. Of course there are many ways to go around this in ice, BUT I guess increasing the offset is a very simple one, and it does the job.

https://dl.dropbox.com/u/39280733/pancho.scn

ps: I use filter instead of And because I want to garantee particles that are not colliding wont be tested for speed, as that is a computer intensive test (because it involves getting the square root of some value)
ps2: this settup of yours is quite nice, different then in the use of Simulation Root you can add global forces, I like it.
You do not have the required permissions to view the files attached to this post.
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 11 Oct 2012, 15:47

Thanks Gustavo!

Kind of works. The only problem (I can see right now : ) ) is that by using the enhanced collision radius, the particles get in the state of colliding while still being in the air. So far I used a "execute once on entering state" for reducing the speed. But the way you proposed the particles already slow down in mid-air. I managed to use the collision detection inside the bounce compound for this purpose, but isn't there anything like sub-steps to increase the precision of the simulation?

Couldn't find any infos about it. Only Lagoa and rigid bodies seem to use them.

User avatar
gustavoeb
Moderator
Posts: 587
Joined: 20 Jul 2010, 22:33
Skype: gustavoboehs

Re: Particle states

Post by gustavoeb » 11 Oct 2012, 17:06

honestly I dont see any slow down... another way to do this that MIGHT work is going inside the surface interaction compounds, see what data is stored at collision and do that yourself in State0, slightly more complicated
Gustavo Eggert Boehs
Blog: http://www.gustavoeb.com.br/

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 12 Oct 2012, 08:18

: )

There's no slowdown in your scene. But I put in a "get velocity", "multiply by scalar", "set velocity compound", which is supposed to "destroy" energie on every bounce (multiply by 0.5, e.g.)

If I use this compound in the "execute once on entering state" input of the state compound, than with the high collision offset you used, the particles will slow down before they visually hit the ground.

In case I want to use this node I need to use the "self.__hit" detection in the "bounce off" compound. Than it works.

That's the reason why I'm wondering if there's a way to increase the precision of the simulation by increasing substeps. I remember that in the beginning of ICE it wasn't possible, but in some version they added it. THat's what I believe. If so, I wonder where I could find these settings.

The only tips I found so far is to increase the framerate to 60 or 120 fps to get more precision and less particles which fall through the collision object.

One more thing. The two collision detections, "test collision" in the state 0 compound and the "test collision" in the bounce compound use the same variable (self.__hit).

In my mind I thought the first collision test would tell the bounce node just to bounce off. But the bounce node got its own collision detection. Is there a better way to change states, and this way the particle behaviour, than to use the collision detection (like Gustavo and I did)?

From what I can tell now it would make more sense to put the particles from the beginning into a sticky mode and just change the state into a bounce one if they start to hit a certain speed limit (faster than ...).

Cheers!

User avatar
TwinSnakes007
Posts: 316
Joined: 06 Jun 2011, 14:00

Re: Particle states

Post by TwinSnakes007 » 12 Oct 2012, 14:29

Pancho wrote:That's the reason why I'm wondering if there's a way to increase the precision of the simulation by increasing substeps. I remember that in the beginning of ICE it wasn't possible, but in some version they added it. THat's what I believe. If so, I wonder where I could find these settings.
They added subframe sampling in 2012, its only supported for simulated ICE Trees, and it only works with ICE simulations, no support for (rigid bodies, soft body, non-ICE Syflex cloth).

The setting is on the Simulation Settings property. This property is automatically added when you create a simulated ICE tree.

-TS-

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 12 Oct 2012, 18:06

One last thing for today. If I use a spawn on collision compound with the bounce compound it works fine. But I need to transfer the new born particles into the falling state. If I do so with the spawn node ( set state "fall" as the initial state) they won't bounce anymore, but will fall instanly through the collision mesh. What would be the proper way to do this.

Seems as if the bounce won't happen anymore, as the particles are already in "fall" state. Either there needs to be kind of a delay before they inherit the "fall" state or something else. I'm too new to particle sims as if I could know better.

Cheers and a nice friday evening!

Pancho
Posts: 659
Joined: 19 Sep 2010, 09:28

Re: Particle states

Post by Pancho » 12 Oct 2012, 18:15

TwinSnakes007 wrote:
Pancho wrote:That's the reason why I'm wondering if there's a way to increase the precision of the simulation by increasing substeps. I remember that in the beginning of ICE it wasn't possible, but in some version they added it. THat's what I believe. If so, I wonder where I could find these settings.
They added subframe sampling in 2012, its only supported for simulated ICE Trees, and it only works with ICE simulations, no support for (rigid bodies, soft body, non-ICE Syflex cloth).

The setting is on the Simulation Settings property. This property is automatically added when you create a simulated ICE tree.

-TS-
Thanks! I'll take a look at it tomorrow.