The AI Bubbles System wants to be a global hub to collect the AI error messages that needs to be addressed to level designers.
Too many times debugging wrong behavior of any AI agent can take lots of time because it's hard to track down which system is connected with the problem and which cvars needs to be enabled to retrieve the important information.
The solution to this problem is to push important messages into the AI Bubbles System: programmers need to push important messages into the system, and then then the latter will take care of notify to the level designers what's wrong in a specific moment.
Each message pushed inside the system can be displayed as:
You can specify the type of the message queued in the system when calling the AIQueueBubbleMessage.
This function is defined as:
bool AIQueueBubbleMessage(const char* messageName, const IAIObject* pAIObject,
const char* message, uint32 flags);
Where the different parameters are:
Parameter name | Description |
---|---|
messageName | It's a 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 will expire and will be deleted from the queue) |
pAIObject | It's a pointer to the object that is connected to the message |
message | The message that needs to be displayed |
flags | The message type. This value of this variable can be obtained combining the following flags:
|
The following CVars are available to control the AI Bubble System behavior.
CVar name | Description | |
---|---|---|
ai_BubblesSystem | Enables/disables the AI Bubbles System. | |
ai_BubblesSystemDecayTime | Specifies the number of seconds a speech bubble will last on screen before the next message can be drawn. | |
ai_BubblesSystemAlertnessFilter | Specifies the alertness level the designer wants to have: | |
ai_BubblesSystemUseDepthTest | Specifies if the notification needs to be occluded by the world geometries or not. | \ |
ai_BubblesSystemFontSize | Defines the font size for the message displayed in the 3D world. |
AIQueueBubbleMessage("COPStick::Execute PATHFINDER_NOPATH non continuous", pPipeUser, "I cannot find a path.", eBNS_Log|eBNS_Balloon);
local entityID = System.GetEntityIdByName("Grunt.AlienGrunt1");
AI.QueueBubbleMessage(entityID,"This is just a test to try the lua connection with the bubble system");