Agent skill

Multiplayer Basics

by jame581 in jame581/GodotPrompter

A skill your agent uses when implementing multiplayer — MultiplayerAPI, ENet/WebSocket peers, RPCs, and authority model

MITAuto-check passedGame Development

Install Multiplayer Basics

skills CLI
$ npx skills add jame581/GodotPrompter --skill multiplayer-basics -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jame581/GodotPrompter multiplayer-basics --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jame581/GodotPrompter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/multiplayer-basics .claude/skills/multiplayer-basics && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
multiplayer-basics
GitHub stars
795
Token cost
~3.1k tokens
SKILL.md length
858 words
Files
5 (incl. references)
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing multiplayer — MultiplayerAPI, ENet/WebSocket peers, RPCs, and authority model

  • Works in 9 steps: Multiplayer Architecture → Setting Up ENetMultiplayerPeer → RPCs → …
  • Implementing multiplayer — MultiplayerAPI
  • SKILL.md covers 1. Multiplayer Architecture, 2. Setting Up…, 3. RPCs and 4. Authority Model, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Multiplayer Basics is an agent skill from jame581/GodotPrompter. Use when implementing multiplayer — MultiplayerAPI, ENet/WebSocket peers, RPCs, and authority model

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/disconnect-handling.md`, `references/enet-setup.md` and `references/player-join-flow.md`).

It sits in Game Development, covering Game development and Realtime and WebSockets. It works with Godot and C#. The repository describes itself as: Agentic skills framework for Godot 4.x. Domain-specific skills for AI coding agents (Claude Code, Copilot, Antigravity, Cursor). The licence is MIT.

When your agent uses it

  • Implementing multiplayer — MultiplayerAPI
  • ENet/WebSocket peers
  • Authority model

Example prompts

  • “/multiplayer-basics”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Multiplayer Architecture
  2. Setting Up ENetMultiplayerPeer
  3. RPCs
  4. Authority Model
  5. Spawning Networked Objects
  6. Player Join Flow
  7. Disconnect Handling
  8. Common Pitfalls
  9. Checklist

What it can do on your machine

Read from SKILL.md and the folder at commit 1e7d79d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are gdscript and csharp).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Multiplayer Basics loads about 3.1k tokens when it runs, and up to ~6.8k if it reads all its reference files. Until then it costs about 30 tokens; SKILL.md has 858 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jame581/GodotPrompter at commit 1e7d79d, republished under its MIT licence (© jame581). 858 words, ~3,073 tokens.

Download SKILL.mdSave it as .claude/skills/multiplayer-basics/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
multiplayer-basics
description
Use when implementing multiplayer — MultiplayerAPI, ENet/WebSocket peers, RPCs, and authority model

Multiplayer Basics in Godot 4.3+

All examples target Godot 4.3+ with no deprecated APIs. GDScript is shown first, C# follows.

Related skills: See multiplayer-sync for state synchronization and interpolation. See dedicated-server for headless export and server deployment.


1. Multiplayer Architecture

Godot uses a client-server model built on top of MultiplayerAPI. One peer acts as the server; all others are clients. Every peer has a unique integer ID assigned by the network layer:

Peer IDRole
1The server (always)
2+Connected clients — randomly generated unique IDs, not sequential

Multiplayer authority is the concept of ownership over a node. Only the authoritative peer should read input and drive that node's state. By default the server (peer 1) is the authority for every node. Call set_multiplayer_authority(peer_id) to transfer ownership to a client.

Server (peer 1)
    ├── Owns game state by default
    ├── Spawns and validates objects
    └── Routes RPCs
Client (peer 2, 3, …)
    ├── Sends input to server via RPC
    └── Receives state updates from server

2. Setting Up ENetMultiplayerPeer

Both sides use the same three steps: create an ENetMultiplayerPeer, call create_server(port, max_clients) or create_client(address, port), then assign it to multiplayer.multiplayer_peer and connect the four MultiplayerAPI signals. Check the create_* return value — it returns an Error, and a silent ERR_CANT_CREATE (port already in use) otherwise looks exactly like a hang.

The server is always peer ID 1; clients receive randomly generated unique IDs, so never assume they are sequential.

Full server and client implementations with every signal handler, in GDScript and C#: references/enet-setup.md


3. RPCs

@rpc (GDScript) / [Rpc] (C#) marks a method as callable across the network. Choose the mode and transfer settings carefully — they affect both security and performance.

RPC Modes
ModeWho may call itExecutes on
"authority" (default)Only the authority peerThe peer(s) it is sent to
"any_peer"Any connected peerThe peer(s) it is sent to
Transfer Modes
ModeDeliveryOrderUse For
"reliable"GuaranteedIn-orderChat, spawn events, important state
"unreliable"Best-effortUnorderedHigh-frequency position updates
"unreliable_ordered"Best-effortIn-order per channelSmooth movement streams
GDScript
gdscript
# chat.gd
extends Node

# Any peer can call; server validates then broadcasts to all peers.
@rpc("any_peer", "reliable")
func send_chat_message(text: String) -> void:
	if not multiplayer.is_server():
		return
	var sender_id := multiplayer.get_remote_sender_id()
	_broadcast_chat.rpc(sender_id, text)


# Only the authority (server) can call this; runs on every peer.
@rpc("authority", "reliable", "call_local")
func _broadcast_chat(sender_id: int, text: String) -> void:
	print("[%d]: %s" % [sender_id, text])


# Client → server: request to spawn an object.
@rpc("any_peer", "reliable")
func request_spawn(scene_path: String, spawn_position: Vector2) -> void:
	if not multiplayer.is_server():
		return
	# Server validates and performs the actual spawn.
	var scene: PackedScene = load(scene_path)
	if scene == null:
		return
	var instance := scene.instantiate()
	instance.global_position = spawn_position
	get_tree().root.add_child(instance)


# High-frequency sync; unreliable_ordered + a channel keeps this off other RPC traffic.
@rpc("authority", "unreliable_ordered", "call_local", 1)
func sync_position(pos: Vector2) -> void:
	global_position = pos

Sending to specific peers:

gdscript
# Send to everyone (including self if call_local is set):
send_chat_message.rpc("Hello!")

# Send to one specific peer:
send_chat_message.rpc_id(target_peer_id, "Hello!")
C#
csharp
// Chat.cs
using Godot;

public partial class Chat : Node
{
    // Any peer can call; executes on the server only.
    [Rpc(MultiplayerApi.RpcMode.AnyPeer, TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)]
    public void SendChatMessage(string text)
    {
        if (!Multiplayer.IsServer()) return;
        int senderId = Multiplayer.GetRemoteSenderId();
        Rpc(MethodName.BroadcastChat, senderId, text);
    }

    // Authority only; runs on every peer including the caller.
    [Rpc(MultiplayerApi.RpcMode.Authority,
         CallLocal = true,
         TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)]
    private void BroadcastChat(int senderId, string text)
        => GD.Print($"[{senderId}]: {text}");

    // Client → server: request a spawn.
    [Rpc(MultiplayerApi.RpcMode.AnyPeer, TransferMode = MultiplayerPeer.TransferModeEnum.Reliable)]
    public void RequestSpawn(string scenePath, Vector2 spawnPosition)
    {
        if (!Multiplayer.IsServer()) return;
        var scene = GD.Load<PackedScene>(scenePath);
        if (scene == null) return;
        var instance = scene.Instantiate<Node2D>();
        instance.GlobalPosition = spawnPosition;
        GetTree().Root.AddChild(instance);
    }

    // High-frequency position sync.
    [Rpc(MultiplayerApi.RpcMode.Authority,
         CallLocal = true,
         TransferMode = MultiplayerPeer.TransferModeEnum.UnreliableOrdered,
         TransferChannel = 1)]
    public void SyncPosition(Vector2 pos)
        => GlobalPosition = pos;
}

Sending to specific peers in C#:

csharp
// Broadcast to all:
Rpc(MethodName.SendChatMessage, "Hello!");

// Send to one peer:
RpcId(targetPeerId, MethodName.SendChatMessage, "Hello!");

4. Authority Model

Every node has exactly one authoritative peer — the peer that is permitted to send state updates for that node. Other peers should treat incoming state as read-only.

GDScript
gdscript
# player.gd
extends CharacterBody2D

func _ready() -> void:
	# multiplayer.get_unique_id() = this peer's ID; server assigns authority during spawn (see Section 6).
	pass


func _physics_process(delta: float) -> void:
	# Guard: authority-only input and movement.
	if not is_multiplayer_authority():
		return

	var direction := Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down")
	velocity = direction * 200.0
	move_and_slide()

	sync_position.rpc(global_position)


@rpc("authority", "unreliable_ordered", "call_local", 1)
func sync_position(pos: Vector2) -> void:
	if not is_multiplayer_authority():
		global_position = pos


func print_authority_info() -> void:
	print("My peer ID : %d" % multiplayer.get_unique_id())
	print("Authority  : %d" % get_multiplayer_authority())
	print("Am I auth? : %s" % str(is_multiplayer_authority()))
C#
csharp
// Player.cs
using Godot;

public partial class Player : CharacterBody2D
{
    public override void _PhysicsProcess(double delta)
    {
        // Guard: authority-only input.
        if (!IsMultiplayerAuthority()) return;

        var direction = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
        Velocity = direction * 200f;
        MoveAndSlide();

        Rpc(MethodName.SyncPosition, GlobalPosition);
    }

    [Rpc(MultiplayerApi.RpcMode.Authority,
         CallLocal = true,
         TransferMode = MultiplayerPeer.TransferModeEnum.UnreliableOrdered,
         TransferChannel = 1)]
    private void SyncPosition(Vector2 pos)
    {
        if (!IsMultiplayerAuthority())
            GlobalPosition = pos;
    }
}

API summary:

MethodReturnsNotes
multiplayer.get_unique_id()intThis peer's ID
get_multiplayer_authority()intID of the peer that owns this node
is_multiplayer_authority()boolTrue if this peer owns this node
set_multiplayer_authority(id)voidTransfer ownership; call on the server

5. Spawning Networked Objects

Use MultiplayerSpawner to replicate scene instances across peers. The server adds a child to the spawned node's parent, the spawner mirrors it on every peer with synchronized state. For dynamic spawn paths, configure _spawnable_scenes and call add_child(scene.instantiate()) only on the server.

See references/spawning-networked-objects.md for MultiplayerSpawner scene setup and the spawn-on-server flow (GDScript + C#).


6. Player Join Flow

The full lobby-join lifecycle: peer connects → server allocates a slot → load lobby scene → spawn player node → broadcast peer-list to all clients → on "start match" RPC, transition all peers to gameplay scene.

See references/player-join-flow.md for the full GDScript and C# implementation (peer-connected handler, slot allocation, lobby state, gameplay transition).


Show full SKILL.md (364 more words)Show less

7. Disconnect Handling

Listen for peer_disconnected(id) on the multiplayer API. On the server: free the disconnected peer's player node and broadcast the updated peer-list. On clients: detect a server-disconnect and route to a reconnect / main-menu screen.

See references/disconnect-handling.md for the timeout detection settings, server-side cleanup, and client-side reconnect flow (GDScript + C#).


8. Common Pitfalls

PitfallSymptomFix
Calling an RPC on the wrong authorityrpc_id silently ignored; method never runsCheck is_multiplayer_authority() before sending; use "any_peer" only where intentional
Desync from unordered RPCsPositions jitter or snapUse "unreliable_ordered" for streams; use "reliable" for critical state changes
Reading input in _process vs _physics_processMovement desyncs on different frame ratesAlways move CharacterBody2D in _physics_process; send sync RPCs from there too
Not checking is_multiplayer_authority() before inputEvery peer controls every playerAdd an if not is_multiplayer_authority(): return guard at the top of input handling
Spawning without MultiplayerSpawnerObject appears on server, missing on clientsEvery runtime add_child on the server that should be replicated must go through MultiplayerSpawner.spawn()
Forgetting call_local on authority RPCsServer state diverges from its own nodeAdd "call_local" when the sender also needs to execute the RPC locally
Using rpc() before the peer is assignedCrash or silent failureAssign multiplayer.multiplayer_peer before calling any RPC
Not stripping res:// scenes from exported buildsClients can read server-only scriptsUse export_exclude or PCK encryption for sensitive server code

9. Checklist

  • ENetMultiplayerPeer.create_server() / create_client() return OK before assigning to multiplayer.multiplayer_peer
  • All four multiplayer signals connected: peer_connected, peer_disconnected, connected_to_server, connection_failed
  • Every node that reads player input guards with if not is_multiplayer_authority(): return
  • Input processing and sync_position RPC are both in _physics_process, not _process
  • RPC modes chosen deliberately: "any_peer" only for client → server calls; "authority" for server → client
  • Unreliable RPCs used only for high-frequency updates (position, rotation); reliable for events (spawn, damage, chat)
  • MultiplayerSpawner configured with all spawnable scenes before the first player joins
  • set_multiplayer_authority(peer_id) called on the server after each player node is spawned
  • peer_disconnected handler frees the player node and removes it from tracking collections
  • server_disconnected handler on clients returns to main menu and nulls multiplayer.multiplayer_peer
  • is_instance_valid() checked before dereferencing any stored node reference in disconnect callbacks
  • No rpc() calls made before multiplayer.multiplayer_peer is assigned

© jame581, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in skills/multiplayer-basics of jame581/GodotPrompter.

  • SKILL.md
  • references/disconnect-handling.md
  • references/enet-setup.md
  • references/player-join-flow.md
  • references/spawning-networked-objects.md

Open the folder on GitHubat commit 1e7d79d

Compare with similar skills

Multiplayer Basics next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Multiplayer Basics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Multiplayer Basics this skilljame581/GodotPrompter795—~3.1kAutomated safety check: PassMIT
Godot Admob App Openpoingstudios/godot-admob-plugin632—~1kAutomated safety check: PassMIT
Godot Admob Bannerpoingstudios/godot-admob-plugin632—~718Automated safety check: PassMIT
Godot Admob Get Startedpoingstudios/godot-admob-plugin632—~1kAutomated safety check: PassMIT
Godot Admob Interstitialpoingstudios/godot-admob-plugin632—~1.1kAutomated safety check: PassMIT
Godot Admob Native Overlaypoingstudios/godot-admob-plugin632—~1kAutomated safety check: PassMIT

Similar skills

  • Godot Admob App Open

    poingstudios/godot-admob-plugin

    Provides instructions to implement, load, show, and destroy App Open ads (shown on application startup or app resume) in GDScript and C.

    632 GitHub stars~1k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Godot Admob Banner

    poingstudios/godot-admob-plugin

    Provides instructions to implement, load, and destroy banner ads (AdView) using custom or adaptive sizes in GDScript and C.

    632 GitHub stars~718 tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Godot Admob Get Started

    poingstudios/godot-admob-plugin

    Provides instructions to initialize the Godot AdMob SDK and configure user consent (UMP Flow) in GDScript and C.

    632 GitHub stars~1k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Godot Admob Interstitial

    poingstudios/godot-admob-plugin

    Provides instructions to implement, load, show, and destroy interstitial ads (full-screen image/text ads) in GDScript and C.

    632 GitHub stars~1.1k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Godot Admob Native Overlay

    poingstudios/godot-admob-plugin

    Provides instructions to implement, load, show, and destroy Native Overlay ads (customized/native-looking Control node template overlays) in GDScript and C.

    632 GitHub stars~1k tokensUpdated 7 days ago
    Game DevelopmentAuto-check passed
  • Apply the Stage Tamagotchi Godot C development method and code style when working in apps/stage-tamagotchi-kirie or its migration predecessor, engines/stage-tamagotchi-godot.

    50k GitHub stars~677 tokensUpdated today
    Game DevelopmentAuto-check passed

More from jame581/GodotPrompter

All 58 skills in this repo
  • Godot 2D Essentials

    jame581/GodotPrompter

    Covers Godot 4.3+ 2D systems with GDScript and C# examples: canvas layers, draw order, TileMaps, parallax, lights and shadows, particles and custom drawing.

    795 GitHub stars~2.3k tokensUpdated 2 days ago
    Auto-check passed
  • Godot 3D Essentials

    jame581/GodotPrompter

    Covers Godot 4.3+ 3D systems such as materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling and decals, with GDScript first and C# second.

    795 GitHub stars~3.7k tokensUpdated 2 days ago
    Auto-check passed
  • Godot Ability System

    jame581/GodotPrompter

    Builds a data-driven ability system in Godot 4 from Resources and a component node, with cooldowns, buffs, stat modifiers, gameplay tags and HUD binding.

    795 GitHub stars~3k tokensUpdated 2 days ago
    Auto-check passed
  • Godot Addon Development

    jame581/GodotPrompter

    Covers Godot 4.3+ editor plugins: plugin folders, @tool scripts, the EditorPlugin lifecycle, custom inspectors, dock panels and gizmos, in GDScript and C#.

    795 GitHub stars~3.3k tokensUpdated 2 days ago
    Auto-check passed
  • Godot AI Navigation

    jame581/GodotPrompter

    Covers pathfinding and enemy movement in Godot 4.3 and later: navigation regions, NavigationAgent nodes, steering, behavior trees and patrol routes.

    795 GitHub stars~3.5k tokensUpdated 2 days ago
    Auto-check passed
  • Godot Animation System

    jame581/GodotPrompter

    Covers animation in Godot 4.3 and later: AnimationPlayer basics, AnimationTree blend trees and state machines, sprite animation, skeleton IK and code-driven motion.

    795 GitHub stars~3.8k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Multiplayer Basics

What does Multiplayer Basics do?

A skill your agent uses when implementing multiplayer — MultiplayerAPI, ENet/WebSocket peers, RPCs, and authority model. Multiplayer Basics is an agent skill from jame581/GodotPrompter.

When should I use Multiplayer Basics?

Multiplayer Basics fits situations like: implementing multiplayer — MultiplayerAPI; ENet/WebSocket peers; authority model.

How do I install Multiplayer Basics in Claude Code?

Run `npx skills add jame581/GodotPrompter --skill multiplayer-basics -a claude-code`. Or copy the skill folder (skills/multiplayer-basics in jame581/GodotPrompter) into .claude/skills/multiplayer-basics in your project. Claude Code loads it when a task matches its description.

How do I install Multiplayer Basics in Codex?

Run `npx skills add jame581/GodotPrompter --skill multiplayer-basics -a codex`. Or copy the skill folder (skills/multiplayer-basics in jame581/GodotPrompter) into .agents/skills/multiplayer-basics in your project. Codex loads it when a task matches its description.

Can I use Multiplayer Basics in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jame581/GodotPrompter --skill multiplayer-basics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/multiplayer-basics, .gemini/skills/multiplayer-basics, .github/skills/multiplayer-basics and .opencode/skills/multiplayer-basics in your project.

What does Multiplayer Basics need to run?

SKILL.md names no scripts, command-line tools or credentials: Multiplayer Basics is instructions for the agent only.

Does Multiplayer Basics access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Multiplayer Basics safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Multiplayer Basics use?

Multiplayer Basics is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Multiplayer Basics use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.7k tokens, read only when the agent opens those files.

What are the alternatives to Multiplayer Basics?

Skills that share tags, products or a category with Multiplayer Basics: Godot Admob App Open (poingstudios/godot-admob-plugin, 632 stars), Godot Admob Banner (poingstudios/godot-admob-plugin, 632 stars), Godot Admob Get Started (poingstudios/godot-admob-plugin, 632 stars) and Godot Admob Interstitial (poingstudios/godot-admob-plugin, 632 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Multiplayer Basics?

jame581 (a GitHub user) maintains it in jame581/GodotPrompter, which has 795 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 6, 2026.

Source: jame581/GodotPrompter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.