
Originally Posted by
Phenidate
So compared to other MMOs, either our servers are crap (which is ridiculous when we have so many players paying monthly mind you) or our inventory is so horribly innefficient that even flavor of the month korean F2P games do it better than FFXIV.
Let me break out some mumbo jumbo to put into context the amount of data we're talking about in an ideal inventory:
Every item in your bag is just an item ID and a quantity, that's about all the server needs to know and tell your client. It knows what item it is by looking up the id. It knows how much you have by the quantity.
All the items info, graphics etc are stored client side. Using the item ID it looks up the graphics, descriptions, etc from the data on your computer.
We know that items are stored client side since sites like XIVDB regularly datamine it from the client.
So thats all an inventory stored in a database should be - the item id of each item in each slot, and a number signifying it's quantity.
Do you want to know how big an item ID and a number would be? They can both be numbers, and if we're going to be extravagant they're full on integers. 32bits each. So each slot would take up two integers.
How big is an integer? 32 bits.
How many slots do we have in our bag? 100. 175 per retainer.
2 numbers for each slot, that's 64 bits.
100 slots that's 6400 bits.
Each retainer by the way would be 11200.
Bear with me now: there's 8 bits in a byte. Our bag is 800 bytes. Our retainer is 1400 bytes.
Let me put that in terms of a quantity you may know: kilobytes. A KB is 1000 bytes, so our bag is .8KB, Each retainer is 1.4KB.
Our bags plus two retainers is 3.6 kilobytes.
To put that into perspective, a 1TB hard drive holds around 1,000,000,000 kilobytes. So that's what, 50 bucks to accommodate 277,777,777.778 players. I don't think we have 278 million players right now.
Want to know something else? I used waaaaaaaaaaay too much data for the quantity, since the most you can have is 99 of any item. We can just use a byte (8 bits) for the quantity. The item id being an integer by the way, gives us enough space to identify 4,294,967,296 unique items. We could make the item ID even smaller to accommodate say, 2 billionish instead.
Simply put, you could fit the inventory into an even smaller number of bits than what I gave above if you were to optimize it.
"Hey Phenidate, whats all this mean to me?"
Well it means that if the people who engineered the inventory system were trying to be good engineers and not waste space, the amount of data of everything you own could fit onto a grain of rice.