Jump to content

Bug Swarm Questions - Collisions and Climbing up Tree/Table/etc.


nchamberlain13

Recommended Posts

Hey all,

I'm trying to create a large swarm of beetles that would climb around on all sorts of surfaces.

So far I have been emitting particles and raying them down onto a surface, then copying the bug geometry 

(currently just temped in).

I've been fairly happy with the results I have gotten, but I was wondering if there is a better way to do this?

Currently the bugs intersect each other's geometry and with this technique I'm not sure if there is a way to have them climb objects (a table for example). Is there a better setup that I could be using?

 

BugTest.hipnc

Link to comment
Share on other sites

if you're handy with code, i'd opt for a vex-based approach using a solver sop wrapped around a point wrangle.

 

you'd basically end up programming a simple ai for each beetle.  you'd feed it your collision geo and then each beetle would step forward (P=P+v*TimeInc) and adjust it's velocity based on the collision geo and other beetles.

 

testing collision geo is a simple "intersect()" call or even "xyzdist()" depending on how you work it out.  you can check collisions against other beetles with a point-cloud search using "pcopen()".

Link to comment
Share on other sites

Sop solving over points and giving each point a bit of AI is definitely the way to go. I highly recommend this book:
http://www.amazon.com/Programming-Example-Wordware-Developers-Library/dp/1556220782/ref=sr_1_1?s=books&ie=UTF8&qid=1451333750&sr=1-1&keywords=ai+games

 

In regards to the collisions, I recommend using an sdf lookup approach especially if your collision geometry is static. As that is only baked once and the lookup is in vops and is much faster.

 

For Ant Man I built an extensive ai-swarm and agent locomotion system. I will probably do a customer story with Sidefx on that now the movie is out on Bluray. You can see a little bit of the ants in the tunnels here:
http://www.methodstudios.com/work/ant-man

  • Thanks 1
Link to comment
Share on other sites

Houdini provides several "POP Steer" pops that can achieve many behaviors of a swarm.
And with the help of volumesample and volumegradient, the crawling simulation can be done too.
What follows is a swarm test I made using what mentioned above:

 

swarm.mov

Edited by sohey
Link to comment
Share on other sites

Thank you for all the advice!

 

I'm still a newbie when it comes to VEX and so I thought I would try the crowd sim approach (I'm not sure I could get the volume of bugs I wanted with Guillaurme's technique. They roam across the land fairly well, but they are not climbing up the tree trunk properly and I'm not quite sure why.

The main thing I think I need to figure out is slowing them down as they ascend the tree trunk and orienting them properly. I'm unsure what variable the crowd sim uses for orientation.

 

Could anyone maybe help me out with this, or if I am at a dead end perhaps clarify a little more how I would go about using a SOP solver + a point wrangle to for the swarm?

Thanks in advance!

Ant_Swarm_Test2.hiplc

Edited by nchamberlain13
Link to comment
Share on other sites

Hi Nick,

What attached are a demo of my approach applying on your very first file: BugTest.hipnc
I add a couple of tubes to allow the bugs to climb onto.

On top of your popnet setups, I added some "popsteer" and "wrangle" pops.
In my opinion, the entire Houdini Crowd System is too big for this kind of simulation.
Some basic crowd behaviors like seeking, seperating and wandering are enough,
and can be easily added to your existing particle system.

Hope this helps.

 

swarmTest_sohey.mov

BugTest_sohey.hipnc

Link to comment
Share on other sites

Hi Nick,

What attached are a demo of my approach applying on your very first file: BugTest.hipnc

I add a couple of tubes to allow the bugs to climb onto.

On top of your popnet setups, I added some "popsteer" and "wrangle" pops.

In my opinion, the entire Houdini Crowd System is too big for this kind of simulation.

Some basic crowd behaviors like seeking, seperating and wandering are enough,

and can be easily added to your existing particle system.

Hope this helps.

 

 

That was so helpful! Thank you so much!

I have sort of an abstract question that may be stupid but I'll ask anyway. When simulating the particles, does the popwrangle update the particles based on the prior adjusted position or based on their position if the wrangle wasn't there (I suppose similarly to a ray sop with 0, -1, 0 rays)?

I'm not sure I'm being clear so I attached a picture (where the particle moves -1 per frame).

 

post-14378-0-06814800-1452193381_thumb.p

Link to comment
Share on other sites

That was so helpful! Thank you so much!

I have sort of an abstract question that may be stupid but I'll ask anyway. When simulating the particles, does the popwrangle update the particles based on the prior adjusted position or based on their position if the wrangle wasn't there (I suppose similarly to a ray sop with 0, -1, 0 rays)?

I'm not sure I'm being clear so I attached a picture (where the particle moves -1 per frame).

 

Hey Nick, you're welcome.

Well, what this popwrangle does is quite different from ray sop's approach.

This popwrangle updates a particle's position in real time.

 

It retrieves current velocity(@v) of a particle and the normal of the surface( vector "grd" in code).
With @v and "grd", we can get a vector that goes along the surface ( vector "dir" in code).
Updating a particle's velocity according to "dir" (and making some adjustments), the bugs will have  "crawling-like" behaviors.

 

How to get "grd"?

 

I convert the model which bugs would climb onto to a VDB.
With volumegradient(), a normal on the model (which is the closest one to that particle) is retrieved.
It's actually called gradient, but you can ignore that for now.
By the way, since I use VDB, any shapes that can be converted to a VDB (for instance tables, trees, cups) will work.

 

How to get "dir"?

 

It's the double "cross" thing.
You can google "cross", it's vector math stuff.

Simply put: by using "perpendicularity" to find the right vector.

 

Hope that's clear.

 

Sohey

Edited by sohey
Link to comment
Share on other sites

 

@Sohey

 

LOL, those files should have a warning label, the video clip was creepy as hell - nu pun intended.  :blink:

 

Awesome share, though. I'm off dissecting it now. :D

 

@Johnny

 

Haha, you should blame Nick, that's his idea :)

 

Thanks, man.

Edited by sohey
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...