Skip to content

Inventory System

am102841-code edited this page Aug 8, 2026 · 1 revision

Inventory System

A reusable inventory system built with Python and Object-Oriented Programming.

The goal of this project is to create an inventory system that can eventually be used in different types of games instead of being designed for only one specific game.


Project Goal

I want to build an inventory system that can handle common game inventory features while keeping the system separate from the game itself.

The inventory should eventually be able to manage:

  • Items
  • Quantities
  • Inventory capacity
  • Item stacking
  • Item categories
  • Weight
  • Value
  • Searching
  • Sorting
  • Saving and loading

After the inventory system is complete, I plan to demonstrate it by connecting it to a game.


Current Progress

Version 1

The first version focuses only on the basic inventory system.

Current features:

  • Inventory class
  • Inventory capacity
  • Add items
  • Remove items
  • Check for items
  • Display inventory
  • Count items
  • Clear inventory
  • Full inventory handling
  • Missing item handling

The inventory currently uses regular Python strings as items.

Example:

Inventory:
- Sword
- Potion
- Dungeon Key

Capacity: 3/10

OOP Structure

The project currently uses one main class:

Inventory
│
├── capacity
├── items
│
├── add_item()
├── remove_item()
├── display_inventory()
├── check_item()
├── clear_inventory()
└── count_items()

The goal is to gradually expand this structure as the inventory becomes more advanced.


Features I Want to Add

Item Quantities

Allow multiple copies of the same item to be represented as a quantity.

Instead of:

Potion
Potion
Potion

the inventory could display:

Potion x3

Item Stacking

Create rules for how many copies of an item can occupy one inventory slot.

For example:

Potion
Maximum Stack: 10

Item Categories

Add categories such as:

  • Weapons
  • Armor
  • Consumables
  • Quest Items
  • Materials
  • Tools
  • Miscellaneous

Weight System

Give items different weights and calculate the total inventory weight.

Value System

Give items values and calculate the total value of everything in the inventory.

Search and Filtering

Allow the inventory to search for items or display only certain categories.

Sorting

Allow items to be sorted by:

  • Name
  • Quantity
  • Value
  • Weight
  • Category

JSON Save System

Eventually, the inventory will be able to save its data to a JSON file and load it again later.


Future OOP Development

Once the basic inventory system is working, I want to introduce more OOP concepts.

A future version could have:

Item
├── Weapon
├── Armor
├── Consumable
└── QuestItem

This would allow me to practice:

  • Inheritance
  • Encapsulation
  • Polymorphism
  • Composition
  • Multiple classes working together

Demo Game

After the inventory system is finished, I want to create a small game to demonstrate it.

The game will not contain a completely separate inventory system.

Instead:

Demo Game
     ↓
Universal Inventory System

The game will use the inventory system for things such as:

  • Collecting items
  • Viewing the inventory
  • Using items
  • Managing quantities
  • Finding items
  • Possibly equipping items

The purpose of the demo is to show that the inventory can be reused in a real game.


What I'm Learning

This project is helping me practice:

  • Python classes
  • Objects
  • __init__()
  • self
  • Methods
  • Lists
  • Dictionaries
  • Conditional statements
  • Loops
  • Searching
  • Data structures
  • JSON
  • Object-Oriented Programming
  • Designing reusable systems

Development Plan

Version 1
Basic Inventory
        ↓
Version 2
Quantities & Stacking
        ↓
Version 3
Categories, Weight & Value
        ↓
Version 4
Searching & Sorting
        ↓
Version 5
JSON Save/Load
        ↓
Version 6
Advanced OOP
        ↓
Version 7
Demo Game

The main goal is to build the inventory system independently first and only connect it to a game once the system is working reliably.

Clone this wiki locally