Miarmy Crowd Simulation Documentation (English)

Terrain

Terrain sentences let agents are able to feel terrains and interactive with them, adapt the shape of terrain, such like follow the height and align the orientation.
For making the agents are able to feel terrains, we need mark terrain for that piece of plane mesh in Miarmy Terrain Manager.

Notice: We highly recommend that you simplify the mesh before marking it as terrain

And once a piece of geometry marked terrain, there will be a McdTerrainNode connect to this mesh.

This node will record some attributes of terrain for physical simulation. So you don't need do anything on this node.



Terrain manager and mark terrain


Once marked terrain for a mesh plane, agent will find them when apply terrain sentences.



Above and beneath the terrain plane mesh


The terrain sentence will first find the closest terrain and return only one result to input results (Fuzzy logic Pipeline).

Shown as the following picture, in this moment, the agent A can only feel and interactive with terrain 1 and the agent B can only feel and interactive with terrain 2



Agents are able to feel the closest terrain in scene


The I'm higher than terrain distance sentence will return the height underneath the feet of agent.

For example and take a look at the following picture, the ground sentence will return 3 for first agent, 0 for second agent, minus 4 for third agent and 2 for last agent.



The terrain sentence example for agents

I'm higher than terrain distance > 0 :This sentence means I'm higher than terrain (then I need to go down)

I'm higher than terrain distance < 0 :This sentence means I'm higher than terrain (then I need to go up)

 


The I'm on terrain UPHILL(DOWNHILL) will return the relationship between the Z-axis of agent and the terrain plane of that agent place, for example the following picture, the first agent is on "uphill" because the ground in-front is higher, and the second agent is on "downhill" because the ground in-front is lower, whereas the third agent is on "plane" because the ground in-front is align to Z-axis of current agent.



agents from left to right are "uphill", "downhill" and "plane" relationship to terrain


The higher terrain on LEFT(RIGHT) sentence is very familiar with "I'm on terrain UPHILL(DOWNHILL)" sentence, nothing special but testing the X-axis (left/right terrain height).

In following picture, the first agent on terrain which right higher, and the second agent on terrain left higher. The third agent is on "plane" because the x-axis of agent is align to the terrain



agents from left to right are "right higher", "left higher" and "plane" relationship to terrain


Once we get the relationship between the agents and terrain, we can move the agents up and down, rotate them up or down, and roll left or right for adapting the terrain



Using terrain sentences, we can align our agent seamless to terrain


Note: 

The agents can read the information from deforming terrain, but it may not accurate when the deformation is big, because there is a Maya bug.

For avoiding the bug, we just need simply create a geometry cache (alembic) for that terrain and remove the deformers.

 

 

 

 

Basefount Technology