Skip to content

fix(unreal): correct Multiplayer Architect RPC validation and GAS setup - #1053

Open
raiden-02 wants to merge 1 commit into
msitarzewski:mainfrom
raiden-02:fix/unreal-multiplayer-architect-examples
Open

raiden-02 wants to merge 1 commit into
msitarzewski:mainfrom
raiden-02:fix/unreal-multiplayer-architect-examples

Conversation

@raiden-02

Copy link
Copy Markdown

What does this PR do?

Some code examples in game-development/unreal-engine/unreal-multiplayer-architect.md either kick honest players off the server or don't compile. This PR fixes them. The agent's persona and structure are unchanged.

  • The _Validate example kicks honest players. If _Validate returns false, the server disconnects the player. The example returned false when the target was too far away or no longer existed. With lag, an honest player can send exactly that request, because the target moved or died before the request arrived. Those checks now run in _Implementation, which just ignores the request. _Validate now only rejects requests that are impossible. I also added a one-line rule that explains this.

  • The GAS (Gameplay Ability System) example doesn't compile. It had two errors:

    • It put BlueprintReadOnly on a private member, which Unreal's header tool rejects.
    • It called GetOrSpawnAttributes, which doesn't exist.

    It also created the ability system component on the Character but told it the PlayerState was its owner. The component now lives on the PlayerState, which matches how this agent already initializes it in PossessedBy and OnRep_PlayerState.

  • The update frequency example uses an API deprecated in UE 5.5. It set NetUpdateFrequency directly. It now calls SetNetUpdateFrequency() and SetMinNetUpdateFrequency(), which is what the agent's own rules already say to do.

  • The RunUAT.bat command lost all its arguments. The command was split over several lines without ^ at the end of each line, so RunUAT only received BuildCookRun. It now has ^ on each line and its own bat code block. I added -noclient so a server-only build doesn't also build, cook and stage the game client. I also changed the comment marker in the ini example to the one Unreal's ini parser actually recognizes.

  • Two names don't exist in the engine. FNetworkPredictionStateBase is now TNetworkPredictionStateTypes<InputCmd, SyncState, AuxState>, and the console command net.RepGraph.PrintAllNodes is now Net.RepGraph.PrintGraph.

Agent Information (if adding/modifying an agent)

  • Agent Name: Unreal Multiplayer Architect
  • Category: Game Development (game-development/unreal-engine/)
  • Specialty: UE5 networking: replication, server-authoritative gameplay, GAS replication, dedicated servers

How I tested it (UE 5.8, Windows)

I copied the code examples exactly as written, both from main and from this branch, into an empty UE 5.8 project and built them. The only extra code was placeholder versions of functions the examples mention but never define, such as PerformInteraction and OnRep_Health.

Example On main With this PR
Replicated actor, GameMode and GameState classes builds builds with no warnings
GAS setup fails: BlueprintReadOnly should not be used on private members. With that worked around, it fails again: 'GetOrSpawnAttributes': is not a member of 'UAbilitySystemComponent' builds with no warnings
Update frequency builds with 5 deprecation warnings (C4996) builds with no warnings

I also ran a real dedicated server with a client connected to it. The client called ServerRequestInteract three times: with a target 100 units away, then 1000 units away, then with nullptr.

  • On main: the first request worked. On the second, the server logged ReceivedRPC: RPC_GetLastFailedReason: ServerRequestInteract_Validate and closed the connection. The client reported ConnectionLost.
  • With this PR: the first request worked, the other two were ignored, and the client stayed connected.
  • GAS with this PR: on both the server and the client, the ability system component sat on the PlayerState, its owner was the PlayerState, its avatar was the Character, and the attribute set was registered. When the server set Health to 42, the client also saw 42.

For RunUAT.bat, I ran both versions through cmd.exe with a fake RunUAT.bat that prints whatever it receives. On main it received only BuildCookRun. With this PR it receives every flag.

The repo's own checks also pass:

  • scripts/lint-agents.sh
  • scripts/test-convert-outputs.sh --drift=advisory: 32 of 32 checks, 282 agents across 15 tools

I used AI to help prepare this. All the builds and runs above were done on my machine.

Checklist

  • Follows the agent template structure from CONTRIBUTING.md (unchanged)
  • Includes YAML frontmatter with name, description, color (unchanged)
  • Has concrete code/template examples (for new agents): not applicable, this edits an existing agent
  • Tested in real scenarios: built in UE 5.8 and run on a dedicated server with a client (see above)
  • Proofread and formatted correctly

@raiden-02
raiden-02 marked this pull request as ready for review October 5, 2026 23:52
TheRealVitja pushed a commit to TheRealVitja/agency-agents that referenced this pull request Oct 6, 2026
…nts)

Curated sync of the open upstream pull requests as of 2026-10-06:

- Script and CI fixes: msitarzewski#1055, msitarzewski#1030, msitarzewski#865, msitarzewski#860, msitarzewski#967, msitarzewski#870, msitarzewski#869, msitarzewski#889,
  msitarzewski#1056, msitarzewski#755, msitarzewski#868, msitarzewski#771, msitarzewski#867; ported msitarzewski#523, msitarzewski#512 and the permissions
  part of msitarzewski#790.
- Existing-agent fixes: msitarzewski#1033-msitarzewski#1052, msitarzewski#1053, msitarzewski#1054, msitarzewski#1023, msitarzewski#756-msitarzewski#759, msitarzewski#799,
  msitarzewski#805, msitarzewski#715, msitarzewski#752, msitarzewski#784, msitarzewski#793, msitarzewski#858, msitarzewski#812, msitarzewski#789, msitarzewski#1007.
- New agents: msitarzewski#702, msitarzewski#707, msitarzewski#731, msitarzewski#732, msitarzewski#764, msitarzewski#848, msitarzewski#859, msitarzewski#862, msitarzewski#863, msitarzewski#886,
  msitarzewski#908, msitarzewski#982-msitarzewski#985, msitarzewski#1031, msitarzewski#1032.
- Docs: msitarzewski#577, msitarzewski#743, msitarzewski#762, msitarzewski#785, msitarzewski#786, msitarzewski#815, msitarzewski#816.

Fixes found while integrating: Bash 3.2 guard for the msitarzewski#755 worker argv,
Windsurf re-conversion over a stale .windsurfrules, locale-independent
check-divisions.sh, agency- prefix handling in the outputs eval, and the
India Business Navigator's YAML and headings. Resolves upstream issues
msitarzewski#229, msitarzewski#763, msitarzewski#821 and msitarzewski#1027.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwgfpJ9tGbUh5g84u5VSgv
@msitarzewski

Copy link
Copy Markdown
Owner

Thank you, @raiden-02. This is a careful fix, and the `_Validate` explanation is exactly right. Returning `false` disconnects the player, so lag-sensitive checks belong in `_Implementation`. Moving the ASC onto the PlayerState, with owner and avatar split, plus the `;` ini comments, the `^` continuations and `-noclient`, all match standard practice.

We verify technical claims before merging. Two claims here we couldn't confirm from public sources, since the engine source isn't public:

  1. `NetUpdateFrequency` deprecation. Writing `NetUpdateFrequency` directly has been deprecated since UE 5.5, and `SetNetUpdateFrequency()` / `SetMinNetUpdateFrequency()` are the replacements. Epic's Detailed Actor Replication Flow and Console Commands for Network Debugging pages don't mention the deprecation or the setters.
  2. Replication Graph command. `Net.RepGraph.PrintGraph` is the current command, and `Net.RepGraph.PrintAllNodes` isn't. Epic's network-debugging page lists no `Net.RepGraph.*` commands at all, and neither did the Replication Graph write-ups we checked.

Could you point us to where you confirmed these, e.g. the engine version plus the header or `.cpp` file (an `UE_DEPRECATED(5.5, …)` line, or the `FAutoConsoleCommand` registration), or a release note? A file path and version is plenty. Once those are confirmed, we'll merge this together with #1054.

@raiden-02

Copy link
Copy Markdown
Author

Thank you, @raiden-02. This is a careful fix, and the _Validate explanation is exactly right. Returning false disconnects the player, so lag-sensitive checks belong in _Implementation. Moving the ASC onto the PlayerState, with owner and avatar split, plus the ; ini comments, the ^ continuations and -noclient, all match standard practice.

We verify technical claims before merging. Two claims here we couldn't confirm from public sources, since the engine source isn't public:

  1. NetUpdateFrequency deprecation. Writing NetUpdateFrequency directly has been deprecated since UE 5.5, and SetNetUpdateFrequency() / SetMinNetUpdateFrequency() are the replacements. Epic's Detailed Actor Replication Flow and Console Commands for Network Debugging pages don't mention the deprecation or the setters.
  2. Replication Graph command. Net.RepGraph.PrintGraph is the current command, and Net.RepGraph.PrintAllNodes isn't. Epic's network-debugging page lists no Net.RepGraph.* commands at all, and neither did the Replication Graph write-ups we checked.

Could you point us to where you confirmed these, e.g. the engine version plus the header or .cpp file (an UE_DEPRECATED(5.5, …) line, or the FAutoConsoleCommand registration), or a release note? A file path and version is plenty. Once those are confirmed, we'll merge this together with #1054.

Thanks for checking these. Both come from the UE 5.8.3 engine source that ships with the launcher install (Build.version: 5.8.3, CL 58210709).

  1. NetUpdateFrequency deprecation: Engine/Source/Runtime/Engine/Classes/GameFramework/Actor.h

    • Line 903: UE_DEPRECATED(5.5, "Public access to NetUpdateFrequency has been deprecated. Use SetNetUpdateFrequency() and GetNetUpdateFrequency() instead.")
    • Line 908: the same for MinNetUpdateFrequency
    • Lines 4624 and 4636: SetNetUpdateFrequency(float) and SetMinNetUpdateFrequency(float)

    Building the old example in 5.8 also gives warning C4996 with that exact message, 5 times.

  2. Replication Graph command: Engine/Plugins/Runtime/ReplicationGraph/Source/Private/ReplicationGraphDebugging.cpp

    • Line 937: FAutoConsoleCommand RepGraphPrintGraph(TEXT("Net.RepGraph.PrintGraph"), ...)
    • Line 1478: Net.RepGraph.PrintAll is registered there too.

    PrintAllNodes doesn't appear anywhere in the 5.8 engine or plugin source.

Anyone with a launcher install can open these files directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants