Skip to main content

C++ Code Structure

The source code for the InworldAI Plugin consists of three modules, one of them InworldAIIntegration is meant to be used by developers directly. It consists of:

  • UInworldApiSubsystem. Represents the main API to communicate with the Inworld AI platform. It is responsible for starting sessions and messaging.
  • Inworld::IPlayerComponent and Inworld::ICharacterComponent - interfaces that must be registered in UInworldApiSubsystem to get and handle messages from Inworld server.
  • UInworldPlayerComponent. The component implements Inworld::IPlayerComponent and is the default messaging component supposed to be added to Player Pawn. This component is supposed to be used as is but can be substituted by a custom Player Component that implements Inworld::IPlayerComponent.
  • UInworldPlayerTargetingComponent - default component for choosing the target Character component to communicate with. The component searches the target based on distance and camera direction.
  • UInworldPlayerAudioCaptureComponent - default component for capturing audio from a mic. It requires standard Unreal Engine AudioCaptureComponent.
  • UInworldCharacterComponent. The component implements Inworld::ICharacterComponent and is the default messaging component for an Inworld character. It responsible for getting messages, queueing and passing it to the Playbacks - subcomponents that can handle the messages in different ways.
  • UInworldCharacterPlayback - base class for a Playback. Any Playback in C++ or Blueprint is inherited from this class.
  • UInworldCharacterPlaybackAudio - default Audio Playback. It handles Audio messages and uses Audio component to play it.
  • UInworldCharacterPlaybackAudioLipSync - inherited from UInworldCharacterPlaybackAudio. It generates data for Lip Syncing based on Audio. Requiers OVRLipSyncPlaybackActorComponent.
  • UInworldCharacterPlaybackHistory - default Playback for saving the history of communication with the Player.
  • UInworldCharacterPlaybackTrigger. This Playback is responsible for handling Triggers.

You don't have to use the default Playbacks. A custom Playback can be created both in C++ or as a Blueprint and added to InworldCharacterComponent on your character. character-playbacks