This would make it really flexible where a stat like strength in code is just a String and an int. Heck, I could even handle the item name and description using this and combine them all by coding in there proper classes. Now I can show the player what the base damage of the weapon is and how much the bonus is. I would handle it like so: modifies = "baseDamage" Something like this:īut this made me wonder, why would I store any attributes in the actual item table? Damage could be a modifier too and so can defense. The modifier relation would stay the same where a single item can have more modifiers. I could even throw in the requirements since thats a 1 on 1 relation anyway. I could have a single item class that defines the type, damage, armor, etc and keep them null if that attribute does not belong to the item. Or strength & 5 to increase strength by 5.īut I might be over complicating things. To clarify table modifiers, the column modifies should hold something like undead and percentage could hold 10 to make the armor or weapon 10% more effective to undead. I could add requirements in the main tables as well but in the diagram below I opted for a separate 1 to 1 relation table.Īnd this could be a variation of it where there is a single table linking them together. A modifier table holds all the modifiers and has a FK to weaponId, bootsId, shieldId and only one should be set where the others are null. Having all my different kinds of gear separated since weapons have damage, boots alter speed and armor, shield give armor and block rate, etc. I tried to get some thought on "paper" and would like some insight in how this can be done properly. To lower the amount of records a player can only have X amount of items. However my server creates items randomly based on several factors. In Diablo 2 most different kind of gear has different kind of attributes and they can all hold X amount of modifiers depending on the quality. But I am having a hard time getting the architecture right. Diablo 2 has a very sophisticated item system and I want to create something similar.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |