1 inventory items and stack limit safety
forgejo-actions edited this page 2026-07-13 19:45:35 +00:00

Inventory Items And Stack Limit Safety

What This System Is

Inventory items connect authoritative economy mutations, durable database rows, realtime snapshots, gameplay conditions, service costs, combat rewards, and UI projection.

How Authors Use It

Authors define item stackability and use inventory counts in costs, conditions, rewards, crafting, vendor stock, and dialogue or service gates. Runtime economy authority owns grants and consumes; UI projection only displays snapshots.

Rules And Invariants

Inventory authority lives on the server. Grants and consumes must use economy transactions. Stack limits should be explicit enough to avoid silent partial rewards. Conditions and service costs must use the same item ids the inventory table stores.

Validation And Debugging

If a reward silently truncates, inspect grant policy and stack limits. If a service option is available but consume fails, compare condition item ids with economy cost item ids. If UI looks stale, inspect realtime inventory snapshot and Bevy sync state.

Examples

A reward that grants ten potions should either guarantee room for ten or use an explicit partial-grant policy with player-visible behavior. A vendor cost should consume the exact item or currency id used by the condition gate.