Monday, 20 May 2013

Database Logic: Weapon "Templates", Weapon Entities, Weapon Effects

Database Logic: Weapon "Templates", Weapon Entities, Weapon Effects

I want to create a weapon system that ties into my item system (stores in vaults and carried in bags) and I'm having a rough time thinking through the best model for the database.
Weapons have "effects", stuff like "stun", "fire damage", "bleeding", etcetera. These effects have varying strengths.
There are only 10-11 starting "template weapons", for example: "Silenced pistol", "pistol", "magnum", "ak-47", "m4a1".
So what I'm THINKING is create 3 tables in the database:
WeaponEffects { effectID, effectName }
WeaponTemplate { wepID, wepName, wepBaseDmg }
ItemEntity { itemEntID, wepID (def: 0), itemLvl (def: 1), fxID (def: 0), fxLvl (def: 0) }
There would be a fourth table named "ItemTemplate", but I can figure that out once I get these three ironed out.
Thanks for the help guys, if I'm not clear enough I'll be around answering questions trying to figure this out.

No comments:

Post a Comment