I though "black magic" was a good explanation
On each section of the file, there are common texts, like "Potion", I merge this kind of text by changing the list of text positions. If possible, I merge common suffixes. Two text positions can point to the same text, on in the same text. The list of positions can be reordered, that's why few editors cannot open the resulting file.