Of saving, passwords, and Nintendo...

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

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

here is what I do...

say I have values like this

phealth = 78
px = 10
py = 21

just some random values...

so I make a saved file called savedgame1 or somethin similar to that and I have it make a random number between 1 and 100 like 24

when I do this I use a method where I take the integer value of each digit of the square root like this

sqr(24) = 4.898979

it is split up into 4, 8, 9, 8, 9, 7, 9
for the next set of scramble numbers I add one to 24 and get 25 and 26 after that and so on until I have enough encrypting numbers when we squareroot 25 we get 5.000000 I program it to ignor zeros so it adds a 5 to the end of the list... our list is now 4, 8, 9, 8, 9, 7, 9, 5 (this is a bad example due to all of the nines but it still serves its purpose...) now that you have the numbers you add a "magic" header to it just to throw people off... so we get the numbers we want to save in order...

42 (magic header number), 24 (original encrypting number), 82 (the players health: 78 plus the first number in the list 4 ), 18 (player x: 10 + 8 the second number on the list), 30 (player y: 21 + 9 the third number on the list) this continues until there are no more numbers to be saved... and then you repeat the process this time multiplying rather than adding...

our final file would look like this

42, 24, 82, 18, 30, 312, 80, 189

to open the file you do the reverse and check it by making sure the numbers you get from the first half of the data match the numbers you get from the second half of the data... this system is very hard to temper with as it requires so much math that is easy and simple for the computer

I know this is long and complicated but I like coming up with tricks like this in my free time especially if it has to do with encrypting or cracking codes (my favorite subject)... you also may say this method has flaws because you can simply copy and paste the files to your friend's computer however I have a way of preventing this but it is off-topic so I wont mention it