00 — Crafting Quickstart¶
Goal: Learn the core Crafting loop using a fully self-contained demo scene.
🎓 What This Scene Demonstrates¶
This scene teaches the first supported Crafting flow:
Preflight → Enqueue → Job execution
You’ll see how CraftingService answers three core questions:
- Can this owner craft this recipe right now?
- If not, what is blocking it?
- If it is valid, what job gets created and tracked?
The scene uses sample in-memory inventory and currency adapters so you can seed state quickly and watch the service respond in real time.
The important part is that the panel still talks to Crafting through supported public APIs — not internals, hidden state, or editor-only shortcuts.
🧭 What To Look For¶
The key learning model is:
- Preflight asks what is possible before anything happens.
- Probe shows what is limiting the craft: items, currency, or output space.
- Enqueue attempts to accept the craft request and create a job.
- Jobs show what is actually running after a request has been accepted.
If a craft is blocked before enqueue, no CraftJob is created.
That distinction matters: a rejected craft attempt is not the same thing as a failed job.
⚠️ Sample Scope¶
This scene is intentionally minimal.
It focuses on the core Crafting loop only:
- Preflight checks
- Probe limits
- Enqueue behaviour
- Live job state
- Pause, resume, and cancel
It does not focus on:
- Benches
- Advanced validators
- Modifiers
- Output routing
- Persistence
- Real inventory/economy integrations
- Networking
Those are covered by later specialised scenes.
👉 This is a learning/demo setup, not a complete gameplay implementation.
🧪 Sample Adapters¶
This scene uses sample adapters so the Crafting flow can be demonstrated in isolation:
FakeInventoryAdapterFakeCurrencyAdapter
These are in-memory sample/demo adapters.
They are useful for quick testing because they let the panel add items, credit currency, inspect balances, and trigger Crafting behaviour without requiring a full inventory or economy setup.
You can seed items and currency either from the CraftingQuickstartPanel or from the fake inventory/currency panels used by the sample scene.
⚠️ Authority Note¶
This scene may include a local sample authority binder configured to allow crafting.
That means:
- Crafting behaves permissively in this sample
- Authority is visible as part of the setup
- This is not a multiplayer or server-authority implementation
To enforce real authority:
- Provide an
ICraftingAuthorityimplementation - Wire it into
CraftingService - Do not rely on simply adding a component to the scene
🌐 Networking Reminder¶
RevFramework does not implement:
- Networking
- Replication
- Prediction
- Rollback
- Reconciliation
These samples demonstrate local behaviour only.
👉 All networking behaviour is your responsibility.
🧩 How To Use¶
- Press Play in the Unity Editor.
- Open or view the CraftingQuickstartPanel.
- Check the Overview tab to confirm the service, owner, container, recipe, adapters, and discovered modifiers/validators.
-
Seed items and currency using either:
-
the Seed tab in the quickstart panel, or
- the fake inventory/currency panels in the sample scene.
- Open the Preflight tab.
- Review the requested count, maximum craft count, reason, and probe limits.
- Use Craft 1, Craft N, or Craft Max from the Jobs tab.
- Watch jobs update live as they run.
- Use Pause, Resume, or Cancel to interact with active jobs.
Cancel uses refund behaviour where supported, but the final result still depends on the configured adapter and service behaviour.
🔎 Failure Behaviour¶
Failures are intentional teaching signals in this scene.
If something is missing or blocked, the panel should explain what to fix next.
Common examples:
- Missing items → seed the required input items.
- Missing currency → credit the required currency.
- Missing inventory adapter → check the
CraftingServiceadapter binding. - Invalid owner/container → check the owner GameObject and container name.
- No output space → free space or check output routing.
- Unauthorized → check the authority gate or sample authority setup.
The important rule is:
If preflight or enqueue rejects the request, no job is created.
A job only appears once the service accepts the request.
⚙️ Behind The Scenes¶
The quickstart panel uses public CraftingService APIs, including:
Probe()CanCraftDetailed()CanCraftCount()Enqueue()FillJobsByState()PauseJob()ResumeJob()CancelJob()TryGetInventoryContext()TryGetCurrencyAdapter()
This is intentional.
The panel is a hostile consumer: it demonstrates the system from the outside, through supported service-facing seams, without reaching into Crafting internals.
💡 Key Takeaway¶
This scene shows the minimum viable Crafting loop:
Check what is possible → accept valid work → track the resulting job
Once you understand this flow, the later Crafting scenes build on it with:
- Workbenches
- Validators
- Modifiers
- Output routing
- Persistence
- Real Inventory/Currency integration
The quickstart is the baseline. Everything else layers on top of it.
Panel: CraftingQuickstartPanel
Scene Path:
Assets/RevFramework/Samples/Systems/Crafting/Scenes/00_Crafting_Quickstart/