General Workflow

Avatar Input Standard defines the storage of all input fields in a single AvatarOverallInput component, as well as logically divides the rights for data reading and writing between the components that interact through it. The general workflow scheme looks as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2aae50f1-a19b-4914-8e39-6c4ded6af297/Untitled.png

As can be seen from the scheme, AvatarOverallInput component is independent (i.e. does not refer to any other components). Components that use AvatarOverallInput could be conveniently classified into two groups:

  1. Receivers;
  2. Transmitters.

Receivers turn to particular fields of AvatarOverallInput component and use them in their own calculations. Transmitters write input values into the fields of AvatarOverallInput component, thus controlling the character. The role of a transmitter can be performed by the elements of user input and AI component of avatar's logic. According to the Standard, avatar control should be performed by either keyboard layout (same as Avatar layout), or AI component. Otherwise the input conflict is possible.

Avatar Overall Input

AvatarOverallInput component looks as follows:

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/015c0b6f-251b-4478-85d7-057a2453bb8a/Untitled.png

HasPlayer parameter gets the true value in case the avatar is controlled by the player camera. OnPlayerEnter and OnPlayerExit events are being performed at the start and the end of avatar control by the player camera. Camera Position parameter holds coordinates of the player camera location. LookRotation parameter defines the turn of the avatar's overview, while Look Position parameter defines the location of the avatar's overview point. For example, in case with the player's avatar, LookRotation would turn his body in horizontal and vertical plane, and Look Position would correspond with interception point of the ray that is emitted from the center of the screen with the nearest surface of the game world, which could be used for correcting the flight of a projectile fired to the center of the screen. Avatar Layout Prefab parameter holds the reference to avatar's layout prefab, which is used in the Player Camera Standard to load the avatar's user interface.

Player Camera Standard

The set of input fields is used to directly receive and transmit input data between components, which interact through AvatarOverallInput. Every input field holds the following data:

  1. Name;
  2. Type;
  3. Data.

The name of the field is used to turn to it from the other components.