Miarmy Crowd Simulation Documentation (English)

2vs2 Figher Action Sync

What is SOAS

Subjective Objective Action Synchronization (SOAS) is a technology that pairing and syncing agent action. When the agents face to face fighting, subjective agent can tell what his doing to the objective agent and the objective agent will take response precisely and simultaneously based on the subjective action.
SOAS doesn't need any complex logic setup, and just 2 SOAS sentences are enough.
SOAS sentence also have priority control, if another other higher priority action sentences activated, the SOAS will be disable automatically.
SOAS is usually used when 2 people fighting or such pairing behavior. For example, agent A & B, when Agent A is attacking, the Agent B should defend, whereas the agent A is defending, the agent B should attack. And the defending and attacking behavior must be synchronized.



2 agents are fighting perfectly


Under the Hood

The SOAS is action node level feature. That is means that no matter what the agent type is, the feature will work OK. Such as that there are 3 types of agents, each one of them can be both the objective and subjective agent.
Also, the SOAS need the help from sound range. The action information can be only passed to others by the sound range.
The first step is setup subjective and objective actions mapping relationship, we need specify the relationship for engine know that before simulation.
Once we fill the "tell" sentence into the decision of agents, these agents will tell what it's playing back to the other agents in their sound range.
Some other agent with "hear" sentence can hear these information and get the objective action if subjective-objective relationship established. Then when logic active, it will perform these objective actions, also will try to synchronize that.

Setup Subjective and Objective Action

We need firstly setup the Subjective and Objective action in Action Synchronization Editor. In Miarmy > Actions > Action Synchronization Editor

 

Setup action sync relationship


For example there are 2 types of agents, A & B. The type A is subjective agent, and type B is objective agent.
The agent type A has:

  • Attack1_action_A
  • Attack2_action_A
  • Defense1_action_A
  • Defense2_action_A

The agent type B has:

  • Attack1_action_B
  • Attack2_action_B
  • Defense1_action_B
  • Defense2_action_B

So the relationship of them should be:

  • Attack1_action_A >>>>> Defense1_action_B
  • Attack2_action_A >>>>> Defense2_action_B
  • Defense1_action_A >>>>> Attack1_action_B
  • Defense2_action_A >>>>> Attack2_action_B

Behind the scene, these actions subjective/objective relationship information are actually the action nodes connections. The subjective action ".syncTo" attribute link to the ".syncs[<id>]" attribute of objective action.
Of course, one action can be objective action of multiple subjective actions. The ".syncs" attribute is an array attribute.



SOAS Sentences

tell near agent my action
This is an output sentence and when active, it will tell the other agents what is its playing back action and which frame
hear and receive action info
It's actually an action sentence, also output. It will make agent hear they others tell it. And find out the objective action if heard one is subjective action. If active, it will try to play back that objective action, and try to synchronize subjective action
tell near agent my action use channel:<id>
Sub channel "id" just simulates the frequency of "tell", letting the agent can tell different type different information. The function is similar like the "tell" sentence. If you don't specify this sub channel, it will be default -1
hear and receive action info only channel:<id>
Same as "hear" sentence, but it is only able to hear the agent using the same sub channel "id".

SOAS Sentences Priority

The SOAS sentences also have priority. When an objective action is activated by SOAS Sentences, but there is another action activated by any other sentences have higher priority. The agent will try to transit to the higher priority one instead of SOAS controlled one.
For example, if two sentences "hear" and "escape" are activated together, but the "escape" have higher priority. The agent will try transit and perform "escape" action.

Future of SOAS

The SOAS of Miarmy is not perfect yet, if the agent is too dense, the tell sentence will tell many different agent with the same information, or some agents will hear many information from multiple agents. It only work perfect with 1 VS 1 scenario, like the picture below.


1 VS 1 scenario


In the future, we'll make the SOAS more precisely based on sound degree limited or closest one algorithm etc.




Basefount Technology