Of saving, passwords, and Nintendo...

BlitzPlus Forums/BlitzPlus Programming/Of saving, passwords, and Nintendo...

Well for saving, you do have to use some form of data file, but a password system (like you said) can be entirely self contained.

I've never tried this but I would imagine that when a password is generated it is simply a list of variables thrown together in a string to represent certain aspects of the game. The string is just a set of values, encrypted, and then parsed out when the game is 'loaded' through the password.

For example, if you needed to store your gold, level, and position, you could do something like this;
gold=24
level=10
x= 10
y=20

Convert it to;
gold=48 ;gold *2
level=I ;10th letter of alphabet (starting at 0 of course)
x=BA ; digits represented by letters
y=CA; digits represented by letters

Then mix it up and put it into a string, then have the program evaluate it later:
CA48IBA

For more advanced games this does lead to extremely long passwords, which is why the password system is pretty much extinct... BattleMaster for the Sega Genesis requires 60 character passwords.