Godot Editor Bridge

Live two-way communication between EngineForge and a running Godot Editor instance via HTTP REST. The bridge enables the AI Agent to create nodes, attach scripts, manage resources, and control the editor remotely.

How it works

  1. When the IDE detects a Godot project (via project.godot), it auto-deploys a GDScript plugin toaddons/gamedev_ide_bridge/
  2. The plugin is a @tool EditorPlugin that starts an HTTP server on ports 27050–27060
  3. The plugin writes a discovery file to.godot/gamedev_ide/bridge.json with the active port
  4. The IDE polls this file every 5 seconds to discover the Godot instance
  5. Once discovered, all communication happens via HTTP request/response

First-time setup

Unlike Unity, Godot requires you to manually enable the plugin once:

  1. Open your project in Godot Editor
  2. Go to Project → Project Settings → Plugins
  3. Find “GameDev IDE Bridge” and check Enable

After enabling, the plugin loads automatically on every subsequent editor launch. The port range (27050–27060) is separate from Unity's range (26742–26752) to avoid conflicts when both editors are running.

HTTP endpoints

MethodPathPurpose
GET/statusHealth check
POST/commandExecute a single command
POST/batchExecute an array of commands
GET/eventsDrain buffered events

Command categories

Scene

ActionDescription
getTreeGet the full node tree of the current scene
createCreate a new blank scene
openOpen an existing .tscn file
saveSave the current scene
getActiveGet the currently open scene info

Node

ActionDescription
createCreate a node with a given type, name, and parent path
deleteDelete a node by path
duplicateDuplicate a node
setPropertySet a property value on a node
getPropertiesGet all properties of a node
findFind a node by name or path
reparentMove a node to a new parent
setTransformSet position, rotation, and scale

Script

ActionDescription
attachAttach a GDScript file to a node
detachRemove the script from a node

Resource

ActionDescription
createCreate a resource (e.g. Material)
findFind a resource by path

Editor

ActionDescription
playStart the game
stopStop the game
pausePause the running game
getStateCheck editor state (playing, paused, stopped)
getScreenInfoGet viewport/screen resolution info

Project

ActionDescription
getInfoGet project name, Godot version, and path
scanRescan the project filesystem

Key differences from Unity

ConceptUnityGodot
Object modelGameObject + ComponentsNode tree (type is the node itself)
Script attachmentAdded as a componentAttached directly to a node
Scene creationCamera + Light auto-addedRoot node type chosen by the AI
Undo supportVia Undo.RegisterCreatedObjectUndoVia EditorUndoRedoManager
Plugin setupFully automaticOne-time manual enable required
Port range26742–2675227050–27060

Smart features

Undo/Redo support

All mutations go through Godot's EditorUndoRedoManager, so every bridge command can be undone with Ctrl+Z in the editor.

Node ownership

Nodes created via the bridge automatically getnode.owner = edited_scene_root set, ensuring they persist when the scene is saved.

Type instantiation

Node types are resolved via ClassDB.instantiate(). Any built-in Godot node type (Sprite2D, CharacterBody2D, Camera2D, Label, etc.) can be created. Unknown types fall back to a plain Node.

Physics rules

These are critical rules the AI follows when creating physics-based scenes in Godot:

  1. Every CollisionShape2D must have a shape resource assigned. Creating a CollisionShape2D without setting its shape property results in a non-functional collision shape.
  2. Shape sizes use full dimensions, not half-extents. A RectangleShape2D with size: [40, 80] is 40 pixels wide and 80 pixels tall.
  3. For CapsuleShape2D, set height before radius. This is a Godot constraint: height must be ≥ 2 × radius.
  4. Every physics body needs a CollisionShape2D childwith a shape assigned:
    CharacterBody2D (Player)
    ├── CollisionShape2D (must have shape!)
    └── Sprite2D or ColorRect

Scene workflows

Creating a new scene

  1. Write any scripts needed (GDScript files)
  2. Call editor.getScreenInfo to get viewport dimensions
  3. Call scene.create to create a blank scene
  4. Create all nodes in a single batch for efficiency
  5. Attach scripts to nodes
  6. Call scene.save

Modifying an existing scene

  1. Call scene.getTree to see the current node structure
  2. Review what exists before making changes
  3. Add, modify, or remove nodes as needed
  4. Call scene.save

Timeouts

SettingValue
Single command timeout15 seconds
Batch timeout60 seconds
Discovery poll interval5 seconds
Event poll interval2 seconds