T-Mobile "Goal" VFX Breakdown by eightvfx

Already missing world cup? We have something for you today.

Have a look at this cool vfx breakdown of the T-Mobile "Goal" commercial made by eightvfx using Golaem Crowd

The eightvfx team designed their own character and motion library together with some flags simulations and used Golaem Crowd to populate the stadium with up to 70 000 characters! This huge crowd has then been rendered using V-Ray and the Golaem Crowd procedural rendering plugin.

Have a look at the finished video, including a performance from Shakira

Rendering Golaem crowds with Arnold and Softimage (preview)

As you already know, Golaem Crowd is a Maya plugin, however we are often asked how one coud use it to create crowds and render them his favorite 3D package. 

Until now some of our customers have used one or another of the following solutions:

  • FBX: export the Maya simulation into a baked fbx geometry or animation
    enables you to reload your characters in any compatible software. However, as you may know FBX is quite memory and time consuming, so it may not be suitable for a really huge crowd.
  • Render using command line: export renderer specific files from Maya (.rib, .vrscene, .mi, .ass...)
    enables you to mix your crowds with your environment exported from another software, just before rendering (see Command Line Rendering for more information)
  • Render crowds directly with your renderer in Maya
    requires to use Nuke or some compositing software to combine crowds rendered within Maya and environment rendered with another software.
Today we present a new method to render Golaem Crowd simulations with Arnold + sitoa in Softimage. The really big advantage of this method is that it uses the procedural rendering (saving a lot of space and enabling to customize shading after simulation) and enables to customize shading directly in Softimage.


Export Simulation From Maya

Create your crowd simulation using  Golaem Crowd in Maya. In addition to exporting the simulation cache, you need to enable .ass export as well.

Create an Arnold Standin in Softimage

An Arnold Standin is a proxy object that references an ass file to be loaded at render time.

It can be created on top of any shape in your Softimage scene (e.g. a polygon cube) by adding the Arnold Standin Property (Get / Property / Arnold / Standin).

In the created Standin, browse to the ass file sequence exported from Maya. The name of the ass file is automatically filled in using the [frame] token. As Golaem Crowd uses a special frame padding in order to accommodate for Motion Blur, it is needed to create an expression and override the current frame with its result thanks to the options offered by the Arnold Stand-in (see below image)

Go to the render options and fill the path for procedural and shaders in the Arnold render options. You should fill it in with respectively the /shaders and /procedurals path of your Golaem Crowd installation as well as the binaries directory of your sitoa installation (something like C:\Users\apillon\Autodesk\Softimage_2014_SP2\Addons\SItoA\
Application\Plugins\bin\nt-x86-64 )

At this point Arnold is already able to render your crowd geometries, however you need to create shaders corresponding to the ones used in your crowd, otherwise nothing will get rendered and Softimage will eventually crash.

Create Shaders For Your Crowds

The first step is to create shaders which names match all shaders defined in the Golaem Crowd .cam file and assign them to an active (not hidden, but possibily out of the camera view) geometry. It can be done manually but the faster method is to import the .fbx character exported by the Golaem Crowd Character Maker (or provided with the Golaem Crowd Character Pack).

WARNING: At this point, it is currently needed to export the softimage scene as a .ass file and open it to check the name of the shading groups. It looks like Sources.Materials.DefaultLib.MAN_MD_legs_shoes_sport_blinn
.Phong.SItoA.5000.31.sta_shading_group. This name changes depending on the frame and each time a shader is added/removed to the Softimage scene. When it changes, the shader name referenced in the Golaem Crowd .cam file should be updated to match it. We plan to remove this (big!) limitation soon by automating the matching process at render time.

Render. You should get a nice crowd, but all characters look the same. They all wear either red sweatshirt or red tshirt because we did not introduced shading diversity yet.

Adding visual diversity

When rendering crowds with Golaem Crowd in Maya, it is possible to use the generated User Data to create visual diversity.

E.g. when using the Golaem Crowd Character Pack, Golaem Crowd will generate a random shader index for tshirts. It is possible to read this value directly in the Render Tree using an Integer_Attribute shader. Its Attribute value should be set via the Script Editor to the user data name defined in the Golaem Crowd Asset Manager.

See Sitoa documentation for details about Arnold User Options, and Golaem Crowd Shader Attributes to know how to generate them.

This attribute shader can then be linked to any Softimage node in order to create diversity. In the following example we linked it to a ColorMultiSwitch. This switch takes several shaders as input and select one per character based on the Integer_Attribute value.

After doing the same kind of setup for t-shirts, pants and hairs, we get a visually diverse crowd as when rendering directly within Maya:


Crowd & Cloth Simulation using nCloth

When characters get bigger on screen, dressing them with dynamic clothes can really help to sell the simulation. Even if Golaem Crowd doesn't provide (yet) a native way to simulate clothes, it offers several alternatives to make it work with your favorite third party dynamics engine. This today post will focus on using Maya's nCloth system coupled with a Constraint behavior.

Character Setup

Obviously, the first step consists of creating the cloth geometry and possibly some collider geometry. Just load your character in Maya and override it with some geometry. In my example as I'd like to simulate a skirt, I created two approximations meshes for the thighs (leftLeg0 and rightLeg0) which I converted into passive colliders (1) as well as a skirt mesh (skirt0) converted into a nCloth (2):

As the nCloth will be attracted by the gravity, it's required to attach it to an object or a piece of geometry. In my example, I'll simply create a locator next to the character root bone and constrain the top vertices of the skirt to it using a nConstraint:

At this point, you should be able to play the sim in Maya and see the skirt taking a nice cloth shape:

Simulation Setup

Now it's time to take those extra meshes to the simulation. First, create a Crowd Entity of the same type than the character you used in the previous step. In the Entity is created as the scene origin that'll look ok but, as soon as the character moves, the meshes do not follow:

To attach an object to any Entity bone, Golaem Crowd provides a Constraint behavior. This behavior requires the name of the object to constrain, the id of the bone to follow and an optional offset. As any other behavior the Constraint behavior can be triggered to start or stop the constraint. Here's the configuration for the constraint of the locator holding the skirt mesh:

 Let's just add in parallel four Constraint behaviors to constrain the skirt locator, the skirt mesh, the left thigh and the right thigh meshes in the Behavior Editor:

And look at the resulting simulation:

The nConstraint locator is following correctly the character root as well as the thigh meshes nColliders. On the other hand, the nCloth simulation does not look that good. This is due to the fact that, by default, the Golaem Crowd simulation is updated only once per frame: this means the nColliders move too fast and the nCloth simulation can not react correctly to collisions.

To avoid such a behavior, you can increase the Golaem Crowd simulation substeps parameter in the Crowd Manager node. Here's the result with a substep step at 4:

Better isn't it?


At this point, as you may have guessed, each constrained mesh should be duplicated as many times as there are Crowd Entities in the scene and named accordingly (skirt1 for Crowd Entity 1...). This step can be easily achieved thanks to a piece of Mel of Python script.

The attached script only duplicates X times a source object (Ctrl+D in Maya) and postfix their names with the id of the corresponding particle. For nCloth duplication (and other specific objects), this script can be changed to duplicate some input nodes and connections. It's up to you to decide what and how :)

Filling a Stadium with Golaem Crowd: Flags

Today we are going to add some flags to our stadium supporters, like Mikros Image did in the Orange 4G commercial below.

This is done using the Geometry Behavior.

Adding the flag in the Geometry File (.fbx)

 - create a flag, and parent it (with its pole) to the hand bone.

Creating and baking the nCloth simulation

- Create a ncloth simulation on the flag (but do not forget to create a box and not a plane if you are not using Arnold)
- To be able to save the nCloth simulation in an FBX file, it is required to create a Quick Set : Select the flag mesh, Create Menu / Sets / Quick Select Set... / Give a name (eg FlagQuickSet)
- Export the fbx file with the given Quick Set selected in the FBX Export parameters:

Adding the flag to your Asset Manager (.cam) file

- open the asset manager and your .cam file
- select the Geometry File line, click on the relocate FBX button and browse to the fbx you just exported with the flag
- click on the character line, then make sure nothing is selected in the outliner and click +
- add an asset group named flag
- select the created asset group, then click + again to add an empty mesh. This way you will be able to randomize people with flags or with no flag in the rendering types tab.
- select your flag geometry and, click +
- make sure the bounding box is large enough to contain the flag when the character will move its arms
Then go to the rendering types tab, select the rendering type, and add the flag asset group.
Note that the flag may not be displayed correctly in render previz, but will be rendered correctly.

Creating the Geometry Behavior

- open the Behavior Editor, and add a Geometry Behavior (it should be added in a parrallel operator if the character should also play a motion at the same time)
- go back to the Asset Manager's Assets tab, select your fbx character and click on the Assign button to assign this fbx animation to the created Geometry Behavior
- finally, select the geometry behavior, and check its attributes (especially, you should set a correct start/stop frame in order to play the animation)
You are now ready to run the simulation tool and render your animation!


Filling a stadium with Golaem Crowd: Placement

In the previous blog post, we saw how to quickly populate a stadium.

However, there are as many stadium setup as project, and the explained method may not be suitable for all projects. Today let's see some alternative methods for placement. The method to be chosen mainly depends on the input geometry, distance from the camera, behaviors to implement...

Face Components

This is the method we already exposed.

Select faces in your geometry and choose the "Selected object or component" mode  in the Population Tool Creator Tool Panel. See here for more details.

Placement Using Seats Pivots

For stadiums which seats are individual meshes, you can select theses meshes and place people relatively to the mesh pivot. 

Just select all these meshes in object mode (the default selection mode)

Then click on the Golaem Crowd Population Tool Creator , and select the "Selected object or component" mode  in the Tool Settings panel.

As usual, you can change the population tool parameters to populate only some of the seats, add a bit of noise...

Usually the pivot of your seat object is centered on the seat, but it is not always what you want. For example if you generate standing supporters, they will be standing inside the seats, which depending on your camera angle can be a very big problem.

In those cases, do not forget that you can either change the pivot of your object before populating the stadium, or move the whole population tool using the usual Maya Translation tool. See an example below where we moved the population tool forward so that the characters are generated in front of the seats.


Using Navmesh For Complex Placement

When it is not possible to use the component or object mode, you can compute a navmesh for your stands and place your characters using a regular population tool (most likely a point shape one  if you want to be able to set a number of rows and columns). This placement mode also offers the advantage of being able to use noise without characters overlapping each others.

The first step is to select the stand mesh and to compute a navmesh (for this case I prefer to use the "Exact subdivision mode", you just need to uncheck the "Keep Only Greatest Connex Zone" in the Advanced Parameters tab).

Then you can place a point shape population tool and adjust its number of row/columns, move it and adjust the distance between characters, to match your stands. Do not forget to adjust the particle radius as well so that they can fit into the stands.

Notice that although we requested 12 columns, given the distance parameters, only 9 could be generated. The advantage of using a navmesh is that the extra particles are not generated outside the stand. They are not generated at all.


Placement With Multiple Terrains

For example when using the navmesh method to place your characters, it can be useful to create more than one terrain. In the example below, we created only one terrain with all stands and try to generate people on the top stand. Unfortunately, depending on the parameters used, some characters may get generated on other stands.

A clever solution for this case is to use a different terrain per particle tool.

In the picture below, we included only the top-left stand in a terrain and generated particles on it. The terrain a population tool should use can be selected in the Terrain Attributes:

Here is the result when placing 4 particle tools, using one terrain per stand. A different Entity color has been used per particle, to show that there is no character generated outside of its relative stand.

One important thing to note is that although it is possible to use multiple terrains for placement, only one terrain will be used during simulation. This terrain is used to correctly adapt the characters feet to the ground.

In our example, if the terrain used during simulation include only one stand, the characters on this stand will be generated correctly, but all other characters, not located on the covered zone, will be adapted incorrectly.

To avoid this, you should create a specific terrain for simulation, and map all stands into its Maya Geometry attribute

Note that if you are not using the Navigation or Goto Behaviors, you do not even need to provide a navmesh file for this terrain.

The terrain to be used during simulation is the one selected in the "In Terrain Mesh" attribute of the CrowdManager node.



Populating a stadium with Golaem Crowd

Filling a stadium with Golaem Crowd is very easy and can be done in a few minutes. In this blog post series, we will go through the basics of stadium filling and learn a few tips & tricks along the way.

Initial Setup

We'll start with an empty stadium stand, subdivided so that a face is more a less the size of a character.

It is only one of the multiple ways to create your stadium so that you can populate it with Golaem Crowd, we'll give a few examples of alternative setup in later posts.

We will also need to create two EntityTypes, whose skeleton and skeleton mapping will be the one provided in the sample files. See the quickstart for more details about how to create an EntityType.

Creating A Default Terrain

Select the stand geometry and click on the terrain locator icon  to create a default terrain, in order to adapt character position to the stand height.


First, set the "Select faces component" selection mode.

Select the stand once, and then select the faces on which you want to place some characters. Note that your selection does not have to be contiguous, you can just select any set of faces you want.

In the following example we want the right-hand side of the stand to be empty in order to create a stair.

Then click on the Golaem Crowd population tool creator , and select the "Selected object or component" mode  in the Tool Settings panel.

A population tool is created, with one character per face. Notice that no character has been placed on the faces we did not select.

Obviously you can customize the number of particles, the number of characters per face, or even their orientation. E.g in the following picture, we removed a few characters and mapped a locator in the LookAt attribute of the Population Tool Locator.  This is very useful to make all people in the stadium look at same point of interest  (optionally with a bit of noise).

Generating Supporters

Click on the "Emit Particles" button at the bottom of the Population Tool attributes editor panel. 

Select the generated particle system, and click on the CrowdField button .

Hit play to see your characters appear.

It is possible to get a better character preview by importing a preview mesh in Maya, and mapping some geometry in the EntityTypeSurface associated to your EntityTypes.

Note that this preview uses a simplfiied skinning which may not be perfect. Do not worry, it is just a previz, and not what will be rendered at the end.

Creating Ambiance In The Stadium

It is simple to create an ambiance in a stadium using a few looping motions started randomly.

Open the behavior editor, and double click on your first EntityType. A tab appear, corresponding to the behavior of the characters from this EntityType.

Drag and drop a MotionBehavior on the Behavior Life arrow.

Select it and check your attribute editor. The main attribute is a list of motions that should be played. Just click on the "+" and add a looping motion.

This motion list typically contains only one motion, which is the motion you would like the characters to play. However if you add multiple motions to this list, one motion will be randomly chosen each time the behavior start. It can help you to easily add animation diversity to your stadium. 

Repeat the same operation with the second EntityType and run the simulation.

As we used only one motion and the characters all start at the same time, there is no animation diversity at all. Just go back to the MotionBehavior attributes and check the "Start percent random".

Creating A Wave In The Stadium

In order to create a wave effect, we need to trigger a stand up and raise arm motion progressively in the stadium.
We are going to take advantage of Golaem Crowd motion blending capacities.
Go back to the first EntityType behavior, create a parrallel operator and insert the sit MotionBehavior inside
Insert another MotionBehavior in the parallel operator, we will use this one for creating the wave
Add a wave motion to the motion list of the created MotionBehavior. Set animation priority to 5. This will enable the wave motion to be fully played over the sit motion when started. The sit motion will be playing in the background, ready for blending back when the wave motion ends.
Let's configure the wave motion start trigger, so that it starts only when wanted.
Create a plane and set keyframes in order to make it pass under the characters and comes back
Select the plane and map it in the zone attribute of the wave MotionBehavior Start Trigger (See Mapping objects to triggers/behaviors). You can also check the random trigger in order to add some more diversity.
The wave MotionBehavior is now triggered when the plane passes under the characters.
Hit play, characters now do the wave when the plane first passes under them.
Then, to avoid the wave motion playing infinitely, it is needed to set a stop trigger. Click on the right-hand side circle of the wave MotionBehavior, and set a motion time trigger at 100%. Do not forget to uncheck the false trigger.


The way to render depends on your renderer. Check out video tutorials to learn how to configure rendering.

How to create explosions effects with Golaem Crowd

In this previous blog post, we detailed how to create a suck-up effect. All the characters were sucked up insided the UFO so we did not have to care about computing collisions with the ground or the environment.

Today we are going to experiment with a simple explosion and a terrain, to see how we can get characters to interact with the environment. Something similar to what we did in the fortress demo:

Initial Setup

The initial setup consists in a few character placed on a plan with a few obstacle.

You can have a look at the Quickstart Tutorial to create such a scene.

Creating a physical world

As for the UFO scene, we need to create a Physic Locator, but here we are going to create a physical world instead of using the default plane.
We'll detail the procedure for Maya 2013 and 2014, for previous versions, you see here.

Load the bullet plugin from the plugin manager

The Bullet plugin loaded in Maya ( > 2013)


Select the meshes you want to include in the physical world (here the plane, the sphere and the cube. Others, if any, will be ignored by physics computation). Notice that the .bullet export (hence Golaem Crowd) can only take into account Static meshes. The selected meshes should not be keyframed

Click on the "Create a dynamic Rigid Body object" icon in the bullet shelf  

Set its Body Type to "Static body" in the attribute editor


Go to file/export and select the .bullet file type

You can then browse to the .bullet  file in the Bullet Environment File attribute of the Physical Locator.
If you want to check that everything went ok, you can check the Wireframe Display attribute to see if the physical world match your environment (you need to go forward a few frames to be able to see it, as the Physical Locator can be refreshed only when the simulation is running).

Enabling Physics on the Entities

Do not forget to check the "Enable Physics" of your Entity Types advanced attributes.

Adding a Ragdoll Behavior

Simply open the behavior editor and drag'n drop a Ragdoll Behavior. Of course, it is possible to have your characters walking with a motion or locomotion behavior before switching to the ragdoll behavior, but let's keep this example simple.

Create a locator that will enable you to choose the direction of the initial impulse, and map it to the ragdoll behavior impulse locator attribute

Finally, you can customize the impulse intensity if needed:

You can now hit play and see your characters explode and collide with the obstacles. Move the impulse direction locator to experiment with various configurations. The funniest thing is to move it up and down to send them lower/higer.


Stopping characters when they reach the ground

You will notice that when the characters reach the ground, physics simulation keeps updating and parasite motions appear. It can be avoided very easily by using a stop trigger, and the "Locked posture" stop mode of the Ragdoll Behavior:

When characters reach the ground, their velocity is close to 0. You can use this to stop them when needed. For more information about how to setup a trigger based on velocity and why you need to protect your trigger with "current frame > 5", see how to select a motion based on character speed. As usual, do not forget to uncheck the FALSE trigger.

The locked posture mode forces the characters to keep the same posture even if the ragdoll behavior is stopped. Otherwise, they will immediately go to their neutral posture (which is a standing character).

Possible improvements

You can obviously use other features of the ragdoll beahvior, like the Impulsion Mask (to simulate headshots or sliding characters...), or the Animation Mask (to ensure their arms stay close to the body). These features have already been detailed in the Ragdoll Behavior How-To.

You can also use a keyframed zone trigger for starting the ragdoll behavior, in order to simulate a collision with a moving object.

Nantes 2099 Making Of: flying ships and live actors integration

Today we'll talk about our last Siggraph Demo. You may already have seen part of it in the Golaem Crowd 2.5 video: it features the creation of flying ships, animated thanks to Maya fields, and live actors integration within a virtual crowd.


Our visitors on the Siggraph Booth particularly appreciated the fact that it was very easy to get the live actors avoided by the virtual extras.


Axel Domenger, the freelance artist who created this demo, did a nice breakdown of the shot, showing how Golaem Crowd was used to reach this result.

UFO attack: How to use the Ragdoll Behavior

One of our customers, Fullframe Filmes from Brazil, just created this commercial for Brahma, a famous brazilian beer brand.

They made an unusual usage of the ragdoll behavior by creating people sucked up by UFOs.

This is a nice occasion to give more details about how to use the ragdoll behavior. We will study a simplified setup of the commercial.

Initial Setup

The initial setup is very similar to a classical stadium, some people playing a loop sit motion at random, and a keyframed UFO flying over. When the UFO reaches the center of the character group, it starts spinning (still keyframe) and will suck up characters.

We created two EntityTypes: 

  • Green people will not be influenced by the UFO
  • Blue people will be sucked up

You can have a look at our brand new online documentation if you want to know how to create the initial setup

Each EntityType has a distinct behavior which is just playing a simple motion.


Creating a Physics Locator 

To be able to compute physics simulation, Golaem Crowd needs a Physics Locator. This locator describes the physical word (which objects are colliders) and provides global parameters like gravity.

As our world is very simple and we do not need any collision with the physical world, we'll just use the "Default plane mode" which is an infinite plane located at the center of the scene.

You can have a look at the User's Guide if you want to learn how to descibe a more complex world, but we will cover this in a next blog post anyway.

Enabling Physics on your EntityType

As physics computation impacts performances, it is turned off by default. It should be activated for each EntityType which should be affected by physics.


Adding a Ragdoll Behavior 

Let's add a parallel operator and a RagDoll Behavior on top of the MotionBehavior

When it starts, the ragdoll behavior turn your motion controlled character (or parts of it) into a ragdoll (a physics controlled character). It can also apply an impulse force so that your character are thrown at a certain direction.

There are several way to describe this direction, we'll use a locator at the center of the UFO, so that it is computed automatically based on the character position. You can add a bit of noise, so that they do not ALL exactly reach the center of the UFO, but not too much, or they'll miss the UFO...

Then you can also control the intensity of the impulse (how fast they will reach the UFO). A positive intensity sends the characters away from the locator (explosion), so we will use a negative intensity here.


Starting the Ragdoll Behavior

Last but not least, we need to tell Golaem Crowd when to start the ragdoll behavior. We litterally want it to start when the UFO start spinning, so we will use a driven attribute trigger (honestly we could just have used a current frame trigger but we wanted to demonstrate the power of driven attributes!).

Each Trigger node has a drivenAttribute Attribute which can be connected to any floating point value of any Maya object. This way you can control your Golaem Crowd simulation with any Maya input. Here we'll use the rotation angle of the UFO (aka pSphere1).

First you need to connect the two attributes together using the Connection Editor (Window/General Editors/Connection Editor). Watch out about which object you select (you need to select the Shape of the Trigger, not its transform) and the way you are connecting them (from the sphere to the trigger)

When the attribute is connected, you can see its name and current value in the attributes editor of the Trigger node. Enable the Driven Attribute Trigger, and set a starting angle value and an operator (here greater than 150).

Also activate the Random Trigger so that they do not start exactly ALL at the same time.

Last but not least, uncheck the True trigger.

Hit play, and here you are!

Wait a minute! They fly, but they do not stop in the UFO! Sure, we did not specify the stopping trigger yet

Stopping the Ragdoll Behavior

We need a 3D Zone stop trigger so when they enter the UFO geometry, the ragdoll behavior stops and they stay in place.

Select the UFO (pSphere1) and map it in the Zone Trigger of the RagdollBehavior Stop Trigger (tips: after selecting it, open the behavior editor, and while holding SHIFT, select the stop trigger on the Ragdoll Behavior, click map in the attribute editor).

Activate the Zone Trigger, and check the 3D checkbox.

Do not forget to uncheck the False trigger, or it won't work at all (yeah I know I were about to forget, I always do!)

Finally, if you want the character to stay still when the ragdoll behavior stops, you have to select the "Locked Posture" stop mode in the Ragdoll Behavior (or else they will just fall back on the floor and sit down again, it's fun but not what you want)


Further Improvements

If you want to enhance the effect even more, you can play with the Impulsion Mask and the Animation Mask (see above attribute editor picture).

The impulsion mask enables to apply the impulsion on only some body parts. For example, if you apply the impulsion only on the left part of the body, they will twist while flying.

The Animation Mask enables to define which part of the body will be controlled by physics or not. If you uncheck arms and legs, and play a Motion Behavior in parallel, you can control the global character position thanks to physics and play a panicked behavior on the arms and legs.

Well I do not have a "panick" motion at hand and anyway you would not see the difference on a screenshot, but remember that at the beginning of the scene we put the Sit Motion Behavior in parrallel with the Ragdoll Behavior. Let see what happens if we uncheck some checkboxes in the Animation Mask

You can see that they keep their legs folded and the arms close to their body. You can then get the best of both worlds!

See you soon for another blog post about how to make your character collides with their environment

Crowds Everywhere: Simulate Everything with Golaem Crowd

If you really think about it, crowds are everywhere: cars in the streets, birds in the sky or bugs in your closet… Even a forest could be considered as a crowd: it’s basically trees with different positions, animations, shapes and colors. Such a diversity of characters and behaviors requires to have a crowd system which is flexible enough to handle it, but still controllable and pipeline friendly.

In this post, we’ll describe how you can simulate any animated geometry with Golaem Crowd, even if it hasn’t a skeleton or a complex rig. If the animation engine will not be usable in such cases, we’ll still be able to use the Asset Manager, some avoidance behaviors and, of course, the procedural rendering techniques.

Setting up your Asset

Here’s my buddy for today: a little nutcracker soldier. No skeleton here, it’s just a bunch of keyframed meshes to make it cyclely walk on-the-spot during 24frames. The only requirement to input this character into Golaem Crowd is to create a root joint on the floor and to parent the character geometry to it (middle click drag’n’drop). This joint will be used by the system to place and orient the characters in world space.

With this root joint, you can create an entry in the Asset Manager for the nutcracker character. Pretty straightforward: select the root joint, create a new asset (Asset_NutCracker), select the character meshes and create a new asset group (Body). Don’t forget to export it in FBX (Tools / Export Selection as FBX), to set up the bounding box and you’re done! For more information about the Asset Manager, take a look at this tutorial.


Setting up the Simulation

The simulation part is the same piece of cake than the asset part:

- Create a new EntityType Nutcracker . As the character will not be animated with the Golaem Crowd animation engine, there is no need to specify a skeleton file.

- Create a Terrain . If no Maya geometry is selected, it’ll create a default plane terrain.

- Create a bunch of particles, either with the Population Tool or some Maya emitters.

- Connect a CrowdField to the particles and run the simulation. As no skeleton has been loaded, the default display will be a bunch of oriented cylinders: pretty rough… Let’s change this.

- Import your animated Nutcracker in the scene and place its root joint at the scene origin.

- Golaem Crowd provides a GPU-based way to efficiently preview animated geometries on top of particles. Go in the entityTypeSurface1 Attribute Editor, switch the Display Mode to “Skinned Mesh” and map the imported nutcracker meshes in the “Skinned Geometry” field. You can even play with the "Hue Variation Factor" to randomize their preview color. It is important to notice that this display is for PREVIEW ONLY: it does not take into acount your shading graph and your asset repartitions (yet)


Setting up the Behaviors

OK, now you’re ready to add some behaviors to your characters, depending on what you’d like them to achieve: reaching a target, avoiding each other, playing a baked animation… Let’s say I want all my soldiers to reach a target and avoid each other.

- Create a Navigation Mesh from your Maya geometry  to compute obstacles and environment limits.

- Add a Crowd Target Locator in your scene. You can keyframe its position if wanted.

- Open the Behavior Editor for your EntityType and add a CrowdBeGoto and a CrowdBeNavigation in a CrowdOpParrallel operator. Change the Goto parameters to make your characters reach the Target Locator we just created. Change the Navigation parameters (speed, acceleration…) if needed.

- Play the simulation and enjoy the result.

- Ok! You may notice that the characters are still not animated: this is normal as we did not add any behavior to deal with animation yet. As the characters do not have a skeleton, we can’t use neither the CrowdBeMotion nor the CrowdBeLocomotion behaviors. So how do we play the baked animation stored in the FBX file then? Let’s have a look to the CrowdBeGeometry behavior:

As you can see, it takes a FBX file to play, a start and a stop frame in this FBX, some speed replay parameters and some start frame parameters. Isn’t it exactly what we need?

- To assign a FBX file to this behavior, go in the Asset Manager, select the FBX file you’d like to play (in this scene, there’s only one) and click on the Assign button on the bottom right corner.

- Change the CrowdBeGeometry parameters to fit the animation: start frame, stop frame, randomize the start percent random. As we do not have skeleton animation to blend, uncheck the "Blend Behavior" option as well (you may need to Refresh the Entity Surface Shape node to take this new configuration into account at the GPU level).


Setting up the Rendering

Nothing special to do here, characters with or without skeleton are rendered the same: just export the cache and add a Crowd Render proxy in your scene and you're done.

You can even add some shader attributes in the Asset Manager to deal with texture / shading variation (without relaunching the cache export). Shading variation will be the topic of a coming blog post. Stay tuned!

Ok, I guess it makes sense for you to use a crowd simulation software to animate moving characters but you're still wondering why you'll use it for static objects such as trees, parked cars? Why not using the Maya instancer instead? Let me try to convince you with few properties relative to my soldier scene:

- maya scene: 900kb
- cache per frame for 800 characters: 19kb
- render time with VRay (full-HD image): 52seconds
- geometry loaded on demand only
- shading variation / geometry variation for free
- thanks to the GPU based preview, the viewport keeps being interactive even when instancing a large number of objects

And few more examples made in a couple of hours:

Cars controlled with an uniform field and animated with a geometry behavior for the tires.

Trees placed and oriented with the Population Tool. Same model but with different scales and geometry variations.

Birds controlled with a flock behavior, animated with a geometry behavior for the wings and with shading variation.

Any other idea or question? As always, feel free to ask!

Syndicate content