Jump to content
Symbolic

Swarm Like Behavior!

Recommended Posts

Hi,

After my posts:

"Reading The Velocity Of The Particles."

"Proper Orientation For Copying Something On A Pop System."

I have figured out an understanding of the particles and driving *.bgeo sequences.

All kind of information may be found under these posts. Thanks to all the odForce Community.

:)

Here is the result:

Bug on the wall.

The thing is that now I have to fiure out a proper POP behavior that will look like some flies on the wall. 20-30 fllies. They have to walk on the wall in various ways... like stopping, speeding up and slowing down at different times... and then finally all of them just fly away in different order.

Here is an example:

Swarm example.

I think (tried) that will be groups of different particles... being in posession of different forces... I have tried using DRAG pop, SPEED LIMIT pop in terms of getting different speeds... but it is not working properly.

Any suggestions, any ideas... Thanks!

Share this post


Link to post
Share on other sites

Hey Symbolic,

Check out my entry for the Houdini Hacker competition they had a little while back. It does swarming behaviour using copy-stamping and curves. Most importantly for your reference it also handles insects climbing over each other. I see a lot of that in your bee clip. You may pick up some ideas from this even though the approach is very different to yours.

The swarming behaviour is done in SOPs rather than POPs although POPs are used to calculate proximities of the insects (so they know when to climb). Bare in mind this method is hugely memory-inefficient beause of the copy-stamping but it was designed that way to work within of the constraints of the competition. As you could only use 42 nodes I was trying to get as much out of them as I could! It should be pretty straight forward to make it much more efficient. For example, reducing the number of body segments would reduce the copy stamping steps a great deal.

Everything is commented so should be fairly easy to work through. There are also a couple of important functions that are in the Settings --> Aliases and Varaibles --> Expressions pane.

Notice how the distance between points on the curves controls the speed at which the centipedes move. Putting several points in the same place would cause the insects to stand still. I used noise functions to generate random curves but you could draw them by hand to completely control when and where the insects move.

Hacker Contest Entries

Here's something else to think about. I replied to one of your other threads to give you an idea about blending the walking and flying cycles using an attribute so mark when the insects take off. Actually, you probably don't need one for this as you can simply blend in the flying animation as the insects leave the wall based on their position. Let's say you built your wall along the Z-axis then when the insects are on the wall their position in Z (e.g. $TZ) will be 0 or very close to it. As they take off their $TZ value will increase. You can then use this value to control the blend of the animation cycles. Let's say a value of $TZ=20 will be fully flying. Then your blend values will be something like:

walking: clamp($TZ,0,20)/20

flying: 1-(clamp($TZ,0,20)/20)

One nice thing about this is that it means the insects will start walking again if they land back on the wall. Obviously this only works as long as the insects don't start to fly back past the wall but it should be fairly wasy to account for that if that's what you want.

One more thing. The bees do a lot of shaking. You can add that in after your simulation through CHOPs for example. Don't try to do it in the actual simulation itself.

What's your school by the way?

john.

Share this post


Link to post
Share on other sites

Thanks! This is a great help. I will check all those tomorrow. Have to sleep for a while now.

I am doimg MA Digital Effects at NCCA (Bournemouth University).

Share this post


Link to post
Share on other sites
I am doimg MA Digital Effects at NCCA (Bournemouth University).

Yes, that's what I figured. That's where I did my FX degree a few years back. You'd be surprised how many Bournemouth people have made it out to LA.

Because the course is so short I found there's a dilema about whether to try lots of new things in order to learn as much software or techniques as possible or to pick a very narrow subject area that you can spend a lot of time on in order to get it looking really great. The former will help you in the industry in the long term but if you want to get good marks and have a good reel I recommend picking something relatively straight-forward that you can spend a lot of time revising to make it look fantastic.

Good luck

john.

Share this post


Link to post
Share on other sites

Wow! You are from NCCA! You really understand what I am going through right now. Thanks!

I have sent you a PM.

Share this post


Link to post
Share on other sites
Wow! You are from NCCA! You really understand what I am going through right now. Thanks!

I have sent you a PM.

Yep they push you pretty hard but that's a good thing, right? Say "hi" to Hubbard.

Share this post


Link to post
Share on other sites
Yep they push you pretty hard but that's a good thing, right? Say "hi" to Hubbard.

I will. :)

Share this post


Link to post
Share on other sites

Hi Everybody!

I have kind of finished the Swarm System... Not the best.. But kind of works...

Thanks to everybody that helped me...

One problem that I have is the *.bgeo reading expression... I get the $VX and $VY... and use this to read the combined SPEED of each particle... Then I use this data to adjust the playback speed of the *.bgeo sequence... So that fast moving bugs move fast and slow/stop bugs stop/go slow.

But the playback of the sequence... I do not know... looks bad... Skipping frames.

Could you please have a look at my file... and suggest me a solution to this problem.

Thanks.

The Houdini file:

on_the_wall_63X.hip

The PARTICLE sequence:

(This is an export of my POPs... just the points... and the attributes)

particles.rar

The BUG walk cycle:

legs_bgeo_seq.rar

Any ideas and help?

:(

Thanks.

Share this post


Link to post
Share on other sites

...by the way...

The particle simulation rendered to a *.bgeo sequence and included on this post as "particles.rar" and "particles.zip" is the ROP output of the fıles posted on "How To Group Procedurally?, How to cycle the group members randomly" post.

By posting just the output of the simulation, I tried to keep the things tidy... since I am working on another problem right now... which a proper and smooth BGEO playback...

Share this post


Link to post
Share on other sites

Hi!

grasshopper has suggested me to use the BlendSequence SOP... I did use it... The result is much much better in terms of smooth playback... But I really could not create that expression properly...

The cycle is not playing correct. I need every frame from 1-45... but at different speeds... The system somehow jumps among different frames...

I do not know why!?

Help!

the Houdini file:

on_the_wall_76XX_prez.hip

the *.BGEO sequence of the walker:

legs.zip

the particle simulation neede to run the system:

sim2.zip

Share this post


Link to post
Share on other sites
:(

Here's some quick hints. I did take a look at your hip and I don't think using the expression like you do is going to work. This is mainly because your expression is based on $F. It should be based on the fly's position within the walk cycle which will be unique for each fly as they are walking at different speeds.

I'm thinking you'll be needing to keep track of speed and/or distance travelled over the previous frame and also where the fly was on the walk cycle in the previous frame. You can use these values to calculate where the fly has got to in the walk cycle on the current frame. One way to do this is to use a Cache SOP to hold the last frame so that you can compare values to derive your calculation. Another option is to investigate using CHOPs. You'll need to have an attribute that stores the walk cycle position for each fly. Obviously this needs to cycle if it gets over 45.

Think about three files. One is walking at the the 'normal' speed you have for your walk cycle. So when walking at normal speed a fly will complete the 45-frame walk cycle every 45 frames. If you have a slow fly that is walking at half the speed of the 'normal' fly it will take 90 frames to complete the walk cycle. You will have to interpolate the inbetween frames to fill in the gaps. It sounds like you have this working using blendshapes. A fly walking twice as fast as the normal fly will complete the walk cycle in 22.5 frames and then cycle to start the sequence again.

So if your fly was on walkcycle frame 10 on the previous frame and is walking at double speed you'll need walkcycle frame 12 on the current frame. If he's walking at half speed you'll need to interpolate walkcycle frame 10.5.

Hope that gives you something to work on

john.

Share this post


Link to post
Share on other sites

...thanks :)

I will have a look at your solution... and try to figure out how it may be executed.

Thanks for your help again. This started to become a very complicated thing... But it will be finished as soon as I get this solved...

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

×