Miarmy Crowd Simulation Documentation (English)

Detect Formation Targets by Input Language

In Miarmy 4.0 we can control the agents follow the targets of placement placer by input language, And it can work with other logic, for example when the agents move to the placer targets the agents, they can also can feel the other logic like avoid spot, avoid zone etc.

Formation Detection Languages

Firstly you need to understand how to create a placement and make it "as target" (Formation Morph with Place Targets)


Placer Formation Sentences

  • placer target is on LEFT(RIGHT)

The sentence will return the degree from the connection line between agent and placer to the agent’ ahead,  just like below picture.

placer is on my left

 

  • placer target to me distance>??(<??)

This sentence will return the distances from agent and placer in 3d space. Just like below picture, point A is our agent and point B is the placer,so the 3d distance is the line A-B.

  • placer target to me 2d distance>??(<??)

This sentence will return the distances from agent to placer in XZ plane, just like the line B-C.

 

  • placer target orient to LEFT(RIGHT)

This sentence will return the degree from their orientations. In below picture the placer orient to the left upper corner, and the agent orient to front straight. Then, the angle between them is "alpha"

orientation difference "alpha"

Workflow

  • Create a place node by Miarmy > Placement > Create Placement Node
  • Attach this place node to a polygon mesh by first select the place node and then the polygon mesh and then click Miarmy > Placement > Attach Range Mesh 
  • Select the placement node and switch to Maya Mesh mode

 

  • Adjust the parameters of attributes "Num Of Agent", "Relax Iter", and "Distance" and get the best result

 

Turn on "As Target" attribute, you can see your placement will turn into red in direction arrow.

 


  • Then you can add the blendshape morph to the base mesh and make it deforming like following pictures:

Frame 1

Frame 30

  • Place the agents at the first frame
  • Use the language "Placer Formation>placer target is on LEFT (RIGHT)" to detect where is the target placer which place this agent out. And In the process, the agents also can feel the other logic, just like spot, zone and so on.

Follow left/right placer formation


  • Create a decision node to stop the agents moving when they close enough to placer. Fill the input decision sentence "Placer Formation>placer target to me distance < ??", it will get the 3d distance between agents and their placer. If the agents are walking on the bumpy ground, there should use the language “Placer Formation>placer target to me 2d distance < ??”.

  • We can get the result like following pictures

Frame 0, Frame 20, Frame 100

  • If we want to make our agents follow the placer orient when they stand, we can use “Placer Formation>placer target orient to LEFT (RIGHT)”, and rotate our agents to match placer target orient.

  • the result will be like following pictures

 

 

 

 

 

 

 

Basefount Technology