How are game states/saves shared as a string?

555 views

I know enough to get myself in trouble here and butchering terminology but how do games condense their save file into a sharable string or text file?

For a few of my idle games and what not you can either get a download of your current save state via a x-length alphanumeric string or a slightly bigger text file/hash. Also works for custom levels.

In: Technology

3 Answers

Anonymous 0 Comments

Save files are ultimately just a collection of appropriate variables. When I save in say Fallout: New Vegas, all it is doing is writing what’s in my inventory, where I’m at, what time of day it is, what missions I have active and where I’m at with them, who I’ve talked to and what dialogue I’ve had with them, and some basic stats.

Now that seems like a lot and for an RPG game like FNV it *is* a lot, but not every game has an insane amount of variables to track. But even with a game like this you don’t write “9mm pistol, condition 76, ammo loaded 8, no modifications.” We would write something like all that out in long form on pen and paper for a tabletop game because we have to know what those numbers mean, but in the code for a videogame it might get all that info from just writing down 00507600800, where 005 is the identifier for what kind of gun, 076 is condition, 008 is ammo loaded and 00 means you haven’t put any mods on it.

Now for a much simpler game than an RPG, like I said, there’s much less data to try and track. And just using the numbers 0-9 and letters A-F (hexadecimal), I can tell you up to 16 bits (a 0 or 1, two bytes of info) with a single letter. If my code for you is 32 characters long, that’s 512 bits of info already! And if the inventory system is more simplified like having just a few key items or not, I can designate a section of those bits to represent the inventory. If it’s a 0 you don’t have it, 1 you do. The same with a linear story, with just 8 of those bits I can provide more than 250 “milestones” to know your progress exactly through the storyline.

And of course I don’t have to limit myself to 32 characters for a string code, or use just hexadecimal. Doubling the characters to every letter except Y and Z with 32 characters and I can give you a full kilobit of info.

You are viewing 1 out of 3 answers, click here to view all answers.