@@ -14,14 +14,14 @@ In the Character Plugin folder, simply navigate to **Blueprints/SocialGroups** a
At first, depending on the size of the group, place the desired amount of VHs into the scene. Make sure that each VH has the ``VHSocialGroups`` and ``VHGazing`` component added. Then place the Social Group blueprint into the scene. In the details panel of the Social Group actor, make sure that ``Spawn as Group`` is false, then add the VHs to the ``Agents in Group`` array. Under dialogue, make sure that ``Start Dialogue`` is false, as this requires additional setup. That's all, if you press play, the agents should arrange themselves in a circular formation around the Social Group actor and follow the behavior described in the [Social Group Behavior](#social-group-behavior) section.
### Adding Dialogue
First of all, make sure that all the VHs that are in the group, have the ``VHSpeech``, ``VHAudiofileSourceComponent`` and ``VHLiveLinkAnimation`` components. In the details panel of the Social Group actor, enable ``Start Dialogue`` (or call the Start Dialogue function at some point during the game). Create entries in the ``Dialogues`` array. To create an entry for ``Dialogue Anim Montage``, see [LipSync](Components/LipSync). For the ``Audiofile`` parameter, provide the path to a .wav file. This .wav file will then be loaded by the virtual acoustic server, so make sure it is set up properly (See[Virtual Acoustic Plugin](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/plugins/unreal-va-plugin/-/wikis/Home) for more details). Finally, specify the gender of the agent, that this dialogue should be assigned to. Add as many dialogues as you want. Finally, specify the number of agents, the dialogues should be distributed between and decide, if the dialogue should be looped, once it has finished. E.g. the ``Dialogues`` array contains five entries and ``Number of Agents in Conversation`` is set to three. Then three agents will be chosen at random, matching the gender if possible. The first three dialogues will then be distributed to the 3 agents, the fourth dialogue will be assigned to the first agent and the fifth one to the second agent.
First of all, make sure that all the VHs that are in the group, have the ``VHSpeech``, ``VHAudiofileSourceComponent`` and ``VHFaceAnimation``(LiveLink, OpenFace or OculusLipsync see [LipSync](Components/LipSync)) components. In the details panel of the Social Group actor, enable ``Start Dialogue`` (or call the Start Dialogue function at some point during the game). Create entries in the ``Dialogues`` array, in the form of Paths to the LipSync and Audio files. These files will be used by the ``VHAudiofileSourceComponent`` and ``VHFaceAnimation``. For more information, see [LipSync](Components/LipSync) and[Virtual Acoustic Plugin](https://devhub.vr.rwth-aachen.de/VR-Group/unreal-development/plugins/unreal-va-plugin/-/wikis/Home). Additionally, specify the gender of the agent, that this dialogue should be assigned to. Add as many dialogues as you want. Finally, specify the number of agents, the dialogues should be distributed between and decide, if the dialogue should be looped, once it has finished. E.g. the ``Dialogues`` array contains five entries and ``Number of Agents in Conversation`` is set to three. Then three agents will be chosen at random, matching the gender if possible. The first three dialogues will then be distributed to the 3 agents, the fourth dialogue will be assigned to the first agent and the fifth one to the second agent.
### Spawn in Group formation
Instead of placing VHs into the scene and adding them to the Social Group, it is also possible to activate ``Spawn as Group``. You can then specify the amount of agents you want and also provide the types of VHs that should be spawned in the ``VHTypes`` array. Ideally you want the amount of entries in the``VHTypes`` array to match the group size, otherwise the same agent will get spawned twice.
Instead of placing VHs into the scene and adding them to the Social Group, it is also possible to activate ``Spawn as Group``. You can then specify the amount of agents you want to spawn and also provide the types of VHs that should be spawned in the ``VHTypes`` array. Ideally, you want the amount of entries in the``VHTypes`` array to match the group size, otherwise the same agent will get spawned twice.
## Social Group Actor
The Social Group actor will show up in the scene as blue ball and will not be visible during the game. Move the Actor to the position, where the center of the group should be.
The Social Group actor will show up in the scene as white sphere and will not be visible during the game. Move the Actor to the position, where the center of the group should be.
In the details panel under the category **Social Group**, the following properties can be changed:
| Parameter| Details |
...
...
@@ -83,3 +83,8 @@ The **Social Group** actor introduces the following functions:
*``StartDialogue(float InitialDelay)`` If the dialogue did not start with begin play, because ``Start Dialogue`` was turned off, use this function to start the dialogue at a later point in time. The dialogue will start after the given initial delay.
*``JoinGroup(AVirtualHuman* VH)`` Makes the given agent walk towards the Social Group. If close enough, the agent will join the group.
*``LeaveGroup(AVirtualHuman* VH)`` Removes the given agent from the Social Group. After this call a movement call should follow, otherwise, the agent will not move away from the group.
## Known Issues
* When Agents do not spawn in group formation, they get stuck while forming the group.
-> Re-arrange the agents so they are roughly in a group formation