I want to redo Zodiacs item system. It's currently a mess. Each weapon has a file. There is than another file for every suffix/prefix/combination available for that weapon. In short: it's disgusting.
The items the player has are then stored as so
clientr.item-Bronze Cutlass=4,weapons/sword/bronzecutlass
The descriptions for each item the player has seen are stored like this
clientr.muditem_Bronze Cutlass="Bronze Cutlass",weapon,sword,hadez-bronzecutlassicon.png,hadez-bronzecutlass.png,zodsword,12,46,"","level,8",0.4, 1230,Neutral,0,0,0,1212634527.719118118
First off: I'm going to remove the need for new files for suffixes/prefixes. That's easy enough to do without a new file. Secondly, I want to do away with the item descriptions in clientr. vars. Can make a cache of item descriptions which is downloaded when you connect. Can make it check if the cache has been updated.
My question concerns how to make the most efficent item system possible. Should I
- Keep all these individual files and load from them when required? (harddrive access, lots of little files)
- Create one large online cache file which can then be parsed for the item details (harddrive again, read time)
- Load each file into a kind of object database so scripts can access the data directly (memory usage, no harddrive)
- Make each item into a wnpc (soo many damn weapons)
Possibly even a combination of these (like load the online cache into an object database). I could maybe only make the server load an item into memory when it's needed and have it clear the object database every hour or something?) Maybe a SQL server would be the best option in the end. I'm leaning towards loading the items into memory but I don't know how much memory each vserver has available to it plus the harddrive access time on the servers could be so minimal it doesn't even matter.