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
IPickupAuthoritybinders (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¶
- Add exactly one binder implementing
IPickupAuthorityto your scene: - NGO →
PickupAuthorityBinder_NGO - Mirror →
PickupAuthorityBinder_Mirror - Fusion →
PickupAuthorityBinder_Fusion - Client attempts to consume → denied locally if binder says false.
- Proxy forwards the request to the server/state authority.
- Server applies the effect and despawns the pickup.
- Pickup replication is handled by your stack (NetworkObject/NetworkIdentity/etc.).
Typical Flow (All Stacks)¶
- Client collides with a pickup → sends request to Server / StateAuthority.
- Server validates via the active
IPickupAuthoritybinder. - Server applies the effect using
effect.ApplyTo(). - Server despawns or destroys the pickup across the network.
- (Optional) Server triggers RPCs or events for feedback/UI.
Per-Stack Notes¶
NGO (Netcode for GameObjects)¶
- Use
NetworkObjectfor pickups. - Client → Server RPC for consume requests.
- Binder:
PickupAuthorityBinder_NGO(OwnerOnly / ServerOnly).
Mirror¶
- Use
NetworkIdentityfor pickups. Commandfrom client → server; optionalClientRpcfor feedback.- Binder:
PickupAuthorityBinder_Mirror(hasAuthority or server).
Fusion¶
- Use
NetworkObjectwith[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.