Skip to content

RevFramework – Pickups • Netcode Samples (Example Only)

⚠️ Important Disclaimer
These files are illustrative only. They show the minimal authority-gating pattern for popular netcode stacks.
They are not a drop-in multiplayer solution — you must implement replication, prediction, reconciliation, and game-specific rules yourself.

Pickups is netcode-agnostic. It does not depend on NGO, Mirror, or Fusion.


What These Samples Cover

  • Authority gating via IPickupAuthority binders (per stack).
  • Server-authoritative pickup consumption using a minimal ServerProxy per stack.
  • Where to place the binder (scene root or near your player authority logic).

They do not cover:
- Replication of pickup GameObjects
- Prediction / rollback
- Reconciliation
- Spawn/despawn or item-sync logic

Those are handled by your chosen netcode stack and architecture.


Folder Layout

Samples/
  NetcodeSamples/
    NGO/
      PickupAuthorityBinder_NGO.cs
      NGOPickupServerProxy.cs
    Mirror/
      PickupAuthorityBinder_Mirror.cs
      MirrorPickupServerProxy.cs
    Fusion/
      PickupAuthorityBinder_Fusion.cs
      FusionPickupServerProxy.cs

Each folder is self-contained and can be copied into any project that already uses that stack.


Enabling the Samples (Scripting Define Symbols)

Add the appropriate symbol in
Project Settings → Player → Other Settings → Scripting Define Symbols

Stack Define Symbol
NGO REV_USE_NGO
Mirror REV_USE_MIRROR
Fusion REV_USE_FUSION

If a symbol is missing, the sample scripts for that stack will not compile (by design).


Authority Quick Start

Single-Player / Local Testing

Add PickupAuthorityBinder with alwaysTrue = ON — done.

Authoritative Multiplayer

  1. Add exactly one binder implementing IPickupAuthority to your scene:
  2. NGO → PickupAuthorityBinder_NGO
  3. Mirror → PickupAuthorityBinder_Mirror
  4. Fusion → PickupAuthorityBinder_Fusion
  5. Client attempts to consume → denied locally if binder says false.
  6. Proxy forwards the request to the server/state authority.
  7. Server applies the effect and despawns the pickup.
  8. Pickup replication is handled by your stack (NetworkObject/NetworkIdentity/etc.).

Typical Flow (All Stacks)

  1. Client collides with a pickup → sends request to Server / StateAuthority.
  2. Server validates via the active IPickupAuthority binder.
  3. Server applies the effect using effect.ApplyTo().
  4. Server despawns or destroys the pickup across the network.
  5. (Optional) Server triggers RPCs or events for feedback/UI.

Per-Stack Notes

NGO (Netcode for GameObjects)

  • Use NetworkObject for pickups.
  • Client → Server RPC for consume requests.
  • Binder: PickupAuthorityBinder_NGO (OwnerOnly / ServerOnly).

Mirror

  • Use NetworkIdentity for pickups.
  • Command from client → server; optional ClientRpc for feedback.
  • Binder: PickupAuthorityBinder_Mirror (hasAuthority or server).

Fusion

  • Use NetworkObject with [Rpc] for consume requests.
  • Client InputAuthority → Server StateAuthority.
  • Binder: PickupAuthorityBinder_Fusion (InputAuthority or StateAuthority).

Troubleshooting

Issue Likely Cause
“Consume denied” warnings No authority binder, or binder returned false.
Pickup not despawning on clients Despawn not replicated via your netcode.
Prediction / lag comp issues Out of scope — use your stack’s built-in systems.
Compilation errors Missing the correct Scripting Define Symbol.

Support Stance

These files are provided as illustrative examples only.
RevFramework does not provide replication, prediction, rollback, or reconciliation.

  • In single-player: use the local binder (PickupAuthorityBinder).
  • In multiplayer: you are responsible for replication and gameplay rules.

Multiplayer support is explicitly out of scope for RevFramework.