Part 1: The current system
First off, I want to talk about how this current system works. Most of this will be guesswork, but it will include a certain amount of leeway from best to worst case scenarios. Also, I will be talking about this using bits, a simple data format that’s either 0 or 1, off or on. I just ask that you allow me this small indulgence as we move forward, since I need some setup for the second part.
The current glamour system allows you to store items in the Glamour Dresser. To make a system like this, you need a reference to the item. In the case of an API like Universalis, it shows that those identifiers are simple numbers. What kind of numbers? This is where the guesswork comes in.
If you're reading this part without programming knowledge, then here's a small piece of info you'll need for the next part: numbers in code are stored as a data type called INTEGER. There are a lot of terms I'll skip over for clarity's sake, like unsigned, but there are multiple types of these integers to handle different sizes, depending on server capacity.
- The smallest size that could work would be a SMALLINT (small integer), which can go from 0 to 65 535.
- A MEDIUMINT (medium integer) offers a bit more leeway, and can go from 0 to 16 777 215.
- The usual format some people go for is an unoptimized use of the INTEGER itself, which can go from 0 to 4 294 967 295.
Now, this was assuming a number was being used. Why is there doubt? That's because if you go look at an item on the Lodestone, you'll see a set of numbers and letters in the URL next to /db/item/[identifier here]. Letters are handled a bit differently in code. Each letter saved in ASCII (a format for defining letters in code) takes up space as a CHAR (character), so having a series of 11 letters ends up taking more space than the previous options.
Below, you'll see a small table comparing the sizes. As of patch 6.2, there are 800 glamour slots. As such, the total size is the data size multiplied by the number of slots. For clarity's sake, I'll be ignoring the Armoire.
Code:
+----------------------+----------+-----------+---------+----------+
| Data type | SMALLINT | MEDIUMINT | INTEGER | CHAR(11) |
+----------------------+----------+-----------+---------+----------+
| Data Size (in bits) | 16 | 24 | 32 | 88 |
+----------------------+----------+-----------+---------+----------+
| Total Size (in bits) | 12800 | 19200 | 25600 | 70400 |
+----------------------+----------+-----------+---------+----------+
TL:DR - This table above is the important part. These are my estimates for how much space (in bits) the current glamour system takes on the server per player. The reason it’s in bits will be explained in the next section.