Jump to content
Sign in to follow this  

Crowd simulation Velocity

Recommended Posts


I've been trying a couple different methods of introducing a start/stop dynamic to a crowd simulation.

In the case of a simple walk cycle I want to be able to make the agent come to a full stop (Freezing at its current cycle time), and then after a certain amount of time return to its cycle.  I was hoping to avoid using a transition network and zones in favor of a more procedural and random start/stop time by directly controlling the velocity.

I'm currently setting my clip to use 'in place' as I believe this gives you more control over the velocity instead of 'locomotive'?

I was checking out a couple tutorials that set the velocity to 0 in a popwrangle, but have been running into issues getting it to actually work - it seems like the crowd simulation ignores when I override the velocities to 0?

v@v = (0,0,0);

Will this method or something similar to it work?

Share this post

Link to post
Share on other sites
Posted (edited)

I think you have to turn off Limit Particle Speed to Gait Speed Range as well, if you want to manually manage velocity. That is located on the Crowd State node.

Edited by Atom

Share this post

Link to post
Share on other sites

Thanks Atom, I ended up messing around with and without that setting

seems like if I disable 'Limit Particle Speed to Gait Speed Range'  the agents all will start at their initial velocity from the crowd source, and then slowly reduce to zero.  Was also finding that if I added in obstacles and wanders that the agents would suddenly go to warp speed because there was nothing constraining their velocity.

so for my best results have come from re-enabling the limit particle speed checkbox, and setting the allowed variance on the gait speed to 110%.  Then I'm running some really rough vex in a popwrangle to try and freeze/unfreeze over time which is getting some ok results.  

f@freeze = abs( sin(0.5 * @Frame * rand(@ptnum) ) );

if(@freeze < 0.5){
	v@v = v@v * @freeze;
    i@froze += 1; 


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this