Menu
Lumberyard
Developer Guide (Version 1.11)

AI Bubbles System

The AI Bubbles system collects AI error messages for level designers to address. This system streamlines the debugging process by helping to track down which system(s) are connected to a problem. To use the AI Bubbles system, programmers need to push important messages into the system, which will then provide notification to the level designers when a problem is occurring.

Message Display Types

Message include a set of information (agent name, position, etc.) that help the designer to understand that something is wrong in the normal flow. Message notifications can be displayed in any of the following ways:

  • Speech bubble over the AI agent

  • Error message in the console

    
                            Error message in the console
  • Blocking Windows message box

Specifying Notification Display Types

Use one of the following ways to specify a display type for error messages:

Console

ai_BubblesSystem

Enables/disables the AI Bubbles System.

ai_BubblesSystemDecayTime

Specifies the number of seconds a speech bubble will remain on screen before the next message can be drawn.

ai_BubblesSystemAlertnessFilter

Specifies which notification types to show to the designer:

  • 0 - No notification types

  • 1 - Only logs in the console

  • 2 - Only bubbles

  • 3 - Logs and bubbles

  • 4 - Only blocking popups

  • 5 - Blocking popups and logs

  • 6 - Blocking popups and bubbles

  • 7 - All notifications types

ai_BubblesSystemUseDepthTest

Specifies whether or not the notification needs to be occluded by the world geometries.

ai_BubblesSystemFontSize

Specifies the font size for notifications displayed in the 3D world.

C++

In C++, use the method AIQueueBubbleMessage() to define how to display the message notification.

Method signature:

Copy
bool AIQueueBubbleMessage(const char* messageName, const IAIObject* pAIObject, const char* message, uint32 flags);

Parameters:

messageName

String describing the message. This is needed to queue the same message error more than once. (The message can be pushed into the system again when it expires is deleted from the queue.)

pAIObject

Pointer to the AI object that is connected to the message.

message

Text of the message to be displayed.

flags

Notification type. This parameter can include one or more flags; multiple flags are separated using a pipe (|).

  • eBNS_Log

  • eBNS_Balloon

  • eBNS_BlockingPopup

Example:

Copy
AIQueueBubbleMessage("COPStick::Execute PATHFINDER_NOPATH non continuous", pPipeUser, "I cannot find a path.", eBNS_Log|eBNS_Balloon);

Lua Script

Copy
local entityID = System.GetEntityIdByName("Grunt.AlienGrunt1"); AI.QueueBubbleMessage(entityID,"I cannot find a path.");