An Army of Ants

An Army of Ants
In this tutorial we are going to use particle flow to create a bunch of ants. Since this is a tutorial on a particle effect I will
not spend time showing you how to model and animate an ant, but instead we will use small spheres to stand in for the
ant. Later once you've animated your own ants you can simply change out the Shape operator for the Shape Instance.
We will start with a simple file I have created that you can download here:
http://animation.diclementi.com/tutorials/ants_start.max
Inside you will find a sphere named "emitter_sphere", a camera, a simple model of an ant hill and a plane for the ground
surface.
This way we can focus on the particle effect and not the creation of such a simple scene.
Go ahead and open up Particle View by hitting 6 on your keyboard, or by going to the Graph Editors menu at the top of
3DS Max.
Drag and Drop an Empty flow operator from the list at the bottom of your particle view window, into the empty light
grey stage area.
Be sure to click on the PF Source 001 header,
and change the viewport % value to 100%.
1
Next, we will drag and drop a Birth operator to the empty light grey stage area underneath our first box and connect the
blue node to the empty circular node connecting the two boxes together.
Then select the birth operator and adjust the settings in the command panel to the right. I have left the emitter start at 0
and stop at 30, change these numbers based on when you want your ants to appear and when you want them to stop
spewing forth from the ant hill. I have also given myself 1000 particles in the amount to start with, we can always raise
this later.
Now drag out a Position Object operator, and drop it in between the Birth operator and the Display 001 operator in our
Event 001 box.
Once you have added it, select it and use the By List button under the Emitter Objects settings in the command panel.
Find the "emitter_sphere" in the list and add it to the Emitter Objects.
This will make our particles spawn from the small sphere deep inside the ant hill.
2
Now drag and drop a Speed by Surface operator from the list right underneath the Position Object.
Set the speed to something very slow, I have chosen 10 with a variation of 6. Ants don't move all that quickly, but you
can adjust this to speed them up or slow them down to your liking.
Then click on the By List button under Surface Geometry, and add the "emitter_sphere" in here as well. Scrubbing back
and forth along your timeline will now show you a bunch of tick marks emitting outwards from all over the sphere.
Ants tend to move a little more erratic than this, so we are going to add a Wind to our scene next. Minimize Particle
View for now and go to your Create tab in the regular 3DS Max screen. Then over to the space warps button.
Click Wind to activate it and then in your top viewport draw out an icon. Does not
matter what size the icon is, just so long as the arrow is pointing up. This will happen
automatically when drawn in the top viewport.
3
Make the strength 0.0, all we want this wind for is the turbulence settings to make
our ants move about more chaotic.
Play with these settings to your liking, I have chosen a low Turbulence of 0.15, a
Frequency of 1.0, and a Scale of 0.15 just to give them a little more erratic
movement than straight ahead.
Now open up Particle View again (6) and drag and drop a Force operator underneath our Speed by Surface. Then click
the By List button in the settings and add our wind to the particle system.
Your particles should move a bit more crazily now.
4
Next we need to use an operator to nail them down to the ground. We aren't making flying ants this time, perhaps
another tutorial. Drag and Drop a Lock/Bond operator to our Event box under the Force.
Click the By List button and add the Ant Hill.
Check the Lock To Surface radial button, and the
box next to Snap to Surface.
Check the Restrict to Surface box as well.
Reduce the Force% to 0.0 to let our particles
move about freely still.
Same thing down here as well.
Your particles should now scurry out of the ant hill in all directions but they should remain firmly planted on the ground.
We can technically call this effect complete as of now, but let's continue on and see what else we can get going.
5
Add a shape operator to the Event 001 box and select the 20 Sided Sphere shape, then give it a size of 2.0
We will make due with spheres for now, but in the future you can model and animate your own ant walkcycle and
simply use a Shape Instance here instead of a regular Shape.
Next we can stretch our ants out a little more so they look less like dots and more like longer bodied critters. Add a Scale
to the Event 001 box under the Shape.
Uncheck the Constrain Proportions box under the Scale Factor settings, then give the spheres a new scale of 250% in the
X axis, and reduce the othe two to 75%.
This will stretch them out, but now they don't look like they are traveling in the right direction. We will fix this by adding
a Rotation next under our Scale.
Set the dropdown setting to Speed Space Follow.
Now your ants will point in whatever direction they are
moving.
6
Now our Ants have bodies, so ... again we can call this effect finished. Or we can take it further still .... We can make it so
once the Ants have left the Ant Hill, they discover something tasty and all rush to find it.
We will do this by adding an Age Test below our Rotation.
Set the Test Value to 150, give or take 15 frames. This means that once a particle is 150 frames (give or take 15) they will
move on to a new event.
The test operators like this one come equipped with another little blue node hanging off the side of it that we can
connect to a new event.
So we need to make a new event, drag and drop a Find Target operator from the depot and place it in the empty grey
stage area below our Event 001 box.
Then connect the new blue node to the new empty circle node in Event 002.
7
Select the new Find Target operator and adjust its settings in the command panel to the right.
It should default the top dropdown menu to Control by Speed which is what we want.
Then go down further and set the speed your ants will travel towards the new icon in our scene at. I have chosen a
speed of 50.0 with a 24.0 Variation. ... give them a little get up and get to the food.
Make sure to reduce the Accel Limit: to 100... rather than 1000 which is its default, and raise the Ease In% to 100 so they
slow to a stop rather than stop on a dime.
The Target should have Icon defaulted, but know that you can set this to be any object in your scene by selecting Mesh
Objects here. .. Anyone feel like modeling a tasty cheese puff? or a donut? or a dead grasshopper? Mmm mmm good.
Then minimize your Particle view again, and find the new Find Target icon in your scene that it created for you. It is
probably in the middle of your ant hill, so selecting by name is advised.
8
Then just move it to the right of the ant hill a bit, or wherever you want your ants to head to.
At age 150 frames your ants will suddenly fly off the ant hill and float gently towards the Icon. In order to keep them
attached to the ground and pointed in the right direction, all we have to do is Move our "Lock/Bond" operator, and the
"Rotation" operator from the Event 001 box, to the PF Source 001 box at the very top.
By placing these two in the very top Box in our flow chart, they will carry their settings all the way through the entire
particle system. I would probably place my Material operator up here as well for similar reasons.
9
That's it, Ant colony simulation at its easiest! Play around with these settings as well as create an actual moving ant, or a
bit of food for them to chase.
Fun stuff right? Hope you enjoyed it!
See a preview animation of a similar effect to this one here:
http://animation.diclementi.com/ants.mov
Just don't ask me why I decided to sink a donut halfway into concrete...
10