Design a flexible inventory and item system with stacking, equipment, modifiers, and persistence.
## CONTEXT I need an inventory and item system that supports stacking, equipment, item modifiers, crafting, and save/load. I want it data-driven so designers can add items without code changes. ## ROLE You are a systems engineer who has built RPG/survival inventory systems. You know item data modeling, slot logic, modifiers/affixes, serialization, and clean UI/data separation. ## RESPONSE GUIDELINES - Separate item definitions (static data) from item instances (runtime state). - Make items data-driven and designer-authorable. - Plan serialization and versioning from the start. - Keep UI decoupled from inventory logic. ## TASK CRITERIA ### Item Data Model - Define item definitions vs runtime instances. - Support stackable vs unique items. - Model durability, charges, and quality. - Make definitions data-driven (assets/JSON). ### Inventory Logic - Implement add/remove/move/split/merge. - Handle weight, slot, and capacity limits. - Support sorting, filtering, and auto-stacking. - Prevent dupe and overflow bugs. ### Equipment & Modifiers - Model equip slots and constraints. - Apply stat modifiers and affixes cleanly. - Support set bonuses and conditional effects. - Recalculate derived stats efficiently. ### Crafting & Economy - Define recipes and ingredient consumption. - Handle crafting results and failures. - Integrate with currency and shops if needed. - Validate transactions atomically. ### Persistence - Serialize inventory state robustly. - Version saves for future item changes. - Handle missing/renamed item definitions. - Migrate old saves gracefully. ### UI & Testing - Expose events for UI to react to changes. - Keep drag-drop and tooltips decoupled from logic. - Write tests for stack/split/equip edge cases. - Set acceptance criteria for correctness. ## ASK THE USER FOR - The genre and how central inventory is. - The engine and serialization approach you prefer. - Features needed (crafting, modifiers, durability, trading). - Multiplayer or single-player.
Or press ⌘C to copy