Augmentations Character - WEKIT-ECS/MIRAGE-XR GitHub Wiki

Character Augmentation

Character augmentation allows the user to create an intelligent avatar which can do different behaviors including following a path or the player, talk and play different types of animations. All behaviors are configurable in all action steps.

character_settings

Data Model

All settings for all steps will be saved in a separate JSON data file in the characterinfo folder of the activity. Each character augmentation has a separate JSON data file in this folder, using the character augmentation (poi) ID as file name.

At the start of each step, a method "ParseCharacters" is called, loading the character and its settings for that step.

Edit/Play mode

The settings panel is only available in EditMode.

Some character behaviours come into action only in PlayMode. For example, only in PlayMode, the character will loop for 'follow path' mode. Similarly, the option to set a trigger to automatically move to a (next) target action step once animations and audio have been played in full comes only into effect in PlayMode. This is to avoid interference with editing.

Classes

CharacterAugmentation: Create the character and the first node. Common methods with other augmentations are implemented here.

CharacterController: Responsible for all behaviours and also loading and saving the data. This is the main class of the characters.

Destination: Control the path nodes. Each node has a destination component attached.

CharacterSettings: Holds the character settings

AI mode

The AI mode is using the following services:

  • DialogueService.cs (IBM Watson and OpenAI chatGPT wrapper)
  • SpeechInputService.cs (IBM Watson wrapper)
  • SpeechOutputService.cs (IBM Watson wrapper)
  • it currently does not use LangTransService.cs (IBM Watson machine translation)
  • and there is a rudimentary implementation for user profile extraction and an example of a decision tree implemented (UserProfile.cs and ExerciseController)

To change the service from IBM Watson to OpenAI chatGPT:

Open the IBMWatsonAssistant.prefab:

image

Select the WatsonServices gameobject:

image

Select OpenAI instead of Watson from the AI dropdown:

image

[!IMPORTANT]
Don't forget to place the .openai credentials file into the root folder of the Unity project. Don't forget to place the ibm-credentials.env credentials file into the root folder of the Unity project.