nchamberlain13 Posted December 26, 2015 Share Posted December 26, 2015 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 Quote Link to comment Share on other sites More sharing options...
Atom Posted December 26, 2015 Share Posted December 26, 2015 (edited) You could create a series of curves that act as paths for particles to follow. Edited May 13, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
fathom Posted December 27, 2015 Share Posted December 27, 2015 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()". Quote Link to comment Share on other sites More sharing options...
pclaes Posted December 28, 2015 Share Posted December 28, 2015 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 1 Quote Link to comment Share on other sites More sharing options...
mestela Posted December 28, 2015 Share Posted December 28, 2015 Wouldn't this sort of stuff be built into the crowd solver already? Quote Link to comment Share on other sites More sharing options...
sohey Posted December 31, 2015 Share Posted December 31, 2015 (edited) 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 December 31, 2015 by sohey Quote Link to comment Share on other sites More sharing options...
nchamberlain13 Posted January 6, 2016 Author Share Posted January 6, 2016 (edited) 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 January 6, 2016 by nchamberlain13 Quote Link to comment Share on other sites More sharing options...
sohey Posted January 6, 2016 Share Posted January 6, 2016 Hi Nick, The attached file cannot be downloaded. Would you check the link? Quote Link to comment Share on other sites More sharing options...
nchamberlain13 Posted January 6, 2016 Author Share Posted January 6, 2016 Hi Nick, The attached file cannot be downloaded. Would you check the link? I updated the post so it should be working now. On the off chance it didn't I attached it here as well. Ant_Swarm_Test2.hiplc Quote Link to comment Share on other sites More sharing options...
sohey Posted January 6, 2016 Share Posted January 6, 2016 Hi Nick,What attached are a demo of my approach applying on your very first file: BugTest.hipncI 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 Quote Link to comment Share on other sites More sharing options...
nchamberlain13 Posted January 7, 2016 Author Share Posted January 7, 2016 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). Quote Link to comment Share on other sites More sharing options...
Farmfield Posted January 7, 2016 Share Posted January 7, 2016 (edited) @Sohey LOL, those files should have a warning label, the video clip was creepy as hell - nu pun intended. Awesome share, though. I'm off dissecting it now. Edited January 7, 2016 by Farmfield Quote Link to comment Share on other sites More sharing options...
sohey Posted January 8, 2016 Share Posted January 8, 2016 (edited) 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 January 9, 2016 by sohey Quote Link to comment Share on other sites More sharing options...
sohey Posted January 8, 2016 Share Posted January 8, 2016 (edited) @Sohey LOL, those files should have a warning label, the video clip was creepy as hell - nu pun intended. Awesome share, though. I'm off dissecting it now. @Johnny Haha, you should blame Nick, that's his idea Thanks, man. Edited January 8, 2016 by sohey Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.