Godot

From j4flmao/agent-skills · View interactive version

Godot is an AI agent skill from the GitHub repository j4flmao/agent-skills. Use when the user asks about Godot 4, GDScript projects, scenes and nodes, Godot C#, GDExtension, Jolt physics in Godot, Godot export templates or Godot performance. Produces Godot 4 project structure, gameplay code and export settings. Not for low-level server APIs and deep optimisation (use godot-

How to use this skill

Skill file

Godot Deep Engineering Guide

Purpose

Godot is a free, open-source game engine built around a scene-tree of Nodes, a first-class editor, and a friendly scripting language (GDScript) plus optional C#, C++, and Rust via GDExtension. Its modular renderer supports Forward+, Mobile, and Compatibility backends.

Agent Protocol

Trigger

"godot", "godot 4", "gdscript project", "godot scenes", "godot export", "godot c#", "gdextension".

Input Context

Output Artifact

GDScript/C# code, scene structure or project settings. No file unless requested.

Response Format

Godot: {4.x}  Renderer: {Forward+ | Mobile | Compatibility}
Change: {what and why}
Code: {snippet}
Verify: {profiler / monitors}

1. Engine Architecture

Godot SceneTree
  Scene (Node tree)
    Node (base: name, owner, groups, tree refs)
      Control    -> UI (UI Toolkit equivalent)
      Node2D     -> 2D gameplay
      Node3D     -> 3D gameplay
      ... custom scripts attach via GDScript/C#/GDExtension
  MainLoop -> SceneTree tick: process(delta) -> physics_process(delta)

1.1 Nodes vs `_process`

extends Node

func _ready(): pass            # once when entering tree
func _process(delta): pass     # every rendered frame
func _physics_process(delta): pass  # fixed 60Hz by default
func _input(event): pass       # input events BEFORE process
func _unhandled_input(event): pass # input not consumed by UI

Rules:

1.2 Autoload (Singletons)

Project Settings -> Autoload: one scene/script loaded globally. Use autoload game manager, audio bus, settings. Alternative to Object.get_node('/root/GameManager').

2. The Scene System

2.1 Pattern: Factories via PackedScene

const Bullet = preload("res://scenes/bullet.tscn")
func fire():
    var b = Bullet.instantiate()
    b.position = muzzle.global_position
    b.velocity = Vector2(speed, 0)  # bullet.gd declares `var velocity: Vector2`
    get_tree().current_scene.add_child(b)

2.2 Scene Organization

3. Scripting: GDScript vs C# vs GDExtension

| Option | Use case |

|--------|----------|

| GDScript | Default: rapid iteration, tight editor integration, Python-like |

| C# | Teams familiar with .NET; heavier runtime; good for tool-heavy projects |

| GDExtension (C++/Rust) | Engine-critical hot loops; custom servers; portability |

3.1 GDScript Rules

4. Rendering

4.1 Backends

| Backend | Use |

|---------|-----|

| Forward+ | Desktop default (Vulkan, D3D12 on Windows, Metal on Apple); clustered lighting, SSAO, SSR, SDFGI, volumetric fog |

| Mobile | Mobile and low-end desktop (Vulkan/Metal/D3D12); per-mesh light limits, no SDFGI/volumetric fog |

| Compatibility | OpenGL 3.3 / OpenGL ES 3.0 / WebGL 2; required for web exports and old hardware |

4.2 2D Rendering

4.3 3D Rendering

4.4 Shaders (Godot Shader Language)

shader_type spatial;
uniform vec4 tint : source_color = vec4(1.0);
// Godot 4: SCREEN_TEXTURE was removed; declare a sampler with a hint instead.
uniform sampler2D screen_tex : hint_screen_texture, filter_linear_mipmap;
void fragment() {
    ALBEDO = texture(screen_tex, SCREEN_UV).rgb * tint.rgb;
}

5. Physics

5.1 Fixed Timestep

Engine.physics_ticks_per_second default 60. Determinism: avoid unordered maps in physics callbacks; deterministic float ops across platforms require careful design (Jolt note).

6. Animation

7. UI (Control Nodes)

8. Multiplayer

8.1 Prediction/Reconciliation

The high-level API has no built-in client prediction or lag compensation. For action games implement input buffering + prediction/reconciliation yourself (usually on CharacterBody3D, not RigidBody3D) or use a community addon such as netfox.

9. Asset Pipeline & Tooling

10. Performance Rules

10.1 Node Count Toggle

For thousands of simple nodes prefer a single _draw()-heavy Control/CanvasItem drawing primitives, or render via MeshInstance3D instancing (MultiMesh).

11. Anti-Patterns

| Anti-pattern | Consequence | Fix |

|--------------|-------------|-----|

| GetNode per frame | String path lookups | @onready cache |

| Untyped variables in loops | Slow | typed loops |

| Instantiate/free each shot | Scene-instancing and tree-insertion cost | object pool |

| All nodes _process ticking | CPU | disable unused |

| Many dynamic lights | mobile GPU melt | baked lightmap + clip |

| Coroutine fired without await | Caller continues before the work finishes | await the function or the signal |

12. When to NOT Use Godot

13. References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.