Friday, October 22, 2010

Item decay

So after my lengthy rants about dynamic items and decay and proper crafter progression, I sat down to implement it myself. At first i started with just the usual, a static item. Its extremely simple for a web game, just a matter of putting it in the DB, creating a player and putting the item in his inventory. Because of it's simplicity and low database usage, its quick, easy to use, and doesn't take up alot of space.

So what if we try and add item decay to it. To do this, I started from my simple models of:

  • Inventory
  • Item
  • Weapon : Item

From these classes i moved to:

  • Inventory
  • ItemTemplate
  • WeaponTemplate : ItemTemplate
  • Item
  • Weapon : Item

Item has a reference to the ItemTemplate. ItemTemplate is exactly how Item used to be, it has static information about items. Item has additional fields ala DAoC. That is it has Durability, Condition, and Quality. The quality is a flat reduction from the max while condition is a increasing reduction through use.

So now I have an item that has values for decay through use, a quality, and we still aren't taking up a ton of data because it has a reference to the static value items.

So that covers some of what I talked about previously. The last change that I would like to make is to have varying values with quality. In this fashion you can have crafters that get better stats with lesser quality and lesser stats with better quality and a truly unique masterwork item which will have 100% quality and the highest stats for that item.

To do this, I would use the same tables, but the template tables would have 2x as many fields and each weapon would be unique. It takes up the most amount of database space but allows for as close to unique values as possible. In this fashion you can begin to implement skills such as Weapon smithing mastery which increases your quality chance and Weapon Smithing Theory which can increase stats or any number of other ways to let players begin to specialize.

No comments: