Miarmy Crowd Simulation Documentation (English)

Road

Road is another main perception content of Miarmy, it's a path been mapped on the terrain and controlled by a NURBS curve.

With road sentences, agents can test the angle between road direction and itself, or test its position in road, then, make decision from the result. For creating road, just select any curve, and click:



Creating road from curve (from menu or shelf button)

Road under the hood

Assets

Once we create a road, there are 3 kinds of asset been created, they need working together for displaying the road and interacting with agents.

Please manage them well and don't delete any one of it, or your road would not working properly.

  1. Road control curve
  2. Road mapping curve
  3. Road node

Take a look at the following pictures, in the left picture, the selected curve on top of road is the "control curve" and the blue-arrows-formed road on the ground is the road.

In the right picture, the selected curve on the ground is the "mapping curve" which is a mapped curve from control curve. It always been set as Intermediate Object (know more about Intermediate Object, please Google "Maya intermediate object").



Control curve and mapping curve, the blue flow arrows are road node

Management by Parenting

For parenting road to others node ,you just need parent the control curve to other node. For example, you need parent your road from "Perception_Set" to "group1", you just need select curve1 and parent curve1 to the group1, then the rest suff will be automatically moved to group1.



Parenting "road" process from Perception_Set to group1, only operate on curve1 (the control curve)

 

Road Visualization by Control Curve Points

Arrange well the points on control curve can lead better visualization of the curve, just like the pictures below.



(left) A well arranged control curve (right) a non-well arranged control curve


Notice: please don't add or delete points on control curve, because in fact the control curve is controlling the "mapping curve" all the time. The road will not working if you add/delete the topology of the control curve.

 

 

Road Precision by Control Curve Points

The precision of road is determined by the complexity of control curve (before creating)


Usually, a more precise road only can lead better visual result, but the calculation is slower, we not recommend you do that.

 

Attach Road to Terrain

Road can be attached to terrain. Select the control curve and terrain mesh, and click Miarmy > Knowledge Perception > Attach Road to Terrain, your road will be attached to terrain.



Road has been attached to terrain

Road Attributes

Road can use indexing technique, which controlled by "road ID" attribute


Road attributes


Road Width Attribute:


Narrow or wide roads, controlled by "roadWidth" attribute

 

Road Edge Flow

Road has its own edge zone, once the agents in the edge zone, they can follow the edge flow orientation instead of main road,

road edge flow attributes

road edge

 

edge flow orient outward and inward

 

wider and thinner edge

 

short and long edge flow length

 

Road for perception

Road Orientation

The relationship of road orientation and agent orientation is in blow picture.

If the road direction pointing to the agents left, the return value should be positive, if the road direction pointing to the right of agent, the return value should be the negative.



The relationship of road orientation and agent z axis


Road Sentences

Firstly, if the agent isn't on the road, the sentence will return blank(false). For the agents on the road, the sentence will return the angle between the agent Z-axis and the road direction. 

Take a look as the following picture

The I'm on road and it point to LEFT(RIGHT) sentence will return the angle between the agent Z-axis and the road direction, the red arrow is the road direction and the blue arrows are the agent Z-axis.

For the agent C, the sentence will return blank, and for the agent A, B and D, it will return β = 35, γ = 0 and α= -70 respectively.

The positive is LEFT and negative value is RIGHT. but you don't need to remember this, you just need select LEFT or RIGHT.



I'm on road and it point to LEFT(RIGHT) sentence sample

 

The I'm on road and my position sentence will return the position of agent on the road, the middle of the road is 0, and the left and right side of the road are 1.0 and -1.0.

In the following example, the agent C will return blank because it's outside of the road, the agent A, B and C will return -0.4, 0.2 and 0.5 respectively.



I'm on road and my position sentence example

 

 

 

Basefount Technology