Skip to content

02 — Routing, Space, and Currency

Goal:
Understand how crafting routes outputs, evaluates space, and applies currency costs using a self‑contained sample scene.


🎓 What This Scene Demonstrates

This scene explores how the Crafting system decides where outputs are routed,
whether sufficient space is available, and how currency costs affect preflight.

You’ll see how to:

  • Inspect routing behaviour and destination containers for crafted outputs
  • Observe how space checks respond to different CraftChanceSpacePolicy settings
  • View and adjust currency balances using sample adapters
  • Compare permissive vs. conservative space budgeting for probabilistic outputs

This scene demonstrates behaviour and diagnostics — it does not define a guaranteed execution order.


Scope Reminder
RevFramework does not implement networking, replication, prediction, rollback, or reconciliation.
These samples demonstrate authority‑gating patterns only — all networking behaviour is your responsibility.


⚠️ Authority Note

No Authority Binder is assigned in this scene.

Leaving the Authority Binder field on CraftingServiceCore unassigned allows crafting to be tested locally without authority checks.

To enforce authority, you must assign an Authority Binder to the service.
Adding the component alone does not automatically block crafting.


🧩 How to Use

  1. Open the CraftingRoutingSpaceCurrencyPanel.
  2. Review routing options and toggle between the demo modes:
  3. Route: None – use the service’s default container.
  4. All → Chest – route all outputs to the “Chest” container.
  5. By Prefix – route ore_* to OreBox and herb_* to HerbPouch.
  6. Adjust the Chance Space Policy:
  7. None – ignores probabilistic outputs in space checks.
  8. ExpectedCeil – uses expected‑value ceiling for chance outputs.
  9. WorstCaseAll – reserves space as if every chance output dropped.
  10. Observe HasSpaceExact() readouts per output and how they respond to policy changes.
  11. Review the Currency section — per‑craft cost and current balance.
  12. Use CanCraft?, Craft 1, or Craft N to test preflight outcomes under different conditions.

⚙️ Behind the Scenes

  • Uses FakeInventoryAdapter and FakeCurrencyAdapter for isolated testing.
  • Calls real service APIs such as CanCraftDetailed() and Enqueue().
  • Visualises routing decisions, space budgeting, and currency constraints in the panel.
  • Demonstrates how preflight decisions affect whether a craft can proceed.

💡 Key Takeaway

Routing, space checks, and currency costs work together to ensure crafting is predictable and safe:

  • Routing determines where outputs attempt to land
  • Space checks determine whether outputs can fit
  • Currency checks determine whether the player can afford the craft

Choosing an appropriate CraftChanceSpacePolicy lets you trade off
between permissive behaviour and conservative safety.


Panel: CraftingRoutingSpaceCurrencyPanel
Scene Path:
Assets/RevFramework/Samples/Crafting/Scenes/02_Routing_Space_Currency/