AI Debug

Or “Brainz ala mode”?

This project was inspired by, started with and will be built in conjunction with @mifth 's MonkeyBrains Demo, with particular inspiration from @toolforger.

Purpose: Initially, the purpose is to provide visual debug feedback for the MonkeyBrains agent framework. Eventually this will be extended into a GUI with controls allowing in game adjustments to both the global MB plugin and per agent settings.

Dependencies: Because it will require data directly from the agent framework (just getting the info from the scene node is pointless; we need to see what the AI is seeing) and any settings and controls will be dependent on changes to the framework, AI Debug will be dependent on the MonkeyBrains plugin. Beyond that, it should be responsive to extensions and plugins that extend MonkeyBrains.

However, I will try to make it as self-contained as possible, and a MB plugin itself, if possible, so builders can hopefully integrate it without too much hassle :stuck_out_tongue:

Initial feature goals:

Info overlays (All toggled and set globally or per agent):

FoV (Field of View); Ghost planes defining what areas are visible to the agent.

LoS (Line of Sight); pulsing beams from agent to target – useful for seeing if the LoS is ignoring mesh it shouldn’t

Focus (Pathfinding); fading, color-coded beams between positions being considered by the pathfinding AI. For instance, when an agent is path-finding, the steering needs to find a way around all obstacles to the target, the focus lines would highlight each position the AI is considering in a kind of laser light show that will show what the AI is missing or getting stuck on. In particular, I’m hoping this will show obstacles the AI is ignoring, but the character control doesn’t, or capsule collisions the AI doesn’t predict, or errors in the pathfinding algo, or…

Path; Up to three sets of footprints showing the optimum (and possibly two alternate) path returned by the AI pathfinding. (Inspired by @thetoucher ‘s footprints in Maker’s Tale :wink:

State; Thought bubbles showing the current state (behavior?) of the agent.

These would all be generated mesh objects added to the scene node when AIDebug is enabled. Of course there would be a performance hit (especially, I’m thinking, with Focus enabled), but that’s what debug does, right :stuck_out_tongue:

Adding a GUI for global AI settings and also for accessing agent behaviors and attributes would be the next extensions of AIDebug.

Reading up on GhostControl, I really don’t see how that would apply to the debug info objects.

These objects are being controlled by MB state and data (I.e. a custom control) and will be doing no physics translations/collision-checking of their own. They will need a custom control to adjust verts as needed to the changing AI state (adjusting FoV, keeping the end-points of LoS connected between moving agents and targets, etc,) but the calculation of those verts has already been done between the PhysicsSpace and the agent framework.

Or am I missing something?

The whole point of displaying AI Debug info is to get the info from MB and present it visually, not to recalc collisions or drop a ray trace to generate a line. I don’t even want to translate the LoS up from the ground (or whatever origin) of the character model (…though I’d need it to follow navmesh over hill and dale, so … some intelligent mapping will be needed :stuck_out_tongue: )

I do want the material of debug objects to be distinct, while not concealing (semi-transparent with color/pattern cues that provide additional info), but that’s a material def or two, nothing to do with GhostControl…

@foxhavendesigns @mifth

Check out the latest version of http://www.simbrain.net
It has world, agent and neural net based AI simulations which can be debugged, so you might get some ideas.
Get the latest 3.x beta version and in getting started you’ll see what I mean

2 Likes

Grabbed it, thank you :slight_smile: