Jump to content
Sign in to follow this  

CROWDS : Walking over other agents / Constraint Network

Recommended Posts


Some R&D about the Crowd system.

Ultimately, I want to recreate a shot from World War Z (more or less a zombie pyramid, where they are crawling over each others, but "realistically", without too much interpenetration).

For the time being I am testing a much more simpler setup to allow agents walking over other agents, using regular nodes and limited code.

In this scene I try to recreate the AdaptGround Behavior of Golaem crowd system (http://golaem.com/content/doc/golaem-crowd-documentation/adaptground-behavior) : my "troops" agents can walk on dead / ragdoll agents.

For the time being, the dead agents are only taken into account for terrain projection, not yet terrain adaptation / foot planting.

If anyone has ideas about that - foot planting and particularly floot planting on uneven ground - , I would be happy to learn or explore these directions ! :-)

I have opened the agent_util.h, terrain_adaptation.h, terrain_projection.h ... VEX code used by the crowd system, but foot planting remains complex and doesn't seem to be easily hacked... (by the way, I have used some code coming from there for this setup)



- In DOP, I duplicate the ground with a poly version of it (convert heightfield to poly) : this is an object that I call "offsetTerrain"

- In DOP, I duplicate the crowd geometry and keep only the dead agents : inside the crowd object (allow editing of content) I add a fetch data and duplicate Geometry into standGuyGeometry. Then with a SOP Solver, I delete all the agents except the dead ones (that happens to be ragdolls, but would work with any other agents).

- I use the DOP data "offsetGeometry" of the object "offsetTerrain" in a Geometry Wrangle to create an attribute (@offsetDead) on each point of the farthest distance of intersection with the standGuyGeometry.

- Using another SOPSolver, I blur the @offsetDead attribute created above, to smooth the trajectory of my future agents when stepping on the dead agents.

- In the stream of the crows state of the walking agents, I add a POP Wrangle to sample the "offsetTerrain" geometry (2nd input of the POPWrangle), and get the attribute created previously (@offsetDead)

- In the agenTerrainProjection1 node, I go inside and change the VEX code of the POPWrangle : I change parms.offset = chf("../offset"); with : parms.offset = f@offsetDead; Therefore, each agent has its own offset and virtually walk over the dead.


Edited by StepbyStepVFX

Share this post

Link to post
Share on other sites

To continue posting my experiments on crowds, on the same page, an example file about ragdolls and constraints.

Can a ragdoll realistically climb a wall, providing some animated constraints ? Nope, but fun to watch...


Share this post

Link to post
Share on other sites

Good evening,

Following my studies on crowds systems, and a question from @jackassol about sticking ragdolls to colliders, I have tried to create constraints on the fly during the simulation, using Impact data.

My first attempt being a quasi-failure (see attached testRagdollDynCon_v1.hip), I have tried with a simpler setup : a sphere rolling over cubes, and when hitting cubes, creating constraints on the impact data.

You can see my test file attached as well : dynConTest.hip

This, again, being not satisfaying, I have tried with a much more simpler setup : 2 cubes sliding on a plane and "joining" where impact occurs. AND IT WORKS !! (see file dynConTest_basics_v2.hip)

Now, I really have a hard time figuring out why my setup dynConTest_basics doesn't work... I am afraid this comes from bad matrix inversion / rounding errors (I use an inversed fullpackedtransform to bring the impact position back to the "initial object space" of the sphere). Does anyone have any idea on where the problem is ?

Thanks for your help !




Edited by StepbyStepVFX

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