RevFramework – Crafting FAQ¶
This FAQ answers decision questions about using the Crafting system: how to integrate it, which extension point to use, and what is supported vs. discouraged.
It does not repeat the README content. If you’re looking for APIs, lifecycle details, or behaviour specifics, see the Crafting READMEs.
How do I integrate Crafting into my project?¶
Minimal runtime setup:
1. Add CraftingServiceCore to the scene.
2. Provide one inventory adapter (ICraftingInventoryAdapter).
3. (Optional) Provide a currency adapter (ICraftingCurrencyAdapter).
If you use the built-in integrations:
- InventoryCraftingAdapter requires REV_INVENTORY_PRESENT.
- CurrencyCraftingAdapter requires REV_CURRENCY_PRESENT.
Rule of thumb: Crafting never talks to gameplay systems directly. You integrate by adapters and interfaces, not by modifying the service.
Is this the right extension point?¶
Use this table to decide where your code belongs.
| If you want to… | Use this |
|---|---|
| Allow/block crafting | Validator (ICraftingValidator) |
| Change duration, cost, or outputs | Modifier (ICraftingModifier) |
| Connect inventory or currency | Adapter (ICraftingInventoryAdapter, ICraftingCurrencyAdapter) |
| Route outputs to containers | Output Router (ICraftingOutputRouter) |
| Apply global rules | CraftingHooks |
| Control multiplayer authority | ICraftingAuthority |
| Drive UI / input | Your own UI code |
Rule of thumb:
If it changes whether you can craft → Validator.
If it changes what happens when you craft → Modifier.
Can I do X with validators or modifiers?¶
Can I change input requirements?¶
No.
Inputs are: - validated - consumed - refunded
as part of a fixed pipeline.
Instead: - Use multiple recipes, or - Use a validator to block crafting based on inventory state.
Can I refund items or currency in a validator?¶
No.
Validators: - do not consume - do not refund - do not mutate state
They only adjust the preflight result.
Instead:
- Use CraftingServiceCore’s built-in refund paths, or
- React to OnJobFailed / OnJobCancelled lifecycle events.
Can I add bonus outputs conditionally?¶
Yes.
Use: ICraftingModifier and write to:
- CraftAdjustments.extraOutputs, or
- CraftAdjustments.chanceOutputs
Remember: - Modifiers run at accept and delivery. - Output routing and space checks still apply.
Can I bypass space checks?¶
Partially.
Use: AllowWithoutSpaceValidator.
It allows exactly one craft when the only failure is NoSpacePreflight.
Delivery may still fail later.
How does Crafting behave in multiplayer?¶
Crafting is netcode-agnostic.
- Use
ICraftingAuthorityto gate mutations (enqueue, cancel, pause, reorder). - Run crafting mutations on the server/host.
- Replicate job results using your netcode (NGO, Mirror, Fusion, custom RPCs).
Important: - Authority only decides who may mutate. - Replication, prediction, and reconciliation are your responsibility.
Can I do fully atomic crafting in multiplayer?¶
Yes — for immediate crafts, via the escrow path.
CraftingServiceCore exposes an opt-in strong / escrow execution path
(TryCraftImmediateEscrow) for atomic, immediate (zero-duration) crafts.
This path: - Requires inventory adapters that support reservations - Requires currency adapters that support holds (when currency is involved) - Executes inputs, currency, and outputs as a single atomic operation - Refuses to run if required guarantees cannot be met
This path is intended for: - server-authoritative crafting - economy-critical actions - anti-duplication guarantees
If your backend cannot reserve inputs or capacity transactionally, use the standard job-based crafting pipeline instead.
Is escrow required for multiplayer?¶
No.
The default job-based crafting pipeline is fully compatible with multiplayer
when mutations are gated via ICraftingAuthority and executed on the server.
Escrow is an advanced opt-in for cases where atomic guarantees are required. It is not necessary for most multiplayer games.
Can I use escrow without RevFramework Inventory or Currency?¶
Yes — if your backend supports reservations.
Escrow is exposed via public adapter seams:
- ICraftingInventoryReservationAdapter
- ICraftingCurrencyHoldAdapter
If your inventory or currency system can reserve and commit transactionally, you can implement these adapters without using RevFramework Inventory or Economy.
If not, escrow will refuse to run by design.
Can I use Crafting without Currency?¶
Yes.
If no currency adapter is assigned: - All currency checks are skipped. - All recipes craft for free.
Can I use Crafting without offline progress?¶
Yes.
- Set
enableOfflineProgress = false. - Jobs resume using in-session remaining time only.
acceptedAtUtc is still recorded for snapshot integrity.
What should I avoid?¶
- ❌ Modifying
CraftingServiceCore - ❌ Performing gameplay logic inside adapters
- ❌ Mutating inventory or currency from validators
- ❌ Assuming workbenches are required
- ❌ Expecting networking or replication to be built-in
- ❌ Treating
RecipeDefinitionas a runtime asset
What guarantees does Crafting provide?¶
- Deterministic behaviour when RNG is seeded and binomial approximation is disabled
- Explicit, ordered preflight → accept → delivery pipeline
- Clear extension seams (validators, modifiers, adapters)
- Offline progress with safe restore semantics
- Authority-aware mutation gating
- UI-agnostic, editor-agnostic runtime
When should I contact support?¶
Before contacting support, please check:
- Do you have an inventory adapter assigned?
- Are you using a validator vs modifier correctly?
- Are you attempting to mutate state from a validator?
- Is offline progress enabled intentionally?
- Are you assuming networking exists?
If you still believe something is wrong, include:
- Unity version
- Active adapters, validators, and modifiers
- Authority setup
- Repro steps
- Relevant CraftFailReason values
Summary¶
Crafting is designed to be: - Modular - Explicit - Deterministic - Authority-aware - UI-agnostic
If you integrate via adapters, choose the correct extension point, and keep gameplay logic out of the service, you’re using it correctly.