March 16th, 2012, 10:38 AM
Player inventory database schema advice
Hi to all,
I have a small question regarding theoretics of database schema for player inventory. Idea is that player has a game character with some items in inventory and some of them (weapon,ring, armor,..) equipped. What I have now in short are tables
and few more fields not important now
CharEquipSlot(nullable, indicating if item is equipped and in what slot(left hand, legs, ring1,..)
ItemTypeID FK (indicating type of item(ring, legs, CloseCombatWeapon,..)
and few others again not important now
So far I can determine what player has on him base on select from CharInventory where CharID = @CharID
But It just doesn't seem to me as an optimal solution. I'm still playing with idea of separated tables for weapons, armors, common items,.. but I'm just not able to figure out how to get connected with player character. That's why I'm starting this thread hoping to get some inspiring posts together with maybe performance tips on how to simplify queries or design to get results quickly and more effectively.
Any help would be great. Thanks in advance.