Enabling an AI's Debug Tools - Black-Horizon-Studios/Emerald-AI GitHub Wiki

Enabling an AI's Debug Tools

Emerald AI features built-in debugging tools for AI that are not behaving as expected. This can make it easier to pinpoint issues by having previously hidden information visible.

To enable an AI's Debug Tools, go to an AI's Emerald AI editor and navigate to the Docs tab. At the bottom of this tab underneath the Report a Bug button, you will see Enable Debugging. Setting this setting to true will make more options available.

Draw Raycasts

This setting is mostly used by ranged AI and it allows raycasts to be draw and visible, while in the Unity Editor. This can be useful for ensuring raycast are being positioned correctly to targets. For some non-AI targets, such as players, the position of the raycast may be at the base of the target which can result in the AI being unable to detect the target properly. In this case, a TargetPositionModifier will need to be used. (The TargetPositionModifier is an upcoming feature that will be added with the 2.5 update).

Note: Drawn raycasts are only visible when in the Unity Editor with Unity's Gizmos enabled.

A yellow line indicates an AI's line of sight towards its look at target.

A green line indicates that the AI's sight is not obstructed towards its current combat target and that it can successfully attack.

A red line indicates that an AI's line of sight is obstructed towards its current combat target and that it cannot attack until its line of sight becomes unobstructed (a green line as explained above).

A orange line indicates an AI's view of each AI within its detection radius, even if the targets aren't yet visible by the AI (When using the Line of Sight Detection Type).

Debug Log Targets

Allows the target objects to be displayed in the Unity Console. This can be useful for ensuring the proper object is being hit when the AI is targeting an object and that it is assigned the correct Target Type.

Debug Log Obstructions

Allows the AI's obstructions to be displayed in the Unity Console. This can be useful for ensuring the proper object is being hit when the AI is targeting an object. This is also useful for identifying detection issues in cases where AI are not attacking correctly even though they have a clear line of sight. Sometimes there are hidden colliders in a scene or player controllers can have internal colliders. This debug setting should identify said colliders.

Debug Log Projectile Collisions

Allows the AI's projectiles to debug log what they collider with. This can be useful if your projectiles don't seem to be hitting the correct collision source.