Sorry, we don't support your browser.  Install a modern browser

Compress save states when sent over the network#854

Instead of storing the URL in JSON, instead store the index into a URL table.

If a save file is larger than 10 MB (I believe that’s the value), only the host can save a game. In a game with large decks (for instance Twilight Imperium has on the order of 500 cards) repeating the cardsheet URL for each card in a deck is a significant portion of the save file. If they were collapsed into an index it would be a huge win for file size.

3 years ago

We do it that way to keep everything modular without dependecies. Each ObjectState can exist on it’s own. If we wanted to keep file sizes down the best option is to convert and compress to binary.

3 years ago

I’d be behind that as well, can confirm the mod in question compresses down to about 10% of original size. Mainly, I’m trying to get to the point where a non-host player can save the game.

3 years ago
Changed the title from "Index URLs in JSON" to "Compress save states when sent over the network"
3 years ago

Just removing unecessary spaces would chop the size by halfish.

3 years ago
1

We already remove indenting when sending over the network.

3 years ago
Changed the status to
Research
3 years ago

To be clear the issue here is non-host players can’t save the game. I’m happy with any flavor of change that solves that (maybe even as simple as increasing that limit).

3 years ago

Non host players can save the game when they are promoted. This is a good way. Not everyone like to share their stuff with everyone. When everyone can save the game without promotion to do so the workshop features like visibility only for friends or unlisted makes no sense anymore. You can’t play your games without making it free for everyone.

3 years ago

I think you’re misunderstanding. Promoted payers that could normally save see nothing happen when they try to save, the host sees an error message about the save being too large.

3 years ago

Okay, then it’s clear that you don’t want to change this behavior.

3 years ago

? I want it to work exactly like it does now, but still work when the size is large.

3 years ago

@Johannes Schwartz please re-read the discussion. The permissions is not the problem.

The problem is that once the save file would get to a certain filesize (>10MB), the host can’t/doesn’t send the save file to the players anymore, even if they are promoted.

3 years ago

Yes, I understood.

3 years ago

#678 Is also closely related here. It would be great if the saves could be compressed (LZMA2 works great!) and could then be transmitted across the wire in compressed form. Better for bandwidth and space on disk.

3 years ago

As a counter point, I constantly edit the save file to update my URL’s and tweak other settings. It’s just easier when an object is in a bag that’s in a bag, thats in a bag, etc. So if compression is added, just let us know the way to uncompress it for editng.

3 years ago

@Tuff-Luck I think the idea is that the compression would occur while the save data is being packed up for transmission to the non-host players and the unpacked on their side as part of the network stack. Has no bearing on how it exists on the harddisk.

3 years ago

@Tuff-Luck The other ticket mentioned, #678, concerns compression of save files on disk, not this one.

3 years ago

If you are going to compress, it is likely that lz4 or zstd make the most sense.

3 years ago