Genetix
Member
I want to talk about Inventory System Design, and get some ideas or feedback on ways to approach and improve the design. Inventory systems are used in many games, and can be a challenging thing to build for many. I'm not overly worried about the exact syntax and code needed to build an inventory, as much as ideas for how it should be designed and work.
To offer a bit of information to help paint the picture - I am currently developing a traditional Rogue-like / Dungeon Crawler game called Darkest Depths. The game is played from a nearly top-down but more 3/4th's perspective. The bulk of the game is played inside of a large tower with procedurally generated floors, although the player can exit the tower and return to a nearby village where they can sell and buy items.
I've designed (more or less successfully) inventory systems before but want to write out my ideas here and hopefully have them picked apart if needed.
- The inventory system will consist of a number of slots or buttons on the screen that a player can click.
- Inventory slots stack Items (You can have 33x Potions on one slot)
- Inventory slots maybe able to split stacks. (I prefer all items in one slot, less complex)
- Clicking an inventory slot will show information about the current item and present a few options.
- Items can be Equipped: Swords equip to a Weapon slot, Armor equips to an Armor Slot, Rings to an Accessory slot.
- Items can be used: Potions can be used directly, food can be eaten, etc from the inventory slot.
- Items can be dropped: Drops items to the ground below player (Items have to be clicked to pick up)
- Items can be moved around the inventory (Drag slots around)
- Items can be set to a Quick Slot (At this point Usuable items can be used from a single click in game, outside of menu)
These are just a few ways that the inventory will work. There are other features to consider such as giving each items weight, how to handle Shops (buying/selling), how to handle Chests and other 'storage' containers.
Not so much of a question - but I am wondering how you guys have designed simple or very complex Inventory systems in your games, and if you have any ideas that would improve mine before I dive to deep into it. Code is always welcome, but I am more interested in how these systems can work best rather then the exact syntax needed to develop them.
//EDIT:
In addition to the above, I started thinking about the actual methods that are needed to build an inventory system, below are some ideas on how different methods of using the inventory could theoretically work.
//Item Pickup Script
- If item quantity > 0 just increment and quit.
- If item quantity = 0 check if inventory is full, if so quit.
- If inventory isn't full, find first open slot and set it's hold id to item id, increment item quantity, destroy item, then quit.
//Item Drop
- If item quantity > 1, decrement item quantity, create item on ground.
- If item quantity = 1, decrement item quantity, create item on ground, empty slot.
//Item Equip
- Set equipped slot (weapon,armor,acc.) to item id, adjust active attributes.
//Item Use
- Decrement item, empty slot if = 0, activate item effects.
To offer a bit of information to help paint the picture - I am currently developing a traditional Rogue-like / Dungeon Crawler game called Darkest Depths. The game is played from a nearly top-down but more 3/4th's perspective. The bulk of the game is played inside of a large tower with procedurally generated floors, although the player can exit the tower and return to a nearby village where they can sell and buy items.
I've designed (more or less successfully) inventory systems before but want to write out my ideas here and hopefully have them picked apart if needed.
- The inventory system will consist of a number of slots or buttons on the screen that a player can click.
- Inventory slots stack Items (You can have 33x Potions on one slot)
- Inventory slots maybe able to split stacks. (I prefer all items in one slot, less complex)
- Clicking an inventory slot will show information about the current item and present a few options.
- Items can be Equipped: Swords equip to a Weapon slot, Armor equips to an Armor Slot, Rings to an Accessory slot.
- Items can be used: Potions can be used directly, food can be eaten, etc from the inventory slot.
- Items can be dropped: Drops items to the ground below player (Items have to be clicked to pick up)
- Items can be moved around the inventory (Drag slots around)
- Items can be set to a Quick Slot (At this point Usuable items can be used from a single click in game, outside of menu)
These are just a few ways that the inventory will work. There are other features to consider such as giving each items weight, how to handle Shops (buying/selling), how to handle Chests and other 'storage' containers.
Not so much of a question - but I am wondering how you guys have designed simple or very complex Inventory systems in your games, and if you have any ideas that would improve mine before I dive to deep into it. Code is always welcome, but I am more interested in how these systems can work best rather then the exact syntax needed to develop them.
//EDIT:
In addition to the above, I started thinking about the actual methods that are needed to build an inventory system, below are some ideas on how different methods of using the inventory could theoretically work.
//Item Pickup Script
- If item quantity > 0 just increment and quit.
- If item quantity = 0 check if inventory is full, if so quit.
- If inventory isn't full, find first open slot and set it's hold id to item id, increment item quantity, destroy item, then quit.
//Item Drop
- If item quantity > 1, decrement item quantity, create item on ground.
- If item quantity = 1, decrement item quantity, create item on ground, empty slot.
//Item Equip
- Set equipped slot (weapon,armor,acc.) to item id, adjust active attributes.
//Item Use
- Decrement item, empty slot if = 0, activate item effects.
Last edited: