Multiple Goals - Randomly Selecting Particles

Discussions about SOFTIMAGEs© Interactive Creative Environment©
burg
Posts: 11
Joined: 09 Jun 2009, 19:08

Multiple Goals - Randomly Selecting Particles

Post by burg » 11 Jun 2009, 10:56

Hi All,

I'm working on a project with a set of 50 balls (particles) and a grid of about 16 goals. I wonder if anyone can help me figure out a way to randomly choose 16 of those 50 particles and tell them to move to their nearest goal (with no conflicts). I'm using RBD as the balls need to collide with each other and a drum surrounding it, kinda like a lottery ball system. Then I need to blow the balls up with a wind force and the random choosing(of the 50) starts again. Attached is the ICE tree I have at the moment. I've got 3 states. 0 being the initialised state, 1 being activated when close enough to a goal to activate the "move to goal" compound and the 3 is just to tell me that it's at the goal (another proximity test but much closer).

The problem I'm having is at the moment I'm relying proximity of the Particles to the goal to get me a selection, which means I may get more than one particle going to the same goal so they don't sit in a nice tidy grid. Also the particles don't go to the centre of the goal just the closest part of its geometry, I thought I might be able to provide a 3D vector array of all the global centres of the Goal cubes into the Set Particle Goal node, but it doesn't accept that data type. So I'm just using a group with the geometry option instead which isn't ideal. Can anyone think of another approach to this, or a tweak to what I'm doing now?

Thanks so much

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

User avatar
origin
Posts: 619
Joined: 09 Jun 2009, 09:59
Location: warsaw

Re: Multiple Goals - Randomly Selecting Particles

Post by origin » 13 Jun 2009, 19:12

Is this what you are looking for ?
Ive attached a scene, It RBD+ 3 goal and 3 specific particles move towards each specific goal
You do not have the required permissions to view the files attached to this post.

burg
Posts: 11
Joined: 09 Jun 2009, 19:08

Re: Multiple Goals - Randomly Selecting Particles

Post by burg » 14 Jun 2009, 08:55

You Sir are a genius!

Thank you so much.

Can you tell me how this is working? You've altered the move towards goal compound right? What have you done?

Thanks again!

User avatar
origin
Posts: 619
Joined: 09 Jun 2009, 09:59
Location: warsaw

Re: Multiple Goals - Randomly Selecting Particles

Post by origin » 14 Jun 2009, 09:10

hey see attached scene,
I just took Move Towards Goal Location compound from Move Towards Goal compound (because MTG sets a goal everytime)

Basically everything is on the screenshot - one particle is FILTERED OUT and is given a new goal position and a custom variable this_particle_is_moving=true.

And In main tree only particles with this custom variable are moved with MTGL compound.

Im not ICE guru so this could be probably done better

burg
Posts: 11
Joined: 09 Jun 2009, 19:08

Re: Multiple Goals - Randomly Selecting Particles

Post by burg » 14 Jun 2009, 11:38

Brilliant! So would there be a way of randomly picking which particles get this variable and change this to other particles at different times? Could this be done via states?

burg
Posts: 11
Joined: 09 Jun 2009, 19:08

Re: Multiple Goals - Randomly Selecting Particles

Post by burg » 15 Jun 2009, 10:58

OK have had a look at this scene and I think i'm getting this now. I'm having a slight problem with you scene tat i can't seem to work out. If I disconnect two of the three of your custom move_selected_particle compounds but still am having three particles moving towards the one goal. What I can't work out is why is it 3 particles rather than one particle that is moving towards the goal?


Thanks

Bry

bkfichter
Posts: 3
Joined: 29 Jun 2009, 16:50

Re: Multiple Goals - Randomly Selecting Particles

Post by bkfichter » 29 Jun 2009, 16:57

burg wrote:Brilliant! So would there be a way of randomly picking which particles get this variable and change this to other particles at different times? Could this be done via states?
You could add a custom parameter (self.whatever) and then assign a randomly selected Boolean (0 or 1) to that parameter. Then test for 1 before processing anything that you want to be processed for these particles.