BGL Format
BGL (Blueprint Graph Language) is a compact text format that represents a Blueprint graph — nodes, pins, connections, and default values — in a way that AI can both read and write accurately. It is the primary format used by NodeLens for AI-assisted Blueprint creation and editing.
Why BGL Exists
Unreal Engine Blueprint graphs are stored as large, complex data files that are not designed for human or AI reading. Asking an AI to work directly with this raw data leads to errors, missed connections, and incorrect output.
BGL solves this by expressing the same graph in a clean, structured text format that is compact enough to fit comfortably within an AI's context window, yet precise enough that it can be converted back into a valid Blueprint graph without information loss.
A graph that takes thousands of lines in raw UE5 format typically takes 20–60 lines in BGL.
What BGL Looks Like
Each node is declared with its type and name, followed by its pins on indented lines. Connections between nodes are expressed directly on the pin lines. Here is a simple example — a Branch node that checks if health is zero:
# BGL v1.0
FEntry "CheckDeath" @-336,0
out exec "then" M1 -> M6
out S real "CurrentHealth" M2 -> M3
Op "<= (Float)" @-144,112
in S real "A" M3
in S real "B" M4 =0
out S bool "ReturnValue" M5 -> M7
Br "Branch" @112,0
in exec "execute" M6
in S bool "Condition" M7
out exec "true" M8 -> M10
out exec "false" M9 -> M14
Set "IsDead" @384,16
in exec "execute" M10
out exec "then" M11 -> M20
in S bool "IsDead" M12 =true
out S bool "Output_Get" M13 -> M21
Set "IsDead" @384,128
in exec "execute" M14
out exec "then" M15 -> M18
in S bool "IsDead" M16 =false
out S bool "Output_Get" M17 -> M19
FResult "Function Result" @640,112
in exec "execute" M18
in S bool "IsDead?" M19
FResult "Function Result" @640,0
in exec "execute" M20
in S bool "IsDead?" M21
The equivalent pseudocode for this graph:
CheckDeath(CurrentHealth)
{
if (CurrentHealth <= 0)
{
IsDead = true;
return IsDead;
}
else
{
IsDead = false;
return IsDead;
}
}
Reading the BGL, you can trace the full flow:
M1 → M6— exec flows from Entry into the BranchM2 → M3—CurrentHealthfeeds into the<= (Float)comparison as input AM5 → M7— the comparison result (true if health ≤ 0) becomes the Branch's Condition- If true:
M8 → M10— callsSet IsDead = true, thenM11 → M20flows to the first Function Result - If false:
M9 → M14— callsSet IsDead = false, thenM15 → M18flows to the second Function Result
How BGL is Used in NodeLens
Viewing existing Blueprints
Every Blueprint function you import into NodeLens is automatically converted to BGL and shown in the BGL tab of the viewer. You can copy it, share it, or paste it directly into a conversation with an AI.
Generating new functions
When you ask an AI (via MCP or the in-app chat) to create a new Blueprint function, it writes the result in BGL. You then import it into NodeLens via the Import panel, review it on the Canvas, and save it as a new Blueprint file.
Editing existing functions
You can ask the AI to read an existing function's BGL, modify it, and save the result to a new folder. The original Blueprint is never touched — the AI always works on a copy.
Typical Workflow
The recommended workflow when asking an AI to create or modify a Blueprint function:
Limitations
- BGL captures function graphs only — Blueprint variables, components, class defaults, and event dispatchers are not part of the BGL format. These need to be set up manually in UE5.
- BGL cannot be directly pasted into Unreal Engine. It is a NodeLens format — use it to plan and verify logic, then recreate it in UE5 using the Canvas as a visual guide.
- Very complex graphs with many nodes and data types may occasionally have pin connection errors. Always verify on the Canvas before using the result.