Jump to content

Help conceptualizing


Brian W

Recommended Posts

I play a home made table top RPG with a few friends. The game is still in child hood stages of development but I am trying to get a few more things stable with our online resources.

The project I would like to tackle at the moment is stores.

I have items, weapons, armor, ect.  to put into the store, but I'm not sure what the best way is to tack the stuff into the store as inventory

Stores will have anywhere from a few items to hundreds of items. I will be creating store fronts that have individual stock, so I need it to be pretty simple to add and remove inventory.

I don't need this done for me, just would like some help with the structure.

Any input appreciated, thanks.

Link to comment
https://forums.phpfreaks.com/topic/133003-help-conceptualizing/
Share on other sites

Here's a standard database style structure

 

Table "items"

Column 1: Integer identifier "item_id"

Column 2: Text item name "item_name"

Column 3: Enum item type "item_type"

Column 4: Integer item value "item_value" (or could be floating point)

 

You might want to add additional item attributes to that table like damage, charges, wearable locations, and so on.

 

Table "stores"

Column 1: Integer identifier "store_id"

Column 2: Text store name "store_name"

 

And additional store attributes in that table, but NOT the items ..

 

Table "store_inventory"

Column 1: Integer identifier "store_id"

Column 2: Integer identifier "item_id"

Column 3: Integer item count "inventory_count"

 

This table has one row for each item that a store has in stock.

 

Does that makes sense?  An item's identifying characteristics go in the "items" table.  A store's identifying characteristics go in the "stores" table.  Then a third table links stores and items to provide inventory information.

Link to comment
https://forums.phpfreaks.com/topic/133003-help-conceptualizing/#findComment-691765
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.