Cyberpunk 2077 saves will become corrupted if they reach 8mb in size
reddit.com
reddit.com
Let's be generous and assume every character in the save file is stored as 4-byte UTF-8 (the edge case - most characters are 1 or 2 bytes only). Given that 1MB is 1 million bytes, that means you can store 250,000 characters in 1 MB, or 2 million characters in 8MB.
What is being stored in this file to warrant space equivalent to 2 million characters?! As far as I'm aware the save file doesn't include PNGs or video recordings that would obviously blow up the size. It onlys contain strings and numbers. How are there so many to fill up all that space?
Maybe someone in the game dev industry can shed some light? It seems so crazy to me, although I am admittedly approaching this from an embedded hardware background.
EDIT: It seems like people are saying this is caused by craftable item data. Even then, with 2 million characters to work with, you'd have to craft 200 guns assuming each item takes up 10,000 characters, and 2,000 guns assuming each item takes up 1000 characters. As far as I can see each gun only has a handful of attributes, so...what gives?
Having bool be 4 or 8 bytes is ridiculous.
(Perhaps unsurprisingly) the literals "true" and "false" appear to be of integer size in the compilers I tried on c99, implying they are implemented as "1" and "0" and not "'\001'" and "'\000'"
If you have that much space to use, you might not want to just store the attributes of the items, but their entire history, without regard to the size of a history entry, because you can reasonably assume that people aren't going to spend a lifetime crafting items in this game.
You can just start implementing it this way because you speculate that you may find a cool use for it, somewhere way down the line during development, when changing that system would become prohibitive. If you don't find a use for it, the overhead still doesn't matter.
To the extent that it may make sense to use file formats that map very closely to in-memory formats, or to duplicate data, even at the cost of file size. If you can stream data faster than you could feasibly decompress it, and if having a flat format is faster than a normalised de-duplicated one, a lot of common sense ideas are inverted.
If so there are two issues: total capacity and strictly increasing size
Stay away for a while unless you want to pay to do QA
"AAA" is not a quality definition yet the size of the studio/marketing budget. Don't get fooled!
(not saying that for sure, just seems to be a big coincidence)