Multiple Controlled Entities in a Joint Scenario

From SIMboxWiki
Jump to navigation Jump to search

     A great feature of creating joint scenarios is the fact that we can have many controlled entities working together, each performing their own tasks and objectives in the mission, while all moving the scenario forward. But what happens when two trainees want to run a scenario that calls for 5 controlled entities? Since each entity has it's own tasks to perform, the scenario will pause while waiting for these tasks to be completed, in effect stopping the scenario altogether. Because of this, we must give each entity a Virtual Instructor agent as well as a Brain, therefore if they are not controlled, they know what to do and will not hinder the progress of the scenario.  See New Scenario to get started.


     In this example we will create two Hummers that must each drive to a predetermined spot and park before the scenario can continue. We will set it up so that both of the Hummers can be controlled, one of the Hummers can be controlled, or we can even leave the scenario to play itself out with no controlled entities whatsoever.


  1. First let's add a Hummer by selecting View > Entity Type and typing Hummer in the "Find" box. Drag and drop the Hummer into the scenario. Do the same thing for a second Hummer. Also add an Identification Waypoint so that your scenario looks something like the following.
    MCE-Placement.jpg
  2. Now make sure Hummer H1 1 is selected and go to View > Entity Settings. Click on the General Tab and select the blank box next to Route, then select <New> from the drop down list. This is going to allow us to create a customized route for this Hummer based on where we want it to go and what we want it to do. But keep in mind, this Route will only affect the Hummer if it is an uncontrolled entity. 
  3. Once you've clicked <New> a Route Editor window will pop up and your cursor will change size and shape so that wherever you click now will become a new Waypoint in your Route. For now, we don't need to create a highly specific route so we'll leave the name the same and just click somewhere close to the Identification Waypoint to set the Route. Close the Route Editor window when you're finished.
    MCE-RouteEditor.jpg
  4. Next, make sure the Hummer is still selected and go back to the Entity Settings box and select the Agents tab. In the blank space below, right-click > New > Brain. Right now we are setting up the Brain that will automatically go into effect if the entity is uncontrolled.
  5. Right-click on Instructions > Advanced > Call Action and select ACTION_PATH_FOLLOWER_SET_SPEED setting the value to 0. This stops the uncontrolled entity from following it's Route. Now right-click on that action and select Timeout, setting the value to 4 seconds. This just provides a short time where the Hummer will stay idle.
  6. Right-click on Instructions > Advanced > Call Action and select ACTION_PATH_FOLLOWER_SET_SPEED and this time set the value to 20. This will send the uncontrolled entity on it's Route. That puts the finishing touches on the Brain for this Hummer. It should look like the following.
    MCE-Brain.jpg
  7. Make sure the same Hummer is still selected and go back to the Entity Settings window. Again make sure the Agents tab is selected and right-click in the blank space then select New > Virtual Instructor. Here, we are going to tell the agent how to handle the Hummer if it is a controlled entity.
  8. Right-click on Instructions > Instructional Aids > VI Guidance and let's set up dialogue to tell the trainee what his objective is. Since we want the two Hummers to drive to the Identification Waypoint, let's task the trainee to "Drive to the Waypoint in the middle of the building and park your Hummer."
  9. Now we want to monitor whether the trainee has done that so right-click on Instructions > Add Flow Control > Continue. We need to set it to monitor for two conditions here, the first one being that the vehicle is stopped, so right click on Range and select the attribute ATT_SPEED_MPH and set the values to  -1 < x < 1.
  10. Next we want to make sure the Hummer is close enough to the Identification Waypoint. Since we don't want to move on until the second condition has also been satisfied at the same time, we can add that condition in the same Continue. So right-click on "Relative to..." > Set Relative Entity and select the Identification Waypoint from the list. This is where we set what we're going to measure this new attribute in relation to, so now let's choose the attribute. Again right-click on "Relative to.." > Add Attribute and select the attribute ATT_GET_DISTANCE_FROM_ENTITY_METERS, setting the values to  0 < x < 25. So far, it should look like this: 
    MCE-1stVI.jpg
  11. Now the scenario will not progress until this Hummer has stopped within 25 meters of the Identification Waypoint, but we also want the other Hummer to be stopped within 25 meters before the scenario continues. The easiest way to do this is to use Traced Entity Steps. Start by copying that whole step exactly as it is and pasting it below.
  12. You should now have two steps that look exactly the same. Right-click on the title of the second step and choose Set Traced Entity, selecting the other Hummer from the list. This step will ensure that the other Hummer has also stopped in the correct position before the agent progresses 
  13. Now we'll add a final untraced step to send some VI Guidance to the trainee telling them that they did well and that the scenario will continue. Your final Virtual Instructor Agent should look something like the one below.
    MCE-2ndVI.jpg
  14. Repeat Steps 2-14 for Hummer H1 2, changing the references where applicable. You should now have a working scenario no matter what the controllable entity configuration.