I'm working to my first game containing items (built a small one before, strategy type but not very complicated). I was thinking something like this for the db design since it will be almost the same items in each shop. I'm thinking of connecting the shop to user items (not sure if you understand what i'm thinking of):
shopname
shopNameId, shopName
shopCategory
shopCategoryId, shopNameId shopCategoryName,
shopItems
shopItemId, armourId, oneHandedWeaponId, twohandedWeapoinId,
this would be for the shop..now;
oneHandedWeapons
oneHandedWeaponId, weaponName, weaponMinAtk, weaponMaxAtk, ...
otherAttributes,
oneHandedExtendedAttributes
oneHandedExtendId, oneHandedWeaponId, ... otherAttritubes,
and again for other item types. This npc's will be the only place from where they can buy items.
Now when a user bought a new item from one of the shops i should insert the id of that item in the inventory table no? I was thinking on a structure like this for a stash based on 10 slots.
userStash
userStashId, userId, slot1, slot2, slot3, slot4, slot6, slot7, slot8, slot9, slot10
now on each on slot i can insert the id of that item.
Now my questions:
- Is it ok how i did this?
- Do you see any problems?
- Do you have any advice?
- Can you give me another ideea / another example how should I do this part?