Jump to content

spawning agents at different time instances?


Recommended Posts

Hi,

In crowd simulation, I want to be able to emit agents from a hidden spot gradually, let's say ants coming out of a hole in a wall, so that they come out gradually, e.g. 10 agents come out then after couple seconds another group of agents come out. I've tried to change the Birth->Impulse Activation in POP source but that did not work - basically all subsequent agents did not stick to terrain and started wandering in 3D space. I guess the other option is to emit ALL at once and start moving them out of that hole gradually (maybe each t second, just transit to "crawl" state).

 

Is there any other way or better way to do that? 

Thanks,

Edited by catchyid
Link to comment
Share on other sites

By default Impulse Activation in the PopSource of the CrowdSim is set to $FF==1 which results in agents being emitted into the scene only on frame 1.

You can use a modulus expression on the Impulse Activation to make the agents appear every so many frames. The number of agents that will appear will be the number of agents specified in the CrowdSource node.

if($F % 24,0,1)
Edited by Atom
  • Like 1
Link to comment
Share on other sites

Thanks Atom :)

I've tested your idea, i.e. emit every so many frames, but for some unknown reasons the agents don't follow the terrain correctly when I do that! In my crowdsolver, I (1) check Terrain-->Enable Terrain Project, and (2) set SOP path to my terrain, SO when I have one emission, i.e. $F==1, then agents stick and modify their up vector to follow the terrain, HOWEVER, when I have multiple emissions, i.e. if ($F %24, 0, 1), then agents penetrate the terrain and their up vectors won't be aligned with Terrain normals...Just to let you know, the terrain is just a grid + mountain, and I change the mountain height with time, e.g. sin($FF)*5

It might be a bug, or maybe I am doing something wrong! Anyways, I don't think it's a show stopper, I will just emit all agents at once then switch them from "idle" to "move" state gradually...

Also, THANKS for pointing to me Sohey's file, I am still learning Houdini and it looks like a good example to learn from :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...