From 9dfe0d6fee81dcfc0f5f81edd7c602c7585bbfa3 Mon Sep 17 00:00:00 2001 From: deathtaco1408 <61480526+deathtaco1408@users.noreply.github.com> Date: Mon, 30 Mar 2026 21:14:16 -0700 Subject: [PATCH 1/2] Update RPC method guidelines in multiplayer tutorial Clarify RPC method requirements and supported patterns in high-level multiplayer documentation. --- .../networking/high_level_multiplayer.rst | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tutorials/networking/high_level_multiplayer.rst b/tutorials/networking/high_level_multiplayer.rst index bb22a349eae..b9fe3d0d605 100644 --- a/tutorials/networking/high_level_multiplayer.rst +++ b/tutorials/networking/high_level_multiplayer.rst @@ -269,6 +269,7 @@ must have the same name. When using ``add_child()`` for nodes which are expected See further explanation and troubleshooting on `this post `__. + The annotation can take a number of arguments, which have default values. ``@rpc`` is equivalent to: .. tabs:: @@ -336,6 +337,39 @@ The function ``multiplayer.get_remote_sender_id()`` can be used to get the uniqu // Process the input and affect game logic. } +RPC methods must be defined on Node-based scripts +----------------------------------------------- + +Godot's high-level multiplayer RPC system is built around the scene tree and ``Node`` paths. +In practice, RPC methods should be defined on scripts attached to ``Node``-derived classes. + +Using ``@rpc`` on methods defined only in non-``Node`` classes (for example, plain ``Resource`` or +``RefCounted``-based helper scripts) is not supported by the high-level multiplayer API and can +result in runtime errors when calling ``rpc()`` or ``rpc_id()``. + +Supported pattern: + +.. code-block:: gdscript + + extends Node + + @rpc("any_peer") + func submit_input(input_vector: Vector2) -> void: + pass + +Unsupported pattern: + +.. code-block:: gdscript + + extends RefCounted + + @rpc("any_peer") + func submit_input(input_vector: Vector2) -> void: + pass + +If you need multiplayer RPC behavior, keep the RPC entry points on ``Node`` scripts and call into +helper objects from there. + Channels -------- Modern networking protocols support channels, which are separate connections within the connection. This allows for multiple From bb27329f059947433fa67d78645d22de66e00e76 Mon Sep 17 00:00:00 2001 From: deathtaco1408 <61480526+deathtaco1408@users.noreply.github.com> Date: Mon, 30 Mar 2026 22:02:02 -0700 Subject: [PATCH 2/2] Clarify RPC method definition requirements in Godot Added a note about Godot's RPC system requirements for node-based scripts. --- tutorials/networking/high_level_multiplayer.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tutorials/networking/high_level_multiplayer.rst b/tutorials/networking/high_level_multiplayer.rst index b9fe3d0d605..8663cf247ba 100644 --- a/tutorials/networking/high_level_multiplayer.rst +++ b/tutorials/networking/high_level_multiplayer.rst @@ -337,6 +337,14 @@ The function ``multiplayer.get_remote_sender_id()`` can be used to get the uniqu // Process the input and affect game logic. } +.. note:: + + Godot's high-level RPC system is node-based. Methods marked with ``@rpc`` should be defined on + scripts attached to ``Node``-derived classes. Defining RPC methods only on non-``Node`` classes + is not supported and may result in runtime errors. + + If needed, keep RPC entry points on ``Node`` scripts and delegate logic to helper objects. + RPC methods must be defined on Node-based scripts -----------------------------------------------