State Machine

Created by Nitin Solanki, Modified on Thu, 08 Sep 2022 at 04:25 PM by Nitin Solanki

The State Machine has two methods of being used. Event based and Always Running. The Always Running state machine is set up to be running at all times during your simulation. The event based one moves forward along the graph based on the actions taken by the user. Triggers are made available in the event based State Machine as the next transition states need them to be activated.


Actions

Actions are what happens when a state is reached or achieved in the State Machine system. There are a variety of types of actions as listed below that are able to affect your simulation and End User Experience.

How to Author the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Launch “HyperSkill-Desktop.exe”

  1. Log in to your account and select “Simulations” from the home screen

  2. Select a simulation from the list and click on the pencil icon  to open it in edit mode.

  3. Click on the State Machine tab  to open the State Machine creation UI.

  4. Layout your state changes as desired utilizing the functions outlined in the State Machine Builder User Interface.

  5. When in experience mode the state machine will start from the entry node which is determined by the Entry Node Dropdown. Anything in the Always Running State is being checked at all transitions.

  6. State machine nodes can affect any attribute, but can only have one trigger to act as a transition. There is no limit to the conditions. States execute along the path of the transitions.


How to Author a Translate Behavior in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Translate.

  3. Press the + button to add the state to the action list.

  4. Select the entity of the object you wish to translate in space with the Select Entity dropdown.

  5. Select the x,y,z coordinates of where you would like the object to be translated to. This is translated in Global space.

  6. Set the amount of time you want the object to take from its current location to the end destination with the Speed field. This value must be greater than or equal to 0. Please be aware that if the object is not Kinematic that it will likely behave erratically as other forces, such as gravity or collisions, attempt to act on the object in question


How to Author a Rotate Behavior in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Rotate.

  3. Press the + button to add the state to the action list.

  4. Select the entity of the object you wish to translate in space with the Select Entity dropdown.

  5. Select the x,y,z coordinates of where you would like the object to be rotated to. This rotation is done globally.

  6. Set the amount of time you want the object to take from its current rotation to the end rotation with the Speed field. This value must be greater than or equal to 0. Please be aware that if the object is not Kinematic that it will likely behave erratically as other forces, such as gravity or collisions, attempt to act on the object in question


How to Author a Delay in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Wait.

  3. Press the + button to add the state to the action list.

  4. The duration functions as a delay before any actions after it in the state machine will take place. This is particularly useful if you start an animation in a previous state and want to delay feedback until the completion of the animation.


How to Author a Set Attribute Behavior in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Set Attribute.

  3. Press the + button to add the state to the action list

  4. Select an entity with the  dropdown. This will be populated with every VO and VP in your space.

  5. From your selected entity, select the Attribute from the  dropdown. This will become selectable after you have selected an entity. The list will populate with every Attribute that currently exists on the selected Entity.

  6. With an attribute selected, the Value field will be able to be entered. This Value will try to automatically fill itself out with a suitable attribute based on the attribute type. For example, types of Boolean will fill in True. This Value is entered as a string regardless of type.

  7. Specifically, for the Snapped attribute the syntax is <VO Name>.<Hitbox Name> where the VO Name is the string given when selected with the selection tool.

How to Author a Highlight Action in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Highlight.

  3. Press the + button to add the state to the action list.

  4. Select the entity you wish to highlight from the  dropdown. This will be populated with every VO and VP in your space.


How to Author a Text Message Display in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Display Message.

  3. Press the + button to add the state to the action list.

  4. Enter the message you want displayed in the text field.

  5. If you wish the message to be spoken select the Spoken field.

  6. If the Spoken field is selected you can also choose the voice that will speak the phrase. Please note, that if the message is spoken it will not move on to the next state in the sequence (if there are multiple) will not occur until the message is finished being spoken by the system.


How to Author an Animation Playing in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Play Animation.

  3. Press the + button to add the state to the action list.

  4. Select the entity from the  dropdown. Any VO can be selected at this point regardless of whether it has an animation on it or not.

  5. Select the Animation from the  dropdown. This will only be populated if an animation exists on the selected entity.

  6. If you only want to play part of an entire animation, you can select the Sub Clip field. This will allow you to utilize the Start Time and End Time fields to control which frames of the animation will play.

How to Author a Sound Cue in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Play Audio.

  3. Press the + button to add the state to the action list.

  4. From the  dropdown select your desired audio clip.

  5. Set the Volume value, somewhere between the range of 0 to 1 to change the volume at which the Audio Clip will be played at.

  6. You can set a delay (in seconds) that you want to wait for before the audio clip plays with the Delay field.

  7. You can preview the audio with the selected volume settings by pressing the Preview Sound  button.

How to Author a Follow Behavior in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type Follow.

  3. Press the + button to add the state to the action list.

  4. The Follower selection is the object that will track the location of the Followee and adjust its position and rotation relative to the Followee. Any object in the space can be selected as a Follower and the same is true of the Followee with the added selection of the player being an option.

  5. Select whether you want the object to start following in this state or stop following by selecting the Is Follow selection. If this is selected it will start following and if it is deselected it will stop if it was following previously.

  6. Set the offset that you would like the Follower to adhere to with the position and rotation values. This is the position and rotation relative to the Followee.
     

  7. Please be aware that objects that follow will still adhere to physics and any other parameters that are left on (like gravity). Please use other state actions to customize this effect further if these are not the end results that you desire.

How to Author a Quiz in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type QMultiple.

  3. Press the + button to add the state to the action list.

  4. Press the Expand Choices button to type in your question prompt and any answers to the prompt. If you would like to delete any provided answer, press the Trash button to delete it. You can select one of the options to be evaluated as correct in this menu as well.

  5. Your QMultiple state will update to reflect your Question prompt.

  6. If you want the prompt to be spoken to the user, select the Spoken check mark box.


How to Author a Simulation Transfer in the State Machine


A detailed explanation of controls and interface functions are described in the section State Machine Builder User Interface.

  1. Within the edit Simulation section of the HyperSkill Desktop application, navigate to the State Machine tab.

  2. Click on the desired state and from the dropdown in either the entry or exit actions select the type GoToSim.

  3. Press the + button to add the state to the action list.

  4. From the dropdown of the  dropdown you will see a list of every simulation that you currently have access to. Whether you have created or have it shared with you.

  5. When this state is triggered the Experience User will be given an option to go to the selected simulation. Saying “No” to this dialogue will dismiss this option.

  6. Please be certain that anyone that you share a simulation with also has any simulation shared with them that is connected to it with this functionality or else there may be an error for the Experience User.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article