Godot server architecture

From nix-community/nur-combined · View interactive version

Godot server architecture is an AI agent skill from the GitHub repository nix-community/nur-combined. Expert blueprint for low-level server access (RenderingServer, PhysicsServer2D/3D, NavigationServer) using RIDs for maximum performance. Bypasses scene tree overhead for procedural generation, particle systems, and voxel engines. Use when nodes are too slow OR managing thousands of objects. Keywords

How to use this skill

Skill file

Server Architecture

RID-based server API, direct rendering/physics access, and object pooling define maximum-performance patterns.

Available Scripts

[headless_init_manager.gd](scripts/headless_init_manager.gd)

Automatically detecting and initializing dedicated server logic when launched with --headless or dedicated_server features.

[enet_optimized_host.gd](scripts/enet_optimized_host.gd)

Expert initialization of high-performance ENet UDP hosts with precise bandwidth and client limits.

[dtls_secure_server.gd](scripts/dtls_secure_server.gd)

Securing ENet UDP traffic using DTLS and X509 certificates to prevent man-in-the-middle attacks.

[physics_server_direct.gd](scripts/physics_server_direct.gd)

Massive scale simulation pattern that bypasses the SceneTree by creating bodies directly on the PhysicsServer3D.

[safe_packet_decoder.gd](scripts/safe_packet_decoder.gd)

Crucial network security pattern that explicitly forbids object decoding to prevent Remote Code Execution (RCE) vulnerabilities.

[manual_network_poll.gd](scripts/manual_network_poll.gd)

Moving networking off the main thread by disabling automatic polling and managing manual multiplayer.poll() loops.

[isolated_multiplayer_api.gd](scripts/isolated_multiplayer_api.gd)

Pattern for running Client and Server branches independently within a single Godot instance via isolated API instances.

[server_authority_validator.gd](scripts/server_authority_validator.gd)

Authoritative entry point validation using get_remote_sender_id() to strictly verify client requests.

[websocket_server_compat.gd](scripts/websocket_server_compat.gd)

Ensuring compatibility with HTML5/Web browser clients using WebSocketMultiplayerPeer architecture.

[peer_kick_manager.gd](scripts/peer_kick_manager.gd)

Graceful termination and cleanup of peer connections with custom reason propagation.

NEVER Do in Server Architecture


Direct access to rendering without nodes.

# Create canvas item (2D sprite equivalent)
var canvas_item := RenderingServer.canvas_item_create()
RenderingServer.canvas_item_set_parent(canvas_item, get_canvas_item())

# Draw texture
var texture_rid := load("res://icon.png").get_rid()
RenderingServer.canvas_item_add_texture_rect(
    canvas_item,
    Rect2(0, 0, 64, 64),
    texture_rid
)

PhysicsServer2D

Create physics bodies without nodes.

# Create body
var body_rid := PhysicsServer2D.body_create()
PhysicsServer2D.body_set_mode(body_rid, PhysicsServer2D.BODY_MODE_RIGID)

# Create shape
var shape_rid := PhysicsServer2D.circle_shape_create()
PhysicsServer2D.shape_set_data(shape_rid, 16.0)  # radius

# Assign shape to body
PhysicsServer2D.body_add_shape(body_rid, shape_rid)

When to Use Servers

Use servers for:

Use nodes for:

Reference

Related

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.